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

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

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

Public Member Functions

 KrylovMobilitySolver (std::string object_name, SAMRAI::tbox::Pointer< IBAMR::INSStaggeredHierarchyIntegrator > navier_stokes_integrator, SAMRAI::tbox::Pointer< IBAMR::CIBStrategy > cib_strategy, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db, std::string default_options_prefix, MPI_Comm petsc_comm=PETSC_COMM_WORLD)
 Constructor for mobility solver that employs the PETSc KSP solver framework.
 
virtual ~KrylovMobilitySolver ()
 Destructor.
 
void setKSPType (const std::string &ksp_type)
 Set the KSP type.
 
void setOptionsPrefix (const std::string &options_prefix)
 Set the options prefix used by this PETSc solver object.
 
const KSP & getPETScKSP () const
 Get the PETSc KSP object.
 
SAMRAI::tbox::Pointer< IBAMR::StaggeredStokesSolvergetStokesSolver () const
 Return the Stokes solver used in the preconditioner of the solver.
 
void setVelocityPoissonSpecifications (const SAMRAI::solv::PoissonSpecifications &u_problem_coefs)
 Set the PoissonSpecifications object used to specify the coefficients for the momentum equation in the incompressible Stokes operator.
 
void setPhysicalBoundaryHelper (SAMRAI::tbox::Pointer< IBAMR::StaggeredStokesPhysicalBoundaryHelper > bc_helper)
 Set the StokesSpecifications object and timestep size used to specify the coefficients for the time-dependent incompressible Stokes operator.
 
void setPhysicalBcCoefs (const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > &u_bc_coefs, SAMRAI::solv::RobinBcCoefStrategy< NDIM > *p_bc_coef)
 Set the SAMRAI::solv::RobinBcCoefStrategy objects used to specify physical boundary conditions. More...
 
bool solveSystem (Vec x, Vec b)
 Solve the linear system of equations $ Mx=b $ for $ x $. More...
 
void initializeSolverState (Vec x, Vec b)
 Compute hierarchy dependent data required for solving $ Mx = b $. More...
 
void deallocateSolverState ()
 Remove all hierarchy dependent data allocated by initializeSolverState(). More...
 
void setSolutionTime (double solution_time)
 Set the time at which the solution is to be evaluated.
 
void setTimeInterval (double current_time, double new_time)
 Set the current time interval.
 
void setInterpScale (const double scale_interp)
 Set scale factor for interp operator.
 
void setSpreadScale (const double scale_spread)
 Set scale factor for spread operator.
 
void setRegularizeMobilityScale (const double scale_reg_mob)
 Set scale factor for regularizing mobility matrix.
 
void setNormalizeSpreadForce (const bool normalize_force)
 Set if the mean of the Lagrangian force is to be subtracted from the Eulerian force variable. More...
 

Detailed Description

We are trying to solve the problem

$ Mx = [J L^{-1} S]x = b $; for $ x $.

Here, $ M $ is the mobility matrix, $ J $ is the interpolation operator, $ L $ is the Stokes operator, and $ S $ is the spreading operator.

Member Function Documentation

◆ deallocateSolverState()

void IBAMR::KrylovMobilitySolver::deallocateSolverState ( )

Remove all hierarchy dependent data allocated by initializeSolverState().

Note
It is safe to call deallocateSolverState() when the solver state is already deallocated.
See also
initializeSolverState

◆ initializeSolverState()

void IBAMR::KrylovMobilitySolver::initializeSolverState ( Vec  x,
Vec  b 
)

Compute hierarchy dependent data required for solving $ Mx = b $.

Parameters
xsolution vector
bright-hand-side vector

◆ setNormalizeSpreadForce()

void IBAMR::KrylovMobilitySolver::setNormalizeSpreadForce ( const bool  normalize_force)

Set if the mean of the Lagrangian force is to be subtracted from the Eulerian force variable.

Note
This operation is needed for certain situations like Stokes flow with periodic BCs.

◆ setPhysicalBcCoefs()

void IBAMR::KrylovMobilitySolver::setPhysicalBcCoefs ( const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > &  u_bc_coefs,
SAMRAI::solv::RobinBcCoefStrategy< NDIM > *  p_bc_coef 
)

Set the SAMRAI::solv::RobinBcCoefStrategy objects used to specify physical boundary conditions.

Note
Any of the elements of u_bc_coefs may be NULL. In this case, homogeneous Dirichlet boundary conditions are employed for that data depth. p_bc_coef may also be NULL; in that case, homogeneous Neumann boundary conditions are employed for the pressure.
Parameters
u_bc_coefsVector of pointers to objects that can set the Robin boundary condition coefficients for the velocity.
p_bc_coefPointer to object that can set the Robin boundary condition coefficients for the pressure.

◆ solveSystem()

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

Solve the linear system of equations $ Mx=b $ for $ x $.

Parameters
xsolution vector
bright-hand-side vector
Returns
true if the solver converged to the specified tolerances, false otherwise

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