SAMRAI::geom::CartesianGridGeometry< DIM > Class Template Reference

#include <source/geometry/cartesian/grid_geom/CartesianGridGeometry.h>

Inheritance diagram for SAMRAI::geom::CartesianGridGeometry< DIM >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 CartesianGridGeometry (const std::string &object_name, tbox::Pointer< tbox::Database > input_db, bool register_for_restart=true)
 CartesianGridGeometry (const std::string &object_name, const double *x_lo, const double *x_up, const hier::BoxArray< DIM > &domain, bool register_for_restart=true)
virtual ~CartesianGridGeometry ()
tbox::Pointer< hier::GridGeometry<
DIM > > 
makeRefinedGridGeometry (const std::string &fine_geom_name, const hier::IntVector< DIM > &refine_ratio, bool register_for_restart) const
tbox::Pointer< hier::GridGeometry<
DIM > > 
makeCoarsenedGridGeometry (const std::string &coarse_geom_name, const hier::IntVector< DIM > &coarsen_ratio, bool register_for_restart) const
void setGeometryDataOnPatch (hier::Patch< DIM > &patch, const hier::IntVector< DIM > &ratio_to_level_zero, const tbox::Array< tbox::Array< bool > > &touches_regular_bdry, const tbox::Array< tbox::Array< bool > > &touches_periodic_bdry) const
void setGeometryData (const double *x_lo, const double *x_up, const hier::BoxArray< DIM > &domain)
const double * getDx () const
const double * getXLower () const
const double * getXUpper () const
virtual void printClassData (std::ostream &os) const
virtual void putToDatabase (tbox::Pointer< tbox::Database > db)

Detailed Description

template<int DIM>
class SAMRAI::geom::CartesianGridGeometry< DIM >

Class CartesianGridGeometry<DIM> provides simple Cartesian mesh geometry management on an AMR hierarchy. The mesh coordinates on each hierarchy level are limited to mesh increments specified as DIM-tuple (dx[0],...,dx[DIM-1]) and spatial coordinates of the lower and upper corners of the smallest parallelepiped bounding the entire computational domain. The mesh increments on each level are defined with respect to the coarsest hierarchy level and multiplying those values by the proper refinement ratio. This class sets geometry information on each patch in an AMR hierarchy. This class is derived from the xfer::Geometry<DIM> base class which is further derived from the hier::GridGeometry<DIM> base class.

An object of this class requires numerous parameters to be read from input. Also, data must be written to and read from files for restart. The input and restart data are summarized as follows:

Required input keys and data types:

Optional input keys, data types, and defaults:

No input values can overwrite restart values.

A sample input file for a two-dimensional problem might look like:

 *
 *    domain_boxes = [(0,0) , (49,39)]
 *    x_lo = 0.0 , 0.0
 *    x_up = 50.0 , 40.0
 *    periodic_dimension = 0, 1  // periodic in y only
 *
 * 

This generates a two-dimensional rectangular domain periodic in the y-direction, and having 50 cells in the x-direction and 40 cells in the y-direction, with the cell size 1 unit in each direction.

See also:
xfer::Geometry

hier::GridGeometry


Constructor & Destructor Documentation

template<int DIM>
SAMRAI::geom::CartesianGridGeometry< DIM >::CartesianGridGeometry ( const std::string &  object_name,
tbox::Pointer< tbox::Database input_db,
bool  register_for_restart = true 
)

Constructor for CartesianGridGeometry<DIM> initializes data members based on parameters read from the specified input database or from the restart database corresponding to the specified object name. The constructor also registers this object for restart using the specified object name when the boolean argument is true. Whether object will write its state to restart files during program execution is determined by this argument. Note that it has a default state of true.

Errors: passing in a null database pointer or an empty string will result in an unrecoverable assertion.

template<int DIM>
SAMRAI::geom::CartesianGridGeometry< DIM >::CartesianGridGeometry ( const std::string &  object_name,
const double *  x_lo,
const double *  x_up,
const hier::BoxArray< DIM > &  domain,
bool  register_for_restart = true 
)

Constructor for CartesianGridGeometry<DIM> sets data members based on arguments. The constructor also registers this object for restart using the specified object name when the boolean argument is true. Whether object will write its state to restart files during program execution is determined by this argument. Note that it has a default state of true.

Errors: passing in an empty string, or null data pointers will result in an unrecoverable assertion.

template<int DIM>
SAMRAI::geom::CartesianGridGeometry< DIM >::~CartesianGridGeometry (  )  [virtual]

Destructor for CartesianGridGeometry<DIM> deallocates data describing grid geometry and unregisters the object with the restart manager if previously registered.


Member Function Documentation

template<int DIM>
tbox::Pointer< hier::GridGeometry< DIM > > SAMRAI::geom::CartesianGridGeometry< DIM >::makeRefinedGridGeometry ( const std::string &  fine_geom_name,
const hier::IntVector< DIM > &  refine_ratio,
bool  register_for_restart 
) const [virtual]

Create and return a pointer to a refined version of this Cartesian grid geometry object. This function is pure virtual in the hier::GridGeometry<DIM> base class.

Implements SAMRAI::hier::GridGeometry< DIM >.

template<int DIM>
tbox::Pointer< hier::GridGeometry< DIM > > SAMRAI::geom::CartesianGridGeometry< DIM >::makeCoarsenedGridGeometry ( const std::string &  coarse_geom_name,
const hier::IntVector< DIM > &  coarsen_ratio,
bool  register_for_restart 
) const [virtual]

Create and return a pointer to a coarsened version of this Cartesian grid geometry object. This function is pure virtual in the hier::GridGeometry<DIM> base class.

Implements SAMRAI::hier::GridGeometry< DIM >.

template<int DIM>
void SAMRAI::geom::CartesianGridGeometry< DIM >::setGeometryDataOnPatch ( hier::Patch< DIM > &  patch,
const hier::IntVector< DIM > &  ratio_to_level_zero,
const tbox::Array< tbox::Array< bool > > &  touches_regular_bdry,
const tbox::Array< tbox::Array< bool > > &  touches_periodic_bdry 
) const [virtual]

Implements SAMRAI::hier::GridGeometry< DIM >.

template<int DIM>
void SAMRAI::geom::CartesianGridGeometry< DIM >::setGeometryData ( const double *  x_lo,
const double *  x_up,
const hier::BoxArray< DIM > &  domain 
)

Set data members for this CartesianGridGeometry<DIM> object.

template<int DIM>
const double * SAMRAI::geom::CartesianGridGeometry< DIM >::getDx (  )  const [inline]

Return const pointer to dx array for reference level in hierarchy.

template<int DIM>
const double * SAMRAI::geom::CartesianGridGeometry< DIM >::getXLower (  )  const [inline]

Return const pointer to lower spatial coordinate for reference level in hierarchy.

template<int DIM>
const double * SAMRAI::geom::CartesianGridGeometry< DIM >::getXUpper (  )  const [inline]

Return const pointer to upper spatial coordinate for reference level in hierarchy.

template<int DIM>
void SAMRAI::geom::CartesianGridGeometry< DIM >::printClassData ( std::ostream &  os  )  const [virtual]

Print class data representation.

Reimplemented from SAMRAI::xfer::Geometry< DIM >.

template<int DIM>
void SAMRAI::geom::CartesianGridGeometry< DIM >::putToDatabase ( tbox::Pointer< tbox::Database db  )  [virtual]

Writes the state of the CartesianGridGeometry object to the database.

When assertion checking is active, db cannot be a null database pointer.

Implements SAMRAI::tbox::Serializable.


The documentation for this class was generated from the following files:
Generated on Thu Jun 18 11:28:22 2009 for SAMRAI by  doxygen 1.5.1