|
| | HyperbolicPatchStrategy () |
| |
| virtual | ~HyperbolicPatchStrategy () |
| |
| virtual void | registerModelVariables (HyperbolicLevelIntegrator< DIM > *integrator)=0 |
| |
| virtual void | setupLoadBalancer (HyperbolicLevelIntegrator< DIM > *integrator, mesh::GriddingAlgorithm< DIM > *gridding_algorithm) |
| |
| virtual void | initializeDataOnPatch (hier::Patch< DIM > &patch, const double data_time, const bool initial_time)=0 |
| |
| virtual double | computeStableDtOnPatch (hier::Patch< DIM > &patch, const bool initial_time, const double dt_time)=0 |
| |
| virtual void | computeFluxesOnPatch (hier::Patch< DIM > &patch, const double time, const double dt)=0 |
| |
| virtual void | conservativeDifferenceOnPatch (hier::Patch< DIM > &patch, const double time, const double dt, bool at_syncronization)=0 |
| |
| virtual void | preprocessAdvanceLevelState (const tbox::Pointer< hier::PatchLevel< DIM > > &level, double current_time, double dt, bool first_step, bool last_step, bool regrid_advance) |
| |
| virtual void | postprocessAdvanceLevelState (const tbox::Pointer< hier::PatchLevel< DIM > > &level, double current_time, double dt, bool first_step, bool last_step, bool regrid_advance) |
| |
| virtual void | tagGradientDetectorCells (hier::Patch< DIM > &patch, const double regrid_time, const bool initial_error, const int tag_index, const bool uses_richardson_extrapolation_too) |
| |
| virtual void | tagRichardsonExtrapolationCells (hier::Patch< DIM > &patch, const int error_level_number, const tbox::Pointer< hier::VariableContext > coarsened_fine, const tbox::Pointer< hier::VariableContext > advanced_coarse, const double regrid_time, const double deltat, const int error_coarsen_ratio, const bool initial_error, const int tag_index, const bool uses_gradient_detector_too) |
| |
| virtual void | setPhysicalBoundaryConditions (hier::Patch< DIM > &patch, const double fill_time, const hier::IntVector< DIM > &ghost_width_to_fill)=0 |
| |
| virtual hier::IntVector< DIM > | getRefineOpStencilWidth () const |
| |
| virtual void | preprocessRefine (hier::Patch< DIM > &fine, const hier::Patch< DIM > &coarse, const hier::Box< DIM > &fine_box, const hier::IntVector< DIM > &ratio) |
| |
| virtual void | postprocessRefine (hier::Patch< DIM > &fine, const hier::Patch< DIM > &coarse, const hier::Box< DIM > &fine_box, const hier::IntVector< DIM > &ratio) |
| |
| virtual hier::IntVector< DIM > | getCoarsenOpStencilWidth () const |
| |
| virtual void | preprocessCoarsen (hier::Patch< DIM > &coarse, const hier::Patch< DIM > &fine, const hier::Box< DIM > &coarse_box, const hier::IntVector< DIM > &ratio) |
| |
| virtual void | postprocessCoarsen (hier::Patch< DIM > &coarse, const hier::Patch< DIM > &fine, const hier::Box< DIM > &coarse_box, const hier::IntVector< DIM > &ratio) |
| |
| tbox::Pointer< hier::VariableContext > | getDataContext () const |
| |
| void | setDataContext (tbox::Pointer< hier::VariableContext > context) |
| |
| void | clearDataContext () |
| |
| virtual void | preprocessRefineBoxes (hier::Patch< DIM > &fine, const hier::Patch< DIM > &coarse, const hier::BoxList< DIM > &fine_boxes, const hier::IntVector< DIM > &ratio) |
| |
| virtual void | postprocessRefineBoxes (hier::Patch< DIM > &fine, const hier::Patch< DIM > &coarse, const hier::BoxList< DIM > &fine_boxes, const hier::IntVector< DIM > &ratio) |
| |
template<int DIM>
class SAMRAI::algs::HyperbolicPatchStrategy< DIM >
Class HyperbolicPatchStrategy<DIM> is an abstract base class defining the interface between an HyperbolicLevelIntegrator<DIM> object and operations applied to a single patch in a structured AMR hierarchy. The operations include patch initialization, dt calculation, flux computation, conservative differencing, and error estimation. This class is derived from the xfer::RefinePatchStrategy<DIM> and xfer::CoarsenPatchStrategy<DIM> abstract base classes. These base classes provide the interface for user-defined interlevel data refining and coarsening operations and the specification of physical boundary conditions. The functions setPhysicalBoundaryConditions(), and pre/postprocessRefine() are overloaded from the class xfer::RefinePatchStrategy<DIM>. The operations pre/postprocessCoarsen() are overloaded from xfer::CoarsenPatchStrategy<DIM>. The pre/postprocessCoarsen/Refine() operations are given empty implementations here so that the user does not need to proovide them if the operations are not needed.
It is important to recognize that for the concrete patch strategy subclass and the HyperbolicLevelIntegrator<DIM> to work together, the concrete strategy must know which patch data to operate on. The patch data storage is manipulated by the level integrator. The set/clearDataContext() methods allow the integrator to inform the patch strategy of the correct data context. The concrete patch strategy subclass can access the appropriate context via the getDataContext() method.
- See also
- algs::HyperbolicLevelIntegrator
-
xfer::RefinePatchStrategy
-
xfer::CoarsenPatchStrategy
Register specific variables needed in the numerical routines with the hyperbolic level integrator using the registerVariable() function in that class. The integrator manipulates storage for the data and this registration defines the way in which data for each quantity will be manipulated on the patches. Typically, the derived data quantities for plotting are registered with a visualization data writer in this routine as well, since the hyperbolic level integrator provides the variable context for plotting (i.e., which data is available when a plot file is generated). The integrator pointer cannot be null in most cases.
The gridding algorithm pointer is provided so that patch data objects may be registered with the load balancer object (owned by the gridding algorithm) for non-uniform load balancing, if needed.
This is an optional routine for user to process any application-specific patch strategy data BEFORE patches are advanced on the given level. This routine is called after patch boundary data is filled (i.e., ghosts) and before computeFluxesOnPatch(). The arguments are: level – level that will be advanced, current_time – current integration time, dt – current time increment, first_step – boolean flag that is true if advance is first in time step sequence on level (i.e., previous advance step was on another level, false otherwise, last_step – boolean flag that is true if advance is last in time step sequence on level (i.e., synchronization with coarser level will occur immediately after this advance), regrid_advance – boolean flag that is true if the advance is during a regridding phase (i.e., the advance is not used to integrate data on the hierarchy) in which case the results of the advance will be discarded.
Note that when this routine is called, the scratch data is filled on all patches (i.e., ghost cells) and that data is the same as the current level data on all patch interiors. That is, both scratch and current data correspond to current_time.
Note that this function is not pure virtual. It is given a dummy implementation here so that users may ignore it when inheriting from this class.
This is an optional routine for user to process any application-specific patch strategy data AFTER patches are advanced on the given level. This routine is called after conservativeDifferenceOnPatch() is called and before computeStableDtOnPatch(). The arguments are: level – level that will be advanced, current_time – current integration time, dt – current time increment, first_step – boolean flag that is true if advance is first in time step sequence on level (i.e., previous advance step was on another level, false otherwise, last_step – boolean flag that is true if advance is last in time step sequence on level (i.e., synchronization with coarser level will occur immediately after this advance), regrid_advance – boolean flag that is true if the advance is during a regridding phase (i.e., the advance is not used to integrate data on the hierarchy) in which case the results of the advance will be discarded.
Note that when this routine is called, the scratch data is filled on all patches (i.e., ghost cells) and that data is the same as the new level data on all patch interiors. That is, both scratch and new data correspond to current_time + dt on patch interiors.
The current data and ghost values correspond to the current_time.
Note that this function is not pure virtual. It is given a dummy implementation here so that users may ignore it when inheriting from this class.
Tag cells based from differences computed in the Richardson extrapolation. The Richardson extrapolation algorithm creates a coarsened version of some hierarchy patch level and advances data in time on both the coarsened patch level and the hierarchy level. This routine takes the data resulting from the advance on both the coarse and fine levels, compares them, and tags cells according to the difference.
* (2)
* n+1 ^------->x finish (1) advanced_coarse
* | ^ (2) coarsened_fine
* time n - |
* ^ |(1)
* | |
* <--------o start
* fine coarse
*
The patch supplied to this routine is on the coarsened level. However, the error_level_number corresponds to the actual hierarchy level from which it was coarsened. Data resides on this patch in two contexts - advanced_coarse'' andcoarsened_fine''. Advanced coarse is data advanced on the coarsened version of the level, while coarsened fine is the data advanced on the fine level and then coarsened to the coarse level. The regrid time and the time increment are given for the actual hierarchy level. The error coarsen ratio argument is the ratio between the index spaces on the hierarchy level and the coarsened hierarchy level. The boolean flag `‘initial_error’' is true when the error estimation is performed at the initial simulation time; i.e., when the hierarchy levels are being constructed for the first time. The tag index argument is the index of the tag data on the patch data array. The other boolean flag uses_gradient_detector_too is true when a gradient detector scheme is used in addition to Richardson extrapolation. This flag helps users manage multiple regridding criteria.
Note that this function is not pure virtual. It is given a dummy implementation here so that users may ignore it when inheriting from this class.
Pre- and post-processing routines for implementing user-defined spatial interpolation routines applied to variables. The interpolation routines are used in the hyperbolic AMR algorithm for filling patch ghost cells before advancing data on a level and after regridding a level to fill portions of the new level from some coarser level. These routines are called automatically from within patch boundary filling schedules; thus, some concrete function matching these signatures must be provided in the user's patch routines. However, the routines only need to perform some operations when "USER_DEFINED_REFINE" is given as the interpolation method for some variable when the patch routines register variables with the hyperbolic level integration algorithm, typically. If the user does not provide operations that refine such variables in either of these routines, then they will not be refined.
The order in which these operations are used in each patch boundary filling schedule is:
Note that these functions are not pure virtual. They are given dummy implementations here so that users may ignore them when inheriting from this class.
Implements SAMRAI::xfer::RefinePatchStrategy< DIM >.
Pre- and post-processing routines for implementing user-defined spatial coarsening routines applied to variables. The coarsening routines are used in the hyperbolic AMR algorithm synchronizing coarse and fine levels when they have been integrated to the same point. These routines are called automatically from within the data synchronization coarsen schedules; thus, some concrete function matching these signatures must be provided in the user's patch routines. However, the routines only need to perform some operations when "USER_DEFINED_COARSEN" is given as the coarsening method for some variable when the patch routines register variables with the hyperbolic level integration algorithm, typically. If the user does not provide operations that coarsen such variables in either of these routines, then they will not be coarsened.
The order in which these operations are used in each coarsening schedule is:
Note that these functions are not pure virtual. They are given dummy implementations here so that users may ignore them when inheriting from this class.
Implements SAMRAI::xfer::CoarsenPatchStrategy< DIM >.
Virtual function to perform user-defined refine operations. This member function is called before standard refining operations (expressed using concrete subclasses of the RefineOperator<DIM> base class). The preprocess function must refine data from the scratch components of the coarse patch into the scratch components of the fine patch on the specified fine box regions.
Typically, only the pure virtual members of this class are implemented in user-defined subclasses of this base class. This version of the preprocess function operates on an entire box list. By default, this version simply loops over the box list and calls the single-box version, which is a pure virtual function.
- Parameters
-
| fine | Fine patch containing destination data. |
| coarse | Coarse patch containing source data. |
| fine_boxes | tbox::List of box regions on fine patch into which data is refined. |
| ratio | Integer vector containing ratio relating index space between coarse and fine patches. |
Reimplemented in SAMRAI::solv::CartesianRobinBcHelper< DIM >.
Virtual function to perform user-defined refine operations. This member function is called after standard refining operations (expressed using concrete subclasses of the RefineOperator<DIM> base class). The postprocess function must refine data from the scratch components of the coarse patch into the scratch components of the fine patch on the specified fine box regions.
Typically, only the pure virtual members of this class are implemented in user-defined subclasses of this base class. This version of the postprocess function operates on an entire box list. By default, this version simply loops over the box list and calls the single-box version, which is a pure virtual function.
- Parameters
-
| fine | Fine patch containing destination data. |
| coarse | Coarse patch containing source data. |
| fine_boxes | tbox::List of box regions on fine patch into which data is refined. |
| ratio | Integer vector containing ratio relating index space between coarse and fine patches. |
Reimplemented in SAMRAI::solv::CartesianRobinBcHelper< DIM >.