IBAMR  IBAMR version 0.19.
Classes | Public Member Functions | Private Member Functions | List of all members
IBAMR::IBStandardForceGen Class Reference

Class IBStandardForceGen is a concrete IBLagrangianForceStrategy that is intended to be used in conjunction with curvilinear mesh data generated by class IBStandardInitializer. More...

#include <ibamr/IBStandardForceGen.h>

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

Classes

struct  BeamData
 
struct  SpringData
 
struct  TargetPointData
 

Public Member Functions

 IBStandardForceGen (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db=SAMRAI::tbox::Pointer< SAMRAI::tbox::Database >())
 Default constructor. More...
 
void registerSpringForceFunction (int force_fcn_index, const SpringForceFcnPtr spring_force_fcn_ptr, const SpringForceDerivFcnPtr spring_force_deriv_fcn_ptr=nullptr)
 Register a spring force specification function with the force generator. More...
 
void setUniformBodyForce (IBTK::Vector F, int structure_id, int level_number)
 Set a uniform body force that is applied on each point in the structure with the given structure_id. More...
 
void initializeLevelData (SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double init_data_time, bool initial_time, IBTK::LDataManager *l_data_manager) override
 Setup the data needed to compute the forces on the specified level of the patch hierarchy. More...
 
void computeLagrangianForce (SAMRAI::tbox::Pointer< IBTK::LData > F_data, SAMRAI::tbox::Pointer< IBTK::LData > X_data, SAMRAI::tbox::Pointer< IBTK::LData > U_data, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double data_time, IBTK::LDataManager *l_data_manager) override
 Compute the force generated by the Lagrangian structure on the specified level of the patch hierarchy. More...
 
void computeLagrangianForceJacobianNonzeroStructure (std::vector< int > &d_nnz, std::vector< int > &o_nnz, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, IBTK::LDataManager *l_data_manager) override
 Compute the non-zero structure of the force Jacobian matrix. More...
 
void computeLagrangianForceJacobian (Mat &J_mat, MatAssemblyType assembly_type, double X_coef, SAMRAI::tbox::Pointer< IBTK::LData > X_data, double U_coef, SAMRAI::tbox::Pointer< IBTK::LData > U_data, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double data_time, IBTK::LDataManager *l_data_manager) override
 Compute the Jacobian of the force with respect to the present structure configuration. More...
 
double computeLagrangianEnergy (SAMRAI::tbox::Pointer< IBTK::LData > X_data, SAMRAI::tbox::Pointer< IBTK::LData > U_data, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double data_time, IBTK::LDataManager *l_data_manager) override
 Compute the potential energy with respect to the present structure configuration and velocity. More...
 
virtual void setTimeInterval (double current_time, double new_time)
 Set the current and new times for the present timestep. More...
 

Private Member Functions

 IBStandardForceGen (const IBStandardForceGen &from)=delete
 Copy constructor. More...
 
IBStandardForceGenoperator= (const IBStandardForceGen &that)=delete
 Assignment operator. More...
 

Data maintained separately for each level of the patch hierarchy.

std::vector< SpringDatad_spring_data
 
std::vector< BeamDatad_beam_data
 
std::vector< TargetPointDatad_target_point_data
 
std::map< int, std::map< int, IBTK::Vector > > d_uniform_body_force_data
 
std::vector< SAMRAI::tbox::Pointer< IBTK::LData > > d_X_ghost_data
 
std::vector< SAMRAI::tbox::Pointer< IBTK::LData > > d_F_ghost_data
 
std::vector< SAMRAI::tbox::Pointer< IBTK::LData > > d_dX_data
 
std::vector< boold_is_initialized
 
std::map< int, SpringForceFcnPtrd_spring_force_fcn_map
 Spring force functions. More...
 
std::map< int, SpringForceDerivFcnPtrd_spring_force_deriv_fcn_map
 
bool d_log_target_point_displacements = false
 Logging settings. More...
 
void initializeSpringLevelData (std::set< int > &nonlocal_petsc_idx_set, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double init_data_time, bool initial_time, IBTK::LDataManager *l_data_manager)
 
void computeLagrangianSpringForce (SAMRAI::tbox::Pointer< IBTK::LData > F_data, SAMRAI::tbox::Pointer< IBTK::LData > X_data, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double data_time, IBTK::LDataManager *l_data_manager)
 
void initializeBeamLevelData (std::set< int > &nonlocal_petsc_idx_set, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double init_data_time, bool initial_time, IBTK::LDataManager *l_data_manager)
 
void computeLagrangianBeamForce (SAMRAI::tbox::Pointer< IBTK::LData > F_data, SAMRAI::tbox::Pointer< IBTK::LData > X_data, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double data_time, IBTK::LDataManager *l_data_manager)
 
void initializeTargetPointLevelData (std::set< int > &nonlocal_petsc_idx_set, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double init_data_time, bool initial_time, IBTK::LDataManager *l_data_manager)
 
void computeLagrangianTargetPointForce (SAMRAI::tbox::Pointer< IBTK::LData > F_data, SAMRAI::tbox::Pointer< IBTK::LData > X_data, SAMRAI::tbox::Pointer< IBTK::LData > U_data, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double data_time, IBTK::LDataManager *l_data_manager)
 
void computeLagrangianBodyForce (SAMRAI::tbox::Pointer< IBTK::LData > F_data, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double data_time, IBTK::LDataManager *l_data_manager)
 

Detailed Description

Class IBStandardForceGen provides support for linear and nonlinear spring forces, linear beam forces, and target point penalty forces.

Note
By default, function default_linear_spring_force() is associated with spring force_fcn_idx 0. This is the default spring force function index used by class IBStandardInitializer in cases in which a force function index is not specified in a spring input file. Users may override this default force function with any function that implements the interface required by registerSpringForceFunction(). Users may also specify additional force functions that may be associated with arbitrary integer indices.

Constructor & Destructor Documentation

◆ IBStandardForceGen() [1/2]

IBAMR::IBStandardForceGen::IBStandardForceGen ( SAMRAI::tbox::Pointer< SAMRAI::tbox::Database input_db = SAMRAI::tbox::PointerSAMRAI::tbox::Database >())

◆ IBStandardForceGen() [2/2]

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

Member Function Documentation

◆ registerSpringForceFunction()

void IBAMR::IBStandardForceGen::registerSpringForceFunction ( int  force_fcn_index,
const SpringForceFcnPtr  spring_force_fcn_ptr,
const SpringForceDerivFcnPtr  spring_force_deriv_fcn_ptr = nullptr 
)

These functions are employed to compute the force generated by a particular spring for the specified displacement, spring constant, rest length, and Lagrangian index.

Note
By default, function default_linear_spring_force() is associated with force_fcn_idx 0.

◆ setUniformBodyForce()

void IBAMR::IBStandardForceGen::setUniformBodyForce ( IBTK::Vector  F,
int  structure_id,
int  level_number 
)

◆ initializeLevelData()

void IBAMR::IBStandardForceGen::initializeLevelData ( SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
int  level_number,
double  init_data_time,
bool  initial_time,
IBTK::LDataManager l_data_manager 
)
overridevirtual

Reimplemented from IBAMR::IBLagrangianForceStrategy.

◆ computeLagrangianForce()

void IBAMR::IBStandardForceGen::computeLagrangianForce ( SAMRAI::tbox::Pointer< IBTK::LData F_data,
SAMRAI::tbox::Pointer< IBTK::LData X_data,
SAMRAI::tbox::Pointer< IBTK::LData U_data,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
int  level_number,
double  data_time,
IBTK::LDataManager l_data_manager 
)
overridevirtual
Note
Nodal forces computed by this method are added to the force vector.

Reimplemented from IBAMR::IBLagrangianForceStrategy.

◆ computeLagrangianForceJacobianNonzeroStructure()

void IBAMR::IBStandardForceGen::computeLagrangianForceJacobianNonzeroStructure ( std::vector< int > &  d_nnz,
std::vector< int > &  o_nnz,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
int  level_number,
IBTK::LDataManager l_data_manager 
)
overridevirtual
Note
Elements indices must be global PETSc indices.

Reimplemented from IBAMR::IBLagrangianForceStrategy.

◆ computeLagrangianForceJacobian()

void IBAMR::IBStandardForceGen::computeLagrangianForceJacobian ( Mat &  J_mat,
MatAssemblyType  assembly_type,
double  X_coef,
SAMRAI::tbox::Pointer< IBTK::LData X_data,
double  U_coef,
SAMRAI::tbox::Pointer< IBTK::LData U_data,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
int  level_number,
double  data_time,
IBTK::LDataManager l_data_manager 
)
overridevirtual
Note
The elements of the Jacobian should be "accumulated" in the provided matrix J.

Reimplemented from IBAMR::IBLagrangianForceStrategy.

◆ computeLagrangianEnergy()

double IBAMR::IBStandardForceGen::computeLagrangianEnergy ( SAMRAI::tbox::Pointer< IBTK::LData X_data,
SAMRAI::tbox::Pointer< IBTK::LData U_data,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
int  level_number,
double  data_time,
IBTK::LDataManager l_data_manager 
)
overridevirtual

Reimplemented from IBAMR::IBLagrangianForceStrategy.

◆ operator=()

IBStandardForceGen& IBAMR::IBStandardForceGen::operator= ( const IBStandardForceGen 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.

◆ initializeSpringLevelData()

void IBAMR::IBStandardForceGen::initializeSpringLevelData ( std::set< int > &  nonlocal_petsc_idx_set,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
int  level_number,
double  init_data_time,
bool  initial_time,
IBTK::LDataManager l_data_manager 
)
private

Spring force routines.

◆ computeLagrangianSpringForce()

void IBAMR::IBStandardForceGen::computeLagrangianSpringForce ( SAMRAI::tbox::Pointer< IBTK::LData F_data,
SAMRAI::tbox::Pointer< IBTK::LData X_data,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
int  level_number,
double  data_time,
IBTK::LDataManager l_data_manager 
)
private

◆ initializeBeamLevelData()

void IBAMR::IBStandardForceGen::initializeBeamLevelData ( std::set< int > &  nonlocal_petsc_idx_set,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
int  level_number,
double  init_data_time,
bool  initial_time,
IBTK::LDataManager l_data_manager 
)
private

Beam force routines.

◆ computeLagrangianBeamForce()

void IBAMR::IBStandardForceGen::computeLagrangianBeamForce ( SAMRAI::tbox::Pointer< IBTK::LData F_data,
SAMRAI::tbox::Pointer< IBTK::LData X_data,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
int  level_number,
double  data_time,
IBTK::LDataManager l_data_manager 
)
private

◆ initializeTargetPointLevelData()

void IBAMR::IBStandardForceGen::initializeTargetPointLevelData ( std::set< int > &  nonlocal_petsc_idx_set,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
int  level_number,
double  init_data_time,
bool  initial_time,
IBTK::LDataManager l_data_manager 
)
private

Target point force routines.

◆ computeLagrangianTargetPointForce()

void IBAMR::IBStandardForceGen::computeLagrangianTargetPointForce ( SAMRAI::tbox::Pointer< IBTK::LData F_data,
SAMRAI::tbox::Pointer< IBTK::LData X_data,
SAMRAI::tbox::Pointer< IBTK::LData U_data,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
int  level_number,
double  data_time,
IBTK::LDataManager l_data_manager 
)
private

◆ computeLagrangianBodyForce()

void IBAMR::IBStandardForceGen::computeLagrangianBodyForce ( SAMRAI::tbox::Pointer< IBTK::LData F_data,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
int  level_number,
double  data_time,
IBTK::LDataManager l_data_manager 
)
private

Constant body force routines.

◆ setTimeInterval()

virtual void IBAMR::IBLagrangianForceStrategy::setTimeInterval ( double  current_time,
double  new_time 
)
virtualinherited
Note
A default empty implementation is provided.

Reimplemented in IBAMR::IBLagrangianForceStrategySet.

Member Data Documentation

◆ d_spring_data

std::vector<SpringData> IBAMR::IBStandardForceGen::d_spring_data
private

◆ d_beam_data

std::vector<BeamData> IBAMR::IBStandardForceGen::d_beam_data
private

◆ d_target_point_data

std::vector<TargetPointData> IBAMR::IBStandardForceGen::d_target_point_data
private

◆ d_uniform_body_force_data

std::map<int, std::map<int, IBTK::Vector> > IBAMR::IBStandardForceGen::d_uniform_body_force_data
private

◆ d_X_ghost_data

std::vector<SAMRAI::tbox::Pointer<IBTK::LData> > IBAMR::IBStandardForceGen::d_X_ghost_data
private

◆ d_F_ghost_data

std::vector<SAMRAI::tbox::Pointer<IBTK::LData> > IBAMR::IBStandardForceGen::d_F_ghost_data
private

◆ d_dX_data

std::vector<SAMRAI::tbox::Pointer<IBTK::LData> > IBAMR::IBStandardForceGen::d_dX_data
private

◆ d_is_initialized

std::vector<bool> IBAMR::IBStandardForceGen::d_is_initialized
private

◆ d_spring_force_fcn_map

std::map<int, SpringForceFcnPtr> IBAMR::IBStandardForceGen::d_spring_force_fcn_map
private

◆ d_spring_force_deriv_fcn_map

std::map<int, SpringForceDerivFcnPtr> IBAMR::IBStandardForceGen::d_spring_force_deriv_fcn_map
private

◆ d_log_target_point_displacements

bool IBAMR::IBStandardForceGen::d_log_target_point_displacements = false
private

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