30 #ifndef OOMPH_LAGRANGE_ENFORCED_FLOW_PRECONDITIONERS_HEADER 31 #define OOMPH_LAGRANGE_ENFORCED_FLOW_PRECONDITIONERS_HEADER 36 #include <oomph-lib-config.h> 40 #include "../generic/matrices.h" 41 #include "../generic/assembly_handler.h" 42 #include "../generic/problem.h" 43 #include "../generic/block_preconditioner.h" 44 #include "../generic/preconditioner.h" 45 #include "../generic/SuperLU_preconditioner.h" 46 #include "../generic/matrix_vector_product.h" 47 #include "../generic/general_purpose_preconditioners.h" 48 #include "../generic/general_purpose_block_preconditioners.h" 49 #ifdef OOMPH_HAS_HYPRE 50 #include "../generic/hypre_solver.h" 52 #ifdef OOMPH_HAS_TRILINOS 53 #include "../generic/trilinos_solver.h" 61 namespace Lagrange_Enforced_Flow_Preconditioner_Subsidiary_Operator_Helper
186 Navier_stokes_preconditioner_pt = 0;
191 Navier_stokes_preconditioner_is_block_preconditioner =
false;
194 Using_superlu_ns_preconditioner =
true;
197 My_mesh_pt.resize(0,0);
201 My_ndof_types_in_mesh.resize(0,0);
204 Use_norm_f_for_scaling_sigma =
true;
206 N_lagrange_doftypes = 0;
207 N_fluid_doftypes = 0;
208 N_velocity_doftypes = 0;
209 Preconditioner_has_been_setup =
false;
215 this->clean_up_memory();
249 Use_norm_f_for_scaling_sigma =
true;
261 if(scaling_sigma == 0.0)
263 std::ostringstream warning_stream;
264 warning_stream <<
"WARNING: \n" 265 <<
"Setting scaling_sigma = 0.0 may cause values.\n";
267 OOMPH_CURRENT_FUNCTION,
268 OOMPH_EXCEPTION_LOCATION);
270 if(scaling_sigma > 0.0)
272 std::ostringstream warning_stream;
273 warning_stream <<
"WARNING: " << std::endl
274 <<
"The scaling (scaling_sigma) is positive: " 275 << Scaling_sigma <<
"\n" 276 <<
"Performance may be degraded.\n";
278 OOMPH_CURRENT_FUNCTION,
279 OOMPH_EXCEPTION_LOCATION);
283 Scaling_sigma = scaling_sigma;
284 Use_norm_f_for_scaling_sigma =
false;
290 return Scaling_sigma;
295 void set_navier_stokes_preconditioner(
302 if (!Using_superlu_ns_preconditioner)
304 delete Navier_stokes_preconditioner_pt;
306 Using_superlu_ns_preconditioner =
true;
311 void clean_up_memory();
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
Vector< unsigned > My_ndof_types_in_mesh
The number of DOF types in each mesh. This is used create various lookup lists.
bool Preconditioner_has_been_setup
Control flag is true if the preconditioner has been setup (used so we can wipe the data when the prec...
double Scaling_sigma
Scaling for the augmentation: Scaling_sigma*(LL^T)
void set_scaling_sigma(const double &scaling_sigma)
Access function to set the scaling sigma. Note: this also sets the flag to use the infinite norm of t...
virtual ~LagrangeEnforcedFlowPreconditioner()
Destructor.
Preconditioner * boomer_amg_for_2D_poisson_problem()
Hypre Boomer AMG setting for the 2D Poisson problem (for serial code).
bool Navier_stokes_preconditioner_is_block_preconditioner
Flag to indicate if the preconditioner for the Navier-Stokes block is a block preconditioner or not...
void setup()
Setup terminate helper.
double scaling_sigma() const
Read (const) function to get the scaling sigma.
unsigned My_nmesh
The number of meshes. This is used to create various lookup lists.
void set_superlu_for_navier_stokes_preconditioner()
Set Navier-Stokes matrix preconditioner (inexact solver) to SuperLU.
Preconditioner * boomer_amg_for_3D_poisson_problem()
Hypre Boomer AMG setting for the 3D Poisson problem (for serial code).
Preconditioner * get_w_cg_preconditioner()
CG with diagonal preconditioner for W-block subsidiary linear systems.
Preconditioner * Navier_stokes_preconditioner_pt
Pointer to the 'preconditioner' for the Navier-Stokes block.
unsigned N_lagrange_doftypes
The number of Lagrange multiplier DOF types.
bool Using_superlu_ns_preconditioner
Flag to indicate whether the default NS preconditioner is used.
Vector< Vector< double > > Inv_w_diag_values
Inverse W values.
bool Use_norm_f_for_scaling_sigma
Flag to indicate if we want to use the infinite norm of the Navier-Stokes momentum block for the scal...
An interface to allow SuperLU to be used as an (exact) Preconditioner.
unsigned N_fluid_doftypes
The number of fluid DOF types (including pressure).
Preconditioner base class. Gives an interface to call all other preconditioners through and stores th...
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
Vector< Mesh * > My_mesh_pt
Storage for the meshes. In our implementation, the first mesh must always be the Navier-Stokes (bulk)...
A vector in the mathematical sense, initially developed for linear algebra type applications. If MPI then this vector can be distributed - its distribution is described by the LinearAlgebraDistribution object at Distribution_pt. Data is stored in a C-style pointer vector (double*)
unsigned N_velocity_doftypes
The number of velocity DOF types.
void operator=(const LagrangeEnforcedFlowPreconditioner &)
Broken assignment operator.
Preconditioner * boomer_amg_for_2D_momentum_simple_visc()
Hypre Boomer AMG setting for the augmented momentum block of a 2D Navier-Stokes problem using the sim...
void use_norm_f_for_scaling_sigma()
Set flag to use the infinite norm of the Navier-Stokes F matrix as the scaling sigma. This is the default behaviour. Note: the norm of the NS F matrix positive, however, we actually use the negative of the norm. This is because the underlying Navier-Stokes Jacobian is multiplied by -1. Ask Andrew/Matthias for more detail.
A class for compressed row matrices. This is a distributable object.
LagrangeEnforcedFlowPreconditioner()
Constructor - initialise variables.
The preconditioner for the Lagrange multiplier constrained Navier-Stokes equations. The velocity components are constrained by Lagrange multiplier, which are applied via OOMPH-LIB's FACE elements.
Preconditioner * boomer_amg2v22_for_3D_momentum()
Hypre Boomer AMG setting for the augmented momentum block of a 3D Navier-Stokes problem (for serial c...
Preconditioner * boomer_amg_for_3D_momentum()
Hypre Boomer AMG setting for the augmented momentum block of a 3D Navier-Stokes problem (for serial c...
Preconditioner * boomer_amg_for_2D_momentum_stressdiv_visc()
Hypre Boomer AMG setting for the augmented momentum block of a 2D Navier-Stokes problem using the str...