Chombo + EB
3.0
|
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< NodeFArrayBox > | m_coarsenedFine |
LayoutData< Vector< IntVectSet > > | m_IVSV |
LayoutData< BitSet > | m_IVSVfull |
LayoutData< Vector< IntVectSet > > | m_IVSVsame |
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.
NodeCoarseAverage::NodeCoarseAverage | ( | ) |
Default constructor. User must subsequently call define().
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::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::NodeCoarseAverage | ( | const DisjointBoxLayout & | a_gridsCoarse, |
int | a_numcomps, | ||
int | a_refRatio, | ||
const ProblemDomain & | a_domainFine | ||
) |
Defining constructor. Calls define() function with identical arguments.
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 | ( | ) |
Destructor.
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.
a_gridsFine | CELL-centered grids at the fine level |
a_gridsCoarse | CELL-centered grids at the coarse level |
a_numcomps | number of components of data |
a_refRatio | refinement ratio between the two levels |
a_domainFine | CELL-centered physical domain at the fine level |
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.
a_gridsFine | CELL-centered grids at the fine level |
a_gridsCoarse | CELL-centered grids at the coarse level |
a_numcomps | number of components of data |
a_refRatio | refinement ratio between the two levels |
a_domainFine | CELL-centered physical domain at the fine level |
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.
a_gridsCoarse | CELL-centered grids at the coarse level |
a_numcomps | number of components of data |
a_refRatio | refinement ratio between the two levels |
a_domainFine | CELL-centered physical domain at the fine level |
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.
a_gridsCoarse | CELL-centered grids at the coarse level |
a_numcomps | number of components of data |
a_refRatio | refinement ratio between the two levels |
a_domainFine | CELL-centered physical domain at the fine level |
bool NodeCoarseAverage::isDefined | ( | ) | const |
Returns true
if this object was created with the defining constructor or if define() has been called.
void NodeCoarseAverage::setVerbose | ( | bool | a_verbose | ) |
Set whether the solver gives output while solving. Default is true
.
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.
a_coarse | coarse data |
a_fine | fine data, modified in exchange() |
|
protected |
has this NodeCoarseAverage object been defined yet?
|
protected |
flag for verbose output
|
protected |
the refinement ratio between the two levels
|
protected |
the number of components of data, used in work array
|
protected |
CELL-centered physical domain at the coarser level
|
protected |
box with indices from -m_refRatio/2 to +m_refRatio/2 in all directions
|
protected |
weights for coarsening
|
protected |
are the fine grids merely refined versions of the coarse grids?
|
protected |
CELL-centered grids at the finer level, coarsened by m_refRatio
|
protected |
work array for the coarsening of the fine data, based on the layout m_coarsenedGrids
|
protected |
interior boundary nodes of coarsened finer-level grids, distributed among the coarser-level grids
|
protected |
whether each section of m_IVSVsame is a complete box
|
protected |
interior boundary nodes of coarsened finer-level grids, distributed among the same grids