|
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 NEW-context interiors at a due correction event. 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). The default rel_tol is 1e-12; omitted abs_tol means 64 machine epsilons times the current fluid capacity. Require finite 0 <= rel_tol < 1 and nonnegative finite abs_tol. max_its (default 64) is a positive trial-evaluation budget, excluding the initial check, at most two bracket endpoints, and final field verification. A safeguarded Newton/bisection solve either accepts a finite field within tolerance or reports TBOX_ERROR before changing the corrected interiors.
Restart restores the initial volume, target, and half-width. Logging state is transient; interval, iteration budget, and tolerances use current input or defaults. correction_interval must be positive. With interval two, the callbacks correct pre-advance steps 0 and 2 (the first and third advances).
| 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 | ||
| ) |
All ranks participate with identical controls. NEW data must be allocated. three_phase selects liquid volume with the second level set demarcating solid; otherwise correct gas volume using the first level set alone. A skipped event leaves the field and last-correction logging unchanged.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |