deal.II version GIT relicensing-6963-gc25d64af46 2026-10-23 04:50: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: Apache-2.0 WITH LLVM-exception OR 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// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_psblas_precondition_h
14#define dealii_psblas_precondition_h
15
18
19
20#ifdef DEAL_II_WITH_AMG4PSBLAS
21
22# include <amg_cbind.h>
23#endif
24
26
27#ifdef DEAL_II_WITH_AMG4PSBLAS
28namespace PSCToolkitWrappers
29{
30
41 {
42 public:
47
53 struct AdditionalData
54 {
55 explicit AdditionalData(const char *cycle_type = "VCYCLE",
56 const unsigned int n_cycles = 1,
57 const double aggregation_threshold = 1e-2,
58 const char *aggregation_type = "SOC1",
59 const unsigned int aggregation_size = 8,
60 const char *smoother_type = "FBGS",
61 const unsigned int smoother_sweeps = 2,
62 const char *aggr_prol = "SMOOTHED",
63 const char *aggr_filter = "FILTER",
64 const char *parallel_aggr_algorithm = "DECOUPLED",
65 const char *coarse_type = "BJAC",
66 const char *coarse_mat_type = "DIST",
67 const bool output_details = false)
68 : cycle_type(cycle_type)
69 , n_cycles(n_cycles)
70 , aggregation_threshold(aggregation_threshold)
71 , aggregation_type(strdup(aggregation_type))
72 , aggregation_size(aggregation_size)
73 , smoother_type(smoother_type)
74 , smoother_sweeps(smoother_sweeps)
75 , aggr_prol(aggr_prol)
76 , aggr_filter(aggr_filter)
77 , parallel_aggr_algorithm(parallel_aggr_algorithm)
78 , coarse_type(coarse_type)
79 , coarse_mat_type(coarse_mat_type)
80 , output_details(output_details)
81 {}
82
83
88 const char *cycle_type;
89
90 /*
91 * Number of multilevel cycles to be performed.
92 */
93 unsigned int n_cycles;
94
98 double aggregation_threshold;
99
104 const char *aggregation_type;
105
112 unsigned int aggregation_size;
113
117 const char *smoother_type;
118
126 unsigned int smoother_sweeps;
127
132 const char *aggr_prol;
133
138 const char *aggr_filter;
139
144 const char *parallel_aggr_algorithm;
145
150 const char *coarse_type;
151
156 const char *coarse_mat_type;
157
162 bool output_details;
163 };
164
172
176 ~PreconditionAMG();
177
182 void
183 initialize(const SparseMatrix &matrix,
184 const AdditionalData &additional_data = AdditionalData());
185
190 void
191 clear();
192
198 amg_c_dprec *
199 get_psblas_preconditioner();
200
204 void
205 vmult(Vector &dst, const Vector &src) const;
206
212 void
213 Tvmult(Vector &dst, const Vector &src) const;
214
215
216 friend class SolverBase;
217
218 private:
223 amg_c_dprec *psblas_preconditioner;
224
228 std::shared_ptr<psb_c_descriptor> psblas_descriptor;
229 };
230
231} // namespace PSCToolkitWrappers
232
233#endif
234
236
237#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