deal.II version GIT relicensing-6842-g793a97d2aa 2026-10-02 14:00:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
psblas_precondition.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2008 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_psblas_precondition_h
16#define dealii_psblas_precondition_h
17
20
21
22#ifdef DEAL_II_WITH_AMG4PSBLAS
23
24# include <amg_cbind.h>
25#endif
26
28
29#ifdef DEAL_II_WITH_AMG4PSBLAS
30namespace PSCToolkitWrappers
31{
32
43 {
44 public:
49
55 struct AdditionalData
56 {
57 explicit AdditionalData(const char *cycle_type = "VCYCLE",
58 const unsigned int n_cycles = 1,
59 const double aggregation_threshold = 1e-2,
60 const char *aggregation_type = "SOC1",
61 const unsigned int aggregation_size = 8,
62 const char *smoother_type = "FBGS",
63 const unsigned int smoother_sweeps = 2,
64 const char *aggr_prol = "SMOOTHED",
65 const char *aggr_filter = "FILTER",
66 const char *parallel_aggr_algorithm = "DECOUPLED",
67 const char *coarse_type = "BJAC",
68 const char *coarse_mat_type = "DIST",
69 const bool output_details = false)
70 : cycle_type(cycle_type)
71 , n_cycles(n_cycles)
72 , aggregation_threshold(aggregation_threshold)
73 , aggregation_type(strdup(aggregation_type))
74 , aggregation_size(aggregation_size)
75 , smoother_type(smoother_type)
76 , smoother_sweeps(smoother_sweeps)
77 , aggr_prol(aggr_prol)
78 , aggr_filter(aggr_filter)
79 , parallel_aggr_algorithm(parallel_aggr_algorithm)
80 , coarse_type(coarse_type)
81 , coarse_mat_type(coarse_mat_type)
82 , output_details(output_details)
83 {}
84
85
90 const char *cycle_type;
91
92 /*
93 * Number of multilevel cycles to be performed.
94 */
95 unsigned int n_cycles;
96
100 double aggregation_threshold;
101
106 const char *aggregation_type;
107
114 unsigned int aggregation_size;
115
119 const char *smoother_type;
120
128 unsigned int smoother_sweeps;
129
134 const char *aggr_prol;
135
140 const char *aggr_filter;
141
146 const char *parallel_aggr_algorithm;
147
152 const char *coarse_type;
153
158 const char *coarse_mat_type;
159
164 bool output_details;
165 };
166
174
178 ~PreconditionAMG();
179
184 void
185 initialize(const SparseMatrix &matrix,
186 const AdditionalData &additional_data = AdditionalData());
187
192 void
193 clear();
194
200 amg_c_dprec *
201 get_psblas_preconditioner();
202
206 void
207 vmult(Vector &dst, const Vector &src) const;
208
214 void
215 Tvmult(Vector &dst, const Vector &src) const;
216
217
218 friend class SolverBase;
219
220 private:
225 amg_c_dprec *psblas_preconditioner;
226
230 std::shared_ptr<psb_c_descriptor> psblas_descriptor;
231 };
232
233} // namespace PSCToolkitWrappers
234
235#endif
236
238
239#endif
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
PETScWrappers::PreconditionBoomerAMG PreconditionAMG
unsigned int global_dof_index
Definition types.h:92