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

Class LData provides storage for a single scalar- or vector-valued Lagrangian quantity. More...

#include </home/runner/work/IBAMR/IBAMR/ibtk/include/ibtk/LData.h>

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

Public Member Functions

 LData (std::string name, unsigned int num_local_nodes, unsigned int depth, std::vector< int > nonlocal_petsc_indices=std::vector< int >(0))
 Constructor. More...
 
 LData (std::string name, Vec vec, std::vector< int > nonlocal_petsc_indices=std::vector< int >(0), const bool manage_petsc_vec=true)
 Constructor. More...
 
 LData (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > db)
 Constructor.
 
virtual ~LData ()
 Virtual destructor.
 
virtual void resetData (Vec vec, const std::vector< int > &nonlocal_petsc_indices=std::vector< int >(0), const bool manage_petsc_vec=true)
 Reset data items. More...
 
const std::stringgetName () const
 Returns a const reference to the name of this LData object.
 
unsigned int getGlobalNodeCount () const
 Returns the total number of Lagrangian nodes.
 
unsigned int getLocalNodeCount () const
 Returns the number of local (i.e., on processor) Lagrangian nodes. More...
 
unsigned int getGhostNodeCount () const
 Returns the number of local ghost nodes associated with the LData object.
 
unsigned int getDepth () const
 Returns the depth (i.e., the number of components per node) of the Lagrangian data.
 
Vec getVec ()
 Returns the PETSc Vec object that stores the data. More...
 
boost::multi_array_ref< double, 1 > * getArray ()
 Returns a pointer to a boost::multi_array_ref object that wraps the array corresponding to the PETSc Vec object. This method is appropriate only for scalar-valued quantities. More...
 
boost::multi_array_ref< double, 1 > * getLocalFormArray ()
 Returns a pointer to a boost::multi_array_ref object that wraps the array corresponding to the PETSc Vec object. This method is appropriate only for scalar-valued quantities. More...
 
boost::multi_array_ref< double, 1 > * getGhostedLocalFormArray ()
 Returns a pointer to a boost::multi_array_ref object that wraps the array corresponding to the ghosted local part of the PETSc Vec object. This method is appropriate only for scalar-valued quantities. More...
 
boost::multi_array_ref< double, 2 > * getVecArray ()
 Returns a pointer to a boost::multi_array_ref object that wraps the array corresponding to the PETSc Vec object. This method is appropriate for either scalar- or vector-valued quantities. More...
 
boost::multi_array_ref< double, 2 > * getLocalFormVecArray ()
 Returns a pointer to a boost::multi_array_ref object that wraps the array corresponding to the PETSc Vec object. This method is appropriate for either scalar- or vector-valued quantities. More...
 
boost::multi_array_ref< double, 2 > * getGhostedLocalFormVecArray ()
 Returns a pointer to a boost::multi_array_ref object that wraps the array corresponding to the ghosted local part of the PETSc Vec object. This method is appropriate for either scalar- or vector-valued quantities. More...
 
void restoreArrays ()
 Restore any arrays extracted via calls to getArray(), getLocalFormArray(), and getGhostedLocalFormArray(). More...
 
void beginGhostUpdate ()
 Begin updating ghost values.
 
void endGhostUpdate ()
 End updating ghost values.
 
void putToDatabase (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > db) override
 Write out object state to the given database.
 

Detailed Description

Class LData provides storage for a single scalar- or vector-valued Lagrangian quantity.

Constructor & Destructor Documentation

◆ LData() [1/2]

IBTK::LData::LData ( std::string  name,
unsigned int  num_local_nodes,
unsigned int  depth,
std::vector< int >  nonlocal_petsc_indices = std::vector<int>(0) 
)

Constructor.

Note
This constructor will allocate an appropriately sized PETSc Vec object. Data management for this PETSc Vec object is handled by the LData object.

◆ LData() [2/2]

IBTK::LData::LData ( std::string  name,
Vec  vec,
std::vector< int >  nonlocal_petsc_indices = std::vector<int>(0),
const bool  manage_petsc_vec = true 
)

Constructor.

Note
This constructor does not allocate a PETSc Vec object. Instead, it can assume responsibilities for data management for the supplied PETSc Vec object. In particular, the caller must not destroy the PETSc Vec object provided to the class constructor, if it is instructed to manage the PETSc Vec.
The blocksize of the supplied PETSc Vec object must be set appropriately. Its value is used to determine the data depth (i.e., the number of data components per node).

Member Function Documentation

◆ getArray()

boost::multi_array_ref< double, 1 > * IBTK::LData::getArray ( )
inline

Returns a pointer to a boost::multi_array_ref object that wraps the array corresponding to the PETSc Vec object. This method is appropriate only for scalar-valued quantities.

Note
Only local data are accessible via the returned array. Nonlocal data must be accessed via appropriate PETSc function calls.
The returned array is indexed using the global PETSc indexing scheme.
Any outstanding references to the underlying array data are invalidated by restoreArrays().
See also
restoreArrays()

◆ getGhostedLocalFormArray()

boost::multi_array_ref< double, 1 > * IBTK::LData::getGhostedLocalFormArray ( )
inline

Returns a pointer to a boost::multi_array_ref object that wraps the array corresponding to the ghosted local part of the PETSc Vec object. This method is appropriate only for scalar-valued quantities.

Note
Only local (i.e., on processor) and ghost node data are accessible via this array. All other nonlocal data must be accessed via appropriate PETSc function calls.
The returned array object is indexed using the local PETSc indexing scheme.
Any outstanding references to the underlying array data are invalidated by restoreArrays().
See also
restoreArrays()

◆ getGhostedLocalFormVecArray()

boost::multi_array_ref< double, 2 > * IBTK::LData::getGhostedLocalFormVecArray ( )
inline

Returns a pointer to a boost::multi_array_ref object that wraps the array corresponding to the ghosted local part of the PETSc Vec object. This method is appropriate for either scalar- or vector-valued quantities.

Note
Only local (i.e., on processor) and ghost node data are accessible via this array. All other nonlocal data must be accessed via appropriate PETSc function calls.
The returned array object is indexed using the local PETSc indexing scheme.
Any outstanding references to the underlying array data are invalidated by restoreArrays().
See also
restoreArrays()

◆ getLocalFormArray()

boost::multi_array_ref< double, 1 > * IBTK::LData::getLocalFormArray ( )
inline

Returns a pointer to a boost::multi_array_ref object that wraps the array corresponding to the PETSc Vec object. This method is appropriate only for scalar-valued quantities.

Note
Only local data are accessible via the returned array. Nonlocal data must be accessed via appropriate PETSc function calls.
The returned array is indexed using the local PETSc indexing scheme.
Any outstanding references to the underlying array data are invalidated by restoreArrays().
See also
restoreArrays()

◆ getLocalFormVecArray()

boost::multi_array_ref< double, 2 > * IBTK::LData::getLocalFormVecArray ( )
inline

Returns a pointer to a boost::multi_array_ref object that wraps the array corresponding to the PETSc Vec object. This method is appropriate for either scalar- or vector-valued quantities.

Note
Only local data are accessible via the returned array. Nonlocal data must be accessed via appropriate PETSc function calls.
The returned array is indexed using the local PETSc indexing scheme.
Any outstanding references to the underlying array data are invalidated by restoreArrays().
See also
restoreArrays()

◆ getLocalNodeCount()

unsigned int IBTK::LData::getLocalNodeCount ( ) const
inline

Returns the number of local (i.e., on processor) Lagrangian nodes.

Note
This count does not include ghost nodes (if any).

◆ getVec()

Vec IBTK::LData::getVec ( )
inline

Returns the PETSc Vec object that stores the data.

Note
getVec() calls restoreArrays(), which invalidates any oustanding references to the underlying array data.
See also
restoreArrays()

◆ getVecArray()

boost::multi_array_ref< double, 2 > * IBTK::LData::getVecArray ( )
inline

Returns a pointer to a boost::multi_array_ref object that wraps the array corresponding to the PETSc Vec object. This method is appropriate for either scalar- or vector-valued quantities.

Note
Only local data are accessible via the returned array. Nonlocal data must be accessed via appropriate PETSc function calls.
The returned array is indexed using the global PETSc indexing scheme.
Any outstanding references to the underlying array data are invalidated by restoreArrays().
See also
restoreArrays()

◆ resetData()

void IBTK::LData::resetData ( Vec  vec,
const std::vector< int > &  nonlocal_petsc_indices = std::vector<int>(0),
const bool  manage_petsc_vec = true 
)
virtual

Reset data items.

Note
The LData object assumes responsibilities for data management for the supplied PETSc Vec object. In particular, the caller must not destroy the PETSc Vec object provided to resetData().
The blocksize of the supplied PETSc Vec object must be set appropriately. Its value is used to determine the data depth (i.e., the number of data components per node).

◆ restoreArrays()

void IBTK::LData::restoreArrays ( )
inline

Restore any arrays extracted via calls to getArray(), getLocalFormArray(), and getGhostedLocalFormArray().

Note
Any outstanding references to the underlying array data are invalidated by restoreArrays().

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