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

Class DirectMobilitySolver solves the mobility and body-mobility sub-problem by employing direct solvers. More...

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

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

Public Member Functions

 DirectMobilitySolver (std::string object_name, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db, SAMRAI::tbox::Pointer< IBAMR::CIBStrategy > cib_strategy)
 The only constructor of this class.
 
virtual ~DirectMobilitySolver ()
 Destructor for this class.
 
void registerMobilityMat (const std::string &mat_name, const unsigned prototype_struct_id, MobilityMatrixType mat_type, std::pair< MobilityMatrixInverseType, MobilityMatrixInverseType > inv_type, const int managing_proc=0, const std::string &filename="", std::pair< double, double > scale=std::pair< double, double >(1.0, 0.0))
 Register a prototypical structure with a particular mobility matrix identified by its name. More...
 
void registerMobilityMat (const std::string &mat_name, const std::vector< unsigned > &prototype_struct_ids, MobilityMatrixType mat_type, std::pair< MobilityMatrixInverseType, MobilityMatrixInverseType > inv_type, const int managing_proc=0, const std::string &filename="", std::pair< double, double > scale=std::pair< double, double >(1.0, 0.0))
 Register mutiple prototype structures with a particular matrix identified by its name. A combined dense mobility matrix for all the associated prototypical structures will be formed. More...
 
void registerStructIDsWithMobilityMat (const std::string &mat_name, const std::vector< std::vector< unsigned > > &struct_ids)
 Register all structures that will be managed by this particular dense mobility matrix. More...
 
void initializeSolverState (Vec x, Vec b)
 Initialize the solver.
 
void deallocateSolverState ()
 Deallocate the solver.
 
void setSolutionTime (const double solution_time)
 Set the time at which the solution is to be evaluated.
 
void setTimeInterval (const double current_time, const double new_time)
 Set the time interval of integration.
 
void setStokesSpecifications (const IBAMR::StokesSpecifications &stokes_spec)
 Set stokes specifications.
 
bool solveSystem (Vec x, Vec b)
 Solves the mobility problem. More...
 
bool solveBodySystem (Vec x, Vec b)
 Solves the body mobility problem. More...
 
const std::vector< unsigned > & getPrototypeStructIDs (const std::string &mat_name)
 Return the ids of the structures associated with the dense mobility matrix formation. More...
 
const std::vector< std::vector< unsigned > > & getStructIDs (const std::string &mat_name)
 Return the ids of the structure associated with the dense mobility matrix. More...
 

Detailed Description

Class DirectMobilitySolver solves the mobility and body-mobility sub-problem by employing direct solvers.

Member Function Documentation

◆ getPrototypeStructIDs()

const std::vector< unsigned > & IBAMR::DirectMobilitySolver::getPrototypeStructIDs ( const std::string mat_name)

Return the ids of the structures associated with the dense mobility matrix formation.

Parameters
mat_nameMatrix handle.
Returns
Vector of structure ids used to form the mobility matrix.

◆ getStructIDs()

const std::vector< std::vector< unsigned > > & IBAMR::DirectMobilitySolver::getStructIDs ( const std::string mat_name)

Return the ids of the structure associated with the dense mobility matrix.

Parameters
mat_nameMatrix handle.
Returns
Vector of structure ids associated with the mobility matrix.

◆ registerMobilityMat() [1/2]

void IBAMR::DirectMobilitySolver::registerMobilityMat ( const std::string mat_name,
const std::vector< unsigned > &  prototype_struct_ids,
MobilityMatrixType  mat_type,
std::pair< MobilityMatrixInverseType, MobilityMatrixInverseType inv_type,
const int  managing_proc = 0,
const std::string filename = "",
std::pair< double, double >  scale = std::pair<double, double>(1.0, 0.0) 
)

Register mutiple prototype structures with a particular matrix identified by its name. A combined dense mobility matrix for all the associated prototypical structures will be formed.

Parameters
mat_nameMatrix handle.
prototype_struct_idsVector of prototypical structure ids as defined while registering structures with IBAMR::IBStrategy class.
mat_typeMatrix type to be used for dense mobility matrix.
inv_typeInversion method to be used for the mobility and body-mobility matrix.
filenameIf the mobility matrix is to be read from an input file.
Note
The current implementation supports only binary files from PETSc I/O.
Parameters
scaleScale for improving the conditioning number of dense mobility matrix. The matrix is scaled as $ [MM] = \alpha*[MM] + \beta*[I]. $
managing_procMPI processor that manages this mobility matrix.

◆ registerMobilityMat() [2/2]

void IBAMR::DirectMobilitySolver::registerMobilityMat ( const std::string mat_name,
const unsigned  prototype_struct_id,
MobilityMatrixType  mat_type,
std::pair< MobilityMatrixInverseType, MobilityMatrixInverseType inv_type,
const int  managing_proc = 0,
const std::string filename = "",
std::pair< double, double >  scale = std::pair<double, double>(1.0, 0.0) 
)

Register a prototypical structure with a particular mobility matrix identified by its name.

Parameters
mat_nameMatrix handle.
prototype_struct_idPrototypical structure id as defined while registering structures with IBAMR::IBStrategy class.
mat_typeMatrix type to be used for dense mobility matrix.
inv_typeInversion method to be used for the mobility and body-mobility matrix.
filenameIf the mobility matrix is to be read from an input file.
Note
The current implementation supports only binary files from PETSc I/O.
Parameters
scaleScale for improving the conditioning number of dense mobility matrix. The matrix is scaled as $ [MM] = \alpha*[MM] + \beta*[I]. $
managing_procMPI processor that manages this mobility matrix.

◆ registerStructIDsWithMobilityMat()

void IBAMR::DirectMobilitySolver::registerStructIDsWithMobilityMat ( const std::string mat_name,
const std::vector< std::vector< unsigned > > &  struct_ids 
)

Register all structures that will be managed by this particular dense mobility matrix.

Note
This function should be called after all the mobility matrices have been registered with a particular processor.

◆ solveBodySystem()

bool IBAMR::DirectMobilitySolver::solveBodySystem ( Vec  x,
Vec  b 
)

Solves the body mobility problem.

Parameters
xVec storing the rigid body center of mass translational and rotational velocity.
bVec storing the applied external force.
Returns
true if the solver converged to the specified tolerances, false otherwise.

◆ solveSystem()

bool IBAMR::DirectMobilitySolver::solveSystem ( Vec  x,
Vec  b 
)

Solves the mobility problem.

Parameters
xVec storing the Lagrange multiplier.
bVec storing the desired velocity.
Returns
true if the solver converged to the specified tolerances, false otherwise.

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