26 #ifndef OOMPH_LAGRANGE_ENFORCED_FLOW_PRECONDITIONERS_HEADER
27 #define OOMPH_LAGRANGE_ENFORCED_FLOW_PRECONDITIONERS_HEADER
32 #include <oomph-lib-config.h>
36 #include "../generic/matrices.h"
37 #include "../generic/assembly_handler.h"
38 #include "../generic/problem.h"
39 #include "../generic/block_preconditioner.h"
40 #include "../generic/preconditioner.h"
41 #include "../generic/SuperLU_preconditioner.h"
42 #include "../generic/matrix_vector_product.h"
43 #include "../generic/general_purpose_preconditioners.h"
44 #include "../generic/general_purpose_block_preconditioners.h"
45 #ifdef OOMPH_HAS_HYPRE
46 #include "../generic/hypre_solver.h"
48 #ifdef OOMPH_HAS_TRILINOS
49 #include "../generic/trilinos_solver.h"
57 namespace Lagrange_Enforced_Flow_Preconditioner_Subsidiary_Operator_Helper
252 std::ostringstream warning_stream;
253 warning_stream <<
"WARNING: \n"
254 <<
"Setting scaling_sigma = 0.0 may cause values.\n";
256 OOMPH_CURRENT_FUNCTION,
257 OOMPH_EXCEPTION_LOCATION);
261 std::ostringstream warning_stream;
262 warning_stream <<
"WARNING: " << std::endl
263 <<
"The scaling (scaling_sigma) is positive: "
265 <<
"Performance may be degraded.\n";
267 OOMPH_CURRENT_FUNCTION,
268 OOMPH_EXCEPTION_LOCATION);
Block Preconditioner base class. The block structure of the overall problem is determined from the Me...
const Mesh * mesh_pt(const unsigned &i) const
Access to i-th mesh (of the various meshes that contain block preconditionable elements of the same n...
A class for compressed row matrices. This is a distributable object.
A vector in the mathematical sense, initially developed for linear algebra type applications....
The preconditioner for the Lagrange multiplier constrained Navier-Stokes equations....
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.
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...
unsigned N_fluid_doftypes
The number of fluid DOF types (including pressure).
void set_navier_stokes_preconditioner(Preconditioner *new_ns_preconditioner_pt=0)
Set a new Navier-Stokes matrix preconditioner (inexact solver)
LagrangeEnforcedFlowPreconditioner(const LagrangeEnforcedFlowPreconditioner &)=delete
Broken copy constructor.
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...
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...
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply the preconditioner. r is the residual (rhs), z will contain the solution.
double scaling_sigma() const
Read (const) function to get the scaling sigma.
Vector< unsigned > My_ndof_types_in_mesh
The number of DOF types in each mesh. This is used create various lookup lists.
LagrangeEnforcedFlowPreconditioner()
Constructor - initialise variables.
Vector< Vector< double > > Inv_w_diag_values
Inverse W values.
void set_meshes(const Vector< Mesh * > &mesh_pt)
Set the meshes, the first mesh in the vector must be the bulk mesh.
unsigned My_nmesh
The number of meshes. This is used to create various lookup lists.
virtual ~LagrangeEnforcedFlowPreconditioner()
Destructor.
void use_norm_f_for_scaling_sigma()
Set flag to use the infinite norm of the Navier-Stokes F matrix as the scaling sigma....
void operator=(const LagrangeEnforcedFlowPreconditioner &)=delete
Broken assignment operator.
double Scaling_sigma
Scaling for the augmentation: Scaling_sigma*(LL^T)
void setup()
Setup method for the LagrangeEnforcedFlowPreconditioner.
bool Using_superlu_ns_preconditioner
Flag to indicate whether the default NS preconditioner is used.
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 clean_up_memory()
Clears the memory.
void set_superlu_for_navier_stokes_preconditioner()
Set Navier-Stokes matrix preconditioner (inexact solver) to SuperLU.
Vector< Mesh * > My_mesh_pt
Storage for the meshes. In our implementation, the first mesh must always be the Navier-Stokes (bulk)...
unsigned N_velocity_doftypes
The number of velocity DOF types.
An OomphLibWarning object which should be created as a temporary object to issue a warning....
Preconditioner base class. Gives an interface to call all other preconditioners through and stores th...
An interface to allow SuperLU to be used as an (exact) Preconditioner.
A slight extension to the standard template vector class so that we can include "graceful" array rang...
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...
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 * get_w_cg_preconditioner()
CG with diagonal preconditioner for W-block subsidiary linear systems.
Preconditioner * boomer_amg_for_3D_poisson_problem()
Hypre Boomer AMG setting for the 3D Poisson problem (for serial code).
Preconditioner * boomer_amg_for_2D_poisson_problem()
Hypre Boomer AMG setting for the 2D Poisson problem (for serial code).
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...
Preconditioner * boomer_amg2v22_for_3D_momentum()
Hypre Boomer AMG setting for the augmented momentum block of a 3D Navier-Stokes problem (for serial c...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...