oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner Class Reference

#include <general_purpose_space_time_subsidiary_block_preconditioner.h>

+ Inheritance diagram for oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner:

Public Member Functions

 SpaceTimeNavierStokesSubsidiaryPreconditioner ()
 Constructor. (By default this preconditioner is upper triangular). More...
 
virtual ~SpaceTimeNavierStokesSubsidiaryPreconditioner ()
 Destructor - delete the preconditioner matrices. More...
 
virtual void clean_up_memory ()
 Clean up the memory. More...
 
 SpaceTimeNavierStokesSubsidiaryPreconditioner (const SpaceTimeNavierStokesSubsidiaryPreconditioner &)=delete
 Broken copy constructor. More...
 
void operator= (const SpaceTimeNavierStokesSubsidiaryPreconditioner &)=delete
 Broken assignment operator. More...
 
void setup ()
 Setup the preconditioner. More...
 
void preconditioner_solve (const DoubleVector &r, DoubleVector &z)
 Apply preconditioner to r. 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...
 
 SpaceTimeNavierStokesSubsidiaryPreconditioner ()
 Constructor. (By default this preconditioner is upper triangular). More...
 
virtual ~SpaceTimeNavierStokesSubsidiaryPreconditioner ()
 Destructor - delete the preconditioner matrices. More...
 
virtual void clean_up_memory ()
 Clean up the memory. More...
 
 SpaceTimeNavierStokesSubsidiaryPreconditioner (const SpaceTimeNavierStokesSubsidiaryPreconditioner &)=delete
 Broken copy constructor. More...
 
void operator= (const SpaceTimeNavierStokesSubsidiaryPreconditioner &)=delete
 Broken assignment operator. More...
 
void setup ()
 Setup the preconditioner. More...
 
void preconditioner_solve (const DoubleVector &r, DoubleVector &z)
 Apply preconditioner to r. 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...
 
void setup (DoubleMatrixBase *matrix_pt)
 
void setup (const Problem *problem_pt, DoubleMatrixBase *matrix_pt)
 
virtual void setup ()=0
 
void setup (DoubleMatrixBase *matrix_pt)
 
void setup (const Problem *problem_pt, DoubleMatrixBase *matrix_pt)
 
virtual void setup ()=0
 
- Public Member Functions inherited from oomph::BlockPreconditioner< CRDoubleMatrix >
 BlockPreconditioner ()
 Constructor. More...
 
 BlockPreconditioner (const BlockPreconditioner &)=delete
 Broken copy constructor. More...
 
virtual ~BlockPreconditioner ()
 Destructor. More...
 
void operator= (const BlockPreconditioner &)=delete
 Broken assignment operator. More...
 
CRDoubleMatrixmatrix_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< CRDoubleMatrix > *master_block_prec_pt, const Vector< unsigned > &doftype_in_master_preconditioner_coarse)
 
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)
 
virtual void block_setup ()
 
void block_setup (const Vector< unsigned > &dof_to_block_map)
 
void get_block (const unsigned &i, const unsigned &j, CRDoubleMatrix &output_matrix, const bool &ignore_replacement_block=false) const
 
CRDoubleMatrix get_block (const unsigned &i, const unsigned &j, const bool &ignore_replacement_block=false) const
 
void set_master_matrix_pt (CRDoubleMatrix *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, CRDoubleMatrix *in_matrix_pt, CRDoubleMatrix &output_matrix)
 
void get_blocks (DenseMatrix< bool > &required_blocks, DenseMatrix< CRDoubleMatrix * > &block_matrix_pt) const
 
void get_dof_level_block (const unsigned &i, const unsigned &j, CRDoubleMatrix &output_block, const bool &ignore_replacement_block=false) const
 
void get_dof_level_block (const unsigned &block_i, const unsigned &block_j, CRDoubleMatrix &output_block, const bool &ignore_replacement_block) const
 
CRDoubleMatrix 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< CRDoubleMatrix > * 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, CRDoubleMatrix &output_block) const
 
void internal_get_block (const unsigned &block_i, const unsigned &block_j, CRDoubleMatrix &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 CRDoubleMatrix *block_matrix_pt) const
 
int get_index_of_value (const Vector< myType > &vec, const myType val, const bool sorted=false) 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)
 

Private Attributes

PreconditionerF_preconditioner_pt
 Pointer to the 'preconditioner' for the F matrix. More...
 
PreconditionerP_preconditioner_pt
 Pointer to the 'preconditioner' for the pressure matrix. More...
 
bool Using_default_f_preconditioner
 Flag indicating whether the default F preconditioner is used. More...
 
bool Using_default_p_preconditioner
 Flag indicating whether the default P preconditioner is used. More...
 
bool Preconditioner_has_been_setup
 
bool Compute_memory_statistics
 
double Memory_usage_in_bytes
 
MatrixVectorProductF_mat_vec_pt
 MatrixVectorProduct operator for F. More...
 
MatrixVectorProductG_mat_vec_pt
 MatrixVectorProduct operator for G. More...
 

Additional Inherited Members

- Protected Member Functions inherited from oomph::BlockPreconditioner< CRDoubleMatrix >
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 inherited from oomph::BlockPreconditioner< CRDoubleMatrix >
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...
 

Detailed Description

General purpose block triangular preconditioner. By default this is Upper triangular. 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

◆ SpaceTimeNavierStokesSubsidiaryPreconditioner() [1/4]

oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::SpaceTimeNavierStokesSubsidiaryPreconditioner ( )
inline

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

60  : BlockPreconditioner<CRDoubleMatrix>()
61  {
62  // By default, don't store the memory statistics of this preconditioner
64 
65  // Initialise the value of Memory_usage_in_bytes
67 
68  // Flag to indicate that the preconditioner has been setup
69  // previously -- if setup() is called again, data can
70  // be wiped.
72 
73  // By default we use SuperLU for both p and f blocks
76 
77  // Set default preconditioners (inexact solvers) -- they are
78  // members of this class!
81 
82  // Null the momentum block matrix-vector product helper
83  F_mat_vec_pt = 0;
84 
85  // Null the gradient block matrix-vector product helper
86  G_mat_vec_pt = 0;
87  }
Preconditioner * P_preconditioner_pt
Pointer to the 'preconditioner' for the pressure matrix.
Definition: general_purpose_space_time_subsidiary_block_preconditioner.h:211
double Memory_usage_in_bytes
Definition: general_purpose_space_time_subsidiary_block_preconditioner.h:229
bool Preconditioner_has_been_setup
Definition: general_purpose_space_time_subsidiary_block_preconditioner.h:221
bool Compute_memory_statistics
Definition: general_purpose_space_time_subsidiary_block_preconditioner.h:225
MatrixVectorProduct * G_mat_vec_pt
MatrixVectorProduct operator for G.
Definition: general_purpose_space_time_subsidiary_block_preconditioner.h:235
MatrixVectorProduct * F_mat_vec_pt
MatrixVectorProduct operator for F.
Definition: general_purpose_space_time_subsidiary_block_preconditioner.h:232
bool Using_default_f_preconditioner
Flag indicating whether the default F preconditioner is used.
Definition: general_purpose_space_time_subsidiary_block_preconditioner.h:214
bool Using_default_p_preconditioner
Flag indicating whether the default P preconditioner is used.
Definition: general_purpose_space_time_subsidiary_block_preconditioner.h:217
Preconditioner * F_preconditioner_pt
Pointer to the 'preconditioner' for the F matrix.
Definition: general_purpose_space_time_subsidiary_block_preconditioner.h:208

References Compute_memory_statistics, F_mat_vec_pt, F_preconditioner_pt, G_mat_vec_pt, Memory_usage_in_bytes, P_preconditioner_pt, Preconditioner_has_been_setup, Using_default_f_preconditioner, and Using_default_p_preconditioner.

◆ ~SpaceTimeNavierStokesSubsidiaryPreconditioner() [1/2]

virtual oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::~SpaceTimeNavierStokesSubsidiaryPreconditioner ( )
inlinevirtual

Destructor - delete the preconditioner matrices.

91  {
92  // Call the auxiliary clean up function
93  this->clean_up_memory();
94  } // End of ~SpaceTimeNavierStokesSubsidiaryPreconditioner
virtual void clean_up_memory()
Clean up the memory.
Definition: general_purpose_space_time_subsidiary_block_preconditioner.h:97

References clean_up_memory().

◆ SpaceTimeNavierStokesSubsidiaryPreconditioner() [2/4]

oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::SpaceTimeNavierStokesSubsidiaryPreconditioner ( const SpaceTimeNavierStokesSubsidiaryPreconditioner )
delete

Broken copy constructor.

◆ SpaceTimeNavierStokesSubsidiaryPreconditioner() [3/4]

oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::SpaceTimeNavierStokesSubsidiaryPreconditioner ( )
inline

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

61  : BlockPreconditioner<CRDoubleMatrix>()
62  {
63  // By default, don't store the memory statistics of this preconditioner
65 
66  // Initialise the value of Memory_usage_in_bytes
68 
69  // Flag to indicate that the preconditioner has been setup
70  // previously -- if setup() is called again, data can
71  // be wiped.
73 
74  // By default we use SuperLU for both p and f blocks
77 
78  // Set default preconditioners (inexact solvers) -- they are
79  // members of this class!
82 
83  // Null the momentum block matrix-vector product helper
84  F_mat_vec_pt = 0;
85 
86  // Null the gradient block matrix-vector product helper
87  G_mat_vec_pt = 0;
88  }

References Compute_memory_statistics, F_mat_vec_pt, F_preconditioner_pt, G_mat_vec_pt, Memory_usage_in_bytes, P_preconditioner_pt, Preconditioner_has_been_setup, Using_default_f_preconditioner, and Using_default_p_preconditioner.

◆ ~SpaceTimeNavierStokesSubsidiaryPreconditioner() [2/2]

virtual oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::~SpaceTimeNavierStokesSubsidiaryPreconditioner ( )
inlinevirtual

Destructor - delete the preconditioner matrices.

92  {
93  // Call the auxiliary clean up function
94  this->clean_up_memory();
95  } // End of ~SpaceTimeNavierStokesSubsidiaryPreconditioner

References clean_up_memory().

◆ SpaceTimeNavierStokesSubsidiaryPreconditioner() [4/4]

oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::SpaceTimeNavierStokesSubsidiaryPreconditioner ( const SpaceTimeNavierStokesSubsidiaryPreconditioner )
delete

Broken copy constructor.

Member Function Documentation

◆ clean_up_memory() [1/2]

virtual void oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::clean_up_memory ( )
inlinevirtual

Clean up the memory.

Reimplemented from oomph::Preconditioner.

98  {
99  // If we've actually set the preconditioner up
101  {
102  // Delete matvecs
103  delete F_mat_vec_pt;
104  F_mat_vec_pt = 0;
105 
106  delete G_mat_vec_pt;
107  G_mat_vec_pt = 0;
108 
109  // Delete the momentum block solver
110  delete F_preconditioner_pt;
112 
113  // Delete the Schur complement solver
114  delete P_preconditioner_pt;
116  } // if (Preconditioner_has_been_setup)
117  } // End of clean_up_memory

References F_mat_vec_pt, F_preconditioner_pt, G_mat_vec_pt, P_preconditioner_pt, and Preconditioner_has_been_setup.

Referenced by setup(), and ~SpaceTimeNavierStokesSubsidiaryPreconditioner().

◆ clean_up_memory() [2/2]

virtual void oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::clean_up_memory ( )
inlinevirtual

Clean up the memory.

Reimplemented from oomph::Preconditioner.

99  {
100  // If we've actually set the preconditioner up
102  {
103  // Delete matvecs
104  delete F_mat_vec_pt;
105  F_mat_vec_pt = 0;
106 
107  delete G_mat_vec_pt;
108  G_mat_vec_pt = 0;
109 
110  // Delete stuff from velocity solve
112  {
113  delete F_preconditioner_pt;
115  }
116 
117  // Delete stuff from Schur complement approx
119  {
120  delete P_preconditioner_pt;
122  }
123  } // if (Preconditioner_has_been_setup)
124  } // End of clean_up_memory

References F_mat_vec_pt, F_preconditioner_pt, G_mat_vec_pt, P_preconditioner_pt, Preconditioner_has_been_setup, Using_default_f_preconditioner, and Using_default_p_preconditioner.

◆ disable_doc_memory_usage() [1/2]

void oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::disable_doc_memory_usage ( )
inline

Don't document the memory usage!

Set the appropriate flag to false

148  {
151  } // End of disable_doc_memory_usage

References Compute_memory_statistics.

◆ disable_doc_memory_usage() [2/2]

void oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::disable_doc_memory_usage ( )
inline

Don't document the memory usage!

Set the appropriate flag to false

155  {
158  } // End of disable_doc_memory_usage

References Compute_memory_statistics.

◆ enable_doc_memory_usage() [1/2]

void oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::enable_doc_memory_usage ( )
inline

Document the memory usage.

Set the appropriate flag to true

140  {
143  } // End of enable_doc_memory_usage

References Compute_memory_statistics.

Referenced by oomph::GMRESBlockPreconditioner::setup().

◆ enable_doc_memory_usage() [2/2]

void oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::enable_doc_memory_usage ( )
inline

Document the memory usage.

Set the appropriate flag to true

147  {
150  } // End of enable_doc_memory_usage

References Compute_memory_statistics.

◆ get_memory_usage_in_bytes() [1/2]

double oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::get_memory_usage_in_bytes ( )
inline

Get the memory statistics.

156  {
157  // Has the preconditioner even been set up yet?
159  {
160  // Were we meant to compute the statistics?
162  {
163  // Return the appropriate variable value
164  return Memory_usage_in_bytes;
165  }
166  else
167  {
168  // Allocate storage for an output stream
169  std::ostringstream warning_message_stream;
170 
171  // Create a warning message
172  warning_message_stream
173  << "The memory statistics have not been calculated "
174  << "so I'm returning\nthe value zero." << std::endl;
175 
176  // Give the user a warning
177  OomphLibWarning(warning_message_stream.str(),
180 
181  // Return the value zero
182  return 0.0;
183  }
184  }
185  // If the preconditioner hasn't been set up yet
186  else
187  {
188  // Allocate storage for an output stream
189  std::ostringstream warning_message_stream;
190 
191  // Create a warning message
192  warning_message_stream
193  << "The preconditioner hasn't even been set up yet "
194  << "so I'm returning\nthe value zero." << std::endl;
195 
196  // Give the user a warning
197  OomphLibWarning(warning_message_stream.str(),
200 
201  // Return the value zero
202  return 0.0;
203  } // if (Preconditioner_has_been_setup)
204  } // 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 Compute_memory_statistics, Memory_usage_in_bytes, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and Preconditioner_has_been_setup.

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

◆ get_memory_usage_in_bytes() [2/2]

double oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::get_memory_usage_in_bytes ( )
inline

Get the memory statistics.

163  {
164  // Has the preconditioner even been set up yet?
166  {
167  // Were we meant to compute the statistics?
169  {
170  // Return the appropriate variable value
171  return Memory_usage_in_bytes;
172  }
173  else
174  {
175  // Allocate storage for an output stream
176  std::ostringstream warning_message_stream;
177 
178  // Create a warning message
179  warning_message_stream
180  << "The memory statistics have not been calculated "
181  << "so I'm returning\nthe value zero." << std::endl;
182 
183  // Give the user a warning
184  OomphLibWarning(warning_message_stream.str(),
187 
188  // Return the value zero
189  return 0.0;
190  }
191  }
192  // If the preconditioner hasn't been set up yet
193  else
194  {
195  // Allocate storage for an output stream
196  std::ostringstream warning_message_stream;
197 
198  // Create a warning message
199  warning_message_stream
200  << "The preconditioner hasn't even been set up yet "
201  << "so I'm returning\nthe value zero." << std::endl;
202 
203  // Give the user a warning
204  OomphLibWarning(warning_message_stream.str(),
207 
208  // Return the value zero
209  return 0.0;
210  } // if (Preconditioner_has_been_setup)
211  } // End of get_memory_usage_in_bytes

References Compute_memory_statistics, Memory_usage_in_bytes, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and Preconditioner_has_been_setup.

◆ operator=() [1/2]

void oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::operator= ( const SpaceTimeNavierStokesSubsidiaryPreconditioner )
delete

Broken assignment operator.

◆ operator=() [2/2]

void oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::operator= ( const SpaceTimeNavierStokesSubsidiaryPreconditioner )
delete

Broken assignment operator.

◆ preconditioner_solve() [1/2]

void oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::preconditioner_solve ( const DoubleVector r,
DoubleVector z 
)
virtual

Apply preconditioner to r.

Preconditioner solve for the block triangular preconditioner.

Implements oomph::Preconditioner.

484  {
485  // If z is not set up then give it the same distribution
486  if (!z.distribution_pt()->built())
487  {
488  // Build z with the same distribution as r
489  z.build(r.distribution_pt(), 0.0);
490  }
491 
492  // -----------------------------------------------------------------------
493  // Step 1 - apply approximate Schur inverse to pressure unknowns (block 1)
494  // -----------------------------------------------------------------------
495  // First working vectors
496  DoubleVector temp_vec;
497 
498  // Second working vector
499  DoubleVector another_temp_vec;
500 
501  // Copy pressure values from residual vector to temp_vec:
502  // Loop over all entries in the global vector (this one
503  // includes velocity and pressure dofs in some random fashion)
504  this->get_block_vector(1, r, temp_vec);
505 
506  // Compute the vector P^{-1}r_p
507  P_preconditioner_pt->preconditioner_solve(temp_vec, another_temp_vec);
508 
509  // Now clear the vector storing r_p
510  temp_vec.clear();
511 
512  // Now compute G(P^{-1}r_p)
513  G_mat_vec_pt->multiply(another_temp_vec, temp_vec);
514 
515  // Clear the vector storing P^{-1}r_p
516  another_temp_vec.clear();
517 
518  // Now update to get F(GP^{-1}r_p)
519  F_mat_vec_pt->multiply(temp_vec, another_temp_vec);
520 
521  // Clear the vector storing GP^{-1}r_p
522  temp_vec.clear();
523 
524  // Now compute D(FGP^{-1}r_p)=G^{T}(FGP^{-1}r_p)
525  G_mat_vec_pt->multiply_transpose(another_temp_vec, temp_vec);
526 
527  // Clear the vector storing FGP^{-1}r_p
528  another_temp_vec.clear();
529 
530  // Finally, compute the full approximation to -z_p;
531  // -z_p=P^{-1}(DFG)P^{-1}r_p NOTE: We'll move the sign over in the next step
532  P_preconditioner_pt->preconditioner_solve(temp_vec, another_temp_vec);
533 
534  // Rebuild temp_vec with another_temp_vec's distribution with all
535  // entries initialised to zero
536  temp_vec.build(another_temp_vec.distribution_pt(), 0.0);
537 
538  // Now fix the sign and store the result in temp_vec
539  temp_vec -= another_temp_vec;
540 
541  // Now copy temp_vec (i.e. z_p) back into the global vector z
542  return_block_vector(1, temp_vec, z);
543 
544  // ------------------------------------------------------------
545  // Step 2 - apply preconditioner to velocity unknowns (block 0)
546  // ------------------------------------------------------------
547  // Clear the vector storing z_p=-P^{-1}(DFG)P^{-1}r_p
548  temp_vec.clear();
549 
550  // Recall that another_temp_vec (computed above) contains the negative
551  // of the solution of the Schur complement system, -z_p. Multiply by G
552  // and store the result in temp_vec (vector resizes itself).
553  G_mat_vec_pt->multiply(another_temp_vec, temp_vec);
554 
555  // Now clear the vector storing P^{-1}(DFG)P^{-1}r_p
556  another_temp_vec.clear();
557 
558  // Get the residual vector entries associated with the velocities, r_u
559  get_block_vector(0, r, another_temp_vec);
560 
561  // Update the result to get r_u-Gz_p
562  another_temp_vec += temp_vec;
563 
564  // Compute the solution z_u which satisfies z_u=F^{-1}(r_u-Gz_p)
565  F_preconditioner_pt->preconditioner_solve(another_temp_vec, temp_vec);
566 
567  // Now store the result in the global solution vector
568  return_block_vector(0, temp_vec, z);
569  } // End of preconditioner_solve
std::vector< double > DoubleVector
loads clump configuration
Definition: ClumpInput.h:26
void return_block_vector(const unsigned &n, const DoubleVector &b, DoubleVector &v) const
Definition: block_preconditioner.cc:4489
void get_block_vector(const unsigned &n, const DoubleVector &v, DoubleVector &b) const
Definition: block_preconditioner.cc:4186
void multiply_transpose(const DoubleVector &x, DoubleVector &y) const
Definition: matrix_vector_product.cc:177
void multiply(const DoubleVector &x, DoubleVector &y) const
Definition: matrix_vector_product.cc:108
virtual void preconditioner_solve(const DoubleVector &r, DoubleVector &z)=0
r
Definition: UniformPSDSelfTest.py:20

References oomph::DoubleVector::build(), oomph::LinearAlgebraDistribution::built(), oomph::DoubleVector::clear(), oomph::DistributableLinearAlgebraObject::distribution_pt(), F_mat_vec_pt, F_preconditioner_pt, G_mat_vec_pt, oomph::BlockPreconditioner< CRDoubleMatrix >::get_block_vector(), oomph::MatrixVectorProduct::multiply(), oomph::MatrixVectorProduct::multiply_transpose(), P_preconditioner_pt, oomph::Preconditioner::preconditioner_solve(), UniformPSDSelfTest::r, and oomph::BlockPreconditioner< CRDoubleMatrix >::return_block_vector().

Referenced by oomph::GMRESBlockPreconditioner::preconditioner_solve(), and oomph::GMRESBlockPreconditioner::update().

◆ preconditioner_solve() [2/2]

void oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::preconditioner_solve ( const DoubleVector r,
DoubleVector z 
)
virtual

Apply preconditioner to r.

Implements oomph::Preconditioner.

◆ setup() [1/8]

void oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::setup ( )
virtual

Setup the preconditioner.

Setup for the block triangular preconditioner.

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////

Implements oomph::Preconditioner.

62  {
63  // For debugging...
64  bool doc_block_matrices = false;
65 
66  // Clean up any previously created data
68 
69  // If we're meant to build silently
70  if (this->Silent_preconditioner_setup == true)
71  {
72  // Store the output stream pointer
73  this->Stream_pt = oomph_info.stream_pt();
74 
75  // Now set the oomph_info stream pointer to the null stream to
76  // disable all possible output
78  }
79 
80 #ifdef PARANOID
81  // If the upcast was unsuccessful
82  if (dynamic_cast<CRDoubleMatrix*>(this->matrix_pt()) == 0)
83  {
84  // Allocate space for an error message
85  std::ostringstream error_message;
86 
87  // Create the error message
88  error_message << "NavierStokesSchurComplementPreconditioner only works "
89  << "with CRDoubleMatrix matrices" << std::endl;
90 
91  // Throw the error message
92  throw OomphLibError(
93  error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
94  }
95 #endif
96 
97  // Start the timer for the block setup
98  double t_block_setup_start = TimingHelpers::timer();
99 
100  // Set up block look up schemes (done automatically in the
101  // BlockPreconditioner base class, based on the information
102  // provided in the block-preconditionable elements in the problem)
103 
104  // This preconditioner has two types of block:
105  // Type 0: Velocity - Corresponding to DOF type 0 & 1
106  // Type 1: Pressure - Corresponding to DOF type 2
107  unsigned n_dof_types = 0;
108 
109  // If this has been set up as a subsidiary preconditioner
111  {
112  // Get the number of dof types (will be told by the master preconditioner)
113  n_dof_types = this->ndof_types();
114 
115  // DRAIG: Delete
116  oomph_info << "Number of dof types: " << n_dof_types << std::endl;
117 
118  // Make sure there's only 3 dof types for now!
119  if (n_dof_types != 3)
120  {
121  // Allocate space for an error message
122  std::ostringstream error_message;
123 
124  // Create the error message
125  error_message << "Should only be 3 dof types! You have " << n_dof_types
126  << " dof types!" << std::endl;
127 
128  // Throw an error
129  throw OomphLibError(error_message.str(),
132  }
133  }
134  else
135  {
136  // Throw an error
137  throw OomphLibError("Can only be used as a subsidiary preconditioner!",
140  } // if (this->is_subsidiary_block_preconditioner())
141 
142  // Allocate storage for the dof-to-block mapping
143  Vector<unsigned> dof_to_block_map(n_dof_types);
144 
145  // The last dof type (the pressure) should have it's own block type
146  dof_to_block_map[n_dof_types - 1] = 1;
147 
148  // Call the generic block setup function
149  this->block_setup(dof_to_block_map);
150 
151  // Stop the timer
152  double t_block_setup_finish = TimingHelpers::timer();
153 
154  // Calculate the time difference
155  double block_setup_time = t_block_setup_finish - t_block_setup_start;
156 
157  // Document the time taken
158  oomph_info << "Time for block_setup(...) [sec]: " << block_setup_time
159  << std::endl;
160 
161  // Get the number of block types
162  unsigned n_block_type = this->nblock_types();
163 
164  // How many block types are there? Should only be 2...
165  oomph_info << "Number of block types: " << n_block_type << std::endl;
166 
167  // Allocate storage for the momentum block
168  CRDoubleMatrix* f_pt = new CRDoubleMatrix;
169 
170  // Allocate storage for the divergence block
171  CRDoubleMatrix* d_pt = new CRDoubleMatrix;
172 
173  // Allocate storage for the gradient block
174  CRDoubleMatrix* g_pt = new CRDoubleMatrix;
175 
176  // Allocate storage for the pressure Poisson matrix
177  CRDoubleMatrix* p_matrix_pt = new CRDoubleMatrix;
178 
179  // Get the momentum block F
180  this->get_block(0, 0, *f_pt);
181 
182  // Get the divergence block, D
183  this->get_block(1, 0, *d_pt);
184 
185  // Get gradient matrix, G=D^T
186  this->get_block(0, 1, *g_pt);
187 
188  // Calculate the pressure Poisson-like matrix
189  d_pt->multiply(*g_pt, *p_matrix_pt);
190 
191  // If the user wants the block matrices themselves
192  if (doc_block_matrices)
193  {
194  // Filename suffix (defaults should be an empty string)
195  std::string suffix = "";
196 
197  // Create space for all of the blocks
198  DenseMatrix<CRDoubleMatrix*> block_matrix_pt(
199  n_block_type, n_block_type, 0);
200 
201  // Loop over the block rows
202  for (unsigned i = 0; i < n_block_type; i++)
203  {
204  // Loop over the block columns
205  for (unsigned j = 0; j < n_block_type; j++)
206  {
207  // Allocate space for the matrix
208  block_matrix_pt(i, j) = new CRDoubleMatrix;
209 
210  // Get the block
211  this->get_block(i, j, *block_matrix_pt(i, j));
212  }
213  } // for (unsigned i=0;i<n_block_type;i++)
214 
215  // Space for the full matrix
216  CRDoubleMatrix* j_pt = new CRDoubleMatrix;
217 
218  // Concatenate the sub-blocks to get the full matrix
219  CRDoubleMatrixHelpers::concatenate(block_matrix_pt, *j_pt);
220 
221  // Output the matrix in MATLAB form
222  j_pt->sparse_indexed_output_with_offset("j_" + suffix + ".csv");
223 
224  // Tell the user
225  oomph_info << "Done output of j_" + suffix + ".csv" << std::endl;
226 
227  // Loop over the block rows
228  for (unsigned i = 0; i < n_block_type; i++)
229  {
230  // Loop over the block columns
231  for (unsigned j = 0; j < n_block_type; j++)
232  {
233  // Clear up this block
234  delete block_matrix_pt(i, j);
235 
236  // Make it a null pointer
237  block_matrix_pt(i, j) = 0;
238  }
239  } // for (unsigned i=0;i<n_block_type;i++)
240 
241  // Now clear up j_pt
242  delete j_pt;
243 
244  // Make it a null pointer
245  j_pt = 0;
246 
247  // Output the matrix in MATLAB form
248  f_pt->sparse_indexed_output_with_offset("f_matrix" + suffix + ".dat");
249 
250  // Tell the user
251  oomph_info << "Done output of f_matrix" + suffix + ".dat" << std::endl;
252 
253  // Output the matrix in MATLAB form
254  d_pt->sparse_indexed_output_with_offset("d_matrix" + suffix + ".dat");
255 
256  // Tell the user
257  oomph_info << "Done output of d_matrix" + suffix + ".dat" << std::endl;
258 
259  // Output the matrix in MATLAB form
260  g_pt->sparse_indexed_output_with_offset("g_matrix" + suffix + ".dat");
261 
262  // Tell the user
263  oomph_info << "Done output of g_matrix" + suffix + ".dat" << std::endl;
264 
265  // Output the matrix in MATLAB form
266  p_matrix_pt->sparse_indexed_output_with_offset("p_matrix" + suffix +
267  ".dat");
268 
269  // Tell the user
270  oomph_info << "Done output of p_matrix" + suffix + ".dat" << std::endl;
271 
272  // Exit
273  exit(0);
274  }
275 
276  // Kill divergence matrix because we don't need it any more
277  delete d_pt;
278 
279  // Make it a null pointer
280  d_pt = 0;
281 
282  // Make a new matrix-vector product
283  F_mat_vec_pt = new MatrixVectorProduct;
284 
285  // Make a new matrix-vector product
286  G_mat_vec_pt = new MatrixVectorProduct;
287 
288  // Set the matrix-vector product up
290 
291  // Set the matrix-vector product up
293 
294  // Do we need to doc. the memory statistics?
296  {
297  // Initialise the memory usage variable
298  Memory_usage_in_bytes = 0.0;
299 
300  // How many rows are there in the momentum block?
301  unsigned n_row_f = f_pt->nrow();
302 
303  // How many nonzeros are there in the momentum block?
304  unsigned n_nnz_f = f_pt->nnz();
305 
306  // Update the memory usage variable. NOTE: This calculation is done by
307  // taking into account the storage scheme for a compressed row matrix
308  Memory_usage_in_bytes += ((2 * ((n_row_f + 1) * sizeof(int))) +
309  (n_nnz_f * (sizeof(int) + sizeof(double))));
310 
311  // How many rows are there in the gradient block?
312  unsigned n_row_g = g_pt->nrow();
313 
314  // How many nonzeros are there in the gradient block?
315  unsigned n_nnz_g = g_pt->nnz();
316 
317  // Update the memory usage variable
318  Memory_usage_in_bytes += ((2 * ((n_row_g + 1) * sizeof(int))) +
319  (n_nnz_g * (sizeof(int) + sizeof(double))));
320  }
321 
322  // Kill the gradient matrix because we don't need it any more
323  delete g_pt;
324 
325  // Make it a null pointer
326  g_pt = 0;
327 
328 #ifdef OOMPH_HAS_HYPRE
329  // Assign the preconditioner for the P block
330  P_preconditioner_pt = new HyprePreconditioner;
331 
332  // Set parameters for use as preconditioner on Poisson-type problem
334  static_cast<HyprePreconditioner*>(P_preconditioner_pt));
335 
336  // Indicate that we're not using the default preconditioner
338 
339  // Assign the preconditioner for the P block
340  F_preconditioner_pt = new HyprePreconditioner;
341 
342  // Indicate that we're not using the default preconditioner
344 #endif
345 
346  /*
347  // Assign the preconditioner for the F block
348  F_preconditioner_pt=new BlockDiagonalPreconditioner<CRDoubleMatrix>;
349 
350  // Number of velocity dof types
351  unsigned n_velocity_dof_types=2;
352 
353  // Create space for the dof-to-block map
354  Vector<unsigned> dof_map(n_velocity_dof_types,0);
355 
356  // Loop over the velocity dofs
357  for (unsigned i=0;i<n_velocity_dof_types;i++)
358  {
359  // Seperate the velocity dofs out (by giving each component its own block)
360  dof_map[i]=i;
361  }
362 
363  // Turn it into a subsidiary preconditioner
364  dynamic_cast<BlockPreconditioner<CRDoubleMatrix>*>(F_preconditioner_pt)->
365  turn_into_subsidiary_block_preconditioner(this,dof_map);
366 
367  // Pass a pointer to the global system matrix
368  F_preconditioner_pt->setup(this->matrix_pt());
369  */
370 
371  // If the P preconditioner has not been set
372  if (P_preconditioner_pt == 0)
373  {
374  // Just use SuperLU
375  P_preconditioner_pt = new SuperLUPreconditioner;
376 
377  // Indicate that we're using the default preconditioner
379  } // if (P_preconditioner_pt==0)
380 
381  // Compute the LU decomposition of P
382  P_preconditioner_pt->setup(p_matrix_pt);
383 
384  // If we need to document the memory statistics
386  {
387  // If we're using SuperLU as the preconditioner
389  {
390  // Add on the memory needed to store and calculate the LU factors of P
392  dynamic_cast<SuperLUPreconditioner*>(P_preconditioner_pt)
393  ->get_total_memory_needed_for_superlu();
394  }
395  // Using Hypre which just really means we just store the matrix P
396  else
397  {
398  // How many rows are there in the momentum block?
399  unsigned n_row_p = p_matrix_pt->nrow();
400 
401  // How many nonzeros are there in the momentum block?
402  unsigned n_nnz_p = p_matrix_pt->nnz();
403 
404  // Update the memory usage variable. NOTE: This calculation is done by
405  // taking into account the storage scheme for a compressed row matrix
406  Memory_usage_in_bytes += ((2 * ((n_row_p + 1) * sizeof(int))) +
407  (n_nnz_p * (sizeof(int) + sizeof(double))));
408  }
409  } // if (Compute_memory_statistics)
410 
411  // Now delete the actual matrix P, we don't need it anymore
412  delete p_matrix_pt;
413 
414  // Make it a null pointer
415  p_matrix_pt = 0;
416 
417  // If the F preconditioner has not been setup
418  if (F_preconditioner_pt == 0)
419  {
420  // Just use SuperLU
421  F_preconditioner_pt = new SuperLUPreconditioner;
422 
423  // Indicate that we're using the default preconditioner
425  } // if (F_preconditioner_pt==0)
426 
427  // Compute the LU decomposition of F
428  F_preconditioner_pt->setup(f_pt);
429 
430  // If we need to document the memory statistics
432  {
433  // If we're using SuperLU as the preconditioner
435  {
436  // Add on the memory needed to store and calculate the LU factors of P
438  dynamic_cast<SuperLUPreconditioner*>(F_preconditioner_pt)
439  ->get_total_memory_needed_for_superlu();
440  }
441  // Using Hypre which just really means we store the matrix F (again, as
442  // it is duplicated inside Hypre)
443  else
444  {
445  // How many rows are there in the momentum block?
446  unsigned n_row_f = f_pt->nrow();
447 
448  // How many nonzeros are there in the momentum block?
449  unsigned n_nnz_f = f_pt->nnz();
450 
451  // Update the memory usage variable. NOTE: This calculation is done by
452  // taking into account the storage scheme for a compressed row matrix
453  Memory_usage_in_bytes += ((2 * ((n_row_f + 1) * sizeof(int))) +
454  (n_nnz_f * (sizeof(int) + sizeof(double))));
455  }
456  } // if (Compute_memory_statistics)
457 
458  // Now delete the matrix, we don't need it anymore
459  delete f_pt;
460 
461  // Make it a null pointer
462  f_pt = 0;
463 
464  // Remember that the preconditioner has been setup so the stored
465  // information can be wiped when we come here next...
467 
468  // If we're meant to build silently, reassign the oomph stream pointer
469  if (this->Silent_preconditioner_setup == true)
470  {
471  // Store the output stream pointer
472  oomph_info.stream_pt() = this->Stream_pt;
473 
474  // Reset our own stream pointer
475  this->Stream_pt = 0;
476  }
477  } // End of setup
int i
Definition: BiCGSTAB_step_by_step.cpp:9
void get_block(const unsigned &i, const unsigned &j, CRDoubleMatrix &output_matrix, const bool &ignore_replacement_block=false) const
Definition: block_preconditioner.h:673
unsigned nblock_types() const
Return the number of block types.
Definition: block_preconditioner.h:1670
CRDoubleMatrix * matrix_pt() const
Definition: block_preconditioner.h:520
bool is_subsidiary_block_preconditioner() const
Definition: block_preconditioner.h:2061
unsigned ndof_types() const
Return the total number of DOF types.
Definition: block_preconditioner.h:1694
void setup_matrix_vector_product(MatrixVectorProduct *matvec_prod_pt, CRDoubleMatrix *block_pt, const Vector< unsigned > &block_col_indices)
Definition: block_preconditioner.h:2397
virtual void block_setup()
Definition: block_preconditioner.cc:2483
std::ostream *& stream_pt()
Access function for the stream pointer.
Definition: oomph_definitions.h:464
void setup(DoubleMatrixBase *matrix_pt)
Definition: preconditioner.h:94
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
void concatenate(const DenseMatrix< CRDoubleMatrix * > &matrix_pt, CRDoubleMatrix &result_matrix)
Definition: matrices.cc:4349
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
void set_defaults_for_2D_poisson_problem(HyprePreconditioner *hypre_preconditioner_pt)
Definition: hypre_solver.cc:45
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
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::BlockPreconditioner< CRDoubleMatrix >::block_setup(), clean_up_memory(), Compute_memory_statistics, oomph::CRDoubleMatrixHelpers::concatenate(), F_mat_vec_pt, F_preconditioner_pt, G_mat_vec_pt, oomph::BlockPreconditioner< CRDoubleMatrix >::get_block(), i, int(), oomph::BlockPreconditioner< CRDoubleMatrix >::is_subsidiary_block_preconditioner(), j, oomph::BlockPreconditioner< CRDoubleMatrix >::matrix_pt(), Memory_usage_in_bytes, oomph::CRDoubleMatrix::multiply(), oomph::BlockPreconditioner< CRDoubleMatrix >::nblock_types(), oomph::BlockPreconditioner< CRDoubleMatrix >::ndof_types(), oomph::CRDoubleMatrix::nnz(), oomph::CRDoubleMatrix::nrow(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, oomph::oomph_nullstream, P_preconditioner_pt, Preconditioner_has_been_setup, oomph::Hypre_default_settings::set_defaults_for_2D_poisson_problem(), oomph::Preconditioner::setup(), oomph::BlockPreconditioner< CRDoubleMatrix >::setup_matrix_vector_product(), oomph::Preconditioner::Silent_preconditioner_setup, oomph::CRDoubleMatrix::sparse_indexed_output_with_offset(), oomph::OomphInfo::stream_pt(), oomph::Preconditioner::Stream_pt, oomph::Global_string_for_annotation::string(), oomph::TimingHelpers::timer(), Using_default_f_preconditioner, and Using_default_p_preconditioner.

Referenced by oomph::GMRESBlockPreconditioner::setup().

◆ setup() [2/8]

void oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::setup ( )
virtual

Setup the preconditioner.

Implements oomph::Preconditioner.

◆ setup() [3/8]

virtual void oomph::Preconditioner::setup
virtual

For some reason we need to remind the compiler that there is also a function named setup in the base class.

Implements oomph::Preconditioner.

◆ setup() [4/8]

virtual void oomph::Preconditioner::setup
virtual

For some reason we need to remind the compiler that there is also a function named setup in the base class.

Implements oomph::Preconditioner.

◆ setup() [5/8]

void oomph::Preconditioner::setup
inlinevirtual

For some reason we need to remind the compiler that there is also a function named setup in the base class.

Implements oomph::Preconditioner.

121  {
123  setup(matrix_pt);
124  }
void setup()
Setup the preconditioner.
Definition: general_purpose_space_time_subsidiary_block_preconditioner.cc:61
void obsolete()
Output warning message.
Definition: oomph_utilities.cc:1102

◆ setup() [6/8]

void oomph::Preconditioner::setup
inlinevirtual

For some reason we need to remind the compiler that there is also a function named setup in the base class.

Implements oomph::Preconditioner.

121  {
123  setup(matrix_pt);
124  }

◆ setup() [7/8]

void oomph::Preconditioner::setup
inlinevirtual

For some reason we need to remind the compiler that there is also a function named setup in the base class.

Implements oomph::Preconditioner.

95  {
96  // Store matrix pointer
98 
99  // Extract and store communicator pointer
100  DistributableLinearAlgebraObject* dist_obj_pt =
102  if (dist_obj_pt != 0)
103  {
104  set_comm_pt(dist_obj_pt->distribution_pt()->communicator_pt());
105  }
106  else
107  {
108  set_comm_pt(0);
109  }
110 
111  double setup_time_start = TimingHelpers::timer();
112  setup();
113  double setup_time_finish = TimingHelpers::timer();
114  Setup_time = setup_time_finish - setup_time_start;
115  }
DistributableLinearAlgebraObject()
Default constructor - create a distribution.
Definition: linear_algebra_distribution.h:438
double Setup_time
The time it takes to set up this preconditioner.
Definition: preconditioner.h:243
virtual void set_comm_pt(const OomphCommunicator *const comm_pt)
Set the communicator pointer.
Definition: preconditioner.h:193
virtual void set_matrix_pt(DoubleMatrixBase *matrix_pt)
Set the matrix pointer.
Definition: preconditioner.h:165

◆ setup() [8/8]

void oomph::Preconditioner::setup
inlinevirtual

For some reason we need to remind the compiler that there is also a function named setup in the base class.

Implements oomph::Preconditioner.

95  {
96  // Store matrix pointer
98 
99  // Extract and store communicator pointer
100  DistributableLinearAlgebraObject* dist_obj_pt =
102  if (dist_obj_pt != 0)
103  {
104  set_comm_pt(dist_obj_pt->distribution_pt()->communicator_pt());
105  }
106  else
107  {
108  set_comm_pt(0);
109  }
110 
111  double setup_time_start = TimingHelpers::timer();
112  setup();
113  double setup_time_finish = TimingHelpers::timer();
114  Setup_time = setup_time_finish - setup_time_start;
115  }

Member Data Documentation

◆ Compute_memory_statistics

bool oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::Compute_memory_statistics
private

Flag to indicate whether or not to record the memory statistics this preconditioner

Referenced by disable_doc_memory_usage(), enable_doc_memory_usage(), get_memory_usage_in_bytes(), setup(), and SpaceTimeNavierStokesSubsidiaryPreconditioner().

◆ F_mat_vec_pt

MatrixVectorProduct * oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::F_mat_vec_pt
private

MatrixVectorProduct operator for F.

Referenced by clean_up_memory(), preconditioner_solve(), setup(), and SpaceTimeNavierStokesSubsidiaryPreconditioner().

◆ F_preconditioner_pt

Preconditioner * oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::F_preconditioner_pt
private

Pointer to the 'preconditioner' for the F matrix.

Referenced by clean_up_memory(), preconditioner_solve(), setup(), and SpaceTimeNavierStokesSubsidiaryPreconditioner().

◆ G_mat_vec_pt

MatrixVectorProduct * oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::G_mat_vec_pt
private

MatrixVectorProduct operator for G.

Referenced by clean_up_memory(), preconditioner_solve(), setup(), and SpaceTimeNavierStokesSubsidiaryPreconditioner().

◆ Memory_usage_in_bytes

double oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::Memory_usage_in_bytes
private

Storage for the memory usage of the solver if the flag above is set to true (in bytes)

Referenced by get_memory_usage_in_bytes(), setup(), and SpaceTimeNavierStokesSubsidiaryPreconditioner().

◆ P_preconditioner_pt

Preconditioner * oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::P_preconditioner_pt
private

Pointer to the 'preconditioner' for the pressure matrix.

Referenced by clean_up_memory(), preconditioner_solve(), setup(), and SpaceTimeNavierStokesSubsidiaryPreconditioner().

◆ Preconditioner_has_been_setup

bool oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::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 clean_up_memory(), get_memory_usage_in_bytes(), setup(), and SpaceTimeNavierStokesSubsidiaryPreconditioner().

◆ Using_default_f_preconditioner

bool oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::Using_default_f_preconditioner
private

Flag indicating whether the default F preconditioner is used.

Referenced by clean_up_memory(), setup(), and SpaceTimeNavierStokesSubsidiaryPreconditioner().

◆ Using_default_p_preconditioner

bool oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::Using_default_p_preconditioner
private

Flag indicating whether the default P preconditioner is used.

Referenced by clean_up_memory(), setup(), and SpaceTimeNavierStokesSubsidiaryPreconditioner().


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