#include <MultiFab.H>
Public Types | |
typedef FArrayBox::value_type | value_type |
Public Member Functions | |
MultiFab () | |
Constructs an empty MultiFab. | |
MultiFab (const BoxArray &bs, int ncomp, int ngrow, FabAlloc mem_mode=Fab_allocate) | |
Constructs a MultiFab with a valid region defined by bxs and a region of definition defined by the grow factor ngrow. | |
MultiFab (const BoxArray &bs, int ncomp, int ngrow, const DistributionMapping &dm, FabAlloc mem_mode) | |
void | operator= (const Real &r) |
Real | min (int comp, int nghost=0) const |
Returns the minimum value contained in component comp of the MultiFab. | |
Real | min (const Box &b, int comp, int nghost=0) const |
Identical to the previous min() function, but confines its search to intersection of Box b and the MultiFab. | |
Real | max (int comp, int nghost=0) const |
Returns the maximum value contained in component comp of the MultiFab. | |
Real | max (const Box &b, int comp, int nghost=0) const |
Identical to the previous max() function, but confines its search to intersection of Box b and the MultiFab. | |
void | plus (Real val, int comp, int num_comp, int nghost=0) |
Adds the scalar value val to the value of each cell in the specified subregion of the MultiFab. | |
void | plus (Real val, const Box ®ion, int comp, int num_comp, int nghost=0) |
Identical to the previous version of plus(), with the restriction that the subregion is further constrained to the intersection with Box region. | |
void | plus (Real val, int nghost) |
Adds the scalar value val to the value of each cell in the valid region of each component of the MultiFab. | |
void | plus (Real val, const Box ®ion, int nghost) |
Adds the scalar value val to the value of each cell in the valid region of each component of the MultiFab, that also intersects the Box region. | |
void | mult (Real val, int comp, int num_comp, int nghost=0) |
Scales the value of each cell in the specified subregion of the MultiFab by the scalar val (a[i] <- a[i]*val). | |
void | mult (Real val, const Box ®ion, int comp, int num_comp, int nghost=0) |
Identical to the previous version of mult(), with the restriction that the subregion is further constrained to the intersection with Box region. | |
void | mult (Real val, int nghost=0) |
Scales the value of each cell in the valid region of each component of the MultiFab by the scalar val (a[i] <- a[i]*val). | |
void | mult (Real val, const Box ®ion, int nghost=0) |
Scales the value of each cell in the valid region of each component of the MultiFab by the scalar val (a[i] <- a[i]*val), that also intersects the Box region. | |
void | invert (Real numerator, int comp, int num_comp, int nghost=0) |
Replaces the value of each cell in the specified subregion of the MultiFab with its reciprocal multiplied by the value of numerator. | |
void | invert (Real numerator, const Box ®ion, int comp, int num_comp, int nghost=0) |
Identical to the previous version of invert(), with the restriction that the subregion is further constrained to the intersection with Box region. | |
void | invert (Real numerator, int nghost) |
Replaces the value of each cell in the specified subregion of the MultiFab with its reciprocal multiplied by the value of numerator. | |
void | invert (Real numerator, const Box ®ion, int nghost) |
Replaces the value of each cell in the specified subregion of the MultiFab, that also intersects the Box region, with its reciprocal multiplied by the value of numerator. | |
void | negate (int comp, int num_comp, int nghost=0) |
Negates the value of each cell in the specified subregion of the MultiFab. | |
void | negate (const Box ®ion, int comp, int num_comp, int nghost=0) |
Identical to the previous version of negate(), with the restriction that the subregion is further constrained to the intersection with Box region. | |
void | negate (int nghost=0) |
Negates the value of each cell in the valid region of the MultiFab. | |
void | negate (const Box ®ion, int nghost=0) |
Negates the value of each cell in the valid region of the MultiFab that also intersects the Box region. | |
void | plus (const MultiFab &mf, int strt_comp, int num_comp, int nghost) |
This function adds the values of the cells in mf to the corresponding cells of this MultiFab. | |
void | minus (const MultiFab &mf, int strt_comp, int num_comp, int nghost) |
This function subtracts the values of the cells in mf from the corresponding cells of this MultiFab. | |
void | FillBoundary () |
Copy on intersection within MultiFab. | |
void | FillBoundary (int src_comp, int num_comp) |
Same as FillBoundary(), but only copies num components starting at src. | |
void | define (const BoxArray &bxs, int nvar, int ngrow, FabAlloc mem_mode) |
Define this FabArray identically to that performed by the constructor having an analogous function signature. | |
void | define (const BoxArray &bxs, int nvar, int ngrow, const DistributionMapping &dm, FabAlloc mem_mode) |
bool | ok () const |
Returns true if the FabArray is well-defined. | |
const FArrayBox & | operator[] (const MFIter &mfi) const |
Returns a constant reference to the FAB associated with the Kth element. | |
FArrayBox & | operator[] (const MFIter &mfi) |
Returns a reference to the FAB associated with the Kth element. | |
const FArrayBox & | operator[] (int K) const |
Returns a constant reference to the FAB associated with the Kth element. | |
FArrayBox & | operator[] (int K) |
Returns a reference to the FAB associated with the Kth element. | |
const FArrayBox & | get (const MFIter &mfi) const |
FArrayBox & | get (const MFIter &mfi) |
void | setFab (int K, FArrayBox *elem) |
Explicitly set the Kth FAB in the FabArray to point to elem. | |
void | clear () |
Releases FAB memory in the FabArray. | |
void | setVal (value_type val) |
Set all components in the valid region of each FAB to val. | |
void | setVal (value_type val, int comp, int num_comp, int nghost=0) |
Set the value of num components in the valid region of each FAB in the FabArray, starting at component comp to val. | |
void | setVal (value_type val, const Box ®ion, int comp, int num_comp, int nghost=0) |
Set the value of num components in the valid region of each FAB in the FabArray, starting at component comp, as well as nghost boundary cells, to val, provided they also intersect with the Box region. | |
void | setVal (value_type val, int nghost) |
Set all components in the valid region of each FAB in the FabArray to val, including nghost boundary cells. | |
void | setVal (value_type val, const Box ®ion, int nghost) |
Set all components in the valid region of each FAB in the FabArray to val, including nghost boundary cells, that also intersect the Box region. | |
void | setBndry (value_type val) |
Set all values in the boundary region to val. | |
void | setBndry (value_type val, int strt_comp, int ncomp) |
Set ncomp values in the boundary region, starting at start to val. | |
void | copy (const FabArray< FArrayBox > &fa) |
This function copies data from fa to this FabArray. | |
void | copy (const FabArray< FArrayBox > &src, int src_comp, int dest_comp, int num_comp) |
This function copies data from src to this FabArray. | |
void | copy (FArrayBox &dest) const |
Copies the values contained in the intersection of the valid region of this FabArray with the FAB dest into dest. | |
void | copy (FArrayBox &dest, const Box &subbox) const |
Copies the values contained in the intersection of the valid region of this FabArray with the FAB dest and the Box subbox into that subregion of dest. | |
void | copy (FArrayBox &dest, int src_comp, int dest_comp, int num_comp) const |
Copies the values contained in the intersection of the num component valid region of this FabArray, starting at component src, with the FAB dest into dest, starting at component dest in dest. | |
void | copy (FArrayBox &dest, const Box &subbox, int src_comp, int dest_comp, int num_comp) const |
Copies the values contained in the intersection of the num component valid region of this FabArray, starting at component src, with the FAB dest and the Box subbox, into dest, starting at component dest in dest. | |
void | shift (const IntVect &v) |
Perform shifts on the FabArray. | |
int | nGrow () const |
Returns the grow factor that defines the region of definition. | |
int | nComp () const |
Returns number of variables associated with each point (nvar). | |
const BoxArray & | boxArray () const |
Returns a constant reference to the BoxArray that defines the valid region associated with this FabArray. | |
virtual const Box & | box (int K) const |
Returns a constant reference to the Kth Box in the BoxArray. | |
virtual Box | fabbox (int K) const |
Returns the Kth FABs Box in the FabArray. | |
int | size () const |
Returns the number of FABs in the FabArray.. | |
const DistributionMapping & | DistributionMap () const |
Returns constant reference to associated DistributionMapping. | |
Static Public Member Functions | |
static void | FlushSICache () |
Flush the cache of self-intersection info used by FillBoundary. | |
static int | SICacheSize () |
The size of the cache of self-intersection info. | |
static void | Copy (MultiFab &dst, const MultiFab &src, int srccomp, int dstcomp, int numcomp, int nghost) |
Copy from `src' to `dst' including `nghost' ghost cells. | |
Protected Attributes | |
PArray< FArrayBox > | fabparray |
BoxArray | boxarray |
DistributionMapping | distributionMap |
int | n_grow |
int | n_comp |
The MultiFab class is publically derived from the FabArray<Real,FArrayBox> class. It is a collection (stored as an array) of FArrayBoxes useful for storing floating point data on a domain defined by a union of rectangular regions embedded in a uniform index space. The MultiFab class extends the function of the underlying FabArray class just as the FArrayBox class extends the funtion of BaseFab<Real>. Additional member functions are defined for I/O and simple arithmetic operations on these aggregate objects.
This class does NOT provide a copy constructor or assignment operator.
typedef FArrayBox ::value_type FabArray< FArrayBox >::value_type [inherited] |
MultiFab::MultiFab | ( | ) |
Constructs a MultiFab with a valid region defined by bxs and a region of definition defined by the grow factor ngrow.
If mem is defined to be Fab then FArrayBoxes are allocated for each Box in the BoxArray. The size of the FArrayBox is given by the Box grown by ngrow and the number of components is given by ncomp. If mem is defined to be Fab then no FArrayBoxes are allocated at this time but can be defined later.
MultiFab::MultiFab | ( | const BoxArray & | bs, | |
int | ncomp, | |||
int | ngrow, | |||
const DistributionMapping & | dm, | |||
FabAlloc | mem_mode | |||
) |
void MultiFab::operator= | ( | const Real & | r | ) |
References FabArray< FArrayBox >::setVal().
Real MultiFab::min | ( | int | comp, | |
int | nghost = 0 | |||
) | const |
Returns the minimum value contained in component comp of the MultiFab.
The parameter nghost determines the number of boundary cells to search for the minimum. The default is to search only the valid regions of the FArrayBoxes.
References BL_ASSERT, BoxLib::grow(), BoxLib::max(), BoxLib::min(), FabArrayBase::n_grow, and ParallelDescriptor::ReduceRealMin().
Referenced by VisMF::Header::Header().
Identical to the previous min() function, but confines its search to intersection of Box b and the MultiFab.
References BL_ASSERT, BoxLib::grow(), BoxLib::max(), BoxLib::min(), FabArrayBase::n_grow, Box::ok(), and ParallelDescriptor::ReduceRealMin().
Real MultiFab::max | ( | int | comp, | |
int | nghost = 0 | |||
) | const |
Returns the maximum value contained in component comp of the MultiFab.
The parameter nghost determines the number of boundary cells to search for the maximum. The default is to search only the valid regions of the FArrayBoxes.
References BL_ASSERT, BoxLib::grow(), BoxLib::max(), FabArrayBase::n_grow, and ParallelDescriptor::ReduceRealMax().
Referenced by VisMF::Header::Header().
Identical to the previous max() function, but confines its search to intersection of Box b and the MultiFab.
References BL_ASSERT, BoxLib::grow(), BoxLib::max(), FabArrayBase::n_grow, Box::ok(), and ParallelDescriptor::ReduceRealMax().
void MultiFab::plus | ( | Real | val, | |
int | comp, | |||
int | num_comp, | |||
int | nghost = 0 | |||
) |
Adds the scalar value val to the value of each cell in the specified subregion of the MultiFab.
The subregion consists of the num components starting at component comp. The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified.
References BL_ASSERT, BoxLib::grow(), FabArrayBase::n_comp, and FabArrayBase::n_grow.
Referenced by plus().
Identical to the previous version of plus(), with the restriction that the subregion is further constrained to the intersection with Box region.
References BL_ASSERT, BoxLib::grow(), FabArrayBase::n_comp, FabArrayBase::n_grow, and Box::ok().
void MultiFab::plus | ( | Real | val, | |
int | nghost | |||
) |
Adds the scalar value val to the value of each cell in the valid region of each component of the MultiFab.
The value of nghost specifies the number of cells in the boundary region that should be modified.
References FabArrayBase::n_comp, and plus().
Adds the scalar value val to the value of each cell in the valid region of each component of the MultiFab, that also intersects the Box region.
The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified.
References FabArrayBase::n_comp, and plus().
void MultiFab::mult | ( | Real | val, | |
int | comp, | |||
int | num_comp, | |||
int | nghost = 0 | |||
) |
Scales the value of each cell in the specified subregion of the MultiFab by the scalar val (a[i] <- a[i]*val).
The subregion consists of the num components starting at component comp. The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified.
References BL_ASSERT, BoxLib::grow(), FabArrayBase::n_comp, and FabArrayBase::n_grow.
Referenced by mult().
Identical to the previous version of mult(), with the restriction that the subregion is further constrained to the intersection with Box region.
The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified.
References BL_ASSERT, BoxLib::grow(), FabArrayBase::n_comp, FabArrayBase::n_grow, and Box::ok().
void MultiFab::mult | ( | Real | val, | |
int | nghost = 0 | |||
) |
Scales the value of each cell in the valid region of each component of the MultiFab by the scalar val (a[i] <- a[i]*val).
The value of nghost specifies the number of cells in the boundary region that should be modified.
References mult(), and FabArrayBase::n_comp.
Scales the value of each cell in the valid region of each component of the MultiFab by the scalar val (a[i] <- a[i]*val), that also intersects the Box region.
The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified.
References mult(), and FabArrayBase::n_comp.
void MultiFab::invert | ( | Real | numerator, | |
int | comp, | |||
int | num_comp, | |||
int | nghost = 0 | |||
) |
Replaces the value of each cell in the specified subregion of the MultiFab with its reciprocal multiplied by the value of numerator.
The subregion consists of the num components starting at component comp. The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified.
References BL_ASSERT, BoxLib::grow(), FabArrayBase::n_comp, and FabArrayBase::n_grow.
Referenced by invert().
void MultiFab::invert | ( | Real | numerator, | |
const Box & | region, | |||
int | comp, | |||
int | num_comp, | |||
int | nghost = 0 | |||
) |
Identical to the previous version of invert(), with the restriction that the subregion is further constrained to the intersection with Box region.
The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified.
References BL_ASSERT, BoxLib::grow(), FabArrayBase::n_comp, FabArrayBase::n_grow, and Box::ok().
void MultiFab::invert | ( | Real | numerator, | |
int | nghost | |||
) |
Replaces the value of each cell in the specified subregion of the MultiFab with its reciprocal multiplied by the value of numerator.
The value of nghost specifies the number of cells in the boundary region that should be modified.
References invert(), and FabArrayBase::n_comp.
Replaces the value of each cell in the specified subregion of the MultiFab, that also intersects the Box region, with its reciprocal multiplied by the value of numerator.
The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified.
References invert(), and FabArrayBase::n_comp.
void MultiFab::negate | ( | int | comp, | |
int | num_comp, | |||
int | nghost = 0 | |||
) |
Negates the value of each cell in the specified subregion of the MultiFab.
The subregion consists of the num components starting at component comp. The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified.
References BL_ASSERT, BoxLib::grow(), FabArrayBase::n_comp, and FabArrayBase::n_grow.
Referenced by negate().
void MultiFab::negate | ( | const Box & | region, | |
int | comp, | |||
int | num_comp, | |||
int | nghost = 0 | |||
) |
Identical to the previous version of negate(), with the restriction that the subregion is further constrained to the intersection with Box region.
References BL_ASSERT, BoxLib::grow(), FabArrayBase::n_comp, FabArrayBase::n_grow, and Box::ok().
void MultiFab::negate | ( | int | nghost = 0 |
) |
Negates the value of each cell in the valid region of the MultiFab.
The value of nghost specifies the number of cells in the boundary region that should be modified.
References FabArrayBase::n_comp, and negate().
void MultiFab::negate | ( | const Box & | region, | |
int | nghost = 0 | |||
) |
Negates the value of each cell in the valid region of the MultiFab that also intersects the Box region.
The value of nghost specifies the number of cells in the boundary region that should be modified.
References FabArrayBase::n_comp, and negate().
void MultiFab::plus | ( | const MultiFab & | mf, | |
int | strt_comp, | |||
int | num_comp, | |||
int | nghost | |||
) |
This function adds the values of the cells in mf to the corresponding cells of this MultiFab.
mf is required to have the same BoxArray or "valid region" as this MultiFab. The addition is done only to num components, starting with component number strt. The parameter nghost specifies the number of boundary cells that will be modified. If nghost == 0, only the valid region of each FArrayBox will be modified.
References BL_ASSERT, FabArrayBase::boxarray, BoxLib::grow(), FabArrayBase::n_comp, FabArrayBase::n_grow, and plus().
void MultiFab::minus | ( | const MultiFab & | mf, | |
int | strt_comp, | |||
int | num_comp, | |||
int | nghost | |||
) |
This function subtracts the values of the cells in mf from the corresponding cells of this MultiFab.
mf is required to have the same BoxArray or "valid region" as this MultiFab. The subtraction is done only to num components, starting with component number strt. The parameter nghost specifies the number of boundary cells that will be modified. If nghost == 0, only the valid region of each FArrayBox will be modified.
References BL_ASSERT, FabArrayBase::boxarray, BoxLib::grow(), FabArrayBase::n_comp, and FabArrayBase::n_grow.
void MultiFab::FillBoundary | ( | ) |
Copy on intersection within MultiFab.
Data is copied from valid regions to intersecting regions of definition. The purpose is to fill in the boundary regions of each FAB in the MultiFab.
References FabArrayBase::n_comp.
void MultiFab::FillBoundary | ( | int | src_comp, | |
int | num_comp | |||
) |
Same as FillBoundary(), but only copies num components starting at src.
References FabArrayCopyDescriptor< FAB >::AddBox(), BL_ASSERT, FabArrayCopyDescriptor< FAB >::CollectData(), FabArrayBase::DistributionMap(), FabArrayCopyDescriptor< FAB >::FillFab(), ParallelDescriptor::MyProc(), MultiFabCopyDescriptor::RegisterMultiFab(), and TheFBsirec().
void MultiFab::FlushSICache | ( | ) | [static] |
int MultiFab::SICacheSize | ( | ) | [static] |
void MultiFab::Copy | ( | MultiFab & | dst, | |
const MultiFab & | src, | |||
int | srccomp, | |||
int | dstcomp, | |||
int | numcomp, | |||
int | nghost | |||
) | [static] |
Copy from `src' to `dst' including `nghost' ghost cells.
The two MultiFabs MUST have the same underlying BoxArray.
References BL_ASSERT, FabArrayBase::boxArray(), FabArray< FArrayBox >::copy(), FabArrayBase::distributionMap, BoxLib::Error(), BoxLib::grow(), FabArrayBase::nGrow(), and Box::ok().
void FabArray< FArrayBox >::define | ( | const BoxArray & | bxs, | |
int | nvar, | |||
int | ngrow, | |||
const DistributionMapping & | dm, | |||
FabAlloc | mem_mode | |||
) | [inherited] |
Returns a constant reference to the FAB associated with the Kth element.
Returns a reference to the FAB associated with the Kth element.
Returns a constant reference to the FAB associated with the Kth element.
Returns a reference to the FAB associated with the Kth element.
Explicitly set the Kth FAB in the FabArray to point to elem.
void FabArray< FArrayBox >::setVal | ( | value_type | val | ) | [inherited] |
void FabArray< FArrayBox >::setVal | ( | value_type | val, | |
int | comp, | |||
int | num_comp, | |||
int | nghost = 0 | |||
) | [inherited] |
Set the value of num components in the valid region of each FAB in the FabArray, starting at component comp to val.
Also set the value of nghost boundary cells.
void FabArray< FArrayBox >::setVal | ( | value_type | val, | |
const Box & | region, | |||
int | comp, | |||
int | num_comp, | |||
int | nghost = 0 | |||
) | [inherited] |
void FabArray< FArrayBox >::setVal | ( | value_type | val, | |
int | nghost | |||
) | [inherited] |
Set all components in the valid region of each FAB in the FabArray to val, including nghost boundary cells.
void FabArray< FArrayBox >::setVal | ( | value_type | val, | |
const Box & | region, | |||
int | nghost | |||
) | [inherited] |
void FabArray< FArrayBox >::setBndry | ( | value_type | val | ) | [inherited] |
Set all values in the boundary region to val.
void FabArray< FArrayBox >::setBndry | ( | value_type | val, | |
int | strt_comp, | |||
int | ncomp | |||
) | [inherited] |
Set ncomp values in the boundary region, starting at start to val.
void FabArray< FArrayBox >::copy | ( | const FabArray< FArrayBox > & | src, | |
int | src_comp, | |||
int | dest_comp, | |||
int | num_comp | |||
) | [inherited] |
This function copies data from src to this FabArray.
Each FAB in src is intersected with all FABs in this FabArray and a copy is performed on the region of intersection. The intersection is restricted to the num components starting at src in the FabArray src, with the destination components in this FabArray starting at dest. This assumes that the source and destination FabArray have identical valid regions.
Copies the values contained in the intersection of the valid region of this FabArray with the FAB dest into dest.
void FabArray< FArrayBox >::copy | ( | FArrayBox & | dest, | |
int | src_comp, | |||
int | dest_comp, | |||
int | num_comp | |||
) | const [inherited] |
Copies the values contained in the intersection of the num component valid region of this FabArray, starting at component src, with the FAB dest into dest, starting at component dest in dest.
int FabArrayBase::nGrow | ( | ) | const [inline, inherited] |
Returns the grow factor that defines the region of definition.
References FabArrayBase::n_grow.
Referenced by BuildFBsirec(), Copy(), and TheFBsirec().
int FabArrayBase::nComp | ( | ) | const [inline, inherited] |
Returns number of variables associated with each point (nvar).
References FabArrayBase::n_comp.
Referenced by FabArray< FAB >::copy(), and VisMF::Write().
const BoxArray & FabArrayBase::boxArray | ( | ) | const [inline, inherited] |
Returns a constant reference to the BoxArray that defines the valid region associated with this FabArray.
References FabArrayBase::boxarray.
Referenced by BuildFBsirec(), Copy(), TheFBsirec(), and VisMF::Write().
const Box & FabArrayBase::box | ( | int | K | ) | const [inline, virtual, inherited] |
Returns a constant reference to the Kth Box in the BoxArray.
That is, the valid region of the Kth grid.
References FabArrayBase::boxarray.
Referenced by FabArrayCopyDescriptor< FAB >::AddBoxDoIt(), BuildFBsirec(), FabArray< FAB >::copy(), FabArray< FAB >::ok(), and MFIter::validbox().
Box FabArrayBase::fabbox | ( | int | K | ) | const [virtual, inherited] |
Returns the Kth FABs Box in the FabArray.
That is, the region the Kth fab is actually defined on.
References FabArrayBase::boxarray, BoxLib::grow(), and FabArrayBase::n_grow.
Referenced by FabArrayCopyDescriptor< FAB >::AddBoxDoIt(), and MFIter::fabbox().
int FabArrayBase::size | ( | ) | const [inline, inherited] |
Returns the number of FABs in the FabArray..
References FabArrayBase::boxarray, and BoxArray::size().
Referenced by BuildFBsirec(), FabArray< FAB >::copy(), and MFIter::isValid().
const DistributionMapping & FabArrayBase::DistributionMap | ( | ) | const [inline, inherited] |
Returns constant reference to associated DistributionMapping.
References FabArrayBase::distributionMap.
Referenced by FabArrayCopyDescriptor< FAB >::AddBoxDoIt(), BuildFBsirec(), FillBoundary(), VisMF::Header::Header(), MFIter::MFIter(), MFIter::operator++(), and VisMF::Write().
BoxArray FabArrayBase::boxarray [mutable, protected, inherited] |
DistributionMapping FabArrayBase::distributionMap [protected, inherited] |
int FabArrayBase::n_grow [protected, inherited] |
int FabArrayBase::n_comp [protected, inherited] |