oomph::GeneralPurposeBlockPreconditioner< MATRIX > Class Template Reference

#include <general_purpose_block_preconditioners.h>

+ Inheritance diagram for oomph::GeneralPurposeBlockPreconditioner< MATRIX >:

Public Types

typedef Preconditioner *(* SubsidiaryPreconditionerFctPt) ()
 

Public Member Functions

 GeneralPurposeBlockPreconditioner ()
 constructor More...
 
virtual ~GeneralPurposeBlockPreconditioner ()
 
virtual void clean_up_memory ()
 
 GeneralPurposeBlockPreconditioner (const GeneralPurposeBlockPreconditioner &)=delete
 Broken copy constructor. More...
 
void operator= (const GeneralPurposeBlockPreconditioner &)=delete
 Broken assignment operator. More...
 
void set_subsidiary_preconditioner_function (SubsidiaryPreconditionerFctPt sub_prec_fn)
 access function to set the subsidiary preconditioner function. More...
 
void reset_subsidiary_preconditioner_function_to_default ()
 Reset the subsidiary preconditioner function to its default. More...
 
void set_subsidiary_preconditioner_pt (Preconditioner *prec, const unsigned &i)
 
Preconditionersubsidiary_preconditioner_pt (const unsigned &i) const
 
void set_dof_to_block_map (Vector< unsigned > &dof_to_block_map)
 Specify a DOF to block map. More...
 
void add_mesh (const Mesh *mesh_pt, const bool &allow_multiple_element_type_in_mesh=false)
 
unsigned gp_nmesh ()
 
- Public Member Functions inherited from oomph::BlockPreconditioner< MATRIX >
 BlockPreconditioner ()
 Constructor. More...
 
virtual ~BlockPreconditioner ()
 Destructor. More...
 
 BlockPreconditioner (const BlockPreconditioner &)=delete
 Broken copy constructor. More...
 
void operator= (const BlockPreconditioner &)=delete
 Broken assignment operator. More...
 
MATRIX * matrix_pt () const
 
void turn_on_recursive_debug_flag ()
 
void turn_off_recursive_debug_flag ()
 
void turn_on_debug_flag ()
 Toggles on the debug flag. More...
 
void turn_off_debug_flag ()
 Toggles off the debug flag. More...
 
void turn_into_subsidiary_block_preconditioner (BlockPreconditioner< MATRIX > *master_block_prec_pt, const Vector< unsigned > &doftype_in_master_preconditioner_coarse)
 
void turn_into_subsidiary_block_preconditioner (BlockPreconditioner< MATRIX > *master_block_prec_pt, const Vector< unsigned > &doftype_in_master_preconditioner_coarse, const Vector< Vector< unsigned >> &doftype_coarsen_map_coarse)
 
virtual void block_setup ()
 
void block_setup (const Vector< unsigned > &dof_to_block_map)
 
void get_block (const unsigned &i, const unsigned &j, MATRIX &output_matrix, const bool &ignore_replacement_block=false) const
 
MATRIX get_block (const unsigned &i, const unsigned &j, const bool &ignore_replacement_block=false) const
 
void set_master_matrix_pt (MATRIX *in_matrix_pt)
 Set the matrix_pt in the upper-most master preconditioner. More...
 
void get_block_other_matrix (const unsigned &i, const unsigned &j, MATRIX *in_matrix_pt, MATRIX &output_matrix)
 
void get_blocks (DenseMatrix< bool > &required_blocks, DenseMatrix< MATRIX * > &block_matrix_pt) const
 
void get_dof_level_block (const unsigned &i, const unsigned &j, MATRIX &output_block, const bool &ignore_replacement_block=false) const
 
MATRIX get_concatenated_block (const VectorMatrix< BlockSelector > &selected_block)
 
void get_concatenated_block_vector (const Vector< unsigned > &block_vec_number, const DoubleVector &v, DoubleVector &b)
 
void return_concatenated_block_vector (const Vector< unsigned > &block_vec_number, const DoubleVector &b, DoubleVector &v) const
 Takes concatenated block ordered vector, b, and copies its. More...
 
void get_block_vectors (const Vector< unsigned > &block_vec_number, const DoubleVector &v, Vector< DoubleVector > &s) const
 
void get_block_vectors (const DoubleVector &v, Vector< DoubleVector > &s) const
 
void return_block_vectors (const Vector< unsigned > &block_vec_number, const Vector< DoubleVector > &s, DoubleVector &v) const
 
void return_block_vectors (const Vector< DoubleVector > &s, DoubleVector &v) const
 
void get_block_vector (const unsigned &n, const DoubleVector &v, DoubleVector &b) const
 
void return_block_vector (const unsigned &n, const DoubleVector &b, DoubleVector &v) const
 
void get_block_ordered_preconditioner_vector (const DoubleVector &v, DoubleVector &w)
 
void return_block_ordered_preconditioner_vector (const DoubleVector &w, DoubleVector &v) const
 
unsigned nblock_types () const
 Return the number of block types. More...
 
unsigned ndof_types () const
 Return the total number of DOF types. More...
 
const Meshmesh_pt (const unsigned &i) const
 
unsigned nmesh () const
 
int block_number (const unsigned &i_dof) const
 Return the block number corresponding to a global index i_dof. More...
 
int index_in_block (const unsigned &i_dof) const
 
const LinearAlgebraDistributionblock_distribution_pt (const unsigned &b) const
 Access function to the block distributions (const version). More...
 
LinearAlgebraDistributionblock_distribution_pt (const unsigned b)
 Access function to the block distributions (non-const version). More...
 
LinearAlgebraDistributiondof_block_distribution_pt (const unsigned &b)
 Access function to the dof-level block distributions. More...
 
const LinearAlgebraDistributionmaster_distribution_pt () const
 
unsigned ndof_types_in_mesh (const unsigned &i) const
 
bool is_subsidiary_block_preconditioner () const
 
bool is_master_block_preconditioner () const
 
void set_block_output_to_files (const std::string &basefilename)
 
void disable_block_output_to_files ()
 Turn off output of blocks (by clearing the basefilename string). More...
 
bool block_output_on () const
 Test if output of blocks is on or not. More...
 
void output_blocks_to_files (const std::string &basefilename, const unsigned &precision=8) const
 
void post_block_matrix_assembly_partial_clear ()
 
BlockPreconditioner< MATRIX > * master_block_preconditioner_pt () const
 Access function to the master block preconditioner pt. More...
 
void clear_block_preconditioner_base ()
 
void document ()
 
Vector< Vector< unsigned > > doftype_coarsen_map_fine () const
 
Vector< unsignedget_fine_grain_dof_types_in (const unsigned &i) const
 
unsigned nfine_grain_dof_types_in (const unsigned &i) const
 
MapMatrix< unsigned, CRDoubleMatrix * > replacement_dof_block_pt () const
 Access function to the replaced dof-level blocks. More...
 
void setup_matrix_vector_product (MatrixVectorProduct *matvec_prod_pt, CRDoubleMatrix *block_pt, const Vector< unsigned > &block_col_indices)
 
void setup_matrix_vector_product (MatrixVectorProduct *matvec_prod_pt, CRDoubleMatrix *block_pt, const unsigned &block_col_index)
 
void internal_get_block_ordered_preconditioner_vector (const DoubleVector &v, DoubleVector &w) const
 
void internal_return_block_ordered_preconditioner_vector (const DoubleVector &w, DoubleVector &v) const
 
unsigned internal_nblock_types () const
 
unsigned internal_ndof_types () const
 
void internal_return_block_vector (const unsigned &n, const DoubleVector &b, DoubleVector &v) const
 
void internal_get_block_vector (const unsigned &n, const DoubleVector &v, DoubleVector &b) const
 
void internal_get_block_vectors (const Vector< unsigned > &block_vec_number, const DoubleVector &v, Vector< DoubleVector > &s) const
 
void internal_get_block_vectors (const DoubleVector &v, Vector< DoubleVector > &s) const
 
void internal_return_block_vectors (const Vector< unsigned > &block_vec_number, const Vector< DoubleVector > &s, DoubleVector &v) const
 
void internal_return_block_vectors (const Vector< DoubleVector > &s, DoubleVector &v) const
 
void internal_get_block (const unsigned &i, const unsigned &j, MATRIX &output_block) const
 
int internal_block_number (const unsigned &i_dof) const
 
int internal_index_in_block (const unsigned &i_dof) const
 
const LinearAlgebraDistributioninternal_block_distribution_pt (const unsigned &b) const
 Access function to the internal block distributions. More...
 
void insert_auxiliary_block_distribution (const Vector< unsigned > &block_vec_number, LinearAlgebraDistribution *dist_pt)
 
void block_matrix_test (const unsigned &i, const unsigned &j, const MATRIX *block_matrix_pt) const
 
template<typename myType >
int get_index_of_value (const Vector< myType > &vec, const myType val, const bool sorted=false) const
 
void internal_get_block (const unsigned &block_i, const unsigned &block_j, CRDoubleMatrix &output_block) const
 
void get_dof_level_block (const unsigned &block_i, const unsigned &block_j, CRDoubleMatrix &output_block, const bool &ignore_replacement_block) const
 
- Public Member Functions inherited from oomph::Preconditioner
 Preconditioner ()
 Constructor. More...
 
 Preconditioner (const Preconditioner &)=delete
 Broken copy constructor. More...
 
void operator= (const Preconditioner &)=delete
 Broken assignment operator. More...
 
virtual ~Preconditioner ()
 Destructor (empty) More...
 
virtual void preconditioner_solve (const DoubleVector &r, DoubleVector &z)=0
 
virtual void preconditioner_solve_transpose (const DoubleVector &r, DoubleVector &z)
 
void setup (DoubleMatrixBase *matrix_pt)
 
void setup (const Problem *problem_pt, DoubleMatrixBase *matrix_pt)
 
void enable_silent_preconditioner_setup ()
 Set up the block preconditioner quietly! More...
 
void disable_silent_preconditioner_setup ()
 Be verbose in the block preconditioner setup. More...
 
virtual void setup ()=0
 
virtual void set_matrix_pt (DoubleMatrixBase *matrix_pt)
 Set the matrix pointer. More...
 
virtual const OomphCommunicatorcomm_pt () const
 Get function for comm pointer. More...
 
virtual void set_comm_pt (const OomphCommunicator *const comm_pt)
 Set the communicator pointer. More...
 
double setup_time () const
 Returns the time to setup the preconditioner. More...
 
virtual void turn_into_subsidiary_block_preconditioner (BlockPreconditioner< CRDoubleMatrix > *master_block_prec_pt, const Vector< unsigned > &doftype_in_master_preconditioner_coarse)
 
virtual void turn_into_subsidiary_block_preconditioner (BlockPreconditioner< CRDoubleMatrix > *master_block_prec_pt, const Vector< unsigned > &doftype_in_master_preconditioner_coarse, const Vector< Vector< unsigned >> &doftype_coarsen_map_coarse)
 
- Public Member Functions inherited from oomph::DistributableLinearAlgebraObject
 DistributableLinearAlgebraObject ()
 Default constructor - create a distribution. More...
 
 DistributableLinearAlgebraObject (const DistributableLinearAlgebraObject &matrix)=delete
 Broken copy constructor. More...
 
void operator= (const DistributableLinearAlgebraObject &)=delete
 Broken assignment operator. More...
 
virtual ~DistributableLinearAlgebraObject ()
 Destructor. More...
 
LinearAlgebraDistributiondistribution_pt () const
 access to the LinearAlgebraDistribution More...
 
unsigned nrow () const
 access function to the number of global rows. More...
 
unsigned nrow_local () const
 access function for the num of local rows on this processor. More...
 
unsigned nrow_local (const unsigned &p) const
 access function for the num of local rows on this processor. More...
 
unsigned first_row () const
 access function for the first row on this processor More...
 
unsigned first_row (const unsigned &p) const
 access function for the first row on this processor More...
 
bool distributed () const
 distribution is serial or distributed More...
 
bool distribution_built () const
 
void build_distribution (const LinearAlgebraDistribution *const dist_pt)
 
void build_distribution (const LinearAlgebraDistribution &dist)
 

Protected Member Functions

void gp_preconditioner_set_all_meshes ()
 Set the mesh in the block preconditioning framework. More...
 
void gp_preconditioner_block_setup ()
 Modified block setup for general purpose block preconditioners. More...
 
void fill_in_subsidiary_preconditioners (const unsigned &nprec_needed)
 
- Protected Member Functions inherited from oomph::BlockPreconditioner< MATRIX >
void set_nmesh (const unsigned &n)
 
void set_mesh (const unsigned &i, const Mesh *const mesh_pt, const bool &allow_multiple_element_type_in_mesh=false)
 
void set_replacement_dof_block (const unsigned &block_i, const unsigned &block_j, CRDoubleMatrix *replacement_dof_block_pt)
 
bool any_mesh_distributed () const
 
int internal_dof_number (const unsigned &i_dof) const
 
unsigned internal_index_in_dof (const unsigned &i_dof) const
 
unsigned internal_block_dimension (const unsigned &b) const
 
unsigned internal_dof_block_dimension (const unsigned &i) const
 
unsigned master_nrow () const
 
unsigned internal_master_dof_number (const unsigned &b) const
 
const LinearAlgebraDistributioninternal_preconditioner_matrix_distribution_pt () const
 
const LinearAlgebraDistributionpreconditioner_matrix_distribution_pt () const
 
- Protected Member Functions inherited from oomph::DistributableLinearAlgebraObject
void clear_distribution ()
 

Protected Attributes

Vector< Preconditioner * > Subsidiary_preconditioner_pt
 List of preconditioners to use for the blocks to be solved. More...
 
SubsidiaryPreconditionerFctPt Subsidiary_preconditioner_creation_function_pt
 
- Protected Attributes inherited from oomph::BlockPreconditioner< MATRIX >
MapMatrix< unsigned, CRDoubleMatrix * > Replacement_dof_block_pt
 The replacement dof-level blocks. More...
 
Vector< LinearAlgebraDistribution * > Block_distribution_pt
 The distribution for the blocks. More...
 
Vector< Vector< unsigned > > Block_to_dof_map_coarse
 
Vector< Vector< unsigned > > Block_to_dof_map_fine
 Mapping for the block types to the most fine grain dof types. More...
 
Vector< Vector< unsigned > > Doftype_coarsen_map_coarse
 
Vector< Vector< unsigned > > Doftype_coarsen_map_fine
 
Vector< LinearAlgebraDistribution * > Internal_block_distribution_pt
 Storage for the default distribution for each internal block. More...
 
Vector< LinearAlgebraDistribution * > Dof_block_distribution_pt
 
Vector< unsignedAllow_multiple_element_type_in_mesh
 
Vector< const Mesh * > Mesh_pt
 
Vector< unsignedNdof_types_in_mesh
 
unsigned Internal_nblock_types
 
unsigned Internal_ndof_types
 
- Protected Attributes inherited from oomph::Preconditioner
bool Silent_preconditioner_setup
 Boolean to indicate whether or not the build should be done silently. More...
 
std::ostream * Stream_pt
 Pointer to the output stream – defaults to std::cout. More...
 

Private Attributes

Vector< unsignedDof_to_block_map
 the set of dof to block maps for this preconditioner More...
 
Vector< std::pair< const Mesh *, bool > > Gp_mesh_pt
 

Detailed Description

template<typename MATRIX>
class oomph::GeneralPurposeBlockPreconditioner< MATRIX >

Base class for general purpose block preconditioners. Deals with setting subsidiary preconditioners and dof to block maps. Subsidiary preconditioners can be set in two ways: 1) A pointer to a subsidiary preconditioner for block i can be passed to set_subsidiary_preconditioner_pt(prec, i). 2) A default subsidiary preconditioner can be set up by providing a function pointer to a function which creates a preconditioner. During setup() all unset subsidiary preconditioner pointers will be filled in using this function. By default this uses SuperLU.

Member Typedef Documentation

◆ SubsidiaryPreconditionerFctPt

template<typename MATRIX >
typedef Preconditioner*(* oomph::GeneralPurposeBlockPreconditioner< MATRIX >::SubsidiaryPreconditionerFctPt) ()

typedef for a function that allows other preconditioners to be employed to solve the subsidiary linear systems. The function should return a pointer to the required subsidiary preconditioner generated using new. This preconditioner is responsible for the destruction of the subsidiary preconditioners.

Constructor & Destructor Documentation

◆ GeneralPurposeBlockPreconditioner() [1/2]

template<typename MATRIX >
oomph::GeneralPurposeBlockPreconditioner< MATRIX >::GeneralPurposeBlockPreconditioner ( )
inline

constructor

88  : BlockPreconditioner<MATRIX>(),
91  {
92  // Make sure that the Gp_mesh_pt container is size zero.
93  Gp_mesh_pt.resize(0);
94  }
SubsidiaryPreconditionerFctPt Subsidiary_preconditioner_creation_function_pt
Definition: general_purpose_block_preconditioners.h:299
Vector< std::pair< const Mesh *, bool > > Gp_mesh_pt
Definition: general_purpose_block_preconditioners.h:307
Preconditioner * create_super_lu_preconditioner()
Definition: general_purpose_block_preconditioners.h:57

References oomph::GeneralPurposeBlockPreconditioner< MATRIX >::Gp_mesh_pt.

◆ ~GeneralPurposeBlockPreconditioner()

template<typename MATRIX >
virtual oomph::GeneralPurposeBlockPreconditioner< MATRIX >::~GeneralPurposeBlockPreconditioner ( )
inlinevirtual

Destructor: clean up memory then delete all subsidiary preconditioners.

99  {
100  this->clean_up_memory();
101 
102  for (unsigned j = 0, nj = Subsidiary_preconditioner_pt.size(); j < nj;
103  j++)
104  {
106  }
107  }
virtual void clean_up_memory()
Definition: general_purpose_block_preconditioners.h:112
Vector< Preconditioner * > Subsidiary_preconditioner_pt
List of preconditioners to use for the blocks to be solved.
Definition: general_purpose_block_preconditioners.h:294
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::GeneralPurposeBlockPreconditioner< MATRIX >::clean_up_memory(), j, and oomph::GeneralPurposeBlockPreconditioner< MATRIX >::Subsidiary_preconditioner_pt.

◆ GeneralPurposeBlockPreconditioner() [2/2]

template<typename MATRIX >
oomph::GeneralPurposeBlockPreconditioner< MATRIX >::GeneralPurposeBlockPreconditioner ( const GeneralPurposeBlockPreconditioner< MATRIX > &  )
delete

Broken copy constructor.

Member Function Documentation

◆ add_mesh()

template<typename MATRIX >
void oomph::GeneralPurposeBlockPreconditioner< MATRIX >::add_mesh ( const Mesh mesh_pt,
const bool allow_multiple_element_type_in_mesh = false 
)
inline

Adds a mesh to be used by the block preconditioning framework for classifying DOF types. Optional boolean argument (default: false) allows the mesh to contain multiple element types.

193  {
194 #ifdef PARANOID
195  // Check that the mesh pointer is not null.
196  if (mesh_pt == 0)
197  {
198  std::ostringstream err_msg;
199  err_msg << "The mesh_pt is null, please point it to a mesh.\n";
200  throw OomphLibError(
202  }
203 #endif
204  // Push back the mesh pointer and the boolean in a pair.
205  Gp_mesh_pt.push_back(
206  std::make_pair(mesh_pt, allow_multiple_element_type_in_mesh));
207  }
const Mesh * mesh_pt(const unsigned &i) const
Definition: block_preconditioner.h:1782
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References oomph::GeneralPurposeBlockPreconditioner< MATRIX >::Gp_mesh_pt, oomph::BlockPreconditioner< MATRIX >::mesh_pt(), OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by main(), PreconditionedFSICollapsibleChannelProblem< ELEMENT >::PreconditionedFSICollapsibleChannelProblem(), NavierStokesProblem< ELEMENT >::set_up_spacetime_solver(), UnsteadyHeatProblem< ELEMENT >::set_up_spacetime_solver(), and TorusProblem< ELEMENT >::TorusProblem().

◆ clean_up_memory()

template<typename MATRIX >
virtual void oomph::GeneralPurposeBlockPreconditioner< MATRIX >::clean_up_memory ( )
inlinevirtual

??ds I think clean_up_memory is supposed to clear out any stuff that doesn't need to be stored between solves. Call clean up on any non-null subsidiary preconditioners.

Reimplemented from oomph::Preconditioner.

Reimplemented in oomph::BandedBlockTriangularPreconditioner< MATRIX >, oomph::ExactDGPBlockPreconditioner< MATRIX >, oomph::BlockTriangularPreconditioner< MATRIX >, and oomph::BlockDiagonalPreconditioner< MATRIX >.

113  {
114  // Call clean up in any subsidiary precondtioners that are set.
115  for (unsigned j = 0, nj = Subsidiary_preconditioner_pt.size(); j < nj;
116  j++)
117  {
119  {
120  Subsidiary_preconditioner_pt[j]->clean_up_memory();
121  }
122  }
123 
124  // Clean up the block preconditioner base class stuff
126  }
void clear_block_preconditioner_base()
Definition: block_preconditioner.h:2159

References oomph::BlockPreconditioner< MATRIX >::clear_block_preconditioner_base(), j, and oomph::GeneralPurposeBlockPreconditioner< MATRIX >::Subsidiary_preconditioner_pt.

Referenced by oomph::BlockDiagonalPreconditioner< MATRIX >::clean_up_memory(), oomph::BlockTriangularPreconditioner< MATRIX >::clean_up_memory(), oomph::ExactDGPBlockPreconditioner< MATRIX >::clean_up_memory(), oomph::BandedBlockTriangularPreconditioner< MATRIX >::clean_up_memory(), oomph::BlockDiagonalPreconditioner< MATRIX >::~BlockDiagonalPreconditioner(), oomph::BlockTriangularPreconditioner< MATRIX >::~BlockTriangularPreconditioner(), and oomph::GeneralPurposeBlockPreconditioner< MATRIX >::~GeneralPurposeBlockPreconditioner().

◆ fill_in_subsidiary_preconditioners()

template<typename MATRIX >
void oomph::GeneralPurposeBlockPreconditioner< MATRIX >::fill_in_subsidiary_preconditioners ( const unsigned nprec_needed)
inlineprotected

Create any subsidiary preconditioners needed. Usually nprec_needed = nblock_types, except for the ExactBlockPreconditioner which only requires one preconditioner.

257  {
258  // If it's empty then fill it in with null pointers.
259  if (Subsidiary_preconditioner_pt.empty())
260  {
261  Subsidiary_preconditioner_pt.assign(nprec_needed, 0);
262  }
263  else
264  {
265  // Otherwise check we have the right number of them
266 #ifdef PARANOID
267  if (Subsidiary_preconditioner_pt.size() != nprec_needed)
268  {
269  using namespace StringConversion;
270  std::string error_msg = "Wrong number of precondtioners in";
271  error_msg += "Subsidiary_preconditioner_pt, should have ";
272  error_msg += to_string(nprec_needed) + " but we actually have ";
273  error_msg += to_string(Subsidiary_preconditioner_pt.size());
274  throw OomphLibError(
276  }
277 #endif
278  }
279 
280 
281  // Now replace any null pointers with new preconditioners
282  for (unsigned j = 0, nj = Subsidiary_preconditioner_pt.size(); j < nj;
283  j++)
284  {
286  {
288  (*Subsidiary_preconditioner_creation_function_pt)();
289  }
290  }
291  }
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
std::string to_string(T object, unsigned float_precision=8)
Definition: oomph_utilities.h:189

References j, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::Global_string_for_annotation::string(), oomph::GeneralPurposeBlockPreconditioner< MATRIX >::Subsidiary_preconditioner_pt, and oomph::StringConversion::to_string().

Referenced by oomph::BlockDiagonalPreconditioner< MATRIX >::fill_in_subsidiary_preconditioners().

◆ gp_nmesh()

template<typename MATRIX >
unsigned oomph::GeneralPurposeBlockPreconditioner< MATRIX >::gp_nmesh ( )
inline

Returns the number of meshes currently set in the GeneralPurposeBlockPreconditioner base class.

212  {
213  return Gp_mesh_pt.size();
214  }

References oomph::GeneralPurposeBlockPreconditioner< MATRIX >::Gp_mesh_pt.

Referenced by oomph::GeneralPurposeBlockPreconditioner< MATRIX >::gp_preconditioner_set_all_meshes().

◆ gp_preconditioner_block_setup()

template<typename MATRIX >
void oomph::GeneralPurposeBlockPreconditioner< MATRIX >::gp_preconditioner_block_setup ( )
inlineprotected

Modified block setup for general purpose block preconditioners.

242  {
243  if (Dof_to_block_map.size() > 0)
244  {
246  }
247  else
248  {
250  }
251  }
virtual void block_setup()
Definition: block_preconditioner.cc:2483
Vector< unsigned > Dof_to_block_map
the set of dof to block maps for this preconditioner
Definition: general_purpose_block_preconditioners.h:303

References oomph::BlockPreconditioner< MATRIX >::block_setup(), and oomph::GeneralPurposeBlockPreconditioner< MATRIX >::Dof_to_block_map.

◆ gp_preconditioner_set_all_meshes()

template<typename MATRIX >
void oomph::GeneralPurposeBlockPreconditioner< MATRIX >::gp_preconditioner_set_all_meshes ( )
inlineprotected

Set the mesh in the block preconditioning framework.

219  {
220  const unsigned nmesh = gp_nmesh();
221 #ifdef PARANOID
222  if (nmesh == 0)
223  {
224  std::ostringstream err_msg;
225  err_msg << "There are no meshes set.\n"
226  << "Have you remembered to call add_mesh(...)?\n";
227  throw OomphLibError(
229  }
230 #endif
231 
232  this->set_nmesh(nmesh);
233  for (unsigned mesh_i = 0; mesh_i < nmesh; mesh_i++)
234  {
235  this->set_mesh(
236  mesh_i, Gp_mesh_pt[mesh_i].first, Gp_mesh_pt[mesh_i].second);
237  }
238  }
unsigned nmesh() const
Definition: block_preconditioner.h:1816
void set_nmesh(const unsigned &n)
Definition: block_preconditioner.h:2851
void set_mesh(const unsigned &i, const Mesh *const mesh_pt, const bool &allow_multiple_element_type_in_mesh=false)
Definition: block_preconditioner.h:2866
unsigned gp_nmesh()
Definition: general_purpose_block_preconditioners.h:211

References oomph::GeneralPurposeBlockPreconditioner< MATRIX >::Gp_mesh_pt, oomph::GeneralPurposeBlockPreconditioner< MATRIX >::gp_nmesh(), oomph::BlockPreconditioner< MATRIX >::nmesh(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::BlockPreconditioner< MATRIX >::set_mesh(), and oomph::BlockPreconditioner< MATRIX >::set_nmesh().

◆ operator=()

template<typename MATRIX >
void oomph::GeneralPurposeBlockPreconditioner< MATRIX >::operator= ( const GeneralPurposeBlockPreconditioner< MATRIX > &  )
delete

Broken assignment operator.

◆ reset_subsidiary_preconditioner_function_to_default()

template<typename MATRIX >
void oomph::GeneralPurposeBlockPreconditioner< MATRIX >::reset_subsidiary_preconditioner_function_to_default ( )
inline

◆ set_dof_to_block_map()

template<typename MATRIX >
void oomph::GeneralPurposeBlockPreconditioner< MATRIX >::set_dof_to_block_map ( Vector< unsigned > &  dof_to_block_map)
inline

◆ set_subsidiary_preconditioner_function()

◆ set_subsidiary_preconditioner_pt()

template<typename MATRIX >
void oomph::GeneralPurposeBlockPreconditioner< MATRIX >::set_subsidiary_preconditioner_pt ( Preconditioner prec,
const unsigned i 
)
inline

Set the subsidiary preconditioner to use for block i. The subsidiary preconditioner should have been created using new (the general purpose block preconditioner will delete it later). If null the general purpose block preconditioner will use the Subsidiary_preconditioner_creation_function_pt to create the preconditioner during setup().

156  {
157  // If the vector is currently too small to hold that many
158  // preconditioners then expand it and fill with nulls.
159  if (Subsidiary_preconditioner_pt.size() < i + 1)
160  {
161  Subsidiary_preconditioner_pt.resize(i + 1, 0);
162  }
163  // Note: the size of the vector is checked by
164  // fill_in_subsidiary_preconditioners(..) when we know what size it
165  // should be.
166 
167  // I'm assuming that the number of preconditioners is always "small"
168  // compared to Jacobian size, so a resize doesn't waste much time.
169 
170  // Put the pointer in the vector
172  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9

References i, and oomph::GeneralPurposeBlockPreconditioner< MATRIX >::Subsidiary_preconditioner_pt.

◆ subsidiary_preconditioner_pt()

template<typename MATRIX >
Preconditioner* oomph::GeneralPurposeBlockPreconditioner< MATRIX >::subsidiary_preconditioner_pt ( const unsigned i) const
inline

Get the subsidiary precondtioner pointer in block i (is allowed to be null if not yet set).

177  {
179  }

References i, and oomph::GeneralPurposeBlockPreconditioner< MATRIX >::Subsidiary_preconditioner_pt.

Member Data Documentation

◆ Dof_to_block_map

template<typename MATRIX >
Vector<unsigned> oomph::GeneralPurposeBlockPreconditioner< MATRIX >::Dof_to_block_map
private

◆ Gp_mesh_pt

◆ Subsidiary_preconditioner_creation_function_pt

template<typename MATRIX >
SubsidiaryPreconditionerFctPt oomph::GeneralPurposeBlockPreconditioner< MATRIX >::Subsidiary_preconditioner_creation_function_pt
protected

◆ Subsidiary_preconditioner_pt


The documentation for this class was generated from the following file: