IBAMR  IBAMR version 0.20.
Public Member Functions | Private Member Functions | Private Attributes | List of all members
IBAMR::LevelSetUtilities::LevelSetMassLossFixer Class Reference

Class LevelSetMassLossFixer corrects a regularized phase volume by a uniform shift q of the level set \(\phi\). More...

#include <ibamr/LevelSetUtilities.h>

Inheritance diagram for IBAMR::LevelSetUtilities::LevelSetMassLossFixer:
Inheritance graph
[legend]

Public Member Functions

 LevelSetMassLossFixer (std::string object_name, SAMRAI::tbox::Pointer< AdvDiffHierarchyIntegrator > adv_diff_integrator, std::vector< SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double >>> ls_vars, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db=nullptr, bool register_for_restart=true)
 Constructor of the class. More...
 
 ~LevelSetMassLossFixer ()
 
void putToDatabase (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > db) override
 
const LevelSetContainer & getLevelSetContainer () const
 
LevelSetContainer & getLevelSetContainer ()
 
void setInitialVolume (double v0)
 
double getInitialVolume () const
 
void setTargetVolume (double v)
 
double getTargetVolume () const
 
void setLagrangeMultiplier (double q)
 
double getLagrangeMultiplier () const
 
void setTime (double time)
 
double getTime () const
 
int getCorrectionInterval () const
 
double getErrorRelTolerance () const
 
double getMaxIterations () const
 
bool enableLogging () const
 
void correctVolume (double new_time, bool three_phase)
 Correct the NEW-context level set if a correction is due. More...
 

Private Member Functions

void getFromRestart ()
 Restore the initial volume, target, and interface half-width. More...
 
void getFromInput (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db)
 Read correction controls and the input interface half-width. More...
 

Private Attributes

std::string d_object_name
 
LevelSetContainer d_ls_container
 
bool d_registered_for_restart
 
bool d_enable_logging = false
 
double d_vol_init = std::numeric_limits<double>::quiet_NaN()
 
double d_vol_target = std::numeric_limits<double>::quiet_NaN()
 
double d_q = std::numeric_limits<double>::quiet_NaN()
 
double d_time = 0.0
 
int d_interval = 1
 
int d_max_its = 64
 
double d_rel_tol = 1e-12
 
std::optional< double > d_abs_tol
 

Detailed Description

With the regularized Heaviside function H, the two-phase correction targets the gas volume \(\int H(-(\phi+q))\,dV\). The three-phase correction targets the liquid volume \(\int H(\phi+q)H(\psi)\,dV\), in which \(\psi\) is the solid level set. Call setInitialVolume() after hierarchy initialization. setTargetVolume() may change the target before a later correction. The half-width of H is half_width times the geometric mean cell spacing on each patch.

The volume tolerance is abs_tol + rel_tol*abs(target), with default rel_tol 1e-12 and default abs_tol 64 machine epsilons times the fluid volume \(\int H(\psi)\,dV\) (the domain volume for two phases). max_its (default 64) bounds the trial evaluations. The correction either reaches the tolerance or stops with an error before changing the field.

A restart restores the initial volume, target, and half-width. The other settings come from the current input.

Constructor & Destructor Documentation

◆ LevelSetMassLossFixer()

IBAMR::LevelSetUtilities::LevelSetMassLossFixer::LevelSetMassLossFixer ( std::string  object_name,
SAMRAI::tbox::Pointer< AdvDiffHierarchyIntegrator >  adv_diff_integrator,
std::vector< SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double >>>  ls_vars,
SAMRAI::tbox::Pointer< SAMRAI::tbox::Database >  input_db = nullptr,
bool  register_for_restart = true 
)
Parameters
input_dbprovides parameters enable_logging, correction_interval, max_its, rel_tol, abs_tol, and half_width.

◆ ~LevelSetMassLossFixer()

IBAMR::LevelSetUtilities::LevelSetMassLossFixer::~LevelSetMassLossFixer ( )

Member Function Documentation

◆ putToDatabase()

void IBAMR::LevelSetUtilities::LevelSetMassLossFixer::putToDatabase ( SAMRAI::tbox::Pointer< SAMRAI::tbox::Database >  db)
overridevirtual

This method serializes the object by writing data to the specified database.

NOTE: The asymetry (not having a "getFromDatabase") is from the historical method for doing SAMRAI restart. The constructor for a Serializable class should get the database to restore state from by making a getRootDatabase call to the RestartManager.

Implements SAMRAI::tbox::Serializable.

◆ getLevelSetContainer() [1/2]

const LevelSetContainer& IBAMR::LevelSetUtilities::LevelSetMassLossFixer::getLevelSetContainer ( ) const
inline

◆ getLevelSetContainer() [2/2]

LevelSetContainer& IBAMR::LevelSetUtilities::LevelSetMassLossFixer::getLevelSetContainer ( )
inline

◆ setInitialVolume()

void IBAMR::LevelSetUtilities::LevelSetMassLossFixer::setInitialVolume ( double  v0)

◆ getInitialVolume()

double IBAMR::LevelSetUtilities::LevelSetMassLossFixer::getInitialVolume ( ) const
inline

◆ setTargetVolume()

void IBAMR::LevelSetUtilities::LevelSetMassLossFixer::setTargetVolume ( double  v)
inline

◆ getTargetVolume()

double IBAMR::LevelSetUtilities::LevelSetMassLossFixer::getTargetVolume ( ) const
inline

◆ setLagrangeMultiplier()

void IBAMR::LevelSetUtilities::LevelSetMassLossFixer::setLagrangeMultiplier ( double  q)
inline

◆ getLagrangeMultiplier()

double IBAMR::LevelSetUtilities::LevelSetMassLossFixer::getLagrangeMultiplier ( ) const
inline

◆ setTime()

void IBAMR::LevelSetUtilities::LevelSetMassLossFixer::setTime ( double  time)
inline

◆ getTime()

double IBAMR::LevelSetUtilities::LevelSetMassLossFixer::getTime ( ) const
inline

◆ getCorrectionInterval()

int IBAMR::LevelSetUtilities::LevelSetMassLossFixer::getCorrectionInterval ( ) const
inline

◆ getErrorRelTolerance()

double IBAMR::LevelSetUtilities::LevelSetMassLossFixer::getErrorRelTolerance ( ) const
inline

◆ getMaxIterations()

double IBAMR::LevelSetUtilities::LevelSetMassLossFixer::getMaxIterations ( ) const
inline

◆ enableLogging()

bool IBAMR::LevelSetUtilities::LevelSetMassLossFixer::enableLogging ( ) const
inline

◆ correctVolume()

void IBAMR::LevelSetUtilities::LevelSetMassLossFixer::correctVolume ( double  new_time,
bool  three_phase 
)

If three_phase is true, the function corrects the liquid volume and uses the second level set to indicate the solid. Otherwise, the function corrects the gas volume.

◆ getFromRestart()

void IBAMR::LevelSetUtilities::LevelSetMassLossFixer::getFromRestart ( )
private

◆ getFromInput()

void IBAMR::LevelSetUtilities::LevelSetMassLossFixer::getFromInput ( SAMRAI::tbox::Pointer< SAMRAI::tbox::Database >  input_db)
private

Member Data Documentation

◆ d_object_name

std::string IBAMR::LevelSetUtilities::LevelSetMassLossFixer::d_object_name
private

◆ d_ls_container

LevelSetContainer IBAMR::LevelSetUtilities::LevelSetMassLossFixer::d_ls_container
private

◆ d_registered_for_restart

bool IBAMR::LevelSetUtilities::LevelSetMassLossFixer::d_registered_for_restart
private

◆ d_enable_logging

bool IBAMR::LevelSetUtilities::LevelSetMassLossFixer::d_enable_logging = false
private

◆ d_vol_init

double IBAMR::LevelSetUtilities::LevelSetMassLossFixer::d_vol_init = std::numeric_limits<double>::quiet_NaN()
private

◆ d_vol_target

double IBAMR::LevelSetUtilities::LevelSetMassLossFixer::d_vol_target = std::numeric_limits<double>::quiet_NaN()
private

◆ d_q

double IBAMR::LevelSetUtilities::LevelSetMassLossFixer::d_q = std::numeric_limits<double>::quiet_NaN()
private

◆ d_time

double IBAMR::LevelSetUtilities::LevelSetMassLossFixer::d_time = 0.0
private

◆ d_interval

int IBAMR::LevelSetUtilities::LevelSetMassLossFixer::d_interval = 1
private

◆ d_max_its

int IBAMR::LevelSetUtilities::LevelSetMassLossFixer::d_max_its = 64
private

◆ d_rel_tol

double IBAMR::LevelSetUtilities::LevelSetMassLossFixer::d_rel_tol = 1e-12
private

◆ d_abs_tol

std::optional<double> IBAMR::LevelSetUtilities::LevelSetMassLossFixer::d_abs_tol
private

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