61 std::ostringstream error_message;
62 error_message <<
"The fluid and pseudo elastic mesh must be set.";
64 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
68 std::ostringstream error_message;
69 error_message <<
"The solid mesh must be set.";
71 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
75 std::ostringstream error_message;
76 error_message <<
"The Lagrange multiplier mesh must be set.";
78 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
88 unsigned nfluid_dof =
Dim + 1;
100 unsigned ntotal_dof =
101 nfluid_dof + npseudo_elastic_dof + nsolid_dof + nlagr_mult_dof;
109 for (
unsigned i = 0;
i < npseudo_elastic_dof;
i++)
111 dof_to_block_map[c] = 2;
114 for (
unsigned i = 0;
i < nsolid_dof;
i++)
116 dof_to_block_map[c] = 1;
119 for (
unsigned i = 0;
i < nlagr_mult_dof;
i++)
121 dof_to_block_map[c] = 3;
128 if (cr_matrix_pt == 0)
130 std::ostringstream error_message;
131 error_message <<
"FSIPreconditioner only works with"
132 <<
" CRDoubleMatrix matrices" << std::endl;
134 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
151 for (
unsigned i = 0;
i < nfluid_dof;
i++)
178 solid_block_preconditioner_pt =
182 if (solid_block_preconditioner_pt != 0)
184 unsigned offset = nfluid_dof + npseudo_elastic_dof;
186 for (
unsigned i = 0;
i < nsolid_dof;
i++)
188 solid_prec_dof_list[
i] = offset +
i;
190 solid_block_preconditioner_pt
192 solid_prec_dof_list);
193 solid_block_preconditioner_pt->
setup(cr_matrix_pt);
197 std::ostringstream error_message;
198 error_message <<
"If the (real) solid preconditioner is a "
199 <<
"BlockPreconditioner then is must be a "
200 <<
"GeneralPurposeBlockPreconditioner";
202 OOMPH_CURRENT_FUNCTION,
203 OOMPH_EXCEPTION_LOCATION);
218 unsigned ndof_for_pseudo_elastic_prec =
Dim * 3;
221 for (
unsigned i = 0;
i <
Dim * 2;
i++)
223 pseudo_elastic_prec_dof_list[
i] = nfluid_dof +
i;
225 for (
unsigned i = 0;
i <
Dim;
i++)
227 pseudo_elastic_prec_dof_list[
i +
Dim * 2] =
228 nfluid_dof + npseudo_elastic_dof + nsolid_dof +
i;
231 this, pseudo_elastic_prec_dof_list);
339 ->preconditioner_solve(z_copy, z);
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...
unsigned ndof_types_in_mesh(const unsigned &i) const
Return the number of DOF types in mesh i. WARNING: This should only be used by the upper-most master ...
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 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...
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< MATRIX > *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 setup_matrix_vector_product(MatrixVectorProduct *matvec_prod_pt, CRDoubleMatrix *block_pt, const Vector< unsigned > &block_col_indices)
Setup a matrix vector product. matvec_prod_pt is a pointer to the MatrixVectorProduct,...
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.
A vector in the mathematical sense, initially developed for linear algebra type applications....
void build(const DoubleVector &old_vector)
Just copys the argument DoubleVector.
void clear()
wipes the DoubleVector
Base class for general purpose block preconditioners. Deals with setting subsidiary preconditioners a...
void clean_up_memory()
clear the memory
void multiply(const DoubleVector &x, DoubleVector &y) const
Apply the operator to the vector x and return the result in the vector y.
void clean_up_memory()
Helper function to delete preconditioner data.
void set_navier_stokes_mesh(Mesh *mesh_pt, const bool &allow_multiple_element_type_in_navier_stokes_mesh=false)
Specify the mesh containing the block-preconditionable Navier-Stokes elements. The optional argument ...
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply preconditioner to Vector r.
An OomphLibError object which should be thrown when an run-time error is encountered....
void setup(DoubleMatrixBase *matrix_pt)
Setup the preconditioner: store the matrix pointer and the communicator pointer then call preconditio...
virtual void clean_up_memory()
Clean up memory (empty). Generic interface function.
virtual void preconditioner_solve(const DoubleVector &r, DoubleVector &z)=0
Apply the preconditioner. Pure virtual generic interface function. This method should apply the preco...
MatrixVectorProduct * Solid_pseudo_elastic_matvec_pt
solid onto pseudo solid matrix vector operatio
Mesh * Lagrange_multiplier_mesh_pt
Mesh containing the lagrange multiplier elements.
MatrixVectorProduct * Lagrange_solid_matvec_pt
void clean_up_memory()
Broken assignment operator.
Preconditioner * Solid_preconditioner_pt
pointer to the solid preconditioner
NavierStokesSchurComplementPreconditioner * Navier_stokes_schur_complement_preconditioner_pt
Navier Stokes Schur complement preconditioner.
void setup()
Setup the precoonditioner.
Preconditioner * Navier_stokes_preconditioner_pt
pointer to the navier stokes precondtioner
MatrixVectorProduct * Fluid_pseudo_elastic_matvec_pt
fluid onto pseudosolid matrix vector operator
MatrixVectorProduct * Solid_fluid_matvec_pt
solid onto fluid matrix vector operatio
Mesh * Fluid_and_pseudo_elastic_mesh_pt
Mesh containing the combined fluid and pseudo solid element.
bool Solid_preconditioner_is_block_preconditioner
boolean flag to indicate whether the Solid preconditioner is a block preconditioner
bool Use_navier_stokes_schur_complement_preconditioner
If true the Navier Stokes Schur complement preconditioner is used. Otherwise SuperLUPreconditioner is...
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply the preconditioner.
unsigned Dim
the dimension of the fluid
PseudoElasticPreconditioner * Pseudo_elastic_preconditioner_pt
pointer to the pseudo solid preconditioner
Mesh * Solid_mesh_pt
Mesh containing the solid elements.
void lagrange_multiplier_preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply the lagrange multiplier subsidiary preconditioner.
void set_lagrange_multiplier_mesh(Mesh *mesh_pt)
Access function to mesh containing the block-preconditionable lagrange multiplier elements.
void elastic_preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply the elastic subsidiary 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.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...