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
111 typedef Preconditioner* (*SubsidiaryPreconditionerFctPt)();
302 :
public BlockPreconditioner<CRDoubleMatrix>
314 typedef Preconditioner* (*SubsidiaryPreconditionerFctPt)();
496 :
public BlockPreconditioner<CRDoubleMatrix>
504 typedef Preconditioner* (*SubsidiaryPreconditionerFctPt)();
585 :
public BlockPreconditioner<CRDoubleMatrix>
593 typedef Preconditioner* (*SubsidiaryPreconditionerFctPt)();
597 : BlockPreconditioner<CRDoubleMatrix>()
669 Vector<PseudoElasticPreconditionerSubsidiaryPreconditionerOld*>
701 :
public BlockPreconditioner<CRDoubleMatrix>
714 BlockPreconditioner<CRDoubleMatrix>* master_prec_pt,
715 CRDoubleMatrix* matrix_pt,
716 Vector<unsigned>& dof_list,
717 const Mesh*
const solid_mesh_pt,
718 const OomphCommunicator* comm_pt)
721 this->turn_into_subsidiary_block_preconditioner(master_prec_pt, dof_list);
724 Vector<unsigned> dof_to_block_map(dof_list.size(), 0);
727 set_matrix_pt(matrix_pt);
731 this->set_mesh(0, solid_mesh_pt);
734 this->set_comm_pt(comm_pt);
737 this->block_setup(dof_to_block_map);
743 this->clear_block_preconditioner_base();
757 CRDoubleMatrix* m_pt =
new CRDoubleMatrix;
758 this->get_block(0, 0, *m_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);
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)
~PseudoElasticPreconditionerScalingHelperOld()
Destructor.
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
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.