Proto  3.2
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Proto::AMRGrid Class Reference

AMR Grid. More...

#include <Proto_AMRGrid.H>

Public Member Functions

 AMRGrid ()
 Trivial Constructor. More...
 
 AMRGrid (const std::vector< DisjointBoxLayout > &a_layouts, const std::vector< Point > &a_refRatios, int a_maxLevels)
 Multi-Level Constructor. More...
 
 AMRGrid (const DisjointBoxLayout &a_layout, const std::vector< Point > &a_refRatios, int a_maxLevels)
 Single-Level Constructor. More...
 
void define (const std::vector< DisjointBoxLayout > &a_layouts, const std::vector< Point > &a_refRatios, int a_maxLevels)
 Multi-Level Define. More...
 
void define (const DisjointBoxLayout &a_layout, const std::vector< Point > &a_refRatios, int a_maxLevels)
 Single-Level Define. More...
 
const DisjointBoxLayoutoperator[] (unsigned int a_level) const
 Layout Access (Const) More...
 
DisjointBoxLayoutoperator[] (unsigned int a_level)
 Layout Access (Non-Const) More...
 
void regrid (LevelTagData &a_tags, unsigned int a_level, Point a_boxSize)
 Regrid. More...
 
void regrid (LevelTagData &a_tags, unsigned int a_level)
 
void enforceNesting (unsigned int a_level, int a_nestingDistance=1)
 Enforce Nesting. More...
 
void enforceNesting2 (unsigned int a_level, int a_nestingDistance=1)
 Trim a_level grids so that they properly nest in a_level-1 grids. More...
 
int numLevels () const
 Query Number of Levels. More...
 
int maxLevels () const
 Query Max Number of Levels. More...
 
Point refRatio (int a_level) const
 Query Refinement Ratio. More...
 
bool compatible (const AMRGrid &a_grid) const
 Query Compatibility. More...
 
void addFinerGrids (LevelTagData &a_tags, int a_level)
 Augments set of a_level tags by set intersecting a_level+2 grids. More...
 
void addFinerTags (LevelTagData &a_tags, unsigned int a_level)
 
void print () const
 

Static Public Member Functions

template<typename T , unsigned int C = 1, MemType MEM = MEMTYPE_DEFAULT, Centering CTR = PR_CELL>
static void computeTags (LevelTagData &a_tags, LevelBoxData< T, C, MEM, CTR > &a_data, Point a_bufferSize, T a_threshold, unsigned int a_comp=0)
 Compute Tags. More...
 
template<typename T , unsigned int C = 1, MemType MEM = MEMTYPE_DEFAULT, Centering CTR = PR_CELL>
static void computeTags (LevelTagData &a_tags, LevelBoxData< T, C, MEM, CTR > &a_data, int a_bufferSize, T a_threshold, unsigned int a_comp=0)
 Compute Tags (Isotropic) More...
 
static void buffer (LevelTagData &a_tags, Point a_bufferSize)
 Buffer Tags. More...
 
static void buffer (LevelTagData &a_tags, int a_bufferSize)
 Buffer Tags (Isotropic) More...
 

Private Attributes

bool m_defined
 
std::vector< DisjointBoxLayoutm_layouts
 
std::vector< Pointm_refRatios
 
int m_maxLevels
 

Detailed Description

AMR Grid.

AMRGrid is a collection of DisjointBoxLayout objects that define properly nested unions of logically rectangular space.

Constructor & Destructor Documentation

◆ AMRGrid() [1/3]

Proto::AMRGrid::AMRGrid ( )
inline

Trivial Constructor.

References m_defined.

◆ AMRGrid() [2/3]

Proto::AMRGrid::AMRGrid ( const std::vector< DisjointBoxLayout > &  a_layouts,
const std::vector< Point > &  a_refRatios,
int  a_maxLevels 
)
inline

Multi-Level Constructor.

Create an AMRGrid using a vector of DisjointBoxLayouts. TODO: What to do if the DBLs are not properly nested?

Parameters
layoutsA vector of DisjointBoxLayouts.
refRatiosRefinement ratios for each coarse level.
maxLevelsThe maximum number of levels allowable in this grid.

◆ AMRGrid() [3/3]

Proto::AMRGrid::AMRGrid ( const DisjointBoxLayout a_layout,
const std::vector< Point > &  a_refRatios,
int  a_maxLevels 
)
inline

Single-Level Constructor.

Create an AMRGrid by initializing only the coarsest level.

Parameters
layoutLayout of the coarsest level.
refRatiosRefinement ratios for each coarse level.
maxLevelsThe maximum number of levels allowable in this grid.

Member Function Documentation

◆ computeTags() [1/2]

template<typename T , unsigned int C, MemType MEM, Centering CTR>
void Proto::AMRGrid::computeTags ( LevelTagData a_tags,
LevelBoxData< T, C, MEM, CTR > &  a_data,
Point  a_bufferSize,
a_threshold,
unsigned int  a_comp = 0 
)
inlinestatic

Compute Tags.

Populate tags using the magnitude of the undivided difference of the a specified component of a dataset.

Parameters
tagsThe tag data to be populated. Must have compatible layout with the level being checked.
dataThe level of data to compute tags on
compComponent of data to use
bufferSizeDistance to buffer the computed tags by
thresholdThreshold above whcih a tag is generated

◆ computeTags() [2/2]

template<typename T , unsigned int C, MemType MEM, Centering CTR>
void Proto::AMRGrid::computeTags ( LevelTagData a_tags,
LevelBoxData< T, C, MEM, CTR > &  a_data,
int  a_bufferSize,
a_threshold,
unsigned int  a_comp = 0 
)
inlinestatic

Compute Tags (Isotropic)

Computes tags with an isotropic buffer radius.

◆ buffer() [1/2]

void Proto::AMRGrid::buffer ( LevelTagData a_tags,
Point  a_bufferSize 
)
inlinestatic

Buffer Tags.

Grows a level of tag data by bufferSize.

◆ buffer() [2/2]

void Proto::AMRGrid::buffer ( LevelTagData a_tags,
int  a_bufferSize 
)
inlinestatic

Buffer Tags (Isotropic)

Grows a level of tag data by bufferSize.

◆ define() [1/2]

void Proto::AMRGrid::define ( const std::vector< DisjointBoxLayout > &  a_layouts,
const std::vector< Point > &  a_refRatios,
int  a_maxLevels 
)
inline

Multi-Level Define.

Lazy multi-level construction

Parameters
layoutsA vector of DisjointBoxLayouts.
refRatiosRefinement ratios for each coarse level.
maxLevelsThe maximum number of levels allowable in this grid.

◆ define() [2/2]

void Proto::AMRGrid::define ( const DisjointBoxLayout a_layout,
const std::vector< Point > &  a_refRatios,
int  a_maxLevels 
)
inline

Single-Level Define.

Lazy single-level construction

Parameters
layoutLayout of the coarsest level.
refRatiosRefinement ratios for each coarse level.
maxLevelsThe maximum number of levels allowable in this grid.

◆ operator[]() [1/2]

const DisjointBoxLayout & Proto::AMRGrid::operator[] ( unsigned int  a_level) const
inline

Layout Access (Const)

◆ operator[]() [2/2]

DisjointBoxLayout & Proto::AMRGrid::operator[] ( unsigned int  a_level)
inline

Layout Access (Non-Const)

◆ regrid() [1/2]

void Proto::AMRGrid::regrid ( LevelTagData a_tags,
unsigned int  a_level,
Point  a_boxSize 
)
inline

Regrid.

Given tag data on a level, modify or generate a grid on the next finer level. Input level must correspond to the grid on which input tags are defined. Input level must be coarser than the finest permissible level in the grid. For grids with fewer than their predefined max number of levels, this function can add at most one level of grid. Proper nesting is NOT enforced by this function (see enforceNesting).

◆ regrid() [2/2]

void Proto::AMRGrid::regrid ( LevelTagData a_tags,
unsigned int  a_level 
)
inline

◆ enforceNesting()

void Proto::AMRGrid::enforceNesting ( unsigned int  a_level,
int  a_nestingDistance = 1 
)
inline

Enforce Nesting.

Enforce the proper nesting criteria on a given level. Input level must be an "internal" level. That is to say, greater than 0 and finer than the finest level in the grid.

◆ enforceNesting2()

void Proto::AMRGrid::enforceNesting2 ( unsigned int  a_level,
int  a_nestingDistance = 1 
)
inline

Trim a_level grids so that they properly nest in a_level-1 grids.

◆ numLevels()

int Proto::AMRGrid::numLevels ( ) const
inline

Query Number of Levels.

References m_layouts.

◆ maxLevels()

int Proto::AMRGrid::maxLevels ( ) const
inline

Query Max Number of Levels.

References m_maxLevels, and refRatio().

Referenced by Proto::AMRData< T, C, MEM, CTR >::maxLevels().

◆ refRatio()

Point Proto::AMRGrid::refRatio ( int  a_level) const
inline

Query Refinement Ratio.

Referenced by maxLevels().

◆ compatible()

bool Proto::AMRGrid::compatible ( const AMRGrid a_grid) const
inline

Query Compatibility.

Determines if the layouts are compatible in a data iterator sence on each level of this and another grid. If the two grids have different numbers of levels, this check is only performed for levels that are defined for both grids.

Parameters
gridAnother AMRGrid

◆ addFinerGrids()

void Proto::AMRGrid::addFinerGrids ( LevelTagData a_tags,
int  a_level 
)
inline

Augments set of a_level tags by set intersecting a_level+2 grids.

◆ addFinerTags()

void Proto::AMRGrid::addFinerTags ( LevelTagData a_tags,
unsigned int  a_level 
)
inline

◆ print()

void Proto::AMRGrid::print ( ) const
inline

Member Data Documentation

◆ m_defined

bool Proto::AMRGrid::m_defined
private

Referenced by AMRGrid().

◆ m_layouts

std::vector<DisjointBoxLayout> Proto::AMRGrid::m_layouts
private

Referenced by numLevels().

◆ m_refRatios

std::vector<Point> Proto::AMRGrid::m_refRatios
private

◆ m_maxLevels

int Proto::AMRGrid::m_maxLevels
private

Referenced by maxLevels().


The documentation for this class was generated from the following file: