IBAMR  IBAMR version 0.19.
Public Member Functions | Protected Attributes | Private Attributes | List of all members
SAMRAI::pdat::SideDataFactory< DIM, TYPE > Class Template Referenceabstract

#include <SideDataFactory.h>

Inheritance diagram for SAMRAI::pdat::SideDataFactory< DIM, TYPE >:
Inheritance graph
[legend]

Public Member Functions

 SideDataFactory (int depth, const hier::IntVector< DIM > &ghosts, bool fine_boundary_represents_var, const hier::IntVector< DIM > &directions=hier::IntVector< DIM >(1))
 
virtual ~SideDataFactory ()
 
virtual tbox::Pointer< hier::PatchDataFactory< DIM > > cloneFactory (const hier::IntVector< DIM > &ghosts)
 Abstract virtual function to clone a patch data factory. More...
 
virtual tbox::Pointer< hier::PatchData< DIM > > allocate (const hier::Box< DIM > &box, tbox::Pointer< tbox::Arena > pool=tbox::Pointer< tbox::Arena >(NULL)) const
 
virtual tbox::Pointer< hier::PatchData< DIM > > allocate (const hier::Patch< DIM > &patch, tbox::Pointer< tbox::Arena > pool=tbox::Pointer< tbox::Arena >(NULL)) const
 
virtual tbox::Pointer< hier::BoxGeometry< DIM > > getBoxGeometry (const hier::Box< DIM > &box) const
 
int getDefaultDepth () const
 
void setDefaultDepth (const int depth)
 
const hier::IntVector< DIM > & getDirectionVector () const
 
virtual size_t getSizeOfMemory (const hier::Box< DIM > &box) const
 
bool fineBoundaryRepresentsVariable () const
 
bool dataLivesOnPatchBorder () const
 
bool validCopyTo (const tbox::Pointer< hier::PatchDataFactory< DIM > > &dst_pdf) const
 
hier::MultiblockDataTranslator< DIM > * getMultiblockDataTranslator ()
 
virtual tbox::Pointer< PatchDataFactory< DIM > > cloneFactory (const IntVector< DIM > &ghosts)=0
 Abstract virtual function to clone a patch data factory. More...
 
virtual tbox::Pointer< PatchData< DIM > > allocate (const Box< DIM > &box, tbox::Pointer< tbox::Arena > pool=(tbox::Arena *) NULL) const =0
 Abstract virtual function to allocate a concrete patch data object. More...
 
virtual tbox::Pointer< BoxGeometry< DIM > > getBoxGeometry (const Box< DIM > &box) const =0
 Abstract virtual function to allocate a concrete box geometry object.
More...
 
const IntVector< DIM > & getGhostCellWidth () const
 Get the ghost cell width.
More...
 
virtual size_t getSizeOfMemory (const Box< DIM > &box) const =0
 Abstract virtual function to compute the amount of memory needed to allocate for object data and to represent the object itself. More...
 

Protected Attributes

IntVector< DIM > d_ghosts
 

Private Attributes

int d_depth
 
bool d_fine_boundary_represents_var
 
hier::IntVector< DIM > d_directions
 
MultiblockSideDataTranslator< DIM, TYPE > * d_mb_trans
 

Detailed Description

template<int DIM, class TYPE>
class SAMRAI::pdat::SideDataFactory< DIM, TYPE >

Class SideDataFactory is a factory class used to allocate new instances of SideData objects. It is a subclass of the patch data factory class and side data is a subclass of patch data. Both the factory and data classes are templated on the type of the contained object (e.g., double or int).

Note that it is possible to create a side data factory to allocate and manage data for cell sides associated with a single coordinate direction only. See the constructor for more information.

See also
pdat::SideData
pdat::PatchDataFactory

Constructor & Destructor Documentation

◆ SideDataFactory()

template<int DIM, class TYPE >
SAMRAI::pdat::SideDataFactory< DIM, TYPE >::SideDataFactory ( int  depth,
const hier::IntVector< DIM > &  ghosts,
bool  fine_boundary_represents_var,
const hier::IntVector< DIM > &  directions = hier::IntVector< DIM >(1) 
)

The default constructor for the side data factory class. The ghost cell width, depth (number of components), and fine boundary representation arguments give the defaults for all edge data objects created with this factory. Also, the default data allocation scheme is to generate storage for sides in all coordinate directions (default integer vector of all 1's). To use this factory to manage side data objects for sides associated with a single direction only, provide the directions vector argument. A zero entry indicates that data for that direction is not wanted. Otherwise, data will be created for that direction. See the SideVariable<DIM> class header file for more information.

◆ ~SideDataFactory()

template<int DIM, class TYPE >
virtual SAMRAI::pdat::SideDataFactory< DIM, TYPE >::~SideDataFactory ( )
virtual

Virtual destructor for the side data factory class.

Member Function Documentation

◆ cloneFactory() [1/2]

template<int DIM, class TYPE >
virtual tbox::Pointer< hier::PatchDataFactory<DIM> > SAMRAI::pdat::SideDataFactory< DIM, TYPE >::cloneFactory ( const hier::IntVector< DIM > &  ghosts)
virtual

This will return a new instantiation of the abstract factory with the same properties. The properties of the cloned factory can then be changed without modifying the original.

Parameters
ghostsdefault ghost cell width for concrete classes created from the factory.

◆ allocate() [1/3]

template<int DIM, class TYPE >
virtual tbox::Pointer< hier::PatchData<DIM> > SAMRAI::pdat::SideDataFactory< DIM, TYPE >::allocate ( const hier::Box< DIM > &  box,
tbox::Pointer< tbox::Arena pool = tbox::Pointertbox::Arena >(NULL) 
) const
virtual

Virtual factory function to allocate a concrete side data object. The default information about the object (e.g., ghost cell width) is taken from the factory. If no memory pool is provided, then the allocation routine assumes some default memory pool.

◆ allocate() [2/3]

template<int DIM, class TYPE >
virtual tbox::Pointer< hier::PatchData<DIM> > SAMRAI::pdat::SideDataFactory< DIM, TYPE >::allocate ( const hier::Patch< DIM > &  patch,
tbox::Pointer< tbox::Arena pool = tbox::Pointertbox::Arena >(NULL) 
) const
virtual

Virtual factory function to allocate a concrete cell data object. Same as above function, except passes in a patch instead of a box.

Implements SAMRAI::hier::PatchDataFactory< DIM >.

◆ getBoxGeometry() [1/2]

template<int DIM, class TYPE >
virtual tbox::Pointer< hier::BoxGeometry<DIM> > SAMRAI::pdat::SideDataFactory< DIM, TYPE >::getBoxGeometry ( const hier::Box< DIM > &  box) const
virtual

Allocate the box geometry object associated with the patch data. This information will be used in the computation of intersections and data dependencies between objects.

◆ getDefaultDepth()

template<int DIM, class TYPE >
int SAMRAI::pdat::SideDataFactory< DIM, TYPE >::getDefaultDepth ( ) const

Get the default depth (number of components). This is the default depth that will be used in the instantiation of side data objects.

◆ setDefaultDepth()

template<int DIM, class TYPE >
void SAMRAI::pdat::SideDataFactory< DIM, TYPE >::setDefaultDepth ( const int  depth)

Set the default depth (number of components). This is the default depth that will be used in the instantiation of side data objects.

◆ getDirectionVector()

template<int DIM, class TYPE >
const hier::IntVector<DIM>& SAMRAI::pdat::SideDataFactory< DIM, TYPE >::getDirectionVector ( ) const

Return constant reference to vector describing which coordinate directions have data associated with this side data object. A vector entry of zero indicates that there is no data array allocated for the corresponding coordinate direction. A non-zero value indicates that a valid data array is maintained for that coordinate direction.

◆ getSizeOfMemory() [1/2]

template<int DIM, class TYPE >
virtual size_t SAMRAI::pdat::SideDataFactory< DIM, TYPE >::getSizeOfMemory ( const hier::Box< DIM > &  box) const
virtual

Calculate the amount of memory needed to store the side data object, including object data and dynamically allocated data.

◆ fineBoundaryRepresentsVariable()

template<int DIM, class TYPE >
bool SAMRAI::pdat::SideDataFactory< DIM, TYPE >::fineBoundaryRepresentsVariable ( ) const
inlinevirtual

Return a boolean value indicating how data for the side quantity will be treated on coarse-fine interfaces. This value is passed into the constructor. See the FaceVariable<DIM> class header file for more information.

Implements SAMRAI::hier::PatchDataFactory< DIM >.

◆ dataLivesOnPatchBorder()

template<int DIM, class TYPE >
bool SAMRAI::pdat::SideDataFactory< DIM, TYPE >::dataLivesOnPatchBorder ( ) const
inlinevirtual

Return true since the side data index space extends beyond the interior of patches. That is, side data lives on patch borders.

Implements SAMRAI::hier::PatchDataFactory< DIM >.

◆ validCopyTo()

template<int DIM, class TYPE >
bool SAMRAI::pdat::SideDataFactory< DIM, TYPE >::validCopyTo ( const tbox::Pointer< hier::PatchDataFactory< DIM > > &  dst_pdf) const
virtual

Return whether it is valid to copy this SideDataFactory to the supplied destination patch data factory. It will return true if dst_pdf is SideDataFactory or OutersideDataFactory, false otherwise.

Implements SAMRAI::hier::PatchDataFactory< DIM >.

◆ getMultiblockDataTranslator()

template<int DIM, class TYPE >
hier::MultiblockDataTranslator<DIM>* SAMRAI::pdat::SideDataFactory< DIM, TYPE >::getMultiblockDataTranslator ( )
virtual

Return pointer to a multiblock data translator

Reimplemented from SAMRAI::hier::PatchDataFactory< DIM >.

◆ cloneFactory() [2/2]

template<int DIM>
virtual tbox::Pointer< PatchDataFactory<DIM> > SAMRAI::hier::PatchDataFactory< DIM >::cloneFactory ( const IntVector< DIM > &  ghosts)
pure virtualinherited

This will return a new instantiation of the abstract factory with the same properties. The properties of the cloned factory can then be changed without modifying the original.

Parameters
ghostsghost cell width for concrete classes created from the factory.

◆ allocate() [3/3]

template<int DIM>
virtual tbox::Pointer< PatchData<DIM> > SAMRAI::hier::PatchDataFactory< DIM >::allocate ( const Box< DIM > &  box,
tbox::Pointer< tbox::Arena pool = (tbox::Arena *) NULL 
) const
pure virtualinherited

The default information about the object (e.g., ghost cell width) is taken from the factory. If no memory pool is provided, then the allocation routine assumes some default memory pool.

◆ getBoxGeometry() [2/2]

template<int DIM>
virtual tbox::Pointer< BoxGeometry<DIM> > SAMRAI::hier::PatchDataFactory< DIM >::getBoxGeometry ( const Box< DIM > &  box) const
pure virtualinherited

The box geometry object will be used in the calculation of box intersections for the computation of data dependencies.

◆ getGhostCellWidth()

template<int DIM>
const IntVector<DIM>& SAMRAI::hier::PatchDataFactory< DIM >::getGhostCellWidth ( ) const
inherited

This is the ghost cell width that will be used in the instantiation of concrete patch data instances. The ghost width is specified in the clone method.

◆ getSizeOfMemory() [2/2]

template<int DIM>
virtual size_t SAMRAI::hier::PatchDataFactory< DIM >::getSizeOfMemory ( const Box< DIM > &  box) const
pure virtualinherited

This includes any dynamic storage, such as arrays, needed by the concrete patch data instance. Although the patch data subclass may choose not to allocate memory from the provided memory pool, it must not use more memory than requested here.

Member Data Documentation

◆ d_depth

template<int DIM, class TYPE >
int SAMRAI::pdat::SideDataFactory< DIM, TYPE >::d_depth
private

◆ d_fine_boundary_represents_var

template<int DIM, class TYPE >
bool SAMRAI::pdat::SideDataFactory< DIM, TYPE >::d_fine_boundary_represents_var
private

◆ d_directions

template<int DIM, class TYPE >
hier::IntVector<DIM> SAMRAI::pdat::SideDataFactory< DIM, TYPE >::d_directions
private

◆ d_mb_trans

template<int DIM, class TYPE >
MultiblockSideDataTranslator<DIM,TYPE>* SAMRAI::pdat::SideDataFactory< DIM, TYPE >::d_mb_trans
private

◆ d_ghosts

template<int DIM>
IntVector<DIM> SAMRAI::hier::PatchDataFactory< DIM >::d_ghosts
protectedinherited

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