Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

BRMeshRefine Class Reference

class which manages Berger-Rigoutsos grid generation More...

#include <BRMeshRefine.H>

Inheritance diagram for BRMeshRefine:

Inheritance graph
[legend]
Collaboration diagram for BRMeshRefine:

Collaboration graph
[legend]
List of all members.

Public Methods

 BRMeshRefine ()
 default constructor -- leaves object in an unusable state

 BRMeshRefine (const Box &a_baseDomain, const Vector< int > &a_refRatios, const Real a_fillRatio, const int a_blockFactor, const int a_bufferSize, const int a_maxSize)
 full constructor -- leaves object in usable state

 BRMeshRefine (const ProblemDomain &a_baseDomain, const Vector< int > &a_refRatios, const Real a_fillRatio, const int a_blockFactor, const int a_bufferSize, const int a_maxSize)
 full constructor -- leaves object in usable state

virtual ~BRMeshRefine ()
 destructor

void define (const Box &a_baseDomain, const Vector< int > &a_refRatios, const Real a_fillRatio, const int a_blockFactor, const int a_bufferSize, const int a_maxSize)
 define function -- size of RefRatios will define maximum number of levels

void define (const ProblemDomain &a_baseDomain, const Vector< int > &a_refRatios, const Real a_fillRatio, const int a_blockFactor, const int a_bufferSize, const int a_maxSize)
 define function -- size of RefRatios will define maximum number of levels

void makeBoxes (Vector< Box > &a_mesh, const IntVectSet &a_tags, const IntVectSet &a_pnd, const ProblemDomain &a_domain, const int a_maxSize) const
 constructs a set of boxes which covers a set of tagged cells


Protected Methods

void makeBoxes (std::list< Box > &a_mesh, const IntVectSet &a_tags, const IntVectSet &a_pnd, const ProblemDomain &a_domain, const int a_maxSize, const int a_depth) const
void splitBox (std::list< Box > &a_boxes, const std::list< Box >::iterator &a_boxindex, const int a_dimension,const int a_maxboxsize) const
Vector< int > makeTrace (const IntVectSet &a_Ivs,int a_dir) const
void makeTraces (const IntVectSet &a_Ivs,Vector< int > *a_traces) const
int findSplit (const Vector< int > &a_trace) const
int findMaxInflectionPoint (const Vector< int > &a_trace,int &a_maxVal) const
void splitTags (const IntVectSet &a_tags, const int a_split_dir,const int a_split_indx, IntVectSet &a_tags_lo,IntVectSet &a_tags_hi) const
void breakBoxes (Vector< Box > &a_vboxin, const int &a_maxSize, const int &a_idir) const
int maxloc (const int *a_V,const int a_Size) const

Detailed Description

class which manages Berger-Rigoutsos grid generation

This class manages grid generation from sets of tagged cells using the Berger-Rigoutsos algorithm in the context of the MeshRefine class from which it is derived

There are two ways grids can be defined based on tagged cells. one takes a single IntVectSet of tags defined on the BaseLevel mesh and uses that set of tags for every level to be refined; the other takes a Vector<IntVectSet> of tags defined on all the mesh levels to be refined and uses those. \ \

{\bf Long Description:} \

Create new meshes based on tagged cells on a range of levels of a mesh hierarchy. Each level of tagged cells is used to generate a new mesh at the next finer level. The finest level in the output mesh will be one level higher than the top of the range of levels given as input. As a special case, use the same tags (appropriately refined) for all levels.

Usage:

Call the regrid functions after computing error estimates and tagging cells. To add a new mesh level, set TopLevel to the index of the finest level in the existing mesh and define tags on the finest level. To keep the existing number of mesh levels, set TopLevel to one less than the index of the finest level and don't define any tags on the finest level. If a single IntVectSet of tags is passed (instead of a Vector<IntVectSet>) then the same tags (properly refined) will be used for all the new meshes up to level TopLevel+1. In any case, the meshes at levels BaseLevel and below are not modified. The output argument newmeshes will be reallocated to the necessary size before being used. When this function returns, the elements of the newmeshes vector corresponding to the unchanged levels will be filled in with copies of the levels from the old mesh vector. The variable tags is modified in an undefined way, so its contents should not be relied upon. The variable BlockFactor specifies the amount by which each box will be coarsenable. Every grid box will have an integral multiple of BlockFactor cells in each dimension and also lower index values that are integral multiples. As a side effect, the minimum box size will be BlockFactor.

Expensive validations are done only when debugging is enabled (i.e. the DEBUG make variable is "TRUE").

Usage Notes:

All the input vectors should be defined with max index >= TopLevel. They should have values for indices [BaseLevel:TopLevel]. (except for OldMeshes, which must be defined for all indices). The new mesh vector newmeshes will be redefined up to index TopLevel+1. RefRatios should be defined such that RefRatios[L] is the value to use to refine the level L mesh to produce the level L+1 mesh. The tags vector is modified in an undefined manner. The output variable newmeshes may not be completely defined if an exception occurs. The BlockFactor can be used to force a minimum box size.


Constructor & Destructor Documentation

BRMeshRefine::BRMeshRefine  
 

default constructor -- leaves object in an unusable state

BRMeshRefine::BRMeshRefine const Box   a_baseDomain,
const Vector< int > &    a_refRatios,
const Real    a_fillRatio,
const int    a_blockFactor,
const int    a_bufferSize,
const int    a_maxSize
 

full constructor -- leaves object in usable state

Parameters:
a_baseDomain  level 0 domain
a_refRatios  refinement ratios -- refRatio[0] is btwn levels 0 and 1
a_fillRatio  measure of how efficiently tagged cells will be covered
a_blockFactor  amount by which grids are guaranteed to be coarsenable
a_bufferSize  proper nesting buffer amount
a_maxSize  maximum grid length in any direction -- 0 means no limit.

BRMeshRefine::BRMeshRefine const ProblemDomain   a_baseDomain,
const Vector< int > &    a_refRatios,
const Real    a_fillRatio,
const int    a_blockFactor,
const int    a_bufferSize,
const int    a_maxSize
 

full constructor -- leaves object in usable state

Parameters:
a_baseDomain  level 0 domain
a_refRatios  refinement ratios -- refRatio[0] is btwn levels 0 and 1
a_fillRatio  measure of how efficiently tagged cells will be covered
a_blockFactor  amount by which grids are guaranteed to be coarsenable
a_bufferSize  proper nesting buffer amount
a_maxSize  maximum grid length in any direction -- 0 means no limit.

virtual BRMeshRefine::~BRMeshRefine   [virtual]
 

destructor


Member Function Documentation

void BRMeshRefine::breakBoxes Vector< Box > &    a_vboxin,
const int &    a_maxSize,
const int &    a_idir
const [protected]
 

void BRMeshRefine::define const ProblemDomain   a_baseDomain,
const Vector< int > &    a_refRatios,
const Real    a_fillRatio,
const int    a_blockFactor,
const int    a_bufferSize,
const int    a_maxSize
 

define function -- size of RefRatios will define maximum number of levels

Parameters:
a_baseDomain  level 0 domain
a_refRatios  refinement ratios -- refRatio[0] is btwn levels 0 and 1
a_fillRatio  measure of how efficiently tagged cells will be covered
a_blockFactor  amount by which grids are guaranteed to be coarsenable
a_bufferSize  proper nesting buffer amount
a_maxSize  maximum grid length in any direction -- 0 means no limit

Reimplemented from MeshRefine.

void BRMeshRefine::define const Box   a_baseDomain,
const Vector< int > &    a_refRatios,
const Real    a_fillRatio,
const int    a_blockFactor,
const int    a_bufferSize,
const int    a_maxSize
 

define function -- size of RefRatios will define maximum number of levels

Parameters:
a_baseDomain  level 0 domain
a_refRatios  refinement ratios -- refRatio[0] is btwn levels 0 and 1
a_fillRatio  measure of how efficiently tagged cells will be covered
a_blockFactor  amount by which grids are guaranteed to be coarsenable
a_bufferSize  proper nesting buffer amount
a_maxSize  maximum grid length in any direction -- 0 means no limit

Reimplemented from MeshRefine.

int BRMeshRefine::findMaxInflectionPoint const Vector< int > &    a_trace,
int &    a_maxVal
const [protected]
 

int BRMeshRefine::findSplit const Vector< int > &    a_trace const [protected]
 

void BRMeshRefine::makeBoxes std::list< Box > &    a_mesh,
const IntVectSet   a_tags,
const IntVectSet   a_pnd,
const ProblemDomain   a_domain,
const int    a_maxSize,
const int    a_depth
const [protected]
 

Parameters:
a_mesh  output: refined boxes at each new level
a_tags  input: set of tagged cells to cover
a_pnd  input: proper nesting domain in which mesh boxes must live
a_domain  input: physical domain
a_maxSize  input: largest number of cells in any dimension for any box
a_depth  input: depth of this recursion in the algorithm

void BRMeshRefine::makeBoxes Vector< Box > &    a_mesh,
const IntVectSet   a_tags,
const IntVectSet   a_pnd,
const ProblemDomain   a_domain,
const int    a_maxSize
const [virtual]
 

constructs a set of boxes which covers a set of tagged cells

constructs a set of boxes which covers a set of tagged cells by using the Berger-Rigoutsos algorithm. Everything should be on the same level, and blocking factor is not applied. Boxes will be on the same refinement level as the tags. This would normally be a protected function, but it can be useful to call it on it's own, so it has been left public.

Parameters:
a_mesh  output: refined boxes at each new level
a_tags  input: set of tagged cells to cover
a_pnd  input: proper nesting domain in which mesh boxes must live
a_domain  input: physical domain
a_maxSize  input: largest number of cells in any dimension for any box

Implements MeshRefine.

Vector<int> BRMeshRefine::makeTrace const IntVectSet   a_Ivs,
int    a_dir
const [protected]
 

void BRMeshRefine::makeTraces const IntVectSet   a_Ivs,
Vector< int > *    a_traces
const [protected]
 

int BRMeshRefine::maxloc const int *    a_V,
const int    a_Size
const [protected]
 

void BRMeshRefine::splitBox std::list< Box > &    a_boxes,
const std::list< Box >::iterator &    a_boxindex,
const int    a_dimension,
const int    a_maxboxsize
const [protected]
 

void BRMeshRefine::splitTags const IntVectSet   a_tags,
const int    a_split_dir,
const int    a_split_indx,
IntVectSet   a_tags_lo,
IntVectSet   a_tags_hi
const [protected]
 


The documentation for this class was generated from the following file:
Generated on Wed Apr 16 14:27:37 2003 for Chombo by doxygen1.2.16