33 namespace Lagrange_Enforced_Flow_Preconditioner_Subsidiary_Operator_Helper
39#ifdef OOMPH_HAS_TRILINOS
53 prec_pt->solver_pt()->disable_doc_time();
57 err_msg <<
"Inner CG preconditioner is unavailable.\n"
58 <<
"Please install Trilinos.\n";
97 err_msg <<
"hypre preconditioner is not available.\n"
98 <<
"Please install Hypre.\n";
109#ifdef OOMPH_HAS_HYPRE
137 err_msg <<
"hypre preconditioner is not available.\n"
138 <<
"Please install Hypre.\n";
148#ifdef OOMPH_HAS_HYPRE
176 err_msg <<
"hypre preconditioner is not available.\n"
177 <<
"Please install Hypre.\n";
187#ifdef OOMPH_HAS_HYPRE
215 err_msg <<
"hypre preconditioner is not available.\n"
216 <<
"Please install Hypre.\n";
227#ifdef OOMPH_HAS_HYPRE
255 err_msg <<
"hypre preconditioner is not available.\n"
256 <<
"Please install Hypre.\n";
266#ifdef OOMPH_HAS_HYPRE
294 err_msg <<
"hypre preconditioner is not available.\n"
295 <<
"Please install Hypre.\n";
316 std::ostringstream error_message;
317 error_message <<
"setup() must be called before using "
318 <<
"preconditioner_solve()";
324 if (z.
nrow() !=
r.nrow())
326 std::ostringstream error_message;
327 error_message <<
"The vectors z and r must have the same number of "
339 z.
build(
r.distribution_pt(), 0.0);
429 err_msg <<
"There should be at least two meshes.\n";
440 err_msg <<
"The pointer mesh_pt[" <<
mesh_i <<
"] is null.\n";
465 err_msg <<
"In the first mesh, the elements have elemental dimension "
467 <<
"with a nodal dimension of " <<
nodal_dim <<
".\n"
468 <<
"The first mesh does not contain 'bulk' elements.\n"
469 <<
"Please re-order your mesh_pt vector.\n";
518 err_msg <<
"There are no meshes set. Please call set_meshes(...)\n"
519 <<
"with at least two mesh.";
609 err_msg <<
"The number of DOF types are incorrect.\n"
612 <<
"The number of DOF types from "
613 <<
"BlockPreconditioner::ndof_types() is " <<
n_dof_types
763 <<
"Division by 0 will occur."
772 <<
"The scaling (Scaling_sigma) is positive: "
774 <<
"Performance may be degraded." << std::endl;
840 <<
"There are no mass matrices on Lagrange block row "
842 <<
"Perhaps the problem setup is incorrect."
869 <<
" in L^T block " <<
l_i <<
" is zero.\n"
870 <<
"Perhaps the problem setup is incorrect."
1148 ->turn_into_subsidiary_block_preconditioner(
1186 err_msg <<
"Not using ExactPreconditioner for NS block,\n"
1187 <<
"but the Navier_stokes_preconditioner_pt is null.\n";
1223 <<
"The LSC preconditioner point is null.\n"
1224 <<
"Using default (SuperLU) preconditioner.\n"
unsigned nmesh() const
Return the number of meshes in Mesh_pt.
void return_block_vector(const unsigned &n, const DoubleVector &b, DoubleVector &v) const
Takes the n-th block ordered vector, b, and copies its entries to the appropriate entries in the natu...
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...
CRDoubleMatrix get_concatenated_block(const VectorMatrix< BlockSelector > &selected_block)
Returns a concatenation of the block matrices specified by the argument selected_block....
Vector< LinearAlgebraDistribution * > Block_distribution_pt
The distribution for the blocks.
void return_concatenated_block_vector(const Vector< unsigned > &block_vec_number, const DoubleVector &b, DoubleVector &v) const
Takes concatenated block ordered vector, b, and copies its entries to the appropriate entries in the ...
void get_block(const unsigned &i, const unsigned &j, CRDoubleMatrix &output_matrix, const bool &ignore_replacement_block=false) const
Put block (i,j) into output_matrix. This block accounts for any coarsening of dof types and any repla...
void clear_block_preconditioner_base()
Clears all BlockPreconditioner data. Called by the destructor and the block_setup(....
void get_block_vector(const unsigned &n, const DoubleVector &v, DoubleVector &b) const
Takes the naturally ordered vector, v and returns the n-th block vector, b. Here n is the block numbe...
void set_replacement_dof_block(const unsigned &block_i, const unsigned &block_j, CRDoubleMatrix *replacement_dof_block_pt)
Set replacement dof-level blocks. Only dof-level blocks can be set. This is important due to how the ...
bool is_subsidiary_block_preconditioner() const
Return true if this preconditioner is a subsidiary preconditioner.
unsigned ndof_types() const
Return the total number of DOF types.
void set_nmesh(const unsigned &n)
Specify the number of meshes required by this block preconditioner. Note: elements in different meshe...
CRDoubleMatrix * matrix_pt() const
Access function to matrix_pt. If this is the master then cast the matrix pointer to MATRIX*,...
virtual void block_setup()
Determine the size of the matrix blocks and setup the lookup schemes relating the global degrees of f...
void get_concatenated_block_vector(const Vector< unsigned > &block_vec_number, const DoubleVector &v, DoubleVector &b)
Takes the naturally ordered vector and extracts the blocks indicated by the block number (the values)...
void set_mesh(const unsigned &i, const Mesh *const mesh_pt, const bool &allow_multiple_element_type_in_mesh=false)
Set the i-th mesh for this block preconditioner. Note: The method set_nmesh(...) must be called befor...
A class for compressed row matrices. This is a distributable object.
unsigned nrow() const
access function to the number of global rows.
LinearAlgebraDistribution * distribution_pt() const
access to the LinearAlgebraDistribution
A vector in the mathematical sense, initially developed for linear algebra type applications....
void build(const DoubleVector &old_vector)
Just copys the argument DoubleVector.
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
An Preconditioner class using the suite of Hypre preconditioners to allow.
A preconditioner for performing inner iteration preconditioner solves. The template argument SOLVER s...
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.
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)
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.
Vector< unsigned > My_ndof_types_in_mesh
The number of DOF types in each mesh. This is used create various lookup lists.
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.
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.
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.
bool built() const
if the communicator_pt is null then the distribution is not setup then false is returned,...
Matrix-based diagonal preconditioner.
An OomphLibError object which should be thrown when an run-time error is encountered....
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...
virtual void setup(DoubleMatrixBase *matrix_pt)
Setup the preconditioner: store the matrix pointer and the communicator pointer then call preconditio...
virtual void preconditioner_solve(const DoubleVector &r, DoubleVector &z)=0
Apply the preconditioner. Pure virtual generic interface function. This method should apply the preco...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
An interface to the Trilinos AztecOO classes allowing it to be used as an Oomph-lib LinearSolver....
double inf_norm(const DenseMatrix< CRDoubleMatrix * > &matrix_pt)
Compute infinity (maximum) norm of sub blocks as if it was one matrix.
Preconditioner * create_exact_preconditioner()
Factory function to create suitable exact preconditioner.
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...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).