|
IBAMR
IBAMR version 0.20.
|
Correct a regularized phase volume by a uniform level-set shift. 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 |
The two-phase correction targets gas volume \(\int H(-(\phi+q))\,dV\); the three-phase correction targets liquid volume \(\int H(\phi+q)H(\psi)\,dV\). Set the initial volume after hierarchy initialization; setTargetVolume() may update the target before a later correction. The half-width 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 current fluid capacity. max_its (default 64) bounds the trial evaluations. The correction either reaches the tolerance or stops with an error before changing the field.
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 | ||
| ) |
three_phase selects the liquid volume, with the second level set marking the solid; otherwise the gas volume is corrected.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |