IBAMR  IBAMR version 0.19.
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SAMRAI::appu::CutCell< DIM > Class Template Reference

The CutCell struct holds data and methods to define a cut-cell on an irregular boundary.
More...

#include <CutCell.h>

Public Member Functions

 CutCell ()
 
 CutCell (const pdat::CellIndex< DIM > &cut_cell)
 
 CutCell (const appu::CutCell< DIM > &cut_cell)
 
CutCellcopy (const appu::CutCell< DIM > &cut_cell)
 
 ~CutCell ()
 
pdat::CellIndex< DIM > getIndex () const
 
double getVolume () const
 
const doublegetArea () const
 
double getArea (const int i) const
 
const doublegetNormal () const
 
double getNormal (const int i) const
 
double getFrontArea () const
 
const doublegetFrontCentroid () const
 
double getFrontCentroid (const int i) const
 
double getSurrVolume () const
 
double getNewBase (const int i, const int j) const
 
int getNumberOfBoundaryNodes () const
 
BoundaryNode< DIM > getBoundaryNode (const int i) const
 
double getFluxFront (const int m) const
 
void setVolume (const double volume)
 
void setArea (const double area, const int i)
 
void setNormal (const double normal, const int i)
 
void setNormal (const double *normal)
 
void setSurrVolume (const double surrvol)
 
void setFrontArea (const double area)
 
void setFrontCentroid (const double centroid, const int i)
 
void setSplit ()
 
void setNewBase (const double base, const int i, const int j)
 
void setNewBase (const double *base)
 
void setNewBase ()
 
void setFluxFront (const int m, const double front)
 
void setBoundaryNode (const BoundaryNode< DIM > &node)
 
void setBoundaryNode (const BoundaryNode< DIM > &node, const int i)
 
void setBoundaryNode (const pdat::NodeIndex< DIM > &node)
 
void printVolumeAndAreas (std::ostream &os) const
 
void printNormal (std::ostream &os) const
 
void printBoundaryNodes (std::ostream &os) const
 
void printAll (std::ostream &os) const
 
void copySourceItem (hier::Index< DIM > &index, const hier::IntVector< DIM > &src_offset, appu::CutCell< DIM > &src_item)
 
size_t getDataStreamSize ()
 
void packStream (tbox::AbstractStream &stream)
 
void unpackStream (tbox::AbstractStream &stream, const hier::IntVector< DIM > &offset)
 
void getFromDatabase (tbox::Pointer< tbox::Database > &database)
 
void putToDatabase (tbox::Pointer< tbox::Database > &database)
 

Static Public Member Functions

static void enableBoundaryNodeStorage ()
 
static bool boundaryNodesEnabled ()
 

Private Member Functions

void initializeCutCellData ()
 
void copyCutCellData (const appu::CutCell< DIM > &cut_cell)
 

Private Attributes

pdat::CellIndex< DIM > d_index
 
double d_vol_fraction
 
double d_area_fraction [2 *DIM]
 
double d_normal [DIM]
 
double d_front_area
 
double d_front_centroid [DIM]
 
bool d_is_split
 
double d_surr_vol
 
double d_newbase [DIM][DIM]
 
int d_num_boundary_nodes
 
tbox::Array< appu::BoundaryNode< DIM > > d_boundary_nodes
 
double d_flux_front [2+DIM]
 

Static Private Attributes

static bool s_enable_boundary_node_storage
 

Detailed Description

template<int DIM>
class SAMRAI::appu::CutCell< DIM >

Information maintained by the struct includes the following:

- INDEX                 - index (i,j,k) of the cell
- VOL FRACTION          - volume fraction of the cell
- AREA FRACTION[2*DIM]  - areas of the faces of the cell
- NORMAL[DIM]           - normal to the cut plane through the cell
- FRONT AREA            - area of exposed plane cutting the cell
- SURROUNDING VOL       - volume of cells surrounding the cut cell
- NEW BASE              - a basis aligned with the cell cut face
- BOUNDARY NODE[DIM**2] - nodes on the corners of the cut cell, which
                          contain information for immersed boundary
                          calculations

Constructor & Destructor Documentation

◆ CutCell() [1/3]

template<int DIM>
SAMRAI::appu::CutCell< DIM >::CutCell ( )

Create a new `‘empty’' CutCell.

◆ CutCell() [2/3]

template<int DIM>
SAMRAI::appu::CutCell< DIM >::CutCell ( const pdat::CellIndex< DIM > &  cut_cell)

Create a new cut cell with specified cell index.

◆ CutCell() [3/3]

template<int DIM>
SAMRAI::appu::CutCell< DIM >::CutCell ( const appu::CutCell< DIM > &  cut_cell)

The copy constructor copies the data of the argument cell.

◆ ~CutCell()

template<int DIM>
SAMRAI::appu::CutCell< DIM >::~CutCell ( )

The destructor for CutCell.

Member Function Documentation

◆ enableBoundaryNodeStorage()

template<int DIM>
static void SAMRAI::appu::CutCell< DIM >::enableBoundaryNodeStorage ( )
static

Static function to set whether storage will be allocated for boundary node information.

◆ boundaryNodesEnabled()

template<int DIM>
static bool SAMRAI::appu::CutCell< DIM >::boundaryNodesEnabled ( )
static

Static function that returns whether storage is allocated for boundary node information.

◆ copy()

template<int DIM>
CutCell& SAMRAI::appu::CutCell< DIM >::copy ( const appu::CutCell< DIM > &  cut_cell)

The assignment operator copies the data of the argument cell.

◆ getIndex()

template<int DIM>
pdat::CellIndex<DIM> SAMRAI::appu::CutCell< DIM >::getIndex ( ) const

Returns the index (i,j,k) of the cell.

◆ getVolume()

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::getVolume ( ) const

Returns the volume fraction of cell.

◆ getArea() [1/2]

template<int DIM>
const double* SAMRAI::appu::CutCell< DIM >::getArea ( ) const

Returns the area fraction of the cell (dimension 2*DIM) 0,1 - Xlower,Xupper 2,3 - Ylower,Yupper 4,5 - Zlower,Zupper

◆ getArea() [2/2]

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::getArea ( const int  i) const

Returns the area fraction of the cell for face i i = 0,1 - Xlower,Xupper i = 2,3 - Ylower,Yupper i = 4,5 - Zlower,Zupper

◆ getNormal() [1/2]

template<int DIM>
const double* SAMRAI::appu::CutCell< DIM >::getNormal ( ) const

Returns the normal vector (dimension DIM).

◆ getNormal() [2/2]

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::getNormal ( const int  i) const

Returns the ith component of the normal vector.

◆ getFrontArea()

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::getFrontArea ( ) const

Returns the frontal area of exposed cut surface.

◆ getFrontCentroid() [1/2]

template<int DIM>
const double* SAMRAI::appu::CutCell< DIM >::getFrontCentroid ( ) const

Returns the front centroid vector (dimension DIM).

◆ getFrontCentroid() [2/2]

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::getFrontCentroid ( const int  i) const

Returns the front centroid location for direction i.

◆ getSurrVolume()

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::getSurrVolume ( ) const

Returns the volume of the cells surrounding the cut cell.

◆ getNewBase()

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::getNewBase ( const int  i,
const int  j 
) const

Returns the new base with components (i,j).

◆ getNumberOfBoundaryNodes()

template<int DIM>
int SAMRAI::appu::CutCell< DIM >::getNumberOfBoundaryNodes ( ) const

Return number of boundary nodes.

◆ getBoundaryNode()

template<int DIM>
BoundaryNode<DIM> SAMRAI::appu::CutCell< DIM >::getBoundaryNode ( const int  i) const

Return boundary node class for location i.

◆ getFluxFront()

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::getFluxFront ( const int  m) const

TO BE REMOVED (eventually)

◆ setVolume()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::setVolume ( const double  volume)

Sets the volume fraction of cell.

◆ setArea()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::setArea ( const double  area,
const int  i 
)

Sets the area fraction of the cell for face i i = 0,1 - Xlower,Xupper i = 2,3 - Ylower,Yupper i = 4,5 - Zlower,Zupper

◆ setNormal() [1/2]

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::setNormal ( const double  normal,
const int  i 
)

Sets the normal vector for dimension i.

◆ setNormal() [2/2]

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::setNormal ( const double normal)

Sets the normal vector (dimension DIM).

◆ setSurrVolume()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::setSurrVolume ( const double  surrvol)

Sets the volume of the cells surrounding the cut cell.

◆ setFrontArea()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::setFrontArea ( const double  area)

Sets the front area.

◆ setFrontCentroid()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::setFrontCentroid ( const double  centroid,
const int  i 
)

Sets the front centroid location for direction i.

◆ setSplit()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::setSplit ( )

Set split cell.

◆ setNewBase() [1/3]

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::setNewBase ( const double  base,
const int  i,
const int  j 
)

Explicitly set the new base vector with components (i,j).

◆ setNewBase() [2/3]

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::setNewBase ( const double base)

Set new base vector using supplied "base" vector.

◆ setNewBase() [3/3]

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::setNewBase ( )

Set new base vector using cell's normal vector.

◆ setFluxFront()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::setFluxFront ( const int  m,
const double  front 
)

TO BE REMOVED (eventually)

◆ setBoundaryNode() [1/3]

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::setBoundaryNode ( const BoundaryNode< DIM > &  node)

Add the supplied boundary node to the array of boundary nodes maintained by this cut cell.

◆ setBoundaryNode() [2/3]

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::setBoundaryNode ( const BoundaryNode< DIM > &  node,
const int  i 
)

Overwrite index i of the boundary node array maintained by the cut cell with the supplied boundary node.

◆ setBoundaryNode() [3/3]

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::setBoundaryNode ( const pdat::NodeIndex< DIM > &  node)

Add the supplied index as an uninitialized boundary node.

◆ printVolumeAndAreas()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::printVolumeAndAreas ( std::ostream &  os) const

Print volume and area data for the cell.

◆ printNormal()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::printNormal ( std::ostream &  os) const

Print normal data for the cell.

◆ printBoundaryNodes()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::printBoundaryNodes ( std::ostream &  os) const

Print boundary nodes for the cell.

◆ printAll()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::printAll ( std::ostream &  os) const

Print all data in the struct.

◆ copySourceItem()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::copySourceItem ( hier::Index< DIM > &  index,
const hier::IntVector< DIM > &  src_offset,
appu::CutCell< DIM > &  src_item 
)

The copySourceItem() method allows CutCell to be a templated data type for IndexData - i.e. IndexData<DIM,CutCell<DIM>>. In addition to this method, the other methods that must be defined are getDataStreamSize(), packStream(), unpackStream() for communication, putToDatabase(), getFromDatabase for restart. These are described below.

◆ getDataStreamSize()

template<int DIM>
size_t SAMRAI::appu::CutCell< DIM >::getDataStreamSize ( )

The following functions enable parallel communication with CutCells. They are used in SAMRAI communication infrastructure to specify the number of bytes of data stored in each CutCell object, and to pack and unpack the data to the specified stream.

◆ packStream()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::packStream ( tbox::AbstractStream stream)

◆ unpackStream()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::unpackStream ( tbox::AbstractStream stream,
const hier::IntVector< DIM > &  offset 
)

◆ getFromDatabase()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::getFromDatabase ( tbox::Pointer< tbox::Database > &  database)

These functions are used to read/write CutCell data to/from restart.

◆ putToDatabase()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::putToDatabase ( tbox::Pointer< tbox::Database > &  database)

◆ initializeCutCellData()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::initializeCutCellData ( )
private

◆ copyCutCellData()

template<int DIM>
void SAMRAI::appu::CutCell< DIM >::copyCutCellData ( const appu::CutCell< DIM > &  cut_cell)
private

Member Data Documentation

◆ s_enable_boundary_node_storage

template<int DIM>
bool SAMRAI::appu::CutCell< DIM >::s_enable_boundary_node_storage
staticprivate

◆ d_index

template<int DIM>
pdat::CellIndex<DIM> SAMRAI::appu::CutCell< DIM >::d_index
private

◆ d_vol_fraction

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::d_vol_fraction
private

◆ d_area_fraction

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::d_area_fraction[2 *DIM]
private

◆ d_normal

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::d_normal[DIM]
private

◆ d_front_area

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::d_front_area
private

◆ d_front_centroid

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::d_front_centroid[DIM]
private

◆ d_is_split

template<int DIM>
bool SAMRAI::appu::CutCell< DIM >::d_is_split
private

◆ d_surr_vol

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::d_surr_vol
private

◆ d_newbase

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::d_newbase[DIM][DIM]
private

◆ d_num_boundary_nodes

template<int DIM>
int SAMRAI::appu::CutCell< DIM >::d_num_boundary_nodes
private

◆ d_boundary_nodes

template<int DIM>
tbox::Array< appu::BoundaryNode<DIM> > SAMRAI::appu::CutCell< DIM >::d_boundary_nodes
private

◆ d_flux_front

template<int DIM>
double SAMRAI::appu::CutCell< DIM >::d_flux_front[2+DIM]
private

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