Class MethodOfLinesIntegrator<DIM> implements a spatially adaptive version of the Strong Stability Preserving (SSP) Runge-Kutta time integration algorithm.
More...
|
| | MethodOfLinesIntegrator (const std::string &object_name, tbox::Pointer< tbox::Database > input_db, MethodOfLinesPatchStrategy< DIM > *patch_strategy, bool register_for_restart=true) |
| |
| virtual | ~MethodOfLinesIntegrator () |
| |
| void | initializeIntegrator (tbox::Pointer< mesh::GriddingAlgorithm< DIM > > gridding_alg) |
| |
| double | getTimestep (const tbox::Pointer< hier::PatchHierarchy< DIM > > hierarchy, const double time) const |
| |
| void | advanceHierarchy (const tbox::Pointer< hier::PatchHierarchy< DIM > > hierarchy, const double time, const double dt) |
| |
| void | registerVariable (const tbox::Pointer< hier::Variable< DIM > > variable, const hier::IntVector< DIM > &ghosts, const MOL_VAR_TYPE m_v_type, const tbox::Pointer< xfer::Geometry< DIM > > &transfer_geom, const std::string &coarsen_name=std::string(), const std::string &refine_name=std::string()) |
| |
| virtual void | printClassData (std::ostream &os) const |
| |
| void | initializeLevelData (const tbox::Pointer< hier::BasePatchHierarchy< DIM > > hierarchy, const int level_number, const double init_time, const bool can_be_refined, const bool initial_time, const tbox::Pointer< hier::BasePatchLevel< DIM > > old_level=tbox::Pointer< hier::BasePatchLevel< DIM > >(NULL), const bool allocate_data=true) |
| |
| void | resetHierarchyConfiguration (const tbox::Pointer< hier::BasePatchHierarchy< DIM > > hierarchy, const int coarsest_level, const int finest_level) |
| |
| virtual void | applyGradientDetector (const tbox::Pointer< hier::BasePatchHierarchy< DIM > > hierarchy, const int level_number, const double time, const int tag_index, const bool initial_time, const bool uses_richardson_extrapolation_too) |
| |
| void | putToDatabase (tbox::Pointer< tbox::Database > db) |
| |
| virtual double | getLevelDt (const tbox::Pointer< hier::BasePatchLevel< DIM > > level, const double dt_time, const bool initial_time) |
| |
| virtual double | advanceLevel (const tbox::Pointer< hier::BasePatchLevel< DIM > > level, const tbox::Pointer< hier::BasePatchHierarchy< DIM > > hierarchy, const double current_time, const double new_time, const bool first_step, const bool last_step, const bool regrid_advance=false) |
| |
| virtual void | resetTimeDependentData (const tbox::Pointer< hier::BasePatchLevel< DIM > > level, const double new_time, const bool can_be_refined) |
| |
| virtual void | resetDataToPreadvanceState (const tbox::Pointer< hier::BasePatchLevel< DIM > > level) |
| |
| virtual void | applyRichardsonExtrapolation (const tbox::Pointer< hier::PatchLevel< DIM > > level, const double error_data_time, const int tag_index, const double deltat, const int error_coarsen_ratio, const bool initial_time, const bool uses_gradient_detector_too) |
| |
| virtual void | coarsenDataForRichardsonExtrapolation (const tbox::Pointer< hier::PatchHierarchy< DIM > > hierarchy, const int level_number, const tbox::Pointer< hier::PatchLevel< DIM > > coarser_level, const double coarsen_data_time, const bool before_advance) |
| |
template<int DIM>
class SAMRAI::algs::MethodOfLinesIntegrator< DIM >
The original non-adaptive version of the algorithm is described in S. Gottlieb, C.W. Shu, E. Tadmor, SIAM Review, Vol. 43, No. 1, pp. 89-112. The advanceHierarchy() method integrates all levels of an AMR hierarchy through a specified timestep. See this method for details of the time-stepping process. Application-specific numerical routines that are necessary for these operations are provided by the MethodOfLinesPatchStrategy<DIM> data member. The collaboration between this class and the patch strategy follows the the Strategy design pattern. A concrete patch strategy object is derived from the base class to provide those routines for a specific problem.
This class is derived from the mesh::StandardTagAndInitStrategy<DIM> abstract base class which defines an interface for routines required by the dynamic adaptive mesh refinement routines in the mesh::GriddingAlgorithm<DIM> class. This collaboration also follows the Strategy design pattern.
Initialization of an MethodOfLinesIntegrator<DIM> object is performed by first setting default values, then reading from input. All input values may override values read from restart. Data read from input is summarized as follows:
Required input keys and data types: NONE
Optional input keys, data types, and defaults:
- order
integer value specifying order of Runge-Kutta scheme. If no input value is given, third order (i.e. order = 3) is used.
- alpha_1
- alpha_2
- beta arrays of double values (length = order) specifying the coeffients used in the multi-step Strong Stability Preserving (SSP) Runge-Kutta algorithm. If no input is supplied, the default alpha_1, alpha_2, and beta values are automatically set to correspond to the specified order.
The following represents a sample input entry:
* MethodOfLinesIntegrator{
* order = 3
* alpha_1 = 1., 0.75, 0.33333
* alpha_2 = 0., 0.25, 0.66666
* beta = 1., 0.25, 0.66666
* }
* - See also
- mesh::StandardTagAndInitStrategy
Initialize data on a new level after it is inserted into an AMR patch hierarchy by the gridding algorithm. The level number indicates that of the new level. The old_level pointer corresponds to the level that resided in the hierarchy before the level with the specified number was introduced. If the pointer is NULL, there was no level in the hierarchy prior to the call and the level data is set based on the user routines and the simulation time. Otherwise, the specified level replaces the old level and the new level receives data from the old level appropriately before it is destroyed.
Typically, when data is set, it is interpolated from coarser levels in the hierarchy. If the data is to be set, the level number must match that of the old level, if non-NULL. If the old level is non-NULL, then data is copied from the old level to the new level on regions of intersection between those levels before interpolation occurs. Then, user-supplied patch routines are called to further initialize the data if needed. The boolean argument after_regrid is passed into the user's routines.
The boolean argument initial_time indicates whether the integration time corresponds to the initial simulation time. If true, the level should be initialized with initial simulation values. Otherwise, it should be assumed that the simulation time is at some point after the start of the simulation. This information is provided since the initialization of the data on a patch may be different in each of those circumstances. The can_be_refined boolean argument indicates whether the level is the finest allowable level in the hierarchy.
Note: This function is overloaded from the base class mesh::StandardTagAndInitStrategy<DIM>.
Implements SAMRAI::mesh::StandardTagAndInitStrategy< DIM >.
Advance data on all patches on specified patch level from current time (current_time) to new time (new_time). This routine is called only during time-dependent regridding procedures, such as Richardson extrapolation. It is virtual with an empty implementation here (rather than pure virtual) so that users are not required to provide an implementation when the function is not needed. The boolean arguments are used to determine the state of the algorithm and the data when the advance routine is called. Note that this advance function is also used during normal time integration steps.
When this function is called, the level data required to begin the advance must be allocated and be defined appropriately. Typically, this is equivalent to what is needed to initialize a new level after regridding. Upon exiting this routine, both current and new data may exist on the level. This data is needed until level synchronization occurs, in general. Current and new data may be reset by calling the member function resetTimeDependentData().
This routine is called from two different points within the Richardson exptrapolation process: to advance a temporary level that is coarser than the hierarchy level on which error estimation is performed, and to advance the hierarchy level itself. In the first case, the values of the boolean flags are:
- first_step = true.
- last_step = true.
- regrid_advance = true.
In the second case, the values of the boolean flags are:
- first_step (when regridding during time integration sequence) = true when the level is not coarsest level to synchronize immediately before the regridding process; else, false. (when generating initial hierarchy construction) = true, even though there may be multiple advance steps.
- last_step = true when the advance is the last in the Richardson extrapolation step sequence; else false.
- regrid_advance = true.
Reimplemented in SAMRAI::algs::HyperbolicLevelIntegrator< DIM >, and SAMRAI::algs::HyperbolicLevelIntegrator< NDIM >.
Set integer tags to "one" in cells where refinement of the given level should occur according to some user-supplied Richardson extrapolation criteria. The "error_data_time" argument is the regrid time. The "deltat" argument is the time increment to advance the solution on the level to be refined. Note that that level is finer than the level in the argument list, in general. The ratio between the argument level and the actual hierarchy level is given by the integer "coarsen ratio".
The integer "tag_index" argument is the patch descriptor index of the cell-centered integer tag array on each patch in the hierarchy.
The boolean argument initial_time indicates whether the level is being subject to refinement at the initial simulation time. If it is false, then the error estimation process is being invoked at some later time after the AMR hierarchy was initially constructed. Typically, this information is passed to the user's patch tagging routines since the application of the Richardson extrapolation process may be different in each case.
The boolean uses_gradient_detector_too is true when a gradient detector procedure is used in addition to Richardson extrapolation, and false otherwise. This argument helps the user to manage multiple regridding criteria.
This routine is only when Richardson extrapolation is being used. It is virtual with an empty implementation here (rather than pure virtual) so that users are not required to provide an implementation when the function is not needed.
Reimplemented in SAMRAI::algs::HyperbolicLevelIntegrator< DIM >, and SAMRAI::algs::HyperbolicLevelIntegrator< NDIM >.