class AMR

framework for Berger-Oliger timestepping for AMR

Inheritance:

AMR


public members:

constructors, destructors and defines
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)

Setup functions
bool isDefined() const
bool isSetUp() const
void setupForRestart( HDF5Handle & a_handle)
void setupForNewAMRRun()
void conclude() const
void run(Real a_max_time, int a_max_step)

Administrative functions
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 dtToleranceFactor(Real a_dt_tolerance_factor)
void fillRatio(Real a_fillRat)
void blockFactor(int a_blockFactor)
void gridBufferSize(int a_grid_buffer_size)
void verbosity (int a_verbosity)
void regridIntervals(const Vector <int>& a_regridIntervals)
int verbosity () const
void maxDtGrow(Real a_dtGrowFactor)
Real maxDtGrow() const
void fixedDt(Real a_dt)
Real fixedDt() const

Documentation

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 AMRLevels. The usage pattern is this:
1. Call define to define the stuff that does not change throughout the run (maxlevel, refinement ratios, domain, and operator)
1.5. Modify any parameters you like (blocking factor and so forth using access functions.
2. Call any one of the three setup functions so AMR can set up all its internal data structures.
3. Call run to run the calculation.
4. Call conclude to output (to stdout) how many cells were updated and so forth.
AMR ()
Default constructor. Use must subsequently call a define() function and a setUp function.

~AMR ()
Destructor.

void define (int a_max_level, const Vector <int>& a_ref_ratios, const Box& a_prob_domain, const AMRLevelFactory * const a_amrLevelFact)
Defines this object. User must call a setup function before running. Arguments:

a_prob_domain (not modified): problem domain on the base level.

a_ref_ratios (not modified): refinement ratios. There must be at least a_max_level+1 elements, or an error will result. Element zero is the base level.

a_max_level (not modified): the maximum level allowed, where the base level is zero. There will be a total of a_max_level+1 levels, since level zero and level a_max_level will both exist.

a_amrlevel_ptr (not modified): pointer to a physics class factory object. The object it points to is used to construct the collection of AMRLevels in this AMR as objects of the physics class type. It can be destructed after this define() returns.

void define (int a_max_level, const Vector <int>& a_ref_ratios, const ProblemDomain & a_prob_domain, const AMRLevelFactory * const a_amrLevelFact)
Defines this object. User must call a setup function before running. Arguments:

a_prob_domain (not modified): problem domain on the base level.

a_ref_ratios (not modified): refinement ratios. There must be at least a_max_level+1 elements, or an error will result. Element zero is the base level.

a_max_level (not modified): the maximum level allowed, where the base level is zero. There will be a total of a_max_level+1 levels, since level zero and level a_max_level will both exist.

a_amrlevel_ptr (not modified): pointer to a physics class factory object. The object it points to is used to construct the collection of AMRLevels in this AMR as objects of the physics class type. It can be destructed after this define() returns.

bool isDefined () const
Has a define function been called? Lots of these functions will assert fail if not.

bool isSetUp () const
Has a setUp function been called? If not, you can't call run

void setupForRestart ( HDF5Handle & a_handle)
Sets up this object from checkpointed data. User must have previosuly called define. Need to call this or setupForNewAMRRun or setupforFixedHierarchyRun before you run.

void setupForNewAMRRun ()
Sets up this object for cold start. User must have previously called define(). Need to call this or setupForRestart or setupforFixedHierarchyRun before you run.

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;

void conclude () const
You should call this last. It writes the last checkpoint file and tells you how many cells you updated and all that.

void run (Real a_max_time, int a_max_step)
Runs the calculation. User must have previously called both the define function and a setup function.

void plotPrefix (const std::string& a_plotfile_prefix)
Sets the plot file prefix. Should be called after define and before setup.

void checkpointPrefix (const std::string& a_checkpointfile_prefix)
Sets the checkpoint file prefix. Should be called after define and before setup.

void plotInterval (int a_plot_interval)
Sets the interval to write plot files, in terms of the base level time step.

void checkpointInterval (int a_checkpoint_interval)
Sets the interval to write checkpoint files, in terms of the base level time step.

void maxGridSize (int a_max_grid_size)
Set the maximum grid size. Should be called after define and before setup.

void dtToleranceFactor (Real a_dt_tolerance_factor)
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).

void fillRatio (Real a_fillRat)
Set the fill ratio for meshrefinement. Should be called after define and before setup.

void blockFactor (int a_blockFactor)
Set the blocking factor for meshrefinement. Should be called after define and before setup.

void gridBufferSize (int a_grid_buffer_size)
Set the buffering for the meshrefinement. Should be called after define and before setup.

void verbosity (int a_verbosity)
Sets verbosity level to a_verbosity.

-inf to 0: print nothing.
1: prints a message every coarse time step.
2: also prints a message when regridding and writing files.
3: also prints function trace, and some more inf during file I/O.
4 to inf: also prints list of boxes and processor maps during regrid.

This should be OK to call any time after define and before run.

void regridIntervals (const Vector <int>& a_regridIntervals)
Sets the regridding intervals. This should be OK to call any time after define and before run.

int verbosity () const
Returns current verbosity level.

-inf to 0: print nothing.
1: prints a message every coarse time step.
2: also prints a message when regridding and writing files.
3: also prints function trace, and some more inf during file I/O.
4 to inf: also prints list of boxes and processor maps during regrid.

void maxDtGrow (Real a_dtGrowFactor)
Set maximum factor by which a timestep can grow.

Real maxDtGrow () const
Returns current maximum factor by which a timestep can grow.

void fixedDt (Real a_dt)
Set a fixed timestep.

Real fixedDt () const
Returns the fixed timestep.


this class has no child classes.

alphabetic index hierarchy of classes


Chombo

Copyright Notice

This software is copyright (C) by the Lawrence Berkeley National Laboratory. Permission is granted to reproduce this software for non-commercial purposes provided that this notice is left intact.

It is acknowledged that the U.S. Government has rights to this software under Contract DE-AC03-765F00098 between the U.S. Department of Energy and the University of California.

This software is provided as a professional and academic contribution for joint exchange. Thus it is experimental, is provided ``as is'', with no warranties of any kind whatsoever, no support, no promise of updates, or printed documentation. By using this software, you acknowledge that the Lawrence Berkeley National Laboratory and Regents of the University of California shall have no liability with respect to the infringement of other copyrights by any part of this software.