IBAMR  IBAMR version 0.19.
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private 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 <ibamr/IBSpringForceSpec.h>

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

Classes

class  Factory
 A factory class to rebuild IBSpringForceSpec objects from SAMRAI::tbox::AbstractStream data streams. More...
 

Public Member Functions

 IBSpringForceSpec (unsigned int num_springs=0)
 Default constructor. More...
 
 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. More...
 
unsigned int getNumberOfSprings () const
 
const intgetMasterNodeIndex () const
 
intgetMasterNodeIndex ()
 
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. 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 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. More...
 

Static Public Attributes

static int STREAMABLE_CLASS_ID
 

Private Types

using IBSpringForceSpecFactory = IBSpringForceSpec::Factory
 

Private Member Functions

 IBSpringForceSpec (const IBSpringForceSpec &from)=delete
 Copy constructor. More...
 
IBSpringForceSpecoperator= (const IBSpringForceSpec &that)=delete
 Assignment operator. More...
 

Private Attributes

int d_master_idx = IBTK::invalid_index
 
std::vector< intd_slave_idxs
 
std::vector< intd_force_fcn_idxs
 
std::vector< std::vector< double > > d_parameters
 

Detailed Description

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 Typedef Documentation

◆ IBSpringForceSpecFactory

Constructor & Destructor Documentation

◆ IBSpringForceSpec() [1/3]

IBAMR::IBSpringForceSpec::IBSpringForceSpec ( unsigned int  num_springs = 0)
inline

◆ IBSpringForceSpec() [2/3]

IBAMR::IBSpringForceSpec::IBSpringForceSpec ( int  master_idx,
const std::vector< int > &  slave_idxs,
const std::vector< int > &  force_fcn_idxs,
const std::vector< std::vector< double > > &  parameters 
)
inline

◆ IBSpringForceSpec() [3/3]

IBAMR::IBSpringForceSpec::IBSpringForceSpec ( const IBSpringForceSpec from)
privatedelete
Note
This constructor is not implemented and should not be used.
Parameters
fromThe value to copy to this object.

Member Function Documentation

◆ registerWithStreamableManager()

static void IBAMR::IBSpringForceSpec::registerWithStreamableManager ( )
static
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.

◆ getIsRegisteredWithStreamableManager()

bool IBAMR::IBSpringForceSpec::getIsRegisteredWithStreamableManager ( )
inlinestatic

◆ getNumberOfSprings()

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

◆ getMasterNodeIndex() [1/2]

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

◆ getMasterNodeIndex() [2/2]

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

◆ getSlaveNodeIndices() [1/2]

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.

◆ getSlaveNodeIndices() [2/2]

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

◆ getForceFunctionIndices() [1/2]

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.

◆ getForceFunctionIndices() [2/2]

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

◆ getParameters() [1/2]

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.

◆ getParameters() [2/2]

std::vector<std::vector<double> >& IBAMR::IBSpringForceSpec::getParameters ( )
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.

◆ getStreamableClassID()

int IBAMR::IBSpringForceSpec::getStreamableClassID ( ) const
inlineoverridevirtual

Implements IBTK::Streamable.

◆ getDataStreamSize()

size_t IBAMR::IBSpringForceSpec::getDataStreamSize ( ) const
inlineoverridevirtual

Implements IBTK::Streamable.

◆ packStream()

void IBAMR::IBSpringForceSpec::packStream ( SAMRAI::tbox::AbstractStream stream)
inlineoverridevirtual

Implements IBTK::Streamable.

◆ operator=()

IBSpringForceSpec& IBAMR::IBSpringForceSpec::operator= ( const IBSpringForceSpec that)
privatedelete
Note
This operator is not implemented and should not be used.
Parameters
thatThe value to assign to this object.
Returns
A reference to this object.

◆ registerPeriodicShift()

virtual void IBTK::Streamable::registerPeriodicShift ( const SAMRAI::hier::IntVector< NDIM > &  offset,
const Vector displacement 
)
virtualinherited
Note
A default empty implementation is provided.

Member Data Documentation

◆ STREAMABLE_CLASS_ID

int IBAMR::IBSpringForceSpec::STREAMABLE_CLASS_ID
static

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

◆ d_master_idx

int IBAMR::IBSpringForceSpec::d_master_idx = IBTK::invalid_index
private

Data required to define the spring forces.

◆ d_slave_idxs

std::vector<int> IBAMR::IBSpringForceSpec::d_slave_idxs
private

◆ d_force_fcn_idxs

std::vector<int> IBAMR::IBSpringForceSpec::d_force_fcn_idxs
private

◆ d_parameters

std::vector<std::vector<double> > IBAMR::IBSpringForceSpec::d_parameters
private

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