Chombo + EB + MF  3.2
Protected Attributes | List of all members
NodeCoarseAverage Class Reference

Replaces coarse-level data with an average of fine-level data. More...

#include <NodeCoarseAverage.H>

Public Member Functions

Constructors, destructor and defines
 NodeCoarseAverage ()
 
 NodeCoarseAverage (const DisjointBoxLayout &a_gridsFine, const DisjointBoxLayout &a_gridsCoarse, int a_numcomps, int a_refRatio, const ProblemDomain &a_domainFine)
 
 NodeCoarseAverage (const DisjointBoxLayout &a_gridsFine, const DisjointBoxLayout &a_gridsCoarse, int a_numcomps, int a_refRatio, const Box &a_domainFine)
 
 NodeCoarseAverage (const DisjointBoxLayout &a_gridsCoarse, int a_numcomps, int a_refRatio, const ProblemDomain &a_domainFine)
 
 NodeCoarseAverage (const DisjointBoxLayout &a_gridsCoarse, int a_numcomps, int a_refRatio, const Box &a_domainFine)
 
 ~NodeCoarseAverage ()
 
void define (const DisjointBoxLayout &a_gridsFine, const DisjointBoxLayout &a_gridsCoarse, int a_numcomps, int a_refRatio, const ProblemDomain &a_domainFine)
 
void define (const DisjointBoxLayout &a_gridsFine, const DisjointBoxLayout &a_gridsCoarse, int a_numcomps, int a_refRatio, const Box &a_domainFine)
 
void define (const DisjointBoxLayout &a_gridsCoarse, int a_numcomps, int a_refRatio, const ProblemDomain &a_domainFine)
 
void define (const DisjointBoxLayout &a_gridsCoarse, int a_numcomps, int a_refRatio, const Box &a_domainFine)
 
Access functions
bool isDefined () const
 
void setVerbose (bool a_verbose)
 
Data modification functions
void averageToCoarse (LevelData< NodeFArrayBox > &a_coarse, LevelData< NodeFArrayBox > &a_fine)
 

Protected Attributes

bool is_defined
 
bool m_verbose
 
int m_refRatio
 
int m_numcomps
 
ProblemDomain m_domainCoarse
 
Box m_refbox
 
FArrayBox m_weights
 
bool m_sameGrids
 
DisjointBoxLayout m_coarsenedGrids
 
LevelData< NodeFArrayBoxm_coarsenedFine
 
LayoutData< Vector< IntVectSet > > m_IVSV
 
LayoutData< BitSetm_IVSVfull
 
LayoutData< Vector< IntVectSet > > m_IVSVsame
 

Detailed Description

Replaces coarse-level data with an average of fine-level data.

This class replaces data at a coarse level of refinement with an average of data at a finer level of refinement, in areas where fine data is present. Coarse-level data is not modified where fine-level data is not present.

Constructor & Destructor Documentation

◆ NodeCoarseAverage() [1/5]

NodeCoarseAverage::NodeCoarseAverage ( )

Default constructor. User must subsequently call define().

◆ NodeCoarseAverage() [2/5]

NodeCoarseAverage::NodeCoarseAverage ( const DisjointBoxLayout a_gridsFine,
const DisjointBoxLayout a_gridsCoarse,
int  a_numcomps,
int  a_refRatio,
const ProblemDomain a_domainFine 
)

Defining constructor. Calls define() function with identical arguments.

◆ NodeCoarseAverage() [3/5]

NodeCoarseAverage::NodeCoarseAverage ( const DisjointBoxLayout a_gridsFine,
const DisjointBoxLayout a_gridsCoarse,
int  a_numcomps,
int  a_refRatio,
const Box a_domainFine 
)

Defining constructor. Calls define() function with identical arguments.

◆ NodeCoarseAverage() [4/5]

NodeCoarseAverage::NodeCoarseAverage ( const DisjointBoxLayout a_gridsCoarse,
int  a_numcomps,
int  a_refRatio,
const ProblemDomain a_domainFine 
)

Defining constructor. Calls define() function with identical arguments.

◆ NodeCoarseAverage() [5/5]

NodeCoarseAverage::NodeCoarseAverage ( const DisjointBoxLayout a_gridsCoarse,
int  a_numcomps,
int  a_refRatio,
const Box a_domainFine 
)

Defining constructor. Calls define() function with identical arguments.

◆ ~NodeCoarseAverage()

NodeCoarseAverage::~NodeCoarseAverage ( )

Destructor.

Member Function Documentation

◆ define() [1/4]

void NodeCoarseAverage::define ( const DisjointBoxLayout a_gridsFine,
const DisjointBoxLayout a_gridsCoarse,
int  a_numcomps,
int  a_refRatio,
const ProblemDomain a_domainFine 
)

Defines this object. Existing information is overriden.

Parameters
a_gridsFineCELL-centered grids at the fine level
a_gridsCoarseCELL-centered grids at the coarse level
a_numcompsnumber of components of data
a_refRatiorefinement ratio between the two levels
a_domainFineCELL-centered physical domain at the fine level

◆ define() [2/4]

void NodeCoarseAverage::define ( const DisjointBoxLayout a_gridsFine,
const DisjointBoxLayout a_gridsCoarse,
int  a_numcomps,
int  a_refRatio,
const Box a_domainFine 
)

Defines this object. Existing information is overriden.

Parameters
a_gridsFineCELL-centered grids at the fine level
a_gridsCoarseCELL-centered grids at the coarse level
a_numcompsnumber of components of data
a_refRatiorefinement ratio between the two levels
a_domainFineCELL-centered physical domain at the fine level

◆ define() [3/4]

void NodeCoarseAverage::define ( const DisjointBoxLayout a_gridsCoarse,
int  a_numcomps,
int  a_refRatio,
const ProblemDomain a_domainFine 
)

Defines this object. Existing information is overriden. Fine grids are refinements of coarse grids.

Parameters
a_gridsCoarseCELL-centered grids at the coarse level
a_numcompsnumber of components of data
a_refRatiorefinement ratio between the two levels
a_domainFineCELL-centered physical domain at the fine level

◆ define() [4/4]

void NodeCoarseAverage::define ( const DisjointBoxLayout a_gridsCoarse,
int  a_numcomps,
int  a_refRatio,
const Box a_domainFine 
)

Defines this object. Existing information is overriden. Fine grids are refinements of coarse grids.

Parameters
a_gridsCoarseCELL-centered grids at the coarse level
a_numcompsnumber of components of data
a_refRatiorefinement ratio between the two levels
a_domainFineCELL-centered physical domain at the fine level

◆ isDefined()

bool NodeCoarseAverage::isDefined ( ) const

Returns true if this object was created with the defining constructor or if define() has been called.

◆ setVerbose()

void NodeCoarseAverage::setVerbose ( bool  a_verbose)

Set whether the solver gives output while solving. Default is true.

◆ averageToCoarse()

void NodeCoarseAverage::averageToCoarse ( LevelData< NodeFArrayBox > &  a_coarse,
LevelData< NodeFArrayBox > &  a_fine 
)

Replaces coarse data with the average of nearby cells' fine data on the interior nodes of the coarsened fine-level domain. Elsewhere, the coarse data is unchanged.

It is an error to call if not this->isDefined().

The domain of a_fine should be the same as a_gridsFine specified in the most recent call to define().

It is expected that the coarse and fine levels' domains are properly nested. Both a_coarse and a_fine should have the same number of components specified in the most recent call to define().

The fine data is modified only in exchange(). A work array is also modified.

Parameters
a_coarsecoarse data
a_finefine data, modified in exchange()

Member Data Documentation

◆ is_defined

bool NodeCoarseAverage::is_defined
protected

has this NodeCoarseAverage object been defined yet?

◆ m_verbose

bool NodeCoarseAverage::m_verbose
protected

flag for verbose output

◆ m_refRatio

int NodeCoarseAverage::m_refRatio
protected

the refinement ratio between the two levels

◆ m_numcomps

int NodeCoarseAverage::m_numcomps
protected

the number of components of data, used in work array

◆ m_domainCoarse

ProblemDomain NodeCoarseAverage::m_domainCoarse
protected

CELL-centered physical domain at the coarser level

◆ m_refbox

Box NodeCoarseAverage::m_refbox
protected

box with indices from -m_refRatio/2 to +m_refRatio/2 in all directions

◆ m_weights

FArrayBox NodeCoarseAverage::m_weights
protected

weights for coarsening

◆ m_sameGrids

bool NodeCoarseAverage::m_sameGrids
protected

are the fine grids merely refined versions of the coarse grids?

◆ m_coarsenedGrids

DisjointBoxLayout NodeCoarseAverage::m_coarsenedGrids
protected

CELL-centered grids at the finer level, coarsened by m_refRatio

◆ m_coarsenedFine

LevelData<NodeFArrayBox> NodeCoarseAverage::m_coarsenedFine
protected

work array for the coarsening of the fine data, based on the layout m_coarsenedGrids

◆ m_IVSV

LayoutData< Vector<IntVectSet> > NodeCoarseAverage::m_IVSV
protected

interior boundary nodes of coarsened finer-level grids, distributed among the coarser-level grids

◆ m_IVSVfull

LayoutData< BitSet > NodeCoarseAverage::m_IVSVfull
protected

whether each section of m_IVSVsame is a complete box

◆ m_IVSVsame

LayoutData< Vector<IntVectSet> > NodeCoarseAverage::m_IVSVsame
protected

interior boundary nodes of coarsened finer-level grids, distributed among the same grids


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