oomph::Lagrange_Enforced_Flow_Preconditioner_Subsidiary_Operator_Helper Namespace Reference

Namespace for subsidiary preconditioner creation helper functions. More...

Functions

Preconditionerget_w_cg_preconditioner ()
 
Preconditionerboomer_amg_for_2D_momentum_simple_visc ()
 
Preconditionerboomer_amg_for_2D_momentum_stressdiv_visc ()
 
Preconditionerboomer_amg_for_3D_momentum ()
 
Preconditionerboomer_amg2v22_for_3D_momentum ()
 
Preconditionerboomer_amg_for_2D_poisson_problem ()
 
Preconditionerboomer_amg_for_3D_poisson_problem ()
 

Detailed Description

Namespace for subsidiary preconditioner creation helper functions.

Function Documentation

◆ boomer_amg2v22_for_3D_momentum()

Preconditioner * oomph::Lagrange_Enforced_Flow_Preconditioner_Subsidiary_Operator_Helper::boomer_amg2v22_for_3D_momentum ( )

Hypre Boomer AMG setting for the augmented momentum block of a 3D Navier-Stokes problem (for serial code).

186  {
187 #ifdef OOMPH_HAS_HYPRE
188  // Create a new HyprePreconditioner
189  HyprePreconditioner* hypre_preconditioner_pt = new HyprePreconditioner;
190 
191  // Coarsening strategy
192  // 1 = classical RS with no boundary treatment (not recommended in
193  // parallel)
194  hypre_preconditioner_pt->amg_coarsening() = 1;
195 
196  // Strength of dependence = 0.668
197  hypre_preconditioner_pt->amg_strength() = 0.8;
198 
199 
200  // Set the smoothers
201  // 1 = Gauss-Seidel, sequential (very slow in parallel!)
202  hypre_preconditioner_pt->amg_simple_smoother() = 1;
203 
204  // Set smoother damping (not required, so set to -1)
205  hypre_preconditioner_pt->amg_damping() = -1;
206 
207 
208  // Set number of cycles to 1xV(2,2)
209  hypre_preconditioner_pt->set_amg_iterations(2);
210  hypre_preconditioner_pt->amg_smoother_iterations() = 2;
211 
212  return hypre_preconditioner_pt;
213 #else
214  std::ostringstream err_msg;
215  err_msg << "hypre preconditioner is not available.\n"
216  << "Please install Hypre.\n";
217  throw OomphLibError(
219 #endif
220  } // function boomer_amg_for_3D_momentum
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References oomph::HyprePreconditioner::amg_coarsening(), oomph::HyprePreconditioner::amg_damping(), oomph::HyprePreconditioner::amg_simple_smoother(), oomph::HyprePreconditioner::amg_smoother_iterations(), oomph::HyprePreconditioner::amg_strength(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::HyprePreconditioner::set_amg_iterations().

◆ boomer_amg_for_2D_momentum_simple_visc()

Preconditioner * oomph::Lagrange_Enforced_Flow_Preconditioner_Subsidiary_Operator_Helper::boomer_amg_for_2D_momentum_simple_visc ( )

Hypre Boomer AMG setting for the augmented momentum block of a 2D Navier-Stokes problem using the simple form of the viscous term (for serial code).

68  {
69 #ifdef OOMPH_HAS_HYPRE
70  // Create a new HyprePreconditioner
71  HyprePreconditioner* hypre_preconditioner_pt = new HyprePreconditioner;
72 
73  // Coarsening strategy
74  // 1 = classical RS with no boundary treatment (not recommended in
75  // parallel)
76  hypre_preconditioner_pt->amg_coarsening() = 1;
77 
78  // Strength of dependence = 0.25
79  hypre_preconditioner_pt->amg_strength() = 0.25;
80 
81 
82  // Set the smoothers
83  // 1 = Gauss-Seidel, sequential (very slow in parallel!)
84  hypre_preconditioner_pt->amg_simple_smoother() = 1;
85 
86  // Set smoother damping (not required, so set to -1)
87  hypre_preconditioner_pt->amg_damping() = -1;
88 
89 
90  // Set number of cycles to 1xV(2,2)
91  hypre_preconditioner_pt->set_amg_iterations(1);
92  hypre_preconditioner_pt->amg_smoother_iterations() = 2;
93 
94  return hypre_preconditioner_pt;
95 #else
96  std::ostringstream err_msg;
97  err_msg << "hypre preconditioner is not available.\n"
98  << "Please install Hypre.\n";
99  throw OomphLibError(
101 #endif
102  } // function boomer_amg_for_2D_momentum_simple_visc

References oomph::HyprePreconditioner::amg_coarsening(), oomph::HyprePreconditioner::amg_damping(), oomph::HyprePreconditioner::amg_simple_smoother(), oomph::HyprePreconditioner::amg_smoother_iterations(), oomph::HyprePreconditioner::amg_strength(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::HyprePreconditioner::set_amg_iterations().

Referenced by TiltedCavityProblem< ELEMENT >::TiltedCavityProblem().

◆ boomer_amg_for_2D_momentum_stressdiv_visc()

Preconditioner * oomph::Lagrange_Enforced_Flow_Preconditioner_Subsidiary_Operator_Helper::boomer_amg_for_2D_momentum_stressdiv_visc ( )

Hypre Boomer AMG setting for the augmented momentum block of a 2D Navier-Stokes problem using the stress divergence form of the viscous term (for serial code).

108  {
109 #ifdef OOMPH_HAS_HYPRE
110  // Create a new HyprePreconditioner
111  HyprePreconditioner* hypre_preconditioner_pt = new HyprePreconditioner;
112 
113  // Coarsening strategy
114  // 1 = classical RS with no boundary treatment (not recommended in
115  // parallel)
116  hypre_preconditioner_pt->amg_coarsening() = 1;
117 
118  // Strength of dependence = 0.668
119  hypre_preconditioner_pt->amg_strength() = 0.668;
120 
121 
122  // Set the smoothers
123  // 1 = Gauss-Seidel, sequential (very slow in parallel!)
124  hypre_preconditioner_pt->amg_simple_smoother() = 1;
125 
126  // Set smoother damping (not required, so set to -1)
127  hypre_preconditioner_pt->amg_damping() = -1;
128 
129 
130  // Set number of cycles to 1xV(2,2)
131  hypre_preconditioner_pt->set_amg_iterations(1);
132  hypre_preconditioner_pt->amg_smoother_iterations() = 2;
133 
134  return hypre_preconditioner_pt;
135 #else
136  std::ostringstream err_msg;
137  err_msg << "hypre preconditioner is not available.\n"
138  << "Please install Hypre.\n";
139  throw OomphLibError(
141 #endif
142  } // function boomer_amg_for_2D_momentum_stressdiv_visc

References oomph::HyprePreconditioner::amg_coarsening(), oomph::HyprePreconditioner::amg_damping(), oomph::HyprePreconditioner::amg_simple_smoother(), oomph::HyprePreconditioner::amg_smoother_iterations(), oomph::HyprePreconditioner::amg_strength(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::HyprePreconditioner::set_amg_iterations().

Referenced by TiltedCavityProblem< ELEMENT >::TiltedCavityProblem().

◆ boomer_amg_for_2D_poisson_problem()

Preconditioner * oomph::Lagrange_Enforced_Flow_Preconditioner_Subsidiary_Operator_Helper::boomer_amg_for_2D_poisson_problem ( )

Hypre Boomer AMG setting for the 2D Poisson problem (for serial code).

226  {
227 #ifdef OOMPH_HAS_HYPRE
228  // Create a new HyprePreconditioner
229  HyprePreconditioner* hypre_preconditioner_pt = new HyprePreconditioner;
230 
231  // Coarsening strategy
232  // 1 = classical RS with no boundary treatment (not recommended in
233  // parallel)
234  hypre_preconditioner_pt->amg_coarsening() = 1;
235 
236  // Strength of dependence = 0.25
237  hypre_preconditioner_pt->amg_strength() = 0.25;
238 
239 
240  // Set the smoothers
241  // 0 = Jacobi
242  hypre_preconditioner_pt->amg_simple_smoother() = 0;
243 
244  // Set Jacobi damping = 2/3
245  hypre_preconditioner_pt->amg_damping() = 0.668;
246 
247 
248  // Set number of cycles to 1xV(2,2)
249  hypre_preconditioner_pt->set_amg_iterations(2);
250  hypre_preconditioner_pt->amg_smoother_iterations() = 1;
251 
252  return hypre_preconditioner_pt;
253 #else
254  std::ostringstream err_msg;
255  err_msg << "hypre preconditioner is not available.\n"
256  << "Please install Hypre.\n";
257  throw OomphLibError(
259 #endif
260  } // function boomer_amg_for_2D_poisson_problem

References oomph::HyprePreconditioner::amg_coarsening(), oomph::HyprePreconditioner::amg_damping(), oomph::HyprePreconditioner::amg_simple_smoother(), oomph::HyprePreconditioner::amg_smoother_iterations(), oomph::HyprePreconditioner::amg_strength(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::HyprePreconditioner::set_amg_iterations().

Referenced by TiltedCavityProblem< ELEMENT >::TiltedCavityProblem().

◆ boomer_amg_for_3D_momentum()

Preconditioner * oomph::Lagrange_Enforced_Flow_Preconditioner_Subsidiary_Operator_Helper::boomer_amg_for_3D_momentum ( )

Hypre Boomer AMG setting for the augmented momentum block of a 3D Navier-Stokes problem (for serial code).

147  {
148 #ifdef OOMPH_HAS_HYPRE
149  // Create a new HyprePreconditioner
150  HyprePreconditioner* hypre_preconditioner_pt = new HyprePreconditioner;
151 
152  // Coarsening strategy
153  // 1 = classical RS with no boundary treatment (not recommended in
154  // parallel)
155  hypre_preconditioner_pt->amg_coarsening() = 1;
156 
157  // Strength of dependence = 0.668
158  hypre_preconditioner_pt->amg_strength() = 0.8;
159 
160 
161  // Set the smoothers
162  // 1 = Gauss-Seidel, sequential (very slow in parallel!)
163  hypre_preconditioner_pt->amg_simple_smoother() = 1;
164 
165  // Set smoother damping (not required, so set to -1)
166  hypre_preconditioner_pt->amg_damping() = -1;
167 
168 
169  // Set number of cycles to 1xV(2,2)
170  hypre_preconditioner_pt->set_amg_iterations(1);
171  hypre_preconditioner_pt->amg_smoother_iterations() = 2;
172 
173  return hypre_preconditioner_pt;
174 #else
175  std::ostringstream err_msg;
176  err_msg << "hypre preconditioner is not available.\n"
177  << "Please install Hypre.\n";
178  throw OomphLibError(
180 #endif
181  } // function boomer_amg_for_3D_momentum

References oomph::HyprePreconditioner::amg_coarsening(), oomph::HyprePreconditioner::amg_damping(), oomph::HyprePreconditioner::amg_simple_smoother(), oomph::HyprePreconditioner::amg_smoother_iterations(), oomph::HyprePreconditioner::amg_strength(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::HyprePreconditioner::set_amg_iterations().

◆ boomer_amg_for_3D_poisson_problem()

Preconditioner * oomph::Lagrange_Enforced_Flow_Preconditioner_Subsidiary_Operator_Helper::boomer_amg_for_3D_poisson_problem ( )

Hypre Boomer AMG setting for the 3D Poisson problem (for serial code).

265  {
266 #ifdef OOMPH_HAS_HYPRE
267  // Create a new HyprePreconditioner
268  HyprePreconditioner* hypre_preconditioner_pt = new HyprePreconditioner;
269 
270  // Coarsening strategy
271  // 1 = classical RS with no boundary treatment (not recommended in
272  // parallel)
273  hypre_preconditioner_pt->amg_coarsening() = 1;
274 
275  // Strength of dependence = 0.7
276  hypre_preconditioner_pt->amg_strength() = 0.7;
277 
278 
279  // Set the smoothers
280  // 0 = Jacobi
281  hypre_preconditioner_pt->amg_simple_smoother() = 0;
282 
283  // Set smoother damping = 2/3
284  hypre_preconditioner_pt->amg_damping() = 0.668;
285 
286 
287  // Set number of cycles to 2xV(1,1)
288  hypre_preconditioner_pt->set_amg_iterations(2);
289  hypre_preconditioner_pt->amg_smoother_iterations() = 1;
290 
291  return hypre_preconditioner_pt;
292 #else
293  std::ostringstream err_msg;
294  err_msg << "hypre preconditioner is not available.\n"
295  << "Please install Hypre.\n";
296  throw OomphLibError(
298 #endif
299  } // function boomer_amg_for_3D_poisson_problem

References oomph::HyprePreconditioner::amg_coarsening(), oomph::HyprePreconditioner::amg_damping(), oomph::HyprePreconditioner::amg_simple_smoother(), oomph::HyprePreconditioner::amg_smoother_iterations(), oomph::HyprePreconditioner::amg_strength(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::HyprePreconditioner::set_amg_iterations().

◆ get_w_cg_preconditioner()

Preconditioner * oomph::Lagrange_Enforced_Flow_Preconditioner_Subsidiary_Operator_Helper::get_w_cg_preconditioner ( )

CG with diagonal preconditioner for W-block subsidiary linear systems.

38  {
39 #ifdef OOMPH_HAS_TRILINOS
40  InnerIterationPreconditioner<TrilinosAztecOOSolver,
41  MatrixBasedDiagPreconditioner>* prec_pt =
42  new InnerIterationPreconditioner<TrilinosAztecOOSolver,
43  MatrixBasedDiagPreconditioner>;
44 
45  // Note: This makes CG a proper "inner iteration" for
46  // which GMRES (may) no longer converge. We should really
47  // use FGMRES or GMRESR for this. However, here the solver
48  // is so good that it'll converge very quickly anyway
49  // so there isn't much to be gained by limiting the number
50  // of iterations...
51  prec_pt->max_iter() = 4;
52  prec_pt->solver_pt()->solver_type() = TrilinosAztecOOSolver::CG;
53  prec_pt->solver_pt()->disable_doc_time();
54  return prec_pt;
55 #else
56  std::ostringstream err_msg;
57  err_msg << "Inner CG preconditioner is unavailable.\n"
58  << "Please install Trilinos.\n";
59  throw OomphLibError(
61 #endif
62  } // function get_w_cg_preconditioner

References oomph::TrilinosAztecOOSolver::CG, OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.