IBAMR  IBAMR version 0.19.
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
IBTK::LNode Class Reference

Class LNode is the basic element of an LMesh. More...

#include <ibtk/LNode.h>

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

Public Member Functions

 LNode (int lagrangian_nidx=-1, int global_petsc_nidx=-1, int local_petsc_nidx=-1, const SAMRAI::hier::IntVector< NDIM > &initial_periodic_offset=SAMRAI::hier::IntVector< NDIM >(0), const SAMRAI::hier::IntVector< NDIM > &current_periodic_offset=SAMRAI::hier::IntVector< NDIM >(0), const Vector &initial_periodic_displacement=Vector::Zero(), const Vector &current_periodic_displacement=Vector::Zero(), const std::vector< SAMRAI::tbox::Pointer< Streamable > > &node_data=std::vector< SAMRAI::tbox::Pointer< Streamable > >())
 Default constructor. More...
 
 LNode (const LNode &from)
 Copy constructor. More...
 
 LNode (SAMRAI::tbox::AbstractStream &stream, const SAMRAI::hier::IntVector< NDIM > &offset)
 Constructor that unpacks data from an input stream. More...
 
 ~LNode ()
 Destructor. More...
 
LNodeoperator= (const LNode &that)
 Assignment operator. More...
 
const std::vector< SAMRAI::tbox::Pointer< Streamable > > & getNodeData () const
 
void setNodeData (const std::vector< SAMRAI::tbox::Pointer< Streamable > > &node_data)
 Reset the collection of additional data items associated with the node referenced by this LNode object. More...
 
void appendNodeDataItem (const SAMRAI::tbox::Pointer< Streamable > &node_data_item)
 Append a data item to the collection of data items associated with this node. The appended item will appear at the end of the vector of node data items associated with this node. More...
 
void removeNodeDataItem (const SAMRAI::tbox::Pointer< Streamable > &node_data_item)
 Remove a data item to the collection of data items associated with this node. If the argument is not associated with the collection of node data associated with this node, this method will have no effect. More...
 
template<typename T >
T * getNodeDataItem () const
 
template<typename T >
std::vector< T * > getNodeDataVector () const
 
void registerPeriodicShift (const SAMRAI::hier::IntVector< NDIM > &offset, const Vector &displacement) override
 Indicate that the LNode object has been shifted across a periodic boundary. More...
 
void copySourceItem (const SAMRAI::hier::Index< NDIM > &src_index, const SAMRAI::hier::IntVector< NDIM > &src_offset, const LNodeIndex &src_item) override
 Copy data from the source. More...
 
size_t getDataStreamSize () const override
 Return an upper bound on the amount of space required to pack the object to a buffer. More...
 
void packStream (SAMRAI::tbox::AbstractStream &stream) override
 Pack data into the output stream. More...
 
virtual void unpackStream (SAMRAI::tbox::AbstractStream &stream, const SAMRAI::hier::IntVector< NDIM > &offset) override
 Unpack data from the input stream. More...
 
int getLagrangianIndex () const
 
void setLagrangianIndex (int lagrangian_nidx)
 Reset the Lagrangian index referenced by this LNodeIndex object. More...
 
int getGlobalPETScIndex () const
 
void setGlobalPETScIndex (int global_petsc_nidx)
 Reset the global PETSc index referenced by this LNodeIndex object. More...
 
int getLocalPETScIndex () const
 
void setLocalPETScIndex (int local_petsc_nidx)
 Reset the local PETSc index referenced by this LNodeIndex object. More...
 
virtual const SAMRAI::hier::IntVector< NDIM > & getInitialPeriodicOffset () const
 Get the initial (t = 0) periodic offset. More...
 
virtual const SAMRAI::hier::IntVector< NDIM > & getPeriodicOffset () const
 Get the periodic offset. More...
 
virtual const VectorgetInitialPeriodicDisplacement () const
 Get the initial (t = 0) periodic displacement. More...
 
virtual const VectorgetPeriodicDisplacement () const
 Get the periodic displacement. More...
 

Private Member Functions

void assignThatToThis (const LNode &that)
 
void setupNodeDataTypeArray ()
 

Private Attributes

std::vector< SAMRAI::tbox::Pointer< Streamable > > d_node_data
 
Streamabled_node_data_type_arr [MAX_SIZE]
 
int d_lagrangian_nidx
 
int d_global_petsc_nidx
 
int d_local_petsc_nidx
 
SAMRAI::hier::IntVector< NDIM > d_offset_0
 
SAMRAI::hier::IntVector< NDIM > d_offset
 
Vector d_displacement_0
 
Vector d_displacement
 

Static Private Attributes

static const short int MAX_SIZE = 8
 

Detailed Description

Class LNode provides Lagrangian and PETSc indexing information and data storage for a single node of a Lagrangian mesh.

Constructor & Destructor Documentation

◆ LNode() [1/3]

IBTK::LNode::LNode ( int  lagrangian_nidx = -1,
int  global_petsc_nidx = -1,
int  local_petsc_nidx = -1,
const SAMRAI::hier::IntVector< NDIM > &  initial_periodic_offset = SAMRAI::hier::IntVector<NDIM>(0),
const SAMRAI::hier::IntVector< NDIM > &  current_periodic_offset = SAMRAI::hier::IntVector<NDIM>(0),
const Vector initial_periodic_displacement = Vector::Zero(),
const Vector current_periodic_displacement = Vector::Zero(),
const std::vector< SAMRAI::tbox::Pointer< Streamable > > &  node_data = std::vector<SAMRAI::tbox::Pointer<Streamable> >() 
)
inline
Note
Any nonzero periodic offset/displacement must already be registered with any provided node data items.

◆ LNode() [2/3]

IBTK::LNode::LNode ( const LNode from)
inline
Parameters
fromThe value to copy to this object.

◆ LNode() [3/3]

IBTK::LNode::LNode ( SAMRAI::tbox::AbstractStream stream,
const SAMRAI::hier::IntVector< NDIM > &  offset 
)
inline

◆ ~LNode()

IBTK::LNode::~LNode ( )
inline

Member Function Documentation

◆ operator=()

LNode & IBTK::LNode::operator= ( const LNode that)
inline
Parameters
thatThe value to assign to this object.
Returns
A reference to this object.

◆ getNodeData()

const std::vector< SAMRAI::tbox::Pointer< Streamable > > & IBTK::LNode::getNodeData ( ) const
inline
Returns
A constant reference to any additional data items associated with the node referenced by this LNode object.

◆ setNodeData()

void IBTK::LNode::setNodeData ( const std::vector< SAMRAI::tbox::Pointer< Streamable > > &  node_data)
inline

◆ appendNodeDataItem()

void IBTK::LNode::appendNodeDataItem ( const SAMRAI::tbox::Pointer< Streamable > &  node_data_item)
inline

◆ removeNodeDataItem()

void IBTK::LNode::removeNodeDataItem ( const SAMRAI::tbox::Pointer< Streamable > &  node_data_item)
inline
Note
Removing items is potentially an inefficient operation.

◆ getNodeDataItem()

template<typename T >
T * IBTK::LNode::getNodeDataItem
inline
Returns
A pointer to the first data item of type T associated with the node referenced by the LNode object.

If no object of the specified type is encountered, this method returns a null pointer.

Note
It is possible for multiple objects of the same type to be associated with each node. This method returns only the first such object encountered in the collection of data items associated with the node.

◆ getNodeDataVector()

template<typename T >
std::vector< T * > IBTK::LNode::getNodeDataVector
inline
Returns
A vector of pointers to all data items of type T associated with the node referenced by the LNode object.

If no object of the specified type is encountered, this method returns an empty vector.

Note
It is possible for multiple objects of the same type to be associated with each node. This method returns a vector of all such objects encountered in the collection of data items associated with the node.

◆ registerPeriodicShift()

void IBTK::LNode::registerPeriodicShift ( const SAMRAI::hier::IntVector< NDIM > &  offset,
const Vector displacement 
)
inlineoverridevirtual

Reimplemented from IBTK::LNodeIndex.

◆ copySourceItem()

void IBTK::LNode::copySourceItem ( const SAMRAI::hier::Index< NDIM > &  src_index,
const SAMRAI::hier::IntVector< NDIM > &  src_offset,
const LNodeIndex src_item 
)
inlineoverridevirtual
Note
The cell index of the destination object is src_index + src_offset.

Reimplemented from IBTK::LNodeIndex.

◆ getDataStreamSize()

size_t IBTK::LNode::getDataStreamSize ( ) const
inlineoverridevirtual

Reimplemented from IBTK::LNodeIndex.

◆ packStream()

void IBTK::LNode::packStream ( SAMRAI::tbox::AbstractStream stream)
inlineoverridevirtual

Reimplemented from IBTK::LNodeIndex.

◆ unpackStream()

void IBTK::LNode::unpackStream ( SAMRAI::tbox::AbstractStream stream,
const SAMRAI::hier::IntVector< NDIM > &  offset 
)
inlineoverridevirtual

Reimplemented from IBTK::LNodeIndex.

◆ assignThatToThis()

void IBTK::LNode::assignThatToThis ( const LNode that)
inlineprivate

Assign that to this.

◆ setupNodeDataTypeArray()

void IBTK::LNode::setupNodeDataTypeArray ( )
inlineprivate

Setup node data map.

◆ getLagrangianIndex()

int IBTK::LNodeIndex::getLagrangianIndex ( ) const
inlineinherited
Returns
The Lagrangian index referenced by this LNodeIndex object.

◆ setLagrangianIndex()

void IBTK::LNodeIndex::setLagrangianIndex ( int  lagrangian_nidx)
inlineinherited

◆ getGlobalPETScIndex()

int IBTK::LNodeIndex::getGlobalPETScIndex ( ) const
inlineinherited
Returns
The global PETSc index referenced by this LNodeIndex object.

◆ setGlobalPETScIndex()

void IBTK::LNodeIndex::setGlobalPETScIndex ( int  global_petsc_nidx)
inlineinherited

◆ getLocalPETScIndex()

int IBTK::LNodeIndex::getLocalPETScIndex ( ) const
inlineinherited
Returns
The local PETSc index referenced by this LNodeIndex object.

◆ setLocalPETScIndex()

void IBTK::LNodeIndex::setLocalPETScIndex ( int  local_petsc_nidx)
inlineinherited

◆ getInitialPeriodicOffset()

const SAMRAI::hier::IntVector< NDIM > & IBTK::LNodeIndex::getInitialPeriodicOffset ( ) const
inlinevirtualinherited

◆ getPeriodicOffset()

const SAMRAI::hier::IntVector< NDIM > & IBTK::LNodeIndex::getPeriodicOffset ( ) const
inlinevirtualinherited

◆ getInitialPeriodicDisplacement()

const Vector & IBTK::LNodeIndex::getInitialPeriodicDisplacement ( ) const
inlinevirtualinherited

◆ getPeriodicDisplacement()

const Vector & IBTK::LNodeIndex::getPeriodicDisplacement ( ) const
inlinevirtualinherited

Member Data Documentation

◆ d_node_data

std::vector<SAMRAI::tbox::Pointer<Streamable> > IBTK::LNode::d_node_data
private

◆ MAX_SIZE

const short int IBTK::LNode::MAX_SIZE = 8
staticprivate

◆ d_node_data_type_arr

Streamable* IBTK::LNode::d_node_data_type_arr[MAX_SIZE]
private

◆ d_lagrangian_nidx

int IBTK::LNodeIndex::d_lagrangian_nidx
privateinherited

◆ d_global_petsc_nidx

int IBTK::LNodeIndex::d_global_petsc_nidx
privateinherited

◆ d_local_petsc_nidx

int IBTK::LNodeIndex::d_local_petsc_nidx
privateinherited

◆ d_offset_0

SAMRAI::hier::IntVector<NDIM> IBTK::LNodeIndex::d_offset_0
privateinherited

◆ d_offset

SAMRAI::hier::IntVector<NDIM> IBTK::LNodeIndex::d_offset
privateinherited

◆ d_displacement_0

Vector IBTK::LNodeIndex::d_displacement_0
privateinherited

◆ d_displacement

Vector IBTK::LNodeIndex::d_displacement
privateinherited

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