#include <AMR.H>
Collaboration diagram for AMR:
Public Methods | |
AMR () | |
~AMR () | |
void | define (int a_max_level, const Vector< int > &a_ref_ratios, const Box &a_prob_domain, const AMRLevelFactory *const a_amrLevelFact) |
void | define (int a_max_level, const Vector< int > &a_ref_ratios, const ProblemDomain &a_prob_domain, const AMRLevelFactory *const a_amrLevelFact) |
bool | isDefined () const |
bool | isSetUp () const |
void | setupForNewAMRRun () |
void | setupForFixedHierarchyRun (const Vector< Vector< Box > > &a_amr_grids, int a_proper_nest=1) |
void | conclude () const |
void | run (Real a_max_time, int a_max_step) |
void | plotPrefix (const std::string &a_plotfile_prefix) |
void | checkpointPrefix (const std::string &a_checkpointfile_prefix) |
void | plotInterval (int a_plot_interval) |
void | checkpointInterval (int a_checkpoint_interval) |
void | maxGridSize (int a_max_grid_size) |
void | maxBaseGridSize (int a_max_base_grid_size) |
void | dtToleranceFactor (Real a_dt_tolerance_factor) |
void | fillRatio (Real a_fillRat) |
void | blockFactor (int a_blockFactor) |
void | gridBufferSize (int a_grid_buffer_size) |
int | maxGridSize () const |
int | maxBaseGridSize () const |
void | verbosity (int a_verbosity) |
void | regridIntervals (const Vector< int > &a_regridIntervals) |
int | verbosity () const |
void | maxDtGrow (Real a_dtGrowFactor) |
void | timeEps (Real a_timeEps) |
Real | maxDtGrow () const |
Real | timeEps () const |
void | fixedDt (Real a_dt) |
Real | fixedDt () const |
Vector< AMRLevel * > | getAMRLevels () |
Real | getCurrentTime () const |
Protected Methods | |
int | timeStep (int a_level, int a_stepsLeft, bool a_coarseTimeBoundary) |
void | clearMemory () |
void | regrid (int a_base_level) |
void | initialGrid () |
void | writePlotFile () const |
void | writeCheckpointFile () const |
void | assignDt () |
bool | needToRegrid (int a_level, int a_numStepsLeft) const |
void | makeBaseLevelMesh (Vector< Box > &a_grids) const |
void | setDefaultValues () |
Protected Attributes | |
int | m_blockFactor |
Real | m_fillRatio |
int | m_max_level |
int | m_finest_level_old |
int | m_finest_level |
int | m_checkpoint_interval |
int | m_plot_interval |
int | m_max_grid_size |
int | m_max_base_grid_size |
Real | m_dt_tolerance_factor |
Real | m_fixedDt |
bool | m_isDefined |
bool | m_isSetUp |
Vector< AMRLevel * > | m_amrlevels |
Vector< int > | m_ref_ratios |
Vector< int > | m_reduction_factor |
Vector< int > | m_regrid_intervals |
Real | m_dt_base |
Vector< Real > | m_dt_new |
Vector< Real > | m_dt_cur |
Real | m_maxDtGrow |
Real | m_time_eps |
BRMeshRefine | m_mesh_refine |
bool | m_use_meshrefine |
Vector< Vector< Box > > | m_amr_grids |
int | m_cur_step |
int | m_restart_step |
int | m_lastcheck_step |
Real | m_cur_time |
Vector< int > | m_steps_since_regrid |
Vector< long > | m_cell_updates |
std::string | m_plotfile_prefix |
std::string | m_checkpointfile_prefix |
int | m_verbosity |
This class is a framework for Berger-Oliger timestepping for adaptive mesh refinement of time-dependent problems. It is applicable to both hyperbolic and parabolic problems. It represents a hierarchy of levels of refinement as a collection of AMRLevel objects.
The usage pattern is this:
|
Default constructor. Use must subsequently call a define() function and a setUp function. |
|
Destructor. |
|
|
|
Set the blocking factor for meshrefinement. Should be called after define and before setup. |
|
Sets the interval to write checkpoint files, in terms of the base level time step. |
|
Sets the checkpoint file prefix. Should be called after define and before setup. |
|
|
|
You should call this last. It writes the last checkpoint file and tells you how many cells you updated and all that. |
|
Defines this object. User must call a setup function before running. Arguments:
|
|
Defines this object. User must call a setup function before running. Arguments:
|
|
Set the factor by which the current dt must exceed the new (max) dt for time subcycling to occur (i.e., reduction of the current dt by powers of 2). |
|
Set the fill ratio for meshrefinement. Should be called after define and before setup. |
|
Returns the fixed timestep. |
|
Set a fixed timestep. |
|
Returns a vector of all the AMR levels |
|
Returns the current time |
|
Set the buffering for the meshrefinement. Should be called after define and before setup. |
|
|
|
Has a define function been called? Lots of these functions will assert fail if not. |
|
Has a setUp function been called? If not, you can't call run |
|
|
|
Returns the maximum grid size for level 0 grids. |
|
Set the maximum grid size for level 0 grids. Defaults to maxGridSize, so should be called after maxGridSize and before setup |
|
Returns current maximum factor by which a timestep can grow. |
|
Set maximum factor by which a timestep can grow. |
|
Returns the maximum grid size. |
|
Set the maximum grid size. Should be called after define and before setup. |
|
|
|
Sets the interval to write plot files, in terms of the base level time step. |
|
Sets the plot file prefix. Should be called after define and before setup. |
|
|
|
Sets the regridding intervals. This should be OK to call any time after define and before run. |
|
Runs the calculation. User must have previously called both the define function and a setup function. |
|
|
|
This sets the hierarchy and sets regrid_intervals to -1 (turns off regridding). If you want to keep regridding on, reset regridIntervals after this call; |
|
Sets up this object for cold start. User must have previously called define(). Need to call this or setupForRestart or setupforFixedHierarchyRun before you run. |
|
Returns amount by which two times may differ and still be considered equal (used to determine whether we've reached stop time yet) |
|
Set amount by which two times may differ and still be considered equal (used to determine whether we've reached stop time yet) In practice, this is multiplied by the current base-level timestep, so we consider ourselves finished if (stopTime - time) < timeEps*dt0 |
|
|
|
Returns current verbosity level.
-inf to 0: print nothing. |
|
Sets verbosity level to a_verbosity.
-inf to 0: print nothing. This should be OK to call any time after define and before run. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|