oomph::BandedBlockTriangularPreconditioner< MATRIX > Class Template Reference

#include <general_purpose_space_time_block_preconditioner.h>

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

Public Member Functions

 BandedBlockTriangularPreconditioner ()
 Constructor. (By default this preconditioner is upper triangular). More...
 
virtual ~BandedBlockTriangularPreconditioner ()
 Destructor - delete the preconditioner matrices. More...
 
virtual void clean_up_memory ()
 Clean up the memory. More...
 
 BandedBlockTriangularPreconditioner (const BandedBlockTriangularPreconditioner &)=delete
 Broken copy constructor. More...
 
void operator= (const BandedBlockTriangularPreconditioner &)=delete
 Broken assignment operator. More...
 
void preconditioner_solve (const DoubleVector &r, DoubleVector &z)
 Apply preconditioner to r. More...
 
void setup ()
 Setup the preconditioner. More...
 
void set_block_bandwidth (const int &block_bandwidth)
 Set the block bandwidth of the preconditioner. More...
 
int block_bandwidth ()
 Get the block bandwidth of the preconditioner. More...
 
void upper_triangular ()
 Use as an upper triangular preconditioner. More...
 
void lower_triangular ()
 Use as a lower triangular preconditioner. More...
 
bool is_upper_triangular ()
 Is this being used as an upper triangular preconditioner? More...
 
void enable_doc_memory_usage ()
 Document the memory usage. More...
 
void disable_doc_memory_usage ()
 Don't document the memory usage! More...
 
double get_memory_usage_in_bytes ()
 Get the memory statistics. More...
 
- Public Member Functions inherited from oomph::GeneralPurposeBlockPreconditioner< MATRIX >
 GeneralPurposeBlockPreconditioner ()
 constructor More...
 
virtual ~GeneralPurposeBlockPreconditioner ()
 
 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_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 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 Attributes

DenseMatrix< MatrixVectorProduct * > Off_diagonal_matrix_vector_products
 Matrix of matrix-vector product operators for the off diagonals. More...
 
- Protected Attributes inherited from oomph::GeneralPurposeBlockPreconditioner< MATRIX >
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

int Block_bandwidth
 
bool Upper_triangular
 Boolean indicating upper or lower triangular. More...
 
bool Preconditioner_has_been_setup
 
bool Compute_memory_statistics
 
double Memory_usage_in_bytes
 

Additional Inherited Members

- Public Types inherited from oomph::GeneralPurposeBlockPreconditioner< MATRIX >
typedef Preconditioner *(* SubsidiaryPreconditionerFctPt) ()
 
- Protected Member Functions inherited from oomph::GeneralPurposeBlockPreconditioner< MATRIX >
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 ()
 

Detailed Description

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

General purpose block triangular preconditioner. By default this operates as an upper triangular preconditioner. Also, by default SuperLUPreconditioner (or SuperLUDistPreconditioner) is used to solve the subsidiary systems, but other preconditioners can be used by setting them using passing a pointer to a function of type SubsidiaryPreconditionerFctPt to the method subsidiary_preconditioner_function_pt().

Constructor & Destructor Documentation

◆ BandedBlockTriangularPreconditioner() [1/2]

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

Constructor. (By default this preconditioner is upper triangular).

203  : GeneralPurposeBlockPreconditioner<MATRIX>()
204  {
205  // Default to upper triangular
206  Upper_triangular = true;
207 
208  // Default is to assume every block above the diagonal is non-empty
209  Block_bandwidth = -1;
210 
211  // The preconditioner has been created but it hasn't been set up yet
213 
214  // By default, don't store the memory statistics of this preconditioner
216 
217  // Initialise the value of Memory_usage_in_bytes
218  Memory_usage_in_bytes = 0.0;
219  } // End of BandedBlockTriangularPreconditioner
bool Preconditioner_has_been_setup
Definition: general_purpose_space_time_block_preconditioner.h:393
bool Compute_memory_statistics
Definition: general_purpose_space_time_block_preconditioner.h:397
bool Upper_triangular
Boolean indicating upper or lower triangular.
Definition: general_purpose_space_time_block_preconditioner.h:389
double Memory_usage_in_bytes
Definition: general_purpose_space_time_block_preconditioner.h:401
int Block_bandwidth
Definition: general_purpose_space_time_block_preconditioner.h:386

References oomph::BandedBlockTriangularPreconditioner< MATRIX >::Block_bandwidth, oomph::BandedBlockTriangularPreconditioner< MATRIX >::Compute_memory_statistics, oomph::BandedBlockTriangularPreconditioner< MATRIX >::Memory_usage_in_bytes, oomph::BandedBlockTriangularPreconditioner< MATRIX >::Preconditioner_has_been_setup, and oomph::BandedBlockTriangularPreconditioner< MATRIX >::Upper_triangular.

◆ ~BandedBlockTriangularPreconditioner()

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

Destructor - delete the preconditioner matrices.

224  {
225  // Forward the call to a helper clean-up function
226  this->clean_up_memory();
227  } // End of ~BandedBlockTriangularPreconditioner
virtual void clean_up_memory()
Clean up the memory.
Definition: general_purpose_space_time_block_preconditioner.h:231

References oomph::BandedBlockTriangularPreconditioner< MATRIX >::clean_up_memory().

◆ BandedBlockTriangularPreconditioner() [2/2]

Broken copy constructor.

Member Function Documentation

◆ block_bandwidth()

template<typename MATRIX >
int oomph::BandedBlockTriangularPreconditioner< MATRIX >::block_bandwidth ( )
inline

Get the block bandwidth of the preconditioner.

280  {
281  // Store it
282  return Block_bandwidth;
283  } // End of block_bandwidth

References oomph::BandedBlockTriangularPreconditioner< MATRIX >::Block_bandwidth.

Referenced by oomph::BandedBlockTriangularPreconditioner< MATRIX >::set_block_bandwidth().

◆ clean_up_memory()

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

Clean up the memory.

Reimplemented from oomph::GeneralPurposeBlockPreconditioner< MATRIX >.

232  {
233  // Delete anything in Off_diagonal_matrix_vector_products
234  for (unsigned i = 0, ni = Off_diagonal_matrix_vector_products.nrow();
235  i < ni;
236  i++)
237  {
238  for (unsigned j = 0, nj = Off_diagonal_matrix_vector_products.ncol();
239  j < nj;
240  j++)
241  {
242  // Delete the matrix-vector product
244 
245  // Make it a null pointer
247  }
248  } // for (unsigned i=0,ni=Off_diagonal_matrix_vector_products.nrow();...
249 
250  // Clean up the base class too
252  } // End of clean_up_memory
int i
Definition: BiCGSTAB_step_by_step.cpp:9
DenseMatrix< MatrixVectorProduct * > Off_diagonal_matrix_vector_products
Matrix of matrix-vector product operators for the off diagonals.
Definition: general_purpose_space_time_block_preconditioner.h:380
virtual void clean_up_memory()
Definition: general_purpose_block_preconditioners.h:112
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::GeneralPurposeBlockPreconditioner< MATRIX >::clean_up_memory(), i, j, and oomph::BandedBlockTriangularPreconditioner< MATRIX >::Off_diagonal_matrix_vector_products.

Referenced by oomph::BandedBlockTriangularPreconditioner< MATRIX >::~BandedBlockTriangularPreconditioner().

◆ disable_doc_memory_usage()

template<typename MATRIX >
void oomph::BandedBlockTriangularPreconditioner< MATRIX >::disable_doc_memory_usage ( )
inline

Don't document the memory usage!

Set the appropriate flag to false

320  {
323  } // End of disable_doc_memory_usage

References oomph::BandedBlockTriangularPreconditioner< MATRIX >::Compute_memory_statistics.

◆ enable_doc_memory_usage()

template<typename MATRIX >
void oomph::BandedBlockTriangularPreconditioner< MATRIX >::enable_doc_memory_usage ( )
inline

Document the memory usage.

Set the appropriate flag to true

312  {
315  } // End of enable_doc_memory_usage

References oomph::BandedBlockTriangularPreconditioner< MATRIX >::Compute_memory_statistics.

Referenced by UnsteadyHeatProblem< ELEMENT >::set_up_spacetime_solver().

◆ get_memory_usage_in_bytes()

template<typename MATRIX >
double oomph::BandedBlockTriangularPreconditioner< MATRIX >::get_memory_usage_in_bytes ( )
inline

Get the memory statistics.

328  {
329  // Has the preconditioner even been set up yet?
331  {
332  // Were we meant to compute the statistics?
334  {
335  // Return the appropriate variable value
336  return Memory_usage_in_bytes;
337  }
338  else
339  {
340  // Allocate storage for an output stream
341  std::ostringstream warning_message_stream;
342 
343  // Create a warning message
344  warning_message_stream
345  << "The memory statistics have not been calculated "
346  << "so I'm returning\nthe value zero." << std::endl;
347 
348  // Give the user a warning
349  OomphLibWarning(warning_message_stream.str(),
352 
353  // Return the value zero
354  return 0.0;
355  }
356  }
357  // If the preconditioner hasn't been set up yet
358  else
359  {
360  // Allocate storage for an output stream
361  std::ostringstream warning_message_stream;
362 
363  // Create a warning message
364  warning_message_stream
365  << "The preconditioner hasn't even been set up yet "
366  << "so I'm returning\nthe value zero." << std::endl;
367 
368  // Give the user a warning
369  OomphLibWarning(warning_message_stream.str(),
372 
373  // Return the value zero
374  return 0.0;
375  } // if (Preconditioner_has_been_setup)
376  } // End of get_memory_usage_in_bytes
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References oomph::BandedBlockTriangularPreconditioner< MATRIX >::Compute_memory_statistics, oomph::BandedBlockTriangularPreconditioner< MATRIX >::Memory_usage_in_bytes, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::BandedBlockTriangularPreconditioner< MATRIX >::Preconditioner_has_been_setup.

◆ is_upper_triangular()

template<typename MATRIX >
bool oomph::BandedBlockTriangularPreconditioner< MATRIX >::is_upper_triangular ( )
inline

Is this being used as an upper triangular preconditioner?

304  {
305  // Return the value of the Upper_triangular flag
306  return Upper_triangular;
307  } // End of is_upper_triangular

References oomph::BandedBlockTriangularPreconditioner< MATRIX >::Upper_triangular.

◆ lower_triangular()

template<typename MATRIX >
void oomph::BandedBlockTriangularPreconditioner< MATRIX >::lower_triangular ( )
inline

Use as a lower triangular preconditioner.

296  {
297  // Update the Upper_triangular flag
298  Upper_triangular = false;
299  } // End of lower_triangular

References oomph::BandedBlockTriangularPreconditioner< MATRIX >::Upper_triangular.

Referenced by UnsteadyHeatProblem< ELEMENT >::set_up_spacetime_solver().

◆ operator=()

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

Broken assignment operator.

◆ preconditioner_solve()

template<typename MATRIX >
void oomph::BandedBlockTriangularPreconditioner< MATRIX >::preconditioner_solve ( const DoubleVector r,
DoubleVector z 
)
virtual

Apply preconditioner to r.

Preconditioner solve for the block triangular preconditioner.

Implements oomph::Preconditioner.

602  {
603  // Cache number of block types
604  unsigned n_block = this->nblock_types();
605 
606  // The start index
607  int start;
608 
609  // The end index
610  int end;
611 
612  // The max. bandwidth of the block matrix
613  int bandwidth_limit;
614 
615  // The steps to take (=+1/-1) which is dependent on whether we're using
616  // the lower or upper triangular form of the preconditioner
617  int step;
618 
619  // If we're using this as an block upper triangular preconditioner
620  if (Upper_triangular)
621  {
622  start = n_block - 1;
623  end = -1;
624  step = -1;
625  }
626  else
627  {
628  start = 0;
629  end = n_block;
630  step = 1;
631  }
632 
633  // Storage for the iteration count. The entries will be updated as we loop
634  // over the blocks. Here -1 is used to indicate that a block was not solved
635  // by GMRES so we ignore it
636  Vector<int> iteration_count(n_block, -1);
637 
638  // Storage for the number of blocks solved with GMRES
639  unsigned n_block_solved_with_gmres = 0;
640 
641  // Vector of vectors for each section of residual vector
642  Vector<DoubleVector> block_r;
643 
644  // Rearrange the vector r into the vector of block vectors block_r
645  this->get_block_vectors(r, block_r);
646 
647  // Vector of vectors for the solution block vectors
648  Vector<DoubleVector> block_z(n_block);
649 
650  // Loop over the block rows
651  for (int i = start; i != end; i += step)
652  {
653  // If the i-th subsidiary preconditioner is a block preconditioner
654  if (dynamic_cast<BlockPreconditioner<CRDoubleMatrix>*>(
655  this->Subsidiary_preconditioner_pt[i]) != 0)
656  {
657  // This is pretty inefficient but there is no other way to do this with
658  // block sub preconditioners as far as I can tell because they demand
659  // to have the full r and z vectors...
660  DoubleVector block_z_with_size_of_full_z(r.distribution_pt());
661  DoubleVector r_updated(r.distribution_pt());
662 
663  // Construct the new r vector (with the update given by back subs
664  // below).
665  this->return_block_vectors(block_r, r_updated);
666 
667  // Solve (blocking is handled inside the block preconditioner).
668  this->Subsidiary_preconditioner_pt[i]->preconditioner_solve(
669  r_updated, block_z_with_size_of_full_z);
670 
671  // Extract this block's z vector because we need it for the next step
672  // (and throw away block_z_with_size_of_full_z).
673  this->get_block_vector(i, block_z_with_size_of_full_z, block_z[i]);
674  }
675  // If the subsidiary preconditioner is just a regular preconditioner
676  else
677  {
678  // Solve on the block
679  this->Subsidiary_preconditioner_pt[i]->preconditioner_solve(block_r[i],
680  block_z[i]);
681  }
682 
683  // See if the i-th subsidiary preconditioner the GMRES block
684  // preconditioner
685  if (dynamic_cast<GMRESBlockPreconditioner*>(
686  this->Subsidiary_preconditioner_pt[i]) != 0)
687  {
688  // Update the iteration count
689  iteration_count[i] = dynamic_cast<GMRESBlockPreconditioner*>(
691  ->iterations();
692 
693  // Increment the counter
694  n_block_solved_with_gmres++;
695  }
696 
697  // If the block bandwidth has been provided
698  if (Block_bandwidth >= 0)
699  {
700  // If we're using this as an block upper triangular preconditioner
701  if (Upper_triangular)
702  {
703  bandwidth_limit = std::max(end - i, step + step * Block_bandwidth);
704  }
705  else
706  {
707  bandwidth_limit = std::min(end - i, step + step * Block_bandwidth);
708  }
709  }
710  // Default case; loop over all the block rows
711  else
712  {
713  bandwidth_limit = end - i;
714  }
715 
716  // Substitute (over all the rows)
717  for (int j = i + step; j != i + bandwidth_limit; j += step)
718  {
719  // Allocate space for the matrix-vector product (MVP)
720  DoubleVector temp;
721 
722  // Calculate the MVP
723  Off_diagonal_matrix_vector_products(j, i)->multiply(block_z[i], temp);
724 
725  // Now update the RHS vector
726  block_r[j] -= temp;
727  }
728  } // for (int i=start;i!=end;i+=step)
729 
730  // Copy the solution from the block vector block_z back into z
731  this->return_block_vectors(block_z, z);
732 
733  // Only compute the iteration count statistics if we have some data
734  if (n_block_solved_with_gmres > 0)
735  {
736  // Storage for the average iteration count
737  double n_iter_mean = 0.0;
738 
739  // Storage for the variance of the iteration count
740  double n_iter_var = 0.0;
741 
742  // Loop over the entries of the iteration count vector
743  for (unsigned i = 0; i < n_block; i++)
744  {
745  // If we used GMRES on this block
746  if (dynamic_cast<GMRESBlockPreconditioner*>(
747  this->Subsidiary_preconditioner_pt[i]) != 0)
748  {
749  // Sanity check: make sure there's a non-negative iteration count
750  if (iteration_count[i] < 0)
751  {
752  // Create an output stream
753  std::ostringstream error_message_stream;
754 
755  // Create an error message
756  error_message_stream
757  << "Iteration count should be non-negative but "
758  << "you have an iteration\ncount of " << iteration_count[i] << "!"
759  << std::endl;
760 
761  // Throw an error
762  throw OomphLibError(error_message_stream.str(),
765  }
766  } // if (dynamic_cast<GMRESBlockPreconditioner*>...
767  } // for (unsigned i=0;i<n_block;i++)
768 
769  // Loop over the entries of the iteration count vector
770  for (unsigned i = 0; i < n_block; i++)
771  {
772  // If we used GMRES on this block
773  if (dynamic_cast<GMRESBlockPreconditioner*>(
774  this->Subsidiary_preconditioner_pt[i]) != 0)
775  {
776  // Update the mean
777  n_iter_mean +=
778  (double(iteration_count[i]) / double(n_block_solved_with_gmres));
779  } // if (dynamic_cast<GMRESBlockPreconditioner*>...
780  } // for (unsigned i=0;i<n_block;i++)
781 
782  // Loop over the entries of the iteration count vector (again)
783  // NOTE: We don't need to do the error checks again, we did them on the
784  // previous run through
785  for (unsigned i = 0; i < n_block; i++)
786  {
787  // If we used GMRES on this block
788  if (dynamic_cast<GMRESBlockPreconditioner*>(
789  this->Subsidiary_preconditioner_pt[i]) != 0)
790  {
791  // Update the variance
792  n_iter_var +=
793  (std::pow(double(iteration_count[i]) - n_iter_mean, 2.0) /
794  double(n_block_solved_with_gmres));
795  } // if (dynamic_cast<GMRESBlockPreconditioner*>...
796  } // for (unsigned i=0;i<n_block;i++)
797 
798  // Doc. the statistics
799  oomph_info << "\nNumber of subsidiary blocks solved with GMRES: "
800  << n_block_solved_with_gmres
801  << "\nAverage subsidiary preconditioner iteration count: "
802  << n_iter_mean
803  << "\nStandard deviation of subsidiary preconditioner "
804  << "iteration count: " << std::sqrt(n_iter_var) << std::endl;
805  } // if (n_block_solved_with_gmres>0)
806  } // End of preconditioner_solve
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
std::vector< double > DoubleVector
loads clump configuration
Definition: ClumpInput.h:26
void return_block_vectors(const Vector< unsigned > &block_vec_number, const Vector< DoubleVector > &s, DoubleVector &v) const
Definition: block_preconditioner.cc:3443
void get_block_vector(const unsigned &n, const DoubleVector &v, DoubleVector &b) const
Definition: block_preconditioner.cc:4186
unsigned nblock_types() const
Return the number of block types.
Definition: block_preconditioner.h:1670
void get_block_vectors(const Vector< unsigned > &block_vec_number, const DoubleVector &v, Vector< DoubleVector > &s) const
Definition: block_preconditioner.cc:2939
Vector< Preconditioner * > Subsidiary_preconditioner_pt
List of preconditioners to use for the blocks to be solved.
Definition: general_purpose_block_preconditioners.h:294
#define min(a, b)
Definition: datatypes.h:22
#define max(a, b)
Definition: datatypes.h:23
static constexpr lastp1_t end
Definition: IndexedViewHelper.h:79
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625
r
Definition: UniformPSDSelfTest.py:20
void start(const unsigned &i)
(Re-)start i-th timer
Definition: oomph_utilities.cc:243
OomphInfo oomph_info
Definition: oomph_definitions.cc:319

References Eigen::placeholders::end, i, j, max, min, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, Eigen::bfloat16_impl::pow(), UniformPSDSelfTest::r, sqrt(), and oomph::CumulativeTimings::start().

◆ set_block_bandwidth()

template<typename MATRIX >
void oomph::BandedBlockTriangularPreconditioner< MATRIX >::set_block_bandwidth ( const int block_bandwidth)
inline

Set the block bandwidth of the preconditioner.

272  {
273  // Store it
275  } // End of set_block_bandwidth
int block_bandwidth()
Get the block bandwidth of the preconditioner.
Definition: general_purpose_space_time_block_preconditioner.h:279

References oomph::BandedBlockTriangularPreconditioner< MATRIX >::block_bandwidth(), and oomph::BandedBlockTriangularPreconditioner< MATRIX >::Block_bandwidth.

Referenced by UnsteadyHeatProblem< ELEMENT >::set_up_spacetime_solver().

◆ setup()

template<typename MATRIX >
void oomph::BandedBlockTriangularPreconditioner< MATRIX >::setup
virtual

Setup the preconditioner.

Set up the block triangular preconditioner.

Implements oomph::Preconditioner.

219  {
220  // Clean the memory
221  this->clean_up_memory();
222 
223  // Subsidiary preconditioners don't really need the meshes
224  if (this->is_master_block_preconditioner())
225  {
226 #ifdef PARANOID
227  if (this->gp_nmesh() == 0)
228  {
229  std::ostringstream err_msg;
230  err_msg << "There are no meshes set.\n"
231  << "Did you remember to call add_mesh(...)?";
232  throw OomphLibError(
234  }
235 #endif
236 
237  // Set all meshes if this is master block preconditioner
239  }
240 
241  // Initialise the memory usage variable
242  Memory_usage_in_bytes = 0.0;
243 
244  // If we're meant to build silently
245  if (this->Silent_preconditioner_setup == true)
246  {
247  // Store the output stream pointer
248  this->Stream_pt = oomph_info.stream_pt();
249 
250  // Now set the oomph_info stream pointer to the null stream to
251  // disable all possible output
253  }
254 
255  // Set up the block look up schemes
257 
258  // Number of block types
259  unsigned n_block_types = this->nblock_types();
260 
261  // Storage for the off diagonal matrix vector products
262  Off_diagonal_matrix_vector_products.resize(n_block_types, n_block_types, 0);
263 
264  // Fill in any null subsidiary preconditioners
265  this->fill_in_subsidiary_preconditioners(n_block_types);
266 
267  // The total time for extracting all the blocks from the "global" matrix
268  double t_extraction_total = 0.0;
269 
270  // The total time for setting up the subsidiary preconditioners
271  double t_subsidiary_setup_total = 0.0;
272 
273  // The total time for setting up the matrix-vector products
274  double t_mvp_setup_total = 0.0;
275 
276  // Build the preconditioners and matrix vector products
277  for (unsigned i = 0; i < n_block_types; i++)
278  {
279  // See if the i-th subsidiary preconditioner is a block preconditioner
280  if (dynamic_cast<BlockPreconditioner<CRDoubleMatrix>*>(
281  this->Subsidiary_preconditioner_pt[i]) != 0)
282  {
283  // If we need to compute the memory statistics
285  {
286  // If we're dealing with a GMRES block preconditioner
287  if (dynamic_cast<GMRESBlockPreconditioner*>(
289  {
290  // Enable the doc-ing of memory usage in the GMRES block
291  // preconditioner
292  dynamic_cast<GMRESBlockPreconditioner*>(
295  }
296  } // if (Compute_memory_statistics)
297 
298  // Get the start time
299  double t_subsidiary_setup_start = TimingHelpers::timer();
300 
301  // It's a block preconditioner so pass it a pointer to the global
302  // matrix!
303  this->Subsidiary_preconditioner_pt[i]->setup(this->matrix_pt());
304 
305  // Get the end time
306  double t_subsidiary_setup_end = TimingHelpers::timer();
307 
308  // Update the timing total
309  t_subsidiary_setup_total +=
310  (t_subsidiary_setup_end - t_subsidiary_setup_start);
311  }
312  // It's just a preconditioner so pass it a deep copy of the block!
313  else
314  {
315  // Get the start time
316  double t_extract_start = TimingHelpers::timer();
317 
318  // Grab the i-th diagonal block
319  CRDoubleMatrix block_matrix = this->get_block(i, i);
320 
321  // Get the end time
322  double t_extract_end = TimingHelpers::timer();
323 
324  // Update the timing total
325  t_extraction_total += (t_extract_end - t_extract_start);
326 
327  // Get the start time
328  double t_subsidiary_setup_start = TimingHelpers::timer();
329 
330  // Set up the i-th subsidiary preconditioner with this block
331  this->Subsidiary_preconditioner_pt[i]->setup(&block_matrix);
332 
333  // Get the end time
334  double t_subsidiary_setup_end = TimingHelpers::timer();
335 
336  // Update the timing total
337  t_subsidiary_setup_total +=
338  (t_subsidiary_setup_end - t_subsidiary_setup_start);
339  }
340 
341  // The index of the lower column bound
342  unsigned l;
343 
344  // The index of the upper column bound
345  unsigned u;
346 
347  // If we're using the upper triangular form of the preconditioner
348  if (Upper_triangular)
349  {
350  // The lower bound column bound
351  l = i + 1;
352 
353  // If the block bandwidth has been provided
354  if (Block_bandwidth >= 0)
355  {
356  // The upper bound is the last nonzero block column
357  u = std::min(n_block_types, l + Block_bandwidth);
358  }
359  // Default case; loop over all the block columns
360  else
361  {
362  // The upper bound is the last column
363  u = n_block_types;
364  }
365  }
366  // If we're using the lower triangular form of the preconditioner
367  else
368  {
369  // The upper bound column bound
370  u = i;
371 
372  // If the block bandwidth has been provided
373  if (Block_bandwidth >= 0)
374  {
375  // The lower bound is the last nonzero block column. The explicit
376  // casting is a bit over the top but it's better to be safe than
377  // sorry...
378  l = std::max(0, int(int(u) - Block_bandwidth));
379  }
380  // Default case; loop over all the block columns
381  else
382  {
383  // The lower bound is the first column
384  l = 0;
385  }
386  } // for (unsigned i=0;i<nblock_types;i++)
387 
388  // Loop over the chosen block columns
389  for (unsigned j = l; j < u; j++)
390  {
391  // Get the start time
392  double t_extract_start = TimingHelpers::timer();
393 
394  // Get the (i,j)-th block matrix
395  CRDoubleMatrix block_matrix = this->get_block(i, j);
396 
397  // Do we need to doc. the memory statistics?
399  {
400  // How many rows are there in this block?
401  unsigned n_row = block_matrix.nrow();
402 
403  // How many nonzeros are there in this block?
404  unsigned n_nnz = block_matrix.nnz();
405 
406  // Compute the memory usage. The only memory overhead here (for the
407  // setup phase) is the storage of the sub-diagonal blocks for the MVPs
408  Memory_usage_in_bytes += ((2 * ((n_row + 1) * sizeof(int))) +
409  (n_nnz * (sizeof(int) + sizeof(double))));
410  }
411 
412  // Get the end time
413  double t_extract_end = TimingHelpers::timer();
414 
415  // Update the timing total
416  t_extraction_total += (t_extract_end - t_extract_start);
417 
418  // Get the start time
419  double t_mvp_start = TimingHelpers::timer();
420 
421  // Copy the block into a "multiplier" class. If trilinos is being
422  // used this should also be faster than oomph-lib's multiphys.
423  Off_diagonal_matrix_vector_products(i, j) = new MatrixVectorProduct();
424 
425  // Set the damn thing up
427  Off_diagonal_matrix_vector_products(i, j), &block_matrix, j);
428 
429  // Get the end time
430  double t_mvp_end = TimingHelpers::timer();
431 
432  // Update the timing total
433  t_mvp_setup_total += (t_mvp_end - t_mvp_start);
434  }
435  } // for (unsigned i=0;i<n_block_types;i++)
436 
437  // Remember that the preconditioner has been set up
439 
440  // If we're meant to build silently, reassign the oomph stream pointer
441  if (this->Silent_preconditioner_setup == true)
442  {
443  // Store the output stream pointer
444  oomph_info.stream_pt() = this->Stream_pt;
445 
446  // Reset our own stream pointer
447  this->Stream_pt = 0;
448  }
449 
450  // Tell the user
451  oomph_info << "Total block extraction time [sec]: " << t_extraction_total
452  << "\nTotal subsidiary preconditioner setup time [sec]: "
453  << t_subsidiary_setup_total
454  << "\nTotal matrix-vector product setup time [sec]: "
455  << t_mvp_setup_total << std::endl;
456 
457  // Do we need to doc. the memory statistics?
458  // NOTE: We're going to assume that either:
459  // (1) GMRES is used as a subsidiary block preconditioner (preconditioned
460  // by the Navier-Stokes subsidiary block preconditioner), or;
461  // (2) SuperLU is used as the subsidiary preconditioner.
463  {
464  // Allocate space for the total memory usage
465  double total_memory_usage_for_setup_phase = 0.0;
466 
467  // How many rows are there in the global Jacobian?
468  unsigned n_row = this->matrix_pt()->nrow();
469 
470  // How many nonzeros are there in the global Jacobian?
471  unsigned n_nnz = this->matrix_pt()->nnz();
472 
473  // Storage for the memory usage of the global system matrix.
474  // NOTE: This calculation is done by taking into account the storage
475  // scheme for a compressed row matrix
476  double memory_usage_for_storage_of_global_jacobian_in_bytes =
477  ((2 * ((n_row + 1) * sizeof(int))) +
478  (n_nnz * (sizeof(int) + sizeof(double))));
479 
480  // Allocate storage for the memory usage of the subsidiary preconditioner
481  double memory_usage_for_subsidiary_preconditioner_in_bytes = 0.0;
482 
483  // Allocate storage for the memory usage of the Navier-Stokes subsidiary
484  // block preconditioner (if it's used, that is)
485  double memory_usage_for_nssbp_preconditioner_in_bytes = 0.0;
486 
487  // Boolean to indicate whether we've issue a warning about not being
488  // able to compute memory statistics. If it doesn't work with one
489  // block, chances are it won't work with any of them, so don't be a
490  // pain in the gluteus maximus and just spit out the warning once
491  bool have_issued_warning_about_memory_calculations = false;
492 
493  // Build the preconditioners and matrix vector products
494  for (unsigned i = 0; i < n_block_types; i++)
495  {
496  // See if the i-th subsidiary preconditioner the GMRES block
497  // preconditioner
498  if (dynamic_cast<GMRESBlockPreconditioner*>(
499  this->Subsidiary_preconditioner_pt[i]) != 0)
500  {
501  // Upcast the subsidiary preconditioner pointer to a GMRES block
502  // preconditioner pointer
503  GMRESBlockPreconditioner* gmres_block_prec_pt =
504  dynamic_cast<GMRESBlockPreconditioner*>(
506 
507  // Update the subsidiary preconditioner memory usage variable
508  memory_usage_for_subsidiary_preconditioner_in_bytes +=
509  gmres_block_prec_pt->get_memory_usage_in_bytes();
510 
511  // Add on the memory usage for the NS subsidiary block preconditioner
512  memory_usage_for_nssbp_preconditioner_in_bytes +=
513  gmres_block_prec_pt->navier_stokes_subsidiary_preconditioner_pt()
514  ->get_memory_usage_in_bytes();
515  }
516  // This block is preconditioned by the SuperLU preconditioner
517  else if (dynamic_cast<SuperLUPreconditioner*>(
518  this->Subsidiary_preconditioner_pt[i]) != 0)
519  {
520  // Update the subsidiary preconditioner memory usage variable
521  memory_usage_for_subsidiary_preconditioner_in_bytes +=
522  dynamic_cast<SuperLUPreconditioner*>(
524  ->get_total_memory_needed_for_superlu();
525  }
526  // Don't know what to do otherwise!
527  else
528  {
529  // Have we already complained once?
530  if (!have_issued_warning_about_memory_calculations)
531  {
532  // Remember that we've issued a warning now
533  have_issued_warning_about_memory_calculations = true;
534 
535  // Allocate storage for an output stream
536  std::ostringstream warning_message_stream;
537 
538  // Create a warning message
539  warning_message_stream
540  << "Can't compute the memory statistics for the " << i
541  << "-th diagonal block in the banded\nblock "
542  << "triangular preconditioner so I'm just going "
543  << "to skip it." << std::endl;
544 
545  // Give the user a warning
546  OomphLibWarning(warning_message_stream.str(),
549  }
550  }
551  } // for (unsigned i=0;i<nblock_types;i++)
552 
553  // Create some space
554  oomph_info << std::endl;
555 
556  // If we've got a nonzero contribution from the NSSBP
557  if (memory_usage_for_nssbp_preconditioner_in_bytes > 0.0)
558  {
559  // Doc. the memory usage for the NSSBP
560  oomph_info << "Amount of memory used by Navier-Stokes subsidiary block "
561  << "preconditioner (MB): "
562  << memory_usage_for_nssbp_preconditioner_in_bytes / 1.0e+06
563  << std::endl;
564 
565  // Add in the NSSBP contribution
566  total_memory_usage_for_setup_phase +=
567  memory_usage_for_nssbp_preconditioner_in_bytes;
568  }
569 
570  // Add in the subsidiary preconditioners contribution
571  total_memory_usage_for_setup_phase +=
572  memory_usage_for_subsidiary_preconditioner_in_bytes;
573 
574  // Add in the banded block triangular preconditioner contribution
575  total_memory_usage_for_setup_phase += get_memory_usage_in_bytes();
576 
577  // Add in the global Jacobian contribution
578  total_memory_usage_for_setup_phase +=
579  memory_usage_for_storage_of_global_jacobian_in_bytes;
580 
581  // How much memory have we used in the subsidiary preconditioners?
582  oomph_info
583  << "Amount of memory used by the subsidiary preconditioners "
584  << "(MB): "
585  << memory_usage_for_subsidiary_preconditioner_in_bytes / 1.0e+06
586  << "\nAmount of memory used by banded block triangular "
587  << "preconditioner (MB): " << get_memory_usage_in_bytes() / 1.0e+06
588  << "\nAmount of memory used to store (global) Jacobian (MB): "
589  << memory_usage_for_storage_of_global_jacobian_in_bytes / 1.0e+06
590  << "\nTotal amount of memory being used after setup (MB): "
591  << total_memory_usage_for_setup_phase / 1.0e+06 << "\n"
592  << std::endl;
593  } // if (Compute_memory_statistics)
594  } // End of setup
void enable_doc_memory_usage()
Document the memory usage.
Definition: general_purpose_space_time_block_preconditioner.h:311
double get_memory_usage_in_bytes()
Get the memory statistics.
Definition: general_purpose_space_time_block_preconditioner.h:327
void get_block(const unsigned &i, const unsigned &j, MATRIX &output_matrix, const bool &ignore_replacement_block=false) const
Definition: block_preconditioner.h:673
bool is_master_block_preconditioner() const
Definition: block_preconditioner.h:2068
MATRIX * matrix_pt() const
Definition: block_preconditioner.h:520
void setup_matrix_vector_product(MatrixVectorProduct *matvec_prod_pt, CRDoubleMatrix *block_pt, const Vector< unsigned > &block_col_indices)
Definition: block_preconditioner.h:2397
void gp_preconditioner_set_all_meshes()
Set the mesh in the block preconditioning framework.
Definition: general_purpose_block_preconditioners.h:218
void fill_in_subsidiary_preconditioners(const unsigned &nprec_needed)
Definition: general_purpose_block_preconditioners.h:256
void gp_preconditioner_block_setup()
Modified block setup for general purpose block preconditioners.
Definition: general_purpose_block_preconditioners.h:241
unsigned gp_nmesh()
Definition: general_purpose_block_preconditioners.h:211
std::ostream *& stream_pt()
Access function for the stream pointer.
Definition: oomph_definitions.h:464
std::ostream * Stream_pt
Pointer to the output stream – defaults to std::cout.
Definition: preconditioner.h:232
bool Silent_preconditioner_setup
Boolean to indicate whether or not the build should be done silently.
Definition: preconditioner.h:229
return int(ret)+1
double timer()
returns the time in seconds after some point in past
Definition: oomph_utilities.cc:1295
Nullstream oomph_nullstream
Single (global) instantiation of the Nullstream.
Definition: oomph_definitions.cc:313

References oomph::TerminateHelper::clean_up_memory(), oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::get_memory_usage_in_bytes(), oomph::GMRESBlockPreconditioner::get_memory_usage_in_bytes(), i, int(), j, max, min, oomph::GMRESBlockPreconditioner::navier_stokes_subsidiary_preconditioner_pt(), oomph::CRDoubleMatrix::nnz(), oomph::CRDoubleMatrix::nrow(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, oomph::oomph_nullstream, GlobalParameters::Stream_pt, oomph::OomphInfo::stream_pt(), and oomph::TimingHelpers::timer().

◆ upper_triangular()

template<typename MATRIX >
void oomph::BandedBlockTriangularPreconditioner< MATRIX >::upper_triangular ( )
inline

Use as an upper triangular preconditioner.

288  {
289  // Update the Upper_triangular flag
290  Upper_triangular = true;
291  } // End of upper_triangular

References oomph::BandedBlockTriangularPreconditioner< MATRIX >::Upper_triangular.

Member Data Documentation

◆ Block_bandwidth

template<typename MATRIX >
int oomph::BandedBlockTriangularPreconditioner< MATRIX >::Block_bandwidth
private

Storage for the block bandwidth of the matrix. Defaults to -1 indicating that we assume every off-diagonal block is non-empty. If the matrix is block diagonal then the value is zero

Referenced by oomph::BandedBlockTriangularPreconditioner< MATRIX >::BandedBlockTriangularPreconditioner(), oomph::BandedBlockTriangularPreconditioner< MATRIX >::block_bandwidth(), and oomph::BandedBlockTriangularPreconditioner< MATRIX >::set_block_bandwidth().

◆ Compute_memory_statistics

◆ Memory_usage_in_bytes

template<typename MATRIX >
double oomph::BandedBlockTriangularPreconditioner< MATRIX >::Memory_usage_in_bytes
private

◆ Off_diagonal_matrix_vector_products

template<typename MATRIX >
DenseMatrix<MatrixVectorProduct*> oomph::BandedBlockTriangularPreconditioner< MATRIX >::Off_diagonal_matrix_vector_products
protected

Matrix of matrix-vector product operators for the off diagonals.

Referenced by oomph::BandedBlockTriangularPreconditioner< MATRIX >::clean_up_memory().

◆ Preconditioner_has_been_setup

template<typename MATRIX >
bool oomph::BandedBlockTriangularPreconditioner< MATRIX >::Preconditioner_has_been_setup
private

Control flag is true if the preconditioner has been setup (used so we can wipe the data when the preconditioner is called again)

Referenced by oomph::BandedBlockTriangularPreconditioner< MATRIX >::BandedBlockTriangularPreconditioner(), and oomph::BandedBlockTriangularPreconditioner< MATRIX >::get_memory_usage_in_bytes().

◆ Upper_triangular


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