26 #ifndef OOMPH_PSEUDO_ELASTIC_SUBSIDIARY_PRECONDITIONER
27 #define OOMPH_PSEUDO_ELASTIC_SUBSIDIARY_PRECONDITIONER
30 #include "../generic/problem.h"
31 #include "../generic/block_preconditioner.h"
32 #include "../generic/preconditioner.h"
33 #include "../generic/SuperLU_preconditioner.h"
34 #include "../generic/matrix_vector_product.h"
35 #include "../generic/general_purpose_preconditioners.h"
36 #include "../generic/general_purpose_block_preconditioners.h"
37 #ifdef OOMPH_HAS_HYPRE
38 #include "../generic/hypre_solver.h"
40 #ifdef OOMPH_HAS_TRILINOS
41 #include "../generic/trilinos_solver.h"
50 namespace Pseudo_Elastic_Preconditioner_Subsidiary_Operator_Helper
52 #ifdef OOMPH_HAS_HYPRE
64 #ifdef OOMPH_HAS_TRILINOS
717 const Mesh*
const solid_mesh_pt,
767 std::ostringstream error_message;
768 error_message <<
"This method is intentionally broken. This class is not "
770 <<
"preconditioner.";
772 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
778 std::ostringstream error_message;
779 error_message <<
"This method is intentionally broken. This class is not "
781 <<
"preconditioner.";
783 error_message.str(), OOMPH_CURRENT_FUNCTION, 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...
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(....
CRDoubleMatrix * matrix_pt() const
Access function to matrix_pt. If this is the master then cast the matrix pointer to MATRIX*,...
void turn_into_subsidiary_block_preconditioner(BlockPreconditioner< CRDoubleMatrix > *master_block_prec_pt, const Vector< unsigned > &doftype_in_master_preconditioner_coarse)
Function to turn this preconditioner into a subsidiary preconditioner that operates within a bigger "...
void set_nmesh(const unsigned &n)
Specify the number of meshes required by this block preconditioner. Note: elements in different meshe...
virtual void block_setup()
Determine the size of the matrix blocks and setup the lookup schemes relating the global degrees of f...
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.
double inf_norm() const
returns the inf-norm of this matrix
//////////////////////////////////////////////////////////////////////////// ////////////////////////...
A vector in the mathematical sense, initially developed for linear algebra type applications....
An oomph-lib wrapper to the MPI_Comm communicator object. Just contains an MPI_Comm object (which is ...
An OomphLibError object which should be thrown when an run-time error is encountered....
Preconditioner base class. Gives an interface to call all other preconditioners through and stores th...
virtual void set_comm_pt(const OomphCommunicator *const comm_pt)
Set the communicator pointer.
virtual const OomphCommunicator * comm_pt() const
Get function for comm pointer.
virtual void set_matrix_pt(DoubleMatrixBase *matrix_pt)
Set the matrix pointer.
Preconditioner for FSI problems with pseudo-elastic fluid node updates. Note: NavierStokesSchurComple...
//////////////////////////////////////////////////////////////////////////// ////////////////////////...
void lagrange_multiplier_preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply the lagrange multiplier subsidiary preconditioner.
Preconditioner * Elastic_preconditioner_pt
storage for the preconditioner for the solid system
Vector< Preconditioner * > Lagrange_multiplier_preconditioner_pt
lagrange multiplier preconditioner pt
virtual ~PseudoElasticPreconditionerOld()
destructor
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply the preconditioner. Method implemented in two other methods (elastic and lagrange multiplier su...
void setup()
Broken assignment operator.
void set_lagrange_multiplier_mesh(Mesh *mesh_pt)
Access function to mesh containing the block-preconditionable lagrange multiplier elements.
bool Use_inf_norm_of_s_scaling
boolean indicating whether the inf-norm of S should be used as scaling. Default = true;
SubsidiaryPreconditionerFctPt Elastic_subsidiary_preconditioner_function_pt
The solid subsidiary preconditioner function pointer.
Elastic_preconditioner_type E_preconditioner_type
An unsigned indicating which method should be used for preconditioning the solid component.
void enable_inf_norm_of_s_scaling()
Call to use the inf norm of S as scaling.
void elastic_preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply the elastic subsidiary preconditioner.
double Scaling
The scaling. Defaults to infinity norm of S.
void disable_inf_norm_of_s_scaling()
Call to use no scaling.
PseudoElasticPreconditionerOld()
Default (and only) constructor.
unsigned Dim
the dimension of the problem
Elastic_preconditioner_type
The augmented elasticity system can be preconditioned in one of four ways. 0 - Exact preconditioner 1...
@ Exact_block_preconditioner
@ Block_upper_triangular_preconditioner
@ Block_lower_triangular_preconditioner
@ Block_diagonal_preconditioner
Preconditioner *(* SubsidiaryPreconditionerFctPt)()
This preconditioner includes the option to use subsidiary operators other than SuperLUPreconditioner ...
void set_elastic_mesh(Mesh *mesh_pt)
Access function to mesh containing the block-preconditionable elastic elements.
Elastic_preconditioner_type & elastic_preconditioner_type()
Set the type of preconditioner applied to the elastic: 0 - Exact preconditioner 1 - Block diagonal pr...
void set_elastic_subsidiary_preconditioner(SubsidiaryPreconditionerFctPt prec_fn)
By default the elastic subsidiary systems are preconditioner with SuperLUPreconditioner....
SubsidiaryPreconditionerFctPt Lagrange_multiplier_subsidiary_preconditioner_function_pt
The Lagrange multiplier subsidary preconditioner function pointer.
void set_lagrange_multiplier_subsidiary_preconditioner(SubsidiaryPreconditionerFctPt prec_fn)
By default the Lagrange multiplier subsidiary systems are preconditioner with SuperLUPreconditioner....
Mesh * Elastic_mesh_pt
Pointer to the mesh containing the solid elements.
void clean_up_memory()
Clears the memory.
Mesh * Lagrange_multiplier_mesh_pt
Pointer to the mesh containing the Lagrange multiplier elements.
PseudoElasticPreconditionerOld(const PseudoElasticPreconditionerOld &)=delete
Broken copy constructor.
//////////////////////////////////////////////////////////////////////////// ////////////////////////...
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply the preconditioner. Pure virtual generic interface function. This method should apply the preco...
~PseudoElasticPreconditionerScalingHelperOld()
Destructor.
void setup()
Setup the preconditioner. Pure virtual generic interface function.
double s_inf_norm()
Broken assignment operator.
PseudoElasticPreconditionerScalingHelperOld(BlockPreconditioner< CRDoubleMatrix > *master_prec_pt, CRDoubleMatrix *matrix_pt, Vector< unsigned > &dof_list, const Mesh *const solid_mesh_pt, const OomphCommunicator *comm_pt)
The constructor. NOTE:
PseudoElasticPreconditionerScalingHelperOld(const PseudoElasticPreconditionerScalingHelperOld &)=delete
Broken copy constructor.
///////////////////////////////////////////////////////////////////////////// ///////////////////////...
void use_block_diagonal_approximation()
use as a block diagonal preconditioner
PseudoElasticPreconditionerSubsidiaryBlockPreconditionerOld()
Constructor. (By default this preconditioner is upper triangular).
void preconditioner_solve(const DoubleVector &res, DoubleVector &z)
Apply preconditioner to r.
SubsidiaryPreconditionerFctPt Subsidiary_preconditioner_function_pt
The SubisidaryPreconditionerFctPt.
void use_upper_triangular_approximation()
Use as an upper triangular preconditioner.
~PseudoElasticPreconditionerSubsidiaryBlockPreconditionerOld()
Destructor.
PseudoElasticPreconditionerSubsidiaryBlockPreconditionerOld(const PseudoElasticPreconditionerSubsidiaryBlockPreconditionerOld &)=delete
Broken copy constructor.
Vector< PseudoElasticPreconditionerSubsidiaryPreconditionerOld * > Diagonal_block_preconditioner_pt
Vector of SuperLU preconditioner pointers for storing the preconditioners for each diagonal block.
void setup()
Setup the preconditioner.
void use_lower_triangular_approximation()
Use as a lower triangular preconditioner.
double Scaling
The scaling. default 1.0.
unsigned Method
the preconditioning method. 0 - block diagonal 1 - upper triangular 2 - lower triangular
void set_subsidiary_preconditioner_function(SubsidiaryPreconditionerFctPt sub_prec_fn)
access function to set the subsidiary preconditioner function.
Preconditioner *(* SubsidiaryPreconditionerFctPt)()
This preconditioner includes the option to use subsidiary operators other than SuperLUPreconditioner ...
void clean_up_memory()
Broken assignment operator.
DenseMatrix< MatrixVectorProduct * > Off_diagonal_matrix_vector_products
Matrix of matrix vector product operators for the off diagonals.
double & scaling()
Specify the scaling. Default is 1.0 Must be set before setup(...).
///////////////////////////////////////////////////////////////////////////// ///////////////////////...
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply the preconditioner.
SubsidiaryPreconditionerFctPt Subsidiary_preconditioner_function_pt
the SubisidaryPreconditionerFctPt
~PseudoElasticPreconditionerSubsidiaryPreconditionerOld()
Destructor.
Preconditioner *(* SubsidiaryPreconditionerFctPt)()
typedef for a function that allows other preconditioners to be emplyed to solve the subsidiary linear...
double & scaling()
Specify the scaling. Default is 1.0 Must be called before setup(...).
void clean_up_memory()
clears the memory
Preconditioner * Preconditioner_pt
the preconditioner pt
void setup()
Broken assignment operator.
PseudoElasticPreconditionerSubsidiaryPreconditionerOld()
Constructor.
void set_subsidiary_preconditioner_function(SubsidiaryPreconditionerFctPt sub_prec_fn)
access function to set the subsidiary preconditioner function.
PseudoElasticPreconditionerSubsidiaryPreconditionerOld(const PseudoElasticPreconditionerSubsidiaryPreconditionerOld &)=delete
Broken copy constructor.
//////////////////////////////////////////////////////////////////////////// ////////////////////////...
SubsidiaryPreconditionerFctPt Lagrange_multiplier_subsidiary_preconditioner_function_pt
The Lagrange multiplier subsidiary preconditioner function pointer.
void disable_inf_norm_of_s_scaling()
Call to use no scaling.
void lagrange_multiplier_preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply the lagrange multiplier subsidiary preconditioner.
Preconditioner *(* SubsidiaryPreconditionerFctPt)()
This preconditioner includes the option to use subsidiary operators other than SuperLUPreconditioner ...
Elastic_preconditioner_type & elastic_preconditioner_type()
Set the type of preconditioner applied to the elastic: 0 - Exact preconditioner 1 - Block diagonal pr...
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply the preconditioner. Method implemented in two other methods (elastic and lagrange multiplier su...
bool Use_inf_norm_of_s_scaling
boolean indicating whether the inf-norm of S should be used as scaling. Default = true;
double Scaling
The scaling. Defaults to infinity norm of S.
void set_lagrange_multiplier_mesh(Mesh *mesh_pt)
Access function to mesh containing the block-preconditionable lagrange multiplier elements.
void set_lagrange_multiplier_subsidiary_preconditioner(SubsidiaryPreconditionerFctPt prec_fn)
By default the Lagrange multiplier subsidiary systems are preconditioner with SuperLUPreconditioner....
void setup()
Broken assignment operator.
Vector< Preconditioner * > Lagrange_multiplier_preconditioner_pt
lagrange multiplier preconditioner pt
void set_elastic_subsidiary_preconditioner(SubsidiaryPreconditionerFctPt prec_fn)
By default the elastic subsidiary systems are preconditioner with SuperLUPreconditioner....
void enable_inf_norm_of_s_scaling()
Call to use the inf norm of S as scaling.
virtual ~PseudoElasticPreconditioner()
destructor
void elastic_preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply the elastic subsidiary preconditioner.
Mesh * Lagrange_multiplier_mesh_pt
Pointer to the mesh containing the Lagrange multiplier elements.
SubsidiaryPreconditionerFctPt Elastic_subsidiary_preconditioner_function_pt
The solid subsidiary preconditioner function pointer.
PseudoElasticPreconditioner()
Default (and only) constructor.
Mesh * Elastic_mesh_pt
Pointer to the mesh containing the solid elements.
Elastic_preconditioner_type E_preconditioner_type
An unsigned indicating which method should be used for preconditioning the solid component.
Elastic_preconditioner_type
The augmented elasticity system can be preconditioned in one of four ways. 0 - Exact preconditioner 1...
@ Block_diagonal_preconditioner
@ Exact_block_preconditioner
@ Block_lower_triangular_preconditioner
@ Block_upper_triangular_preconditioner
void clean_up_memory()
Clears the memory.
void set_elastic_mesh(Mesh *mesh_pt)
Access function to mesh containing the block-preconditionable elastic elements.
PseudoElasticPreconditioner(const PseudoElasticPreconditioner &)=delete
Broken copy constructor.
Preconditioner * Elastic_preconditioner_pt
storage for the preconditioner for the solid system
unsigned Dim
the dimension of the problem
A slight extension to the standard template vector class so that we can include "graceful" array rang...
Preconditioner * get_lagrange_multiplier_preconditioner()
CG with diagonal preconditioner for the lagrange multiplier subsidiary linear systems.
Preconditioner * get_elastic_preconditioner()
AMG w/ GS smoothing for the augmented elastic subsidiary linear systems – calls Hypre version to stay...
Preconditioner * get_elastic_preconditioner_trilinos_ml()
TrilinosML smoothing for the augmented elastic subsidiary linear systems.
Preconditioner * get_elastic_preconditioner_hypre()
AMG w/ GS smoothing for the augmented elastic subsidiary linear systems.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...