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

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

#include </home/runner/work/IBAMR/IBAMR/ibtk/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.
 
 ~LNode ()
 Destructor.
 
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.
 
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.
 
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.
 
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.
 
void packStream (SAMRAI::tbox::AbstractStream &stream) override
 Pack data into the output stream.
 
virtual void unpackStream (SAMRAI::tbox::AbstractStream &stream, const SAMRAI::hier::IntVector< NDIM > &offset) override
 Unpack data from the input stream.
 
- Public Member Functions inherited from IBTK::LNodeIndex
 LNodeIndex (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())
 Default constructor.
 
 LNodeIndex (const LNodeIndex &from)
 Copy constructor. More...
 
 LNodeIndex (SAMRAI::tbox::AbstractStream &stream, const SAMRAI::hier::IntVector< NDIM > &offset)
 Constructor that unpacks data from an input stream.
 
virtual ~LNodeIndex ()
 Virtual destructor.
 
LNodeIndexoperator= (const LNodeIndex &that)
 Assignment operator. More...
 
int getLagrangianIndex () const
 
void setLagrangianIndex (int lagrangian_nidx)
 Reset the Lagrangian index referenced by this LNodeIndex object.
 
int getGlobalPETScIndex () const
 
void setGlobalPETScIndex (int global_petsc_nidx)
 Reset the global PETSc index referenced by this LNodeIndex object.
 
int getLocalPETScIndex () const
 
void setLocalPETScIndex (int local_petsc_nidx)
 Reset the local PETSc index referenced by this LNodeIndex object.
 
virtual const SAMRAI::hier::IntVector< NDIM > & getInitialPeriodicOffset () const
 Get the initial (t = 0) periodic offset.
 
virtual const SAMRAI::hier::IntVector< NDIM > & getPeriodicOffset () const
 Get the periodic offset.
 
virtual const Vector & getInitialPeriodicDisplacement () const
 Get the initial (t = 0) periodic displacement.
 
virtual const Vector & getPeriodicDisplacement () const
 Get the periodic displacement.
 

Detailed Description

Class LNode is the basic element of an LMesh.

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

Constructor & Destructor Documentation

◆ LNode() [1/2]

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

Default constructor.

Note
Any nonzero periodic offset/displacement must already be registered with any provided node data items.

◆ LNode() [2/2]

IBTK::LNode::LNode ( const LNode from)
inline

Copy constructor.

Parameters
fromThe value to copy to this object.

Member Function Documentation

◆ copySourceItem()

void IBTK::LNode::copySourceItem ( const SAMRAI::hier::Index< NDIM > &  src_index,
const SAMRAI::hier::IntVector< NDIM > &  src_offset,
const LNodeIndex src_item 
)
inlineoverridevirtual

Copy data from the source.

Note
The cell index of the destination object is src_index + src_offset.

Reimplemented from IBTK::LNodeIndex.

◆ 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.

◆ 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.

◆ operator=()

LNode & IBTK::LNode::operator= ( const LNode that)
inline

Assignment operator.

Parameters
thatThe value to assign to this object.
Returns
A reference to this object.

◆ removeNodeDataItem()

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

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.

Note
Removing items is potentially an inefficient operation.

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