IBAMR  IBAMR version 0.20.
Public Types | Public Member Functions | Protected Attributes | List of all members
IBAMR::RelaxationLSMethod Class Reference

Class RelaxationLSMethod provides a relaxation algorithm implementation of the level set method. Specifically, this class iterates (to steady-state) the PDE \(\frac{\partial Q}{\partial \tau}+sgn(Q^0)(|\nabla Q | - 1) = 0\), which produces a solution to the Eikonal equation \( |\nabla Q | = 1 \). The solution of the Eikonal equation produces the signed distance away from an interface. More...

#include <ibamr/RelaxationLSMethod.h>

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

Public Types

using LocateInterfaceNeighborhoodFcnPtr = void(*)(int D_idx, SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps > hier_math_ops, double time, bool initial_time, void *ctx)
 Function specifying distance function near an interface. More...
 

Public Member Functions

 RelaxationLSMethod (std::string object_name, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > db=nullptr, bool register_for_restart=true)
 Constructor. More...
 
virtual void registerPhysicalBoundaryCondition (SAMRAI::solv::RobinBcCoefStrategy< NDIM > *robin_bc_coef)
 Register physical boundary condition for the level set. More...
 
virtual void registerInterfaceNeighborhoodLocatingFcn (LocateInterfaceNeighborhoodFcnPtr callback, void *ctx)
 Register interface neighborhood locating functions. More...
 
virtual void setReinitializeLSData (bool reinit_ls_data)
 Indicate that the class should reinitialize level set. More...
 
void putToDatabase (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > db) override
 

Protected Attributes

std::string d_object_name
 
bool d_registered_for_restart
 
LevelSetOrder d_ls_order = FIRST_ORDER_LS
 
LevelSetTimeStepping d_ls_ts = GAUSS_SEIDEL_PSEUDO_TS
 
double d_abs_tol = 1.0e-5
 
int d_max_its = 100
 
bool d_enable_logging = false
 
bool d_reinitialize_ls = false
 
int d_reinit_interval = 0
 
SAMRAI::solv::RobinBcCoefStrategy< NDIM > * d_bc_coef
 
std::vector< LocateInterfaceNeighborhoodFcnPtr > d_locate_interface_fcns
 
std::vector< void * > d_locate_interface_fcns_ctx
 

Implementation of IBAMR::LSInitStrategy interface.

bool d_apply_mass_constraint = false
 
bool d_apply_vol_redistribution = false
 
bool d_apply_subcell_fix = false
 
bool d_apply_sign_fix = false
 
int d_D_gcw = -1
 
double d_alpha = 1.0
 
void initializeLSData (int D_idx, SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps > hierarchy_math_ops, int integrator_step, double time, bool initial_time) override
 Initialize level set data using the relaxation method. More...
 
void setApplyMassConstraint (bool apply_mass_constraint)
 Indicate that the class should apply the mass constraint. More...
 
void setApplySubcellFix (bool apply_subcell_fix)
 Indicate that the class should apply the subcell fix. More...
 
void setApplySignFix (bool apply_sign_fix)
 Indicate that the class should apply the sign fix near interface points. More...
 
void setLSGhostCellWidth (int D_gcw)
 Hard set the ghost cell width for the level set variable. More...
 
void setApplyVolumeRedistribution (bool apply_volume_redistribution)
 Indicate that the class should apply the volume redistribution algorithm. More...
 
void relax (SAMRAI::tbox::Pointer< IBTK::HierarchyGhostCellInterpolation > D_fill_op, SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps > hier_math_ops, int dist_idx, int dist_init_idx, int dist_copy_idx, int dt_idx, const int iter, const double time) const
 Do one relaxation step over the hierarchy. More...
 
void relax (SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >> dist_data, const SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >> dist_init_data, SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >> dt_data, const SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM >> patch, const int iter) const
 Do one relaxation step over a patch. More...
 
void computeHamiltonian (SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps > hier_math_ops, int ham_idx, int dist_idx) const
 Compute the Hamiltonian of the indicator field over the hierarchy. More...
 
void computeHamiltonian (SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >> ham_data, const SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >> dist_data, const SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM >> patch) const
 Compute the hamiltonian of the indicator field field over a patch. More...
 
void applyMassConstraint (SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps > hier_math_ops, int dist_idx, int dist_copy_idx, int dist_init_idx, int ham_init_idx) const
 Apply the mass constraint over the hierarchy. More...
 
void applyMassConstraint (SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >> dist_data, const SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >> dist_copy_data, const SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >> dist_init_data, const SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >> ham_init_data, const SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM >> patch) const
 Apply the mass constraint over a patch. More...
 
void applyVolumeRedistribution (SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps > hier_math_ops, int lambda_idx, int dist_idx, int dist_init_idx, int ham_idx, int dt_idx) const
 Validate and apply the volume redistribution update over the hierarchy. More...
 
void getFromInput (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > db)
 
void getFromRestart ()
 
 RelaxationLSMethod (const RelaxationLSMethod &from)=delete
 Copy constructor. More...
 
RelaxationLSMethod & operator= (const RelaxationLSMethod &that)=delete
 Assignment operator. More...
 

Detailed Description

An optional mass constraint can be applied to certain high-order LS schemes by first computing an intermediate \(\tilde{Q}\) and projecting in the following way:

\(Q = \tilde{Q} + \lambda_{ij}H'(Q^0)|\nabla Q^0|\).

This greatly improves the volume conservation of the interface while still retaining the order of accuracy and signed distance property. The mass conservation constraint assumes that \(Q^0\) is already close to a signed distance function and is hence, by default, disabled at initial time.

References Min, C., On reinitializing level set functions

Sussman, M. and Fatemi, E., An Efficient, Interface-Preserving Level Set Redistancing Algorithm and Its Application to Interfacial Incompressible Fluid Flow

Member Typedef Documentation

◆ LocateInterfaceNeighborhoodFcnPtr

using IBAMR::LSInitStrategy::LocateInterfaceNeighborhoodFcnPtr = void (*)(int D_idx, SAMRAI::tbox::Pointer<IBTK::HierarchyMathOps> hier_math_ops, double time, bool initial_time, void* ctx)
inherited

Constructor & Destructor Documentation

◆ RelaxationLSMethod() [1/2]

IBAMR::RelaxationLSMethod::RelaxationLSMethod ( std::string  object_name,
SAMRAI::tbox::Pointer< SAMRAI::tbox::Database >  db = nullptr,
bool  register_for_restart = true 
)

◆ RelaxationLSMethod() [2/2]

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

Member Function Documentation

◆ initializeLSData()

void IBAMR::RelaxationLSMethod::initializeLSData ( int  D_idx,
SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps >  hierarchy_math_ops,
int  integrator_step,
double  time,
bool  initial_time 
)
overridevirtual

Implements IBAMR::LSInitStrategy.

◆ setApplyMassConstraint()

void IBAMR::RelaxationLSMethod::setApplyMassConstraint ( bool  apply_mass_constraint)

◆ setApplySubcellFix()

void IBAMR::RelaxationLSMethod::setApplySubcellFix ( bool  apply_subcell_fix)

◆ setApplySignFix()

void IBAMR::RelaxationLSMethod::setApplySignFix ( bool  apply_sign_fix)

◆ setLSGhostCellWidth()

void IBAMR::RelaxationLSMethod::setLSGhostCellWidth ( int  D_gcw)

◆ setApplyVolumeRedistribution()

void IBAMR::RelaxationLSMethod::setApplyVolumeRedistribution ( bool  apply_volume_redistribution)

Redistribution is skipped if the source integral and the weight integral are both zero. The program stops with an error, before the reinitialized field changes, if the correction is nonfinite or not representable.

◆ relax() [1/2]

void IBAMR::RelaxationLSMethod::relax ( SAMRAI::tbox::Pointer< IBTK::HierarchyGhostCellInterpolation >  D_fill_op,
SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps >  hier_math_ops,
int  dist_idx,
int  dist_init_idx,
int  dist_copy_idx,
int  dt_idx,
const int  iter,
const double  time 
) const
private

◆ relax() [2/2]

void IBAMR::RelaxationLSMethod::relax ( SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >>  dist_data,
const SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >>  dist_init_data,
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >>  dt_data,
const SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM >>  patch,
const int  iter 
) const
private

◆ computeHamiltonian() [1/2]

void IBAMR::RelaxationLSMethod::computeHamiltonian ( SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps >  hier_math_ops,
int  ham_idx,
int  dist_idx 
) const
private

◆ computeHamiltonian() [2/2]

void IBAMR::RelaxationLSMethod::computeHamiltonian ( SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >>  ham_data,
const SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >>  dist_data,
const SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM >>  patch 
) const
private

◆ applyMassConstraint() [1/2]

void IBAMR::RelaxationLSMethod::applyMassConstraint ( SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps >  hier_math_ops,
int  dist_idx,
int  dist_copy_idx,
int  dist_init_idx,
int  ham_init_idx 
) const
private

◆ applyMassConstraint() [2/2]

void IBAMR::RelaxationLSMethod::applyMassConstraint ( SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >>  dist_data,
const SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >>  dist_copy_data,
const SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >>  dist_init_data,
const SAMRAI::tbox::Pointer< SAMRAI::pdat::CellData< NDIM, double >>  ham_init_data,
const SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM >>  patch 
) const
private

◆ applyVolumeRedistribution()

void IBAMR::RelaxationLSMethod::applyVolumeRedistribution ( SAMRAI::tbox::Pointer< IBTK::HierarchyMathOps >  hier_math_ops,
int  lambda_idx,
int  dist_idx,
int  dist_init_idx,
int  ham_idx,
int  dt_idx 
) const
private

◆ getFromInput()

void IBAMR::RelaxationLSMethod::getFromInput ( SAMRAI::tbox::Pointer< SAMRAI::tbox::Database >  db)
private

Read input values from a given database.

◆ getFromRestart()

void IBAMR::RelaxationLSMethod::getFromRestart ( )
private

Read object state from the restart file and initialize class data members.

◆ operator=()

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

◆ registerPhysicalBoundaryCondition()

virtual void IBAMR::LSInitStrategy::registerPhysicalBoundaryCondition ( SAMRAI::solv::RobinBcCoefStrategy< NDIM > *  robin_bc_coef)
virtualinherited

◆ registerInterfaceNeighborhoodLocatingFcn()

virtual void IBAMR::LSInitStrategy::registerInterfaceNeighborhoodLocatingFcn ( LocateInterfaceNeighborhoodFcnPtr  callback,
void *  ctx 
)
virtualinherited

◆ setReinitializeLSData()

virtual void IBAMR::LSInitStrategy::setReinitializeLSData ( bool  reinit_ls_data)
virtualinherited

◆ putToDatabase()

void IBAMR::LSInitStrategy::putToDatabase ( SAMRAI::tbox::Pointer< SAMRAI::tbox::Database >  db)
overridevirtualinherited

Write out object state to the given database.

An empty default implementation is provided.

Implements SAMRAI::tbox::Serializable.

Member Data Documentation

◆ d_apply_mass_constraint

bool IBAMR::RelaxationLSMethod::d_apply_mass_constraint = false
protected

◆ d_apply_vol_redistribution

bool IBAMR::RelaxationLSMethod::d_apply_vol_redistribution = false
protected

◆ d_apply_subcell_fix

bool IBAMR::RelaxationLSMethod::d_apply_subcell_fix = false
protected

◆ d_apply_sign_fix

bool IBAMR::RelaxationLSMethod::d_apply_sign_fix = false
protected

◆ d_D_gcw

int IBAMR::RelaxationLSMethod::d_D_gcw = -1
protected

◆ d_alpha

double IBAMR::RelaxationLSMethod::d_alpha = 1.0
protected

◆ d_object_name

std::string IBAMR::LSInitStrategy::d_object_name
protectedinherited

◆ d_registered_for_restart

bool IBAMR::LSInitStrategy::d_registered_for_restart
protectedinherited

◆ d_ls_order

LevelSetOrder IBAMR::LSInitStrategy::d_ls_order = FIRST_ORDER_LS
protectedinherited

◆ d_ls_ts

LevelSetTimeStepping IBAMR::LSInitStrategy::d_ls_ts = GAUSS_SEIDEL_PSEUDO_TS
protectedinherited

◆ d_abs_tol

double IBAMR::LSInitStrategy::d_abs_tol = 1.0e-5
protectedinherited

◆ d_max_its

int IBAMR::LSInitStrategy::d_max_its = 100
protectedinherited

◆ d_enable_logging

bool IBAMR::LSInitStrategy::d_enable_logging = false
protectedinherited

◆ d_reinitialize_ls

bool IBAMR::LSInitStrategy::d_reinitialize_ls = false
protectedinherited

◆ d_reinit_interval

int IBAMR::LSInitStrategy::d_reinit_interval = 0
protectedinherited

◆ d_bc_coef

SAMRAI::solv::RobinBcCoefStrategy<NDIM>* IBAMR::LSInitStrategy::d_bc_coef
protectedinherited

◆ d_locate_interface_fcns

std::vector<LocateInterfaceNeighborhoodFcnPtr> IBAMR::LSInitStrategy::d_locate_interface_fcns
protectedinherited

◆ d_locate_interface_fcns_ctx

std::vector<void*> IBAMR::LSInitStrategy::d_locate_interface_fcns_ctx
protectedinherited

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