IBAMR
An adaptive and distributed-memory parallel implementation of the immersed boundary (IB) method
Public Member Functions | List of all members
IBAMR::CFUpperConvectiveOperator Class Reference

Class CFUpperConvectiveOperator is a concrete ConvectiveOperator that implements the upper convective derivative. This uses second order finite differences to compute the velocity gradients. The transport component can be chosen from any current convective operators. If the advected quantity allows for a square root or logarithmic decomposition, this class can advect the symmetric square root or logarithm of the tensor. Note that this class requires the registration of a source funtion before it can be applied. More...

#include </home/runner/work/IBAMR/IBAMR/include/ibamr/CFUpperConvectiveOperator.h>

Inheritance diagram for IBAMR::CFUpperConvectiveOperator:
Inheritance graph
[legend]

Public Member Functions

 CFUpperConvectiveOperator (const std::string &object_name, SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > Q_var, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db, const std::string &convective_op_type, ConvectiveDifferencingType difference_type, const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > &Q_bc_coefs, const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > &u_bc_coefs)
 
 CFUpperConvectiveOperator (const CFUpperConvectiveOperator &from)=delete
 
CFUpperConvectiveOperatoroperator= (const CFUpperConvectiveOperator &that)=delete
 
void applyConvectiveOperator (int Q_idx, int Y_idx) override
 Compute N = u * grad Q.
 
void initializeOperatorState (const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &in, const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &out) override
 Compute hierarchy dependent data required for computing y=F[x] and z=F[x]+y. More...
 
void deallocateOperatorState () override
 Remove all hierarchy dependent data allocated by initializeOperatorState(). More...
 
void registerCFStrategy (SAMRAI::tbox::Pointer< IBAMR::CFStrategy > cf_strategy)
 : Registers a source function with the convective operator. Note that this source function is given the evolved version of the tensor, and therefore must first be converted from the square root or logarithm to the tensor.
 
- Public Member Functions inherited from IBAMR::ConvectiveOperator
 ConvectiveOperator (std::string object_name, ConvectiveDifferencingType difference_form)
 Class constructor.
 
 ~ConvectiveOperator ()
 Destructor.
 
void setAdvectionVelocity (int u_idx)
 Set the patch data index corresponding to the advection velocity to be used when computing the convective derivative.
 
int getAdvectionVelocity () const
 Get the patch data index corresponding to the advection velocity used when computing the convective derivative.
 
void setConvectiveDifferencingType (ConvectiveDifferencingType difference_form)
 Set the convective differencing form to be used by the operator.
 
ConvectiveDifferencingType getConvectiveDifferencingType () const
 Get the convective differencing form used by the operator.
 
void apply (SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &x, SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &y) override
 Compute $y=F[x]$. More...
 
- Public Member Functions inherited from IBTK::GeneralOperator
 GeneralOperator (std::string object_name, bool homogeneous_bc=false)
 Constructor.
 
virtual ~GeneralOperator ()
 Empty virtual destructor.
 
const std::stringgetName () const
 Return the object name.
 
virtual bool getIsInitialized () const
 Return whether the operator is initialized.
 
virtual void setHomogeneousBc (bool homogeneous_bc)
 Set whether the operator should use homogeneous boundary conditions.
 
virtual bool getHomogeneousBc () const
 Return whether the operator is using homogeneous boundary conditions.
 
virtual void setSolutionTime (double solution_time)
 Set the time at which the solution is to be evaluated.
 
virtual double getSolutionTime () const
 Get the time at which the solution is being evaluated.
 
virtual void setTimeInterval (double current_time, double new_time)
 Set the current time interval.
 
virtual std::pair< double, double > getTimeInterval () const
 Get the current time interval.
 
virtual double getDt () const
 Get the current time step size.
 
virtual void setHierarchyMathOps (SAMRAI::tbox::Pointer< HierarchyMathOps > hier_math_ops)
 Set the HierarchyMathOps object used by the operator.
 
virtual SAMRAI::tbox::Pointer< HierarchyMathOpsgetHierarchyMathOps () const
 Get the HierarchyMathOps object used by the operator.
 
virtual void applyAdd (SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &x, SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &y, SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &z)
 Compute $z=F[x]+y$. More...
 
virtual void modifyRhsForBcs (SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &y)
 Modify the RHS vector to account for boundary conditions. More...
 
virtual void imposeSolBcs (SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &u)
 Impose boudary conditions in the solution vector. More...
 
virtual void setLoggingEnabled (bool enable_logging=true)
 Enable or disable logging.
 
virtual bool getLoggingEnabled () const
 Determine whether logging is enabled or disabled.
 
virtual void printClassData (std::ostream &stream)
 Print class data to stream.
 

Additional Inherited Members

- Protected Attributes inherited from IBAMR::ConvectiveOperator
ConvectiveDifferencingType d_difference_form
 
int d_u_idx = IBTK::invalid_index
 
- Protected Attributes inherited from IBTK::GeneralOperator
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()
 
SAMRAI::tbox::Pointer< HierarchyMathOpsd_hier_math_ops
 
bool d_hier_math_ops_external = false
 
bool d_enable_logging = false
 

Detailed Description

Class CFUpperConvectiveOperator is a concrete ConvectiveOperator that implements the upper convective derivative. This uses second order finite differences to compute the velocity gradients. The transport component can be chosen from any current convective operators. If the advected quantity allows for a square root or logarithmic decomposition, this class can advect the symmetric square root or logarithm of the tensor. Note that this class requires the registration of a source funtion before it can be applied.

Member Function Documentation

◆ deallocateOperatorState()

void IBAMR::CFUpperConvectiveOperator::deallocateOperatorState ( )
overridevirtual

Remove all hierarchy dependent data allocated by initializeOperatorState().

Note
Subclasses are required to be implemented so that it is safe to call deallocateOperatorState() when the operator state is already deallocated.
See also
initializeOperatorState

Reimplemented from IBTK::GeneralOperator.

◆ initializeOperatorState()

void IBAMR::CFUpperConvectiveOperator::initializeOperatorState ( const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  in,
const SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &  out 
)
overridevirtual

Compute hierarchy dependent data required for computing y=F[x] and z=F[x]+y.

The vector arguments for apply(), applyAdd(), etc, need not match those for initializeOperatorState(). However, there must be a certain degree of similarity, including

  • hierarchy configuration (hierarchy pointer and level range)
  • number, type and alignment of vector component data
  • ghost cell widths of data in the input and output vectors
Note
It is generally necessary to reinitialize the operator state when the hierarchy configuration changes.

It is safe to call initializeOperatorState() when the state is already initialized. In this case, the operator state is first deallocated and then reinitialized.

Conditions on arguments:

  • input and output vectors must have same hierarchy
  • input and output vectors must have same structure, depth, etc.

Call deallocateOperatorState() to remove any data allocated by this method.

See also
deallocateOperatorState
Parameters
ininput vector
outoutput vector

Reimplemented from IBTK::GeneralOperator.


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