IBAMR  IBAMR version 0.20.
Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
IBTK::CartGridPointwiseFunction< Value, Data, Function > Class Template Reference

Initialize or transform Cartesian patch-interior values with a functor. More...

#include <ibtk/CartGridPointwiseFunction.h>

Inheritance diagram for IBTK::CartGridPointwiseFunction< Value, Data, Function >:
Inheritance graph
[legend]

Classes

struct  Centering
 
struct  Values
 

Public Member Functions

 CartGridPointwiseFunction (std::string object_name, Function function)
 Construct a scalar or vector function, owning the supplied functor. More...
 
 CartGridPointwiseFunction (std::string object_name, Function function, TensorStorage storage)
 Construct a MatrixNd function with explicit tensor storage. More...
 
bool isTimeDependent () const override
 Conservatively report that the supplied function depends on time. More...
 
void setDataOnPatch (int data_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM >> var, SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM >> patch, double data_time, bool initial_time=false, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM >> patch_level=nullptr) override
 Apply the callback to the allocated double-precision patch data. More...
 

Private Member Functions

void applyPointwise (Data &data, const SAMRAI::hier::Box< NDIM > &box, const SAMRAI::geom::CartesianPatchGeometry< NDIM > &geometry, double time)
 Evaluate the callback on patch-interior data of the selected centering. More...
 

Private Attributes

Function d_function
 
TensorStorage d_tensor_storage
 

Static Private Attributes

static constexpr bool s_initializes = std::is_invocable_r_v<Value, Function&, const VectorNd&, double, int, int>
 
static constexpr bool s_transforms
 

Methods to set patch interior data.

virtual void setDataOnPatchHierarchy (int data_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM >> var, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM >> hierarchy, double data_time, bool initial_time=false, int coarsest_ln=invalid_level_number, int finest_ln=invalid_level_number)
 Evaluate the function on the patch interiors on the specified levels of the patch hierarchy using the virtual function setDataOnPatch(). More...
 
virtual void setDataOnPatchLevel (int data_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM >> var, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM >> patch_level, double data_time, bool initial_time=false)
 Evaluate the function on the patch interiors on the specified level of the patch hierarchy using the virtual function setDataOnPatch(). More...
 
std::string d_object_name
 

Detailed Description

template<typename Value, typename Data, typename Function>
class IBTK::CartGridPointwiseFunction< Value, Data, Function >

Data must be CellData, NodeData, SideData, FaceData, or EdgeData of doubles. Value must be double, VectorNd, VectorXd, or MatrixNd: a double callback is evaluated for every depth, VectorNd requires depth NDIM, VectorXd uses the complete depth vector, and MatrixNd requires a TensorStorage and the corresponding depth.

Function must support exactly one of these signatures:

Value(const VectorNd& x, double time, int depth, int axis);
Value(const Value& q, const VectorNd& x, double time, int depth, int axis);
Eigen::Matrix< double, NDIM, 1 > VectorNd
Definition: ibtk_utilities.h:300

The first initializes data; the second transforms initialized data in place. depth is the scalar depth index, or zero for vector and tensor callbacks. axis is the orientation for side-, face-, and edge-centered data, or invalid_index for cell- and node-centered data.

Ghost values are neither read nor modified, and values shared between patches are evaluated on each patch that holds them.

See also
make_cart_grid_pointwise_function()

Constructor & Destructor Documentation

◆ CartGridPointwiseFunction() [1/2]

template<typename Value , typename Data , typename Function >
IBTK::CartGridPointwiseFunction< Value, Data, Function >::CartGridPointwiseFunction ( std::string  object_name,
Function  function 
)

◆ CartGridPointwiseFunction() [2/2]

template<typename Value , typename Data , typename Function >
IBTK::CartGridPointwiseFunction< Value, Data, Function >::CartGridPointwiseFunction ( std::string  object_name,
Function  function,
TensorStorage  storage 
)

Member Function Documentation

◆ isTimeDependent()

template<typename Value , typename Data , typename Function >
bool IBTK::CartGridPointwiseFunction< Value, Data, Function >::isTimeDependent
overridevirtual

◆ setDataOnPatch()

template<typename Value , typename Data , typename Function >
void IBTK::CartGridPointwiseFunction< Value, Data, Function >::setDataOnPatch ( int  data_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM >>  var,
SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM >>  patch,
double  data_time,
bool  initial_time = false,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM >>  patch_level = nullptr 
)
overridevirtual

◆ applyPointwise()

template<typename Value , typename Data , typename Function >
void IBTK::CartGridPointwiseFunction< Value, Data, Function >::applyPointwise ( Data &  data,
const SAMRAI::hier::Box< NDIM > &  box,
const SAMRAI::geom::CartesianPatchGeometry< NDIM > &  geometry,
double  time 
)
private

◆ setDataOnPatchHierarchy()

virtual void IBTK::CartGridFunction::setDataOnPatchHierarchy ( int  data_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM >>  var,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM >>  hierarchy,
double  data_time,
bool  initial_time = false,
int  coarsest_ln = invalid_level_number,
int  finest_ln = invalid_level_number 
)
virtualinherited

◆ setDataOnPatchLevel()

virtual void IBTK::CartGridFunction::setDataOnPatchLevel ( int  data_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM >>  var,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM >>  patch_level,
double  data_time,
bool  initial_time = false 
)
virtualinherited

Member Data Documentation

◆ s_initializes

template<typename Value , typename Data , typename Function >
constexpr bool IBTK::CartGridPointwiseFunction< Value, Data, Function >::s_initializes = std::is_invocable_r_v<Value, Function&, const VectorNd&, double, int, int>
staticconstexprprivate

◆ s_transforms

template<typename Value , typename Data , typename Function >
constexpr bool IBTK::CartGridPointwiseFunction< Value, Data, Function >::s_transforms
staticconstexprprivate
Initial value:
=
std::is_invocable_r_v<Value, Function&, const Value&, const VectorNd&, double, int, int>

◆ d_function

template<typename Value , typename Data , typename Function >
Function IBTK::CartGridPointwiseFunction< Value, Data, Function >::d_function
private

◆ d_tensor_storage

template<typename Value , typename Data , typename Function >
TensorStorage IBTK::CartGridPointwiseFunction< Value, Data, Function >::d_tensor_storage
private

◆ d_object_name

std::string IBTK::CartGridFunction::d_object_name
protectedinherited

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