31 #ifndef OOMPH_BIHARMONIC_PRECONDITIONER_HEADER 32 #define OOMPH_BIHARMONIC_PRECONDITIONER_HEADER 37 #include <oomph-lib-config.h> 40 #include "../generic/preconditioner.h" 41 #include "../generic/block_preconditioner.h" 42 #include "../generic/hijacked_elements.h" 44 #include "../meshes/hermite_element_quad_mesh.template.h" 45 #include "../generic/SuperLU_preconditioner.h" 46 #include "../generic/general_purpose_preconditioners.h" 48 #ifdef OOMPH_HAS_HYPRE 49 #include "../generic/hypre_solver.h" 56 #ifdef OOMPH_HAS_HYPRE 63 namespace Biharmonic_schur_complement_Hypre_defaults
85 extern void set_defaults(HyprePreconditioner* hypre_prec_pt);
104 Sub_preconditioner_1_pt = 0;
105 Sub_preconditioner_2_pt = 0;
106 Hijacked_sub_block_preconditioner_pt = 0;
110 #ifdef OOMPH_HAS_HYPRE 111 Preconditioner_type = 2;
113 Preconditioner_type = 1;
118 Bulk_element_mesh_pt = 0;
124 this->clean_up_memory();
131 delete Sub_preconditioner_1_pt;
132 delete Sub_preconditioner_2_pt;
133 delete Hijacked_sub_block_preconditioner_pt;
161 return Preconditioner_type;
169 return Bulk_element_mesh_pt;
212 const bool& retain_all_blocks=
false) :
213 Retain_all_blocks(retain_all_blocks)
222 this->turn_into_subsidiary_block_preconditioner(master_prec_pt,
226 Sub_preconditioner_pt = 0;
232 this->clean_up_memory();
238 delete Sub_preconditioner_pt; Sub_preconditioner_pt = 0;
295 this->turn_into_subsidiary_block_preconditioner
296 (master_prec_pt,block_lookup);
299 S_00_preconditioner_pt = 0;
300 Lumped_J_11_preconditioner_pt = 0;
301 Lumped_J_22_preconditioner_pt = 0;
310 this->clean_up_memory();
317 delete S_00_preconditioner_pt;
318 S_00_preconditioner_pt = 0;
321 delete Lumped_J_11_preconditioner_pt;
322 Lumped_J_11_preconditioner_pt = 0;
323 delete Lumped_J_22_preconditioner_pt;
324 Lumped_J_22_preconditioner_pt = 0;
327 unsigned n = Matrix_of_block_pointers.nrow();
330 for (
unsigned i = 0;
i < n;
i++)
332 for (
unsigned j = 0; j < n; j++)
334 if (Matrix_of_block_pointers(
i,j) != 0)
336 delete Matrix_of_block_pointers(
i,j);
337 Matrix_of_block_pointers(
i,j)=0;
367 void compute_inexact_schur_complement();
double AMG_strength
amg strength parameter: 0.25 – optimal for 2d
Preconditioner * Sub_preconditioner_pt
void set_defaults(HyprePreconditioner *hypre_prec_pt)
set the defaults
void clean_up_memory()
Clean up memory (empty). Generic interface function.
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
BiharmonicPreconditioner(const BiharmonicPreconditioner &)
Broken copy constructor.
unsigned AMG_smoother
smoother type - Gauss Seidel: 1
BiharmonicPreconditioner()
Constructor - by default inexact preconditioning is used.
void operator=(const ExactSubBiharmonicPreconditioner &)
Broken assignment operator.
~ExactSubBiharmonicPreconditioner()
destructor deletes the exact preconditioner
ExactSubBiharmonicPreconditioner(const ExactSubBiharmonicPreconditioner &)
Broken copy constructor.
unsigned Preconditioner_type
unsigned N_cycle
number of V cycles: 2
DenseMatrix< CRDoubleMatrix * > Matrix_of_block_pointers
void setup()
Setup terminate helper.
Matrix-based lumped preconditioner.
void clean_up_memory()
clean the memory
double AMG_jacobi_damping
jacobi damping – hierher not used 0.1
Sub Biharmonic Preconditioner - an exact preconditioner for the 3x3 top left hand corner sub block ma...
unsigned & preconditioner_type()
Access function to the preconditioner type .
void operator=(const BiharmonicPreconditioner &)
Broken assignment operator.
Mesh *& bulk_element_mesh_pt()
Access function to the mesh pt for the bulk elements. The mesh should only contain BiharmonicElement<...
ExactSubBiharmonicPreconditioner(BiharmonicPreconditioner *master_prec_pt, const bool &retain_all_blocks=false)
Constructor - for a preconditioner acting as a sub preconditioner.
MatrixBasedLumpedPreconditioner< CRDoubleMatrix > * Lumped_J_11_preconditioner_pt
Preconditioner for storing the lumped J_11 matrix.
Preconditioner * Hijacked_sub_block_preconditioner_pt
Preconditioner the diagonal block associated with hijacked elements.
~InexactSubBiharmonicPreconditioner()
destructor - just calls this->clean_up_memory()
void clean_up_memory()
delete the subsidiary preconditioner pointer
unsigned AMG_coarsening
amg coarsening strategy: classical Ruge Stueben: 1
Preconditioner base class. Gives an interface to call all other preconditioners through and stores th...
Preconditioner * S_00_preconditioner_pt
Pointer to the S00 Schur Complement preconditioner.
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
bool Retain_all_blocks
Boolean indicating that all blocks are to be retained (defaults to false)
Class for dense matrices, storing all the values of the matrix as a pointer to a pointer with assorte...
A vector in the mathematical sense, initially developed for linear algebra type applications. If MPI then this vector can be distributed - its distribution is described by the LinearAlgebraDistribution object at Distribution_pt. Data is stored in a C-style pointer vector (double*)
MatrixBasedLumpedPreconditioner< CRDoubleMatrix > * Lumped_J_22_preconditioner_pt
Preconditioner for storing the lumped J_22 matrix.
SubBiharmonic Preconditioner - an inexact preconditioner for the 3x3 top left hand corner sub block m...
Preconditioner * Sub_preconditioner_2_pt
Inexact Preconditioner Pointer.
unsigned Use_amg
booean indicating whether (Hypre BoomerAMG) AMG should be used to solve the S00 subsidiary linear sys...
~BiharmonicPreconditioner()
destructor - cleans up preconditioners and delete matrices
A class for compressed row matrices. This is a distributable object.
Preconditioner * Sub_preconditioner_1_pt
Exact Preconditioner Pointer.
void operator=(const InexactSubBiharmonicPreconditioner &)
Broken assignment operator.
Mesh * Bulk_element_mesh_pt
the bulk element mesh pt
unsigned AMG_smoother_iterations
amg smoother iterations
Biharmonic Preconditioner - for two dimensional problems.