|
IBAMR
IBAMR version 0.20.
|
Class LevelSetMassLossFixer corrects a regularized phase volume by a uniform shift q of the level set \(\phi\). More...
#include <ibamr/LevelSetUtilities.h>

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 |
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.
| 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 |
||
| ) |
| input_db | provides parameters enable_logging, correction_interval, max_its, rel_tol, abs_tol, and half_width. |
| IBAMR::LevelSetUtilities::LevelSetMassLossFixer::~LevelSetMassLossFixer | ( | ) |
|
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.
|
inline |
|
inline |
| void IBAMR::LevelSetUtilities::LevelSetMassLossFixer::setInitialVolume | ( | double | v0 | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| 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.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |