IBAMR  IBAMR version 0.19.
Public Member Functions | List of all members
IBTK::FACPreconditionerStrategy Class Referenceabstract

Class FACPreconditionerStrategy provides an interface for specifying the problem-specific operations needed to implement a specific FAC preconditioner. More...

#include <ibtk/FACPreconditionerStrategy.h>

Inheritance diagram for IBTK::FACPreconditionerStrategy:
Inheritance graph
[legend]

Public Member Functions

 FACPreconditionerStrategy (std::string object_name, bool homogeneous_bc=false)
 Constructor. More...
 
virtual ~FACPreconditionerStrategy ()=default
 Empty virtual desctructor. More...
 
const std::string & getName () const
 Return the object name. More...
 
virtual bool getIsInitialized () const
 Return whether the operator is initialized. More...
 
virtual void setFACPreconditioner (SAMRAI::tbox::ConstPointer< FACPreconditioner > preconditioner)
 Method to allow the FACPreconditioner object to register itself with the concrete FACPreconditionerStrategy. More...
 
virtual void setHomogeneousBc (bool homogeneous_bc)
 Set whether the solver should use homogeneous boundary conditions. More...
 
virtual bool getHomogeneousBc () const
 Return whether the solver is using homogeneous boundary conditions. More...
 
virtual void setSolutionTime (double solution_time)
 Set the time at which the solution is to be evaluated. More...
 
virtual double getSolutionTime () const
 Get the time at which the solution is being evaluated. More...
 
virtual void setTimeInterval (double current_time, double new_time)
 Set the current time interval. More...
 
virtual std::pair< double, doublegetTimeInterval () const
 Get the current time interval. More...
 
virtual double getDt () const
 Get the current time step size. More...
 
virtual void setToZero (SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &error, int level_num)=0
 Zero-out the provided vector on the specified level of the patch hierarchy. More...
 
virtual void restrictResidual (const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &source, SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &dest, int dest_level_num)=0
 Restrict the residual from the source vector to the destination vector on the specified level of the patch hierarchy. More...
 
virtual void prolongError (const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &source, SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &dest, int dest_level_num)=0
 Prolong the error from the source vector to the destination vector on the specified level of the patch hierarchy. More...
 
virtual void prolongErrorAndCorrect (const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &source, SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &dest, int dest_level_num)=0
 Prolong the error from the source vector to the destination vector on the specified level of the patch hierarchy and correct the fine-grid error. More...
 
virtual void smoothError (SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &error, const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &residual, int level_num, int num_sweeps, bool performing_pre_sweeps, bool performing_post_sweeps)=0
 Smooth the error by the specified number of sweeps on the specified level of the patch hierarchy. More...
 
virtual bool solveCoarsestLevel (SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &error, const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &residual, int coarsest_level_num)=0
 Solve the system of equations on the coarsest level of the patch hierarchy. More...
 
virtual void computeResidual (SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &residual, const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &solution, const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &rhs, int coarsest_level_num, int finest_level_num)=0
 Compute the composite-grid residual on the specified range of levels of the patch hierarchy. More...
 
virtual void initializeOperatorState (const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &solution, const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &rhs)
 Initialize any hierarchy-dependent data. More...
 
virtual void deallocateOperatorState ()
 Deallocate any hierarchy-dependent data initialized by initializeOperatorState(). More...
 
virtual void allocateScratchData ()
 Allocate scratch data. More...
 
virtual void deallocateScratchData ()
 Deallocate scratch data. More...
 

Logging functions.

SAMRAI::tbox::ConstPointer< IBTK::FACPreconditionerd_preconditioner
 
const std::string d_object_name
 
bool d_is_initialized = false
 
bool d_homogeneous_bc
 
double d_solution_time = std::numeric_limits<double>::quiet_NaN()
 
double d_current_time = std::numeric_limits<double>::quiet_NaN()
 
double d_new_time = std::numeric_limits<double>::quiet_NaN()
 
virtual void printClassData (std::ostream &stream)
 Print class data to stream. More...
 
virtual SAMRAI::tbox::Pointer< SAMRAI::solv::SAMRAIVectorReal< NDIM, double > > getLevelSAMRAIVectorReal (const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &vec, int level_num) const
 Return a SAMRAIVectorReal object that corresponds to the given object but restricted to a single level of the patch hierarchy. More...
 
 FACPreconditionerStrategy ()=delete
 Default constructor. More...
 
 FACPreconditionerStrategy (const FACPreconditionerStrategy &from)=delete
 Copy constructor. More...
 
FACPreconditionerStrategyoperator= (const FACPreconditionerStrategy &that)=delete
 Assignment operator. More...
 

Detailed Description

This class is similar to the SAMRAI class SAMRAI::solv::FACOperatorStrategy, except that certain methods required by the SAMRAI::solv::FACOperatorStrategy interface have been modified (specifically, smoothError()) or removed (specifically, restrictSolution() and postprocessOneCycle()). This interface also requires the implementation of a method, prolongError(), that is optimized for the case in which the FAC preconditioner algorithm is configured not to use pre-smoothing sweeps.

See also
FACPreconditioner

Constructor & Destructor Documentation

◆ FACPreconditionerStrategy() [1/3]

IBTK::FACPreconditionerStrategy::FACPreconditionerStrategy ( std::string  object_name,
bool  homogeneous_bc = false 
)

◆ ~FACPreconditionerStrategy()

virtual IBTK::FACPreconditionerStrategy::~FACPreconditionerStrategy ( )
virtualdefault

◆ FACPreconditionerStrategy() [2/3]

IBTK::FACPreconditionerStrategy::FACPreconditionerStrategy ( )
privatedelete
Note
This constructor is not implemented and should not be used.

◆ FACPreconditionerStrategy() [3/3]

IBTK::FACPreconditionerStrategy::FACPreconditionerStrategy ( const FACPreconditionerStrategy from)
privatedelete
Note
This constructor is not implemented and should not be used.
Parameters
fromThe value to copy to this object.

Member Function Documentation

◆ getName()

const std::string& IBTK::FACPreconditionerStrategy::getName ( ) const

◆ getIsInitialized()

virtual bool IBTK::FACPreconditionerStrategy::getIsInitialized ( ) const
virtual

◆ setFACPreconditioner()

virtual void IBTK::FACPreconditionerStrategy::setFACPreconditioner ( SAMRAI::tbox::ConstPointer< FACPreconditioner preconditioner)
virtual

◆ setHomogeneousBc()

virtual void IBTK::FACPreconditionerStrategy::setHomogeneousBc ( bool  homogeneous_bc)
virtual

◆ getHomogeneousBc()

virtual bool IBTK::FACPreconditionerStrategy::getHomogeneousBc ( ) const
virtual

◆ setSolutionTime()

virtual void IBTK::FACPreconditionerStrategy::setSolutionTime ( double  solution_time)
virtual

◆ getSolutionTime()

virtual double IBTK::FACPreconditionerStrategy::getSolutionTime ( ) const
virtual

◆ setTimeInterval()

virtual void IBTK::FACPreconditionerStrategy::setTimeInterval ( double  current_time,
double  new_time 
)
virtual

◆ getTimeInterval()

virtual std::pair<double, double> IBTK::FACPreconditionerStrategy::getTimeInterval ( ) const
virtual

◆ getDt()

virtual double IBTK::FACPreconditionerStrategy::getDt ( ) const
virtual

◆ setToZero()

virtual void IBTK::FACPreconditionerStrategy::setToZero ( SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  error,
int  level_num 
)
pure virtual

◆ restrictResidual()

virtual void IBTK::FACPreconditionerStrategy::restrictResidual ( const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  source,
SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  dest,
int  dest_level_num 
)
pure virtual
Note
Implementations must support the case in which source and dest are the same vector.

Implemented in IBAMR::StaggeredStokesFACPreconditionerStrategy, IBTK::PoissonFACPreconditionerStrategy, and IBTK::VCSCViscousOpPointRelaxationFACOperator.

◆ prolongError()

virtual void IBTK::FACPreconditionerStrategy::prolongError ( const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  source,
SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  dest,
int  dest_level_num 
)
pure virtual
Note
Implementations must support the case in which source and dest are the same vector.

Implemented in IBAMR::StaggeredStokesFACPreconditionerStrategy, and IBTK::PoissonFACPreconditionerStrategy.

◆ prolongErrorAndCorrect()

virtual void IBTK::FACPreconditionerStrategy::prolongErrorAndCorrect ( const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  source,
SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  dest,
int  dest_level_num 
)
pure virtual
Note
Implementations must support the case in which source and dest are the same vector.

Implemented in IBAMR::StaggeredStokesFACPreconditionerStrategy, and IBTK::PoissonFACPreconditionerStrategy.

◆ smoothError()

virtual void IBTK::FACPreconditionerStrategy::smoothError ( SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  error,
const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  residual,
int  level_num,
int  num_sweeps,
bool  performing_pre_sweeps,
bool  performing_post_sweeps 
)
pure virtual

◆ solveCoarsestLevel()

virtual bool IBTK::FACPreconditionerStrategy::solveCoarsestLevel ( SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  error,
const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  residual,
int  coarsest_level_num 
)
pure virtual

◆ computeResidual()

virtual void IBTK::FACPreconditionerStrategy::computeResidual ( SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  residual,
const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  solution,
const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  rhs,
int  coarsest_level_num,
int  finest_level_num 
)
pure virtual

◆ initializeOperatorState()

virtual void IBTK::FACPreconditionerStrategy::initializeOperatorState ( const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  solution,
const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  rhs 
)
virtual

◆ deallocateOperatorState()

virtual void IBTK::FACPreconditionerStrategy::deallocateOperatorState ( )
virtual

◆ allocateScratchData()

virtual void IBTK::FACPreconditionerStrategy::allocateScratchData ( )
virtual

◆ deallocateScratchData()

virtual void IBTK::FACPreconditionerStrategy::deallocateScratchData ( )
virtual

◆ printClassData()

virtual void IBTK::FACPreconditionerStrategy::printClassData ( std::ostream &  stream)
virtual

◆ getLevelSAMRAIVectorReal()

virtual SAMRAI::tbox::Pointer<SAMRAI::solv::SAMRAIVectorReal<NDIM, double> > IBTK::FACPreconditionerStrategy::getLevelSAMRAIVectorReal ( const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  vec,
int  level_num 
) const
protectedvirtual

◆ operator=()

FACPreconditionerStrategy& IBTK::FACPreconditionerStrategy::operator= ( const FACPreconditionerStrategy that)
privatedelete
Note
This operator is not implemented and should not be used.
Parameters
thatThe value to assign to this object.
Returns
A reference to this object.

Member Data Documentation

◆ d_preconditioner

SAMRAI::tbox::ConstPointer<IBTK::FACPreconditioner> IBTK::FACPreconditionerStrategy::d_preconditioner
protected

◆ d_object_name

const std::string IBTK::FACPreconditionerStrategy::d_object_name
protected

◆ d_is_initialized

bool IBTK::FACPreconditionerStrategy::d_is_initialized = false
protected

◆ d_homogeneous_bc

bool IBTK::FACPreconditionerStrategy::d_homogeneous_bc
protected

◆ d_solution_time

double IBTK::FACPreconditionerStrategy::d_solution_time = std::numeric_limits<double>::quiet_NaN()
protected

◆ d_current_time

double IBTK::FACPreconditionerStrategy::d_current_time = std::numeric_limits<double>::quiet_NaN()
protected

◆ d_new_time

double IBTK::FACPreconditionerStrategy::d_new_time = std::numeric_limits<double>::quiet_NaN()
protected

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