28#include <oomph-lib-config.h>
45 namespace Biharmonic_schur_complement_Hypre_defaults
86 oomph_info <<
"Re-assigned number of v cycles: "
93 oomph_info <<
"Current number of amg smoother iterations: "
98 oomph_info <<
"Re-assigned number of amg smoother iterations: "
116 std::ostringstream error_message;
117 error_message <<
"The bulk element mesh has not been passed to "
118 "bulk_element_mesh_pt()";
146 std::ostringstream error_message;
147 error_message <<
"Preconditioner_type must be equal to 0 (BBD exact), 1 "
148 "(inexact BBD with LU),"
149 <<
" 2 (inexact BBD with AMG) or 3 (exact BD).";
287 if (n_block_types != 3)
289 std::ostringstream error_message;
291 <<
"This preconditioner requires 3 block types.\n"
292 <<
"It is sub preconditioner for the BiharmonicPreconditioner.\n";
304 const bool want_block =
true;
370 if (n_block_types != 3)
372 std::ostringstream error_message;
374 <<
"This preconditioner requires 3 block types.\n"
375 <<
"It is sub preconditioner for the BiharmonicPreconditioner.\n";
418#ifdef OOMPH_HAS_HYPRE
424 std::ostringstream error_message;
425 error_message <<
"Request AMG solver but oomph-lib does not have HYPRE";
505 ->bulk_element_mesh_pt())
506 ->nelement_in_dim(0);
541 std::min(
static_cast<int>(
J_00_nrow - 1),
548 std::min(
static_cast<int>(
J_00_nrow - 1),
551 std::max(0,
static_cast<int>(
i - 3)));
553 0, std::min(
static_cast<int>(
J_00_nrow - 1),
static_cast<int>(
i + 3)));
559 std::min(
static_cast<int>(
J_00_nrow - 1),
563 std::max(0,
static_cast<int>(
i +
n_element_x * 2 - 5)));
566 std::min(
static_cast<int>(
J_00_nrow - 1),
573 for (
unsigned b = 0; b <
n_band; b++)
589 static_cast<int>(
j) &&
590 static_cast<int>(
j) <=
607 static_cast<int>(
j) &&
608 static_cast<int>(
j) <=
Biharmonic Preconditioner - for two dimensional problems.
Preconditioner * Hijacked_sub_block_preconditioner_pt
Preconditioner the diagonal block associated with hijacked elements.
Preconditioner * Sub_preconditioner_2_pt
Inexact Preconditioner Pointer.
void clean_up_memory()
Clean up memory (empty). Generic interface function.
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply preconditioner to r.
void setup()
Setup the preconditioner.
unsigned Preconditioner_type
preconditioner type
Mesh * Bulk_element_mesh_pt
the bulk element mesh pt
Preconditioner * Sub_preconditioner_1_pt
Exact Preconditioner Pointer.
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...
CRDoubleMatrix get_concatenated_block(const VectorMatrix< BlockSelector > &selected_block)
Returns a concatenation of the block matrices specified by the argument selected_block....
void get_blocks(DenseMatrix< bool > &required_blocks, DenseMatrix< CRDoubleMatrix * > &block_matrix_pt) const
Get all the block matrices required by the block preconditioner. Takes a pointer to a matrix of bools...
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...
BlockPreconditioner< CRDoubleMatrix > * master_block_preconditioner_pt() const
Access function to the master block preconditioner pt.
unsigned nblock_types() const
Return the number of block types.
void return_block_ordered_preconditioner_vector(const DoubleVector &w, DoubleVector &v) const
Takes the block ordered vector, w, and reorders it in natural order. Reordered vector is returned in ...
void get_block_vectors(const Vector< unsigned > &block_vec_number, const DoubleVector &v, Vector< DoubleVector > &s) const
Takes the naturally ordered vector and rearranges it into a vector of sub vectors corresponding to th...
CRDoubleMatrix * matrix_pt() const
Access function to matrix_pt. If this is the master then cast the matrix pointer to MATRIX*,...
const LinearAlgebraDistribution * block_distribution_pt(const unsigned &b) const
Access function to the block distributions (const version).
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...
void get_block_ordered_preconditioner_vector(const DoubleVector &v, DoubleVector &w)
Given the naturally ordered vector, v, return the vector rearranged in block order in w....
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 initialise(const double &v)
initialise the whole vector with value v
void clear()
wipes the DoubleVector
Sub Biharmonic Preconditioner - an exact preconditioner for the 3x3 top left hand corner sub block ma...
void clean_up_memory()
delete the subsidiary preconditioner pointer
Preconditioner * Sub_preconditioner_pt
bool Retain_all_blocks
Boolean indicating that all blocks are to be retained (defaults to false)
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply preconditioner to r.
void setup()
Setup the preconditioner.
An Preconditioner class using the suite of Hypre preconditioners to allow.
SubBiharmonic Preconditioner - an inexact preconditioner for the 3x3 top left hand corner sub block m...
DenseMatrix< CRDoubleMatrix * > Matrix_of_block_pointers
void compute_inexact_schur_complement()
Computes the inexact schur complement of the block J_00 using lumping as an approximate inverse of bl...
Preconditioner * S_00_preconditioner_pt
Pointer to the S00 Schur Complement preconditioner.
unsigned Use_amg
booean indicating whether (Hypre BoomerAMG) AMG should be used to solve the S00 subsidiary linear sys...
void clean_up_memory()
clean the memory
MatrixBasedLumpedPreconditioner< CRDoubleMatrix > * Lumped_J_22_preconditioner_pt
Preconditioner for storing the lumped J_22 matrix.
void setup()
Setup the preconditioner.
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply preconditioner to r.
MatrixBasedLumpedPreconditioner< CRDoubleMatrix > * Lumped_J_11_preconditioner_pt
Preconditioner for storing the lumped J_11 matrix.
Matrix-based diagonal preconditioner.
An OomphLibError object which should be thrown when an run-time error is encountered....
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...
unsigned N_cycle
number of V cycles: 2
double AMG_jacobi_damping
jacobi damping – hierher not used 0.1
unsigned AMG_smoother
smoother type - Gauss Seidel: 1
void set_defaults(HyprePreconditioner *hypre_prec_pt)
set the defaults
unsigned AMG_coarsening
amg coarsening strategy: classical Ruge Stueben: 1
double AMG_strength
amg strength parameter: 0.25 – optimal for 2d
unsigned AMG_smoother_iterations
amg smoother iterations
Preconditioner * create_exact_preconditioner()
Factory function to create suitable exact preconditioner.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...