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

Class IBSpringForceSpec encapsulates the data necessary to compute the forces generated by a network of linear or nonlinear springs (i.e., structures that resist extension and/or compression) at a single node of the Lagrangian mesh. More...

#include </home/runner/work/IBAMR/IBAMR/include/ibamr/IBSpringForceSpec.h>

Inheritance diagram for IBAMR::IBSpringForceSpec:
Inheritance graph
[legend]

Public Member Functions

 IBSpringForceSpec (unsigned int num_springs=0)
 Default constructor.
 
 IBSpringForceSpec (int master_idx, const std::vector< int > &slave_idxs, const std::vector< int > &force_fcn_idxs, const std::vector< std::vector< double > > &parameters)
 Alternative constructor.
 
unsigned int getNumberOfSprings () const
 
const int & getMasterNodeIndex () const
 
int & getMasterNodeIndex ()
 
const std::vector< int > & getSlaveNodeIndices () const
 
std::vector< int > & getSlaveNodeIndices ()
 
const std::vector< int > & getForceFunctionIndices () const
 
std::vector< int > & getForceFunctionIndices ()
 
const std::vector< std::vector< double > > & getParameters () const
 
std::vector< std::vector< double > > & getParameters ()
 
int getStreamableClassID () const override
 Return the unique identifier used to specify the IBTK::StreamableFactory object used by the IBTK::StreamableManager to extract Streamable objects from data streams.
 
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.
 
- Public Member Functions inherited from IBTK::Streamable
 Streamable ()=default
 Default empty constructor.
 
virtual ~Streamable ()=default
 Virtual destructor.
 
virtual void registerPeriodicShift (const SAMRAI::hier::IntVector< NDIM > &offset, const Vector &displacement)
 Indicate that the Streamable object has been shifted across a periodic boundary. More...
 

Static Public Member Functions

static void registerWithStreamableManager ()
 Register this class and its factory class with the singleton IBTK::StreamableManager object. This method must be called before any IBSpringForceSpec objects are created. More...
 
static bool getIsRegisteredWithStreamableManager ()
 Returns a boolean indicating whether the class has been registered with the singleton IBTK::StreamableManager object.
 

Static Public Attributes

static int STREAMABLE_CLASS_ID = StreamableManager::getUnregisteredID()
 

Detailed Description

Class IBSpringForceSpec encapsulates the data necessary to compute the forces generated by a network of linear or nonlinear springs (i.e., structures that resist extension and/or compression) at a single node of the Lagrangian mesh.

Springs are connections between two particular nodes of the Lagrangian mesh. Forces generated by springs have the feature that the force applied to one end of the spring is the negation of the force applied to the other end of the spring. Consequently, to determine the total nodal forces, we only need to compute the force at one end of the spring (e.g., at the master node). Then, the negation of that force can be applied to the opposite end of the spring (e.g., at the slave node).

IBSpringForceSpec objects are stored as IBTK::Streamable data associated with only the master nodes in the mesh.

Note
Different spring force functions may be specified for each link in the mesh. This data is specified as force_fcn_idxs in the class constructor. By default, function default_linear_spring_force() is associated with force_fcn_idx 0. Users may override this default value with any function that implements the interface required by IBSpringForceGen::registerSpringForceFunction().

Member Function Documentation

◆ getForceFunctionIndices() [1/2]

std::vector< int > & IBAMR::IBSpringForceSpec::getForceFunctionIndices ( )
inline
Returns
A non-const reference to the force function index of the springs attached to the master node.

◆ getForceFunctionIndices() [2/2]

const std::vector< int > & IBAMR::IBSpringForceSpec::getForceFunctionIndices ( ) const
inline
Returns
A const reference to the force function index of the springs attached to the master node.

◆ getMasterNodeIndex() [1/2]

int & IBAMR::IBSpringForceSpec::getMasterNodeIndex ( )
inline
Returns
A non-const reference to the master node index.

◆ getMasterNodeIndex() [2/2]

const int & IBAMR::IBSpringForceSpec::getMasterNodeIndex ( ) const
inline
Returns
A const reference to the master node index.

◆ getNumberOfSprings()

unsigned int IBAMR::IBSpringForceSpec::getNumberOfSprings ( ) const
inline
Returns
The number of springs attached to the master node.

◆ getParameters() [1/2]

std::vector< std::vector< double > > & IBAMR::IBSpringForceSpec::getParameters ( )
inline
Returns
A non-const reference to the parameters of the springs attached to the master node.
Warning
Users may change parameter values but must not resize the parameter vectors.

◆ getParameters() [2/2]

const std::vector< std::vector< double > > & IBAMR::IBSpringForceSpec::getParameters ( ) const
inline
Returns
A const reference to the parameters of the springs attached to the master node.
Warning
Users may change parameter values but must not resize the parameter vectors.

◆ getSlaveNodeIndices() [1/2]

std::vector< int > & IBAMR::IBSpringForceSpec::getSlaveNodeIndices ( )
inline
Returns
A non-const reference to the slave node indices for the springs attached to the master node.

◆ getSlaveNodeIndices() [2/2]

const std::vector< int > & IBAMR::IBSpringForceSpec::getSlaveNodeIndices ( ) const
inline
Returns
A const reference to the slave node indices for the springs attached to the master node.

◆ registerWithStreamableManager()

void IBAMR::IBSpringForceSpec::registerWithStreamableManager ( )
static

Register this class and its factory class with the singleton IBTK::StreamableManager object. This method must be called before any IBSpringForceSpec objects are created.

Note
This method is collective on all MPI processes. This is done to ensure that all processes employ the same class ID for the IBSpringForceSpec class.

Member Data Documentation

◆ STREAMABLE_CLASS_ID

int IBAMR::IBSpringForceSpec::STREAMABLE_CLASS_ID = StreamableManager::getUnregisteredID()
static

The unique class ID for this object type assigned by the IBTK::StreamableManager.


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