#include <FluxBox.H>
This is a class to contain face-centered fluxes on a box.
Public Member Functions | |
FluxBox () | |
Default constructor. | |
FluxBox (const Box &bx, int n=1) | |
Constructs FluxBox on cell-centered box with n components. | |
FluxBox (const Box &a_bx, const int a_nComp, D_DECL6(Real *const a_alias0, Real *const a_alias1, Real *const a_alias2, Real *const a_alias3, Real *const a_alias4, Real *const a_alias5)) | |
Constructs FluxBox aliasing SpaceDim memory pointers for the FArrayBox. | |
~FluxBox () | |
Destructor. | |
void | define (const Box &bx, int n=1) |
Resize FluxBox similar to BaseFab::resize(). | |
void | define (const FluxBox &a_fb) |
void | clear () |
Returns the FluxBox to the undefined state. | |
int | nComp () const |
Number of components. | |
const Box & | box () const |
Returns cell-centered box which defines fluxBox. | |
FArrayBox & | getFlux (const int dir) |
Returns face-centered flux in direction dir. | |
const FArrayBox & | getFlux (const int dir) const |
Returns const reference to face-centered flux in direction dir. | |
FArrayBox & | operator[] (const int dir) |
Returns FArrayBox in direction dir. | |
const FArrayBox & | operator[] (const int dir) const |
Constant version. | |
void | setVal (const Real val) |
Set all fluxes to val. | |
void | setVal (const Real val, const int dir) |
Set fluxes in direction dir to val. | |
void | setVal (const Real val, const int dir, const int startComp, const int nComp) |
More specific setVal. | |
void | setVal (const Real val, const Box &bx) |
Sets fluxes on faces surrounding cell-centered box bx. | |
void | setVal (const Real val, const Box &bx, const int dir, const int startComp, const int nComp) |
Most specific setVal. | |
void | copy (const FluxBox &src) |
Copy from src to this FluxBox -- sizes must be identical. | |
void | copy (const FluxBox &src, const int srcComp, const int destComp, const int numComp) |
Copy on overlap, for all directions. | |
void | copy (const FluxBox &src, const int dir, const int srcComp, const int destComp, const int numComp) |
Copy on overlap of FluxBoxes, in direction dir. | |
void | copy (const FluxBox &a_src, const Box &a_destbox) |
void | copy (const Box &R, const Interval &Cdest, const FluxBox &src, const Interval &Csrc) |
Copies from a subsection of one box into another. | |
void | copy (const Box &srcbox, const Interval &destcomps, const Box &destbox, const FluxBox &src, const Interval &srccomps) |
Modifies this FluxBox by copying the contents of src into it. | |
FluxBox & | negate (const Box &subbox, int comp=0, int numcomp=1) |
Modifies this FluxBox to its additive inverse. | |
FluxBox & | negate (int comp, int numcomp=1) |
Modifies this FluxBox to its additive inverse. | |
FluxBox & | negate () |
Modifies this FluxBox to its additive inverse. | |
FluxBox & | plus (const FluxBox &a_src, const Box &a_subbox, int a_srccomp, int a_destcomp, int a_numcomp=1) |
Modifies this FluxBox by adding src in the CELL-CENTERED sub-box. | |
FluxBox & | minus (const FluxBox &a_src, const Box &a_subbox, int a_srccomp, int a_destcomp, int a_numcomp=1) |
Modifies this FluxBox by subtracting src in the CELL-CENTERED sub-box. | |
FluxBox & | mult (const FluxBox &a_src, const Box &a_subbox, int a_srccomp, int a_destcomp, int a_numcomp=1) |
Modifies this FluxBox by multiplying src in the CELL-CENTERED sub-box. | |
FluxBox & | divide (const FluxBox &a_src, const Box &a_subbox, int a_srccomp, int a_destcomp, int a_numcomp=1) |
Modifies this FluxBox by dividing src in the CELL-CENTERED sub-box. | |
FluxBox & | operator+= (Real r) |
Modifies this FluxBox by adding the scalar Real r to all values. | |
FluxBox & | operator+= (const FluxBox &f) |
Modifies this FluxBox by incrementing with the argument FluxBox. | |
FluxBox & | operator-= (Real r) |
Modifies this FluxBox by subtracting the scalar Real r to all values. | |
FluxBox & | operator-= (const FluxBox &f) |
Modifies this FluxBox by decrementing with the argument FluxBox. | |
FluxBox & | operator*= (Real r) |
Modifies this FluxBox by multiplying all values by the scalar Real r. | |
FluxBox & | operator*= (const FluxBox &f) |
Modifies this FluxBox by multiplying by the argument FluxBox. | |
FluxBox & | shift (const IntVect &v) |
Modifies this FluxBox by shifting its domain box. | |
int | size (const Box &bx, const Interval &comps) const |
Returns size of linearized data over bx. | |
void | linearOut (void *buf, const Box &R, const Interval &comps) const |
Writes a linear representation of this FluxBox. | |
void * | linearOut2 (void *buf, const Box &R, const Interval &comps) const |
like linearOut, but returns current position in the buffer | |
void | linearIn (void *buf, const Box &R, const Interval &comps) |
Read a linear representation of the data over the Box R. | |
void * | linearIn2 (void *buf, const Box &R, const Interval &comps) |
like linearInt, but returns current position in the buffer | |
Static Public Member Functions | |
static int | preAllocatable () |
Helper function for linearization. | |
Protected Attributes | |
Box | m_bx |
int | m_nvar |
Vector< FArrayBox * > | m_fluxes |
Private Member Functions | |
FluxBox (const FluxBox &) | |
Disallowed. | |
FluxBox & | operator= (const FluxBox &) |
Disallowed. |
FluxBox::FluxBox | ( | ) |
Default constructor.
FluxBox::FluxBox | ( | const Box & | bx, | |
int | n = 1 | |||
) |
FluxBox::~FluxBox | ( | ) |
Destructor.
FluxBox::FluxBox | ( | const FluxBox & | ) | [private] |
Disallowed.
void FluxBox::define | ( | const Box & | bx, | |
int | n = 1 | |||
) |
Resize FluxBox similar to BaseFab::resize().
Define function
Referenced by define(), VCAMRPoissonOp2::getFlux(), NWOViscousTensorOp::getFlux(), ViscousTensorOp::getFlux(), and AMRPoissonOp::getFlux().
void FluxBox::clear | ( | ) |
Returns the FluxBox to the undefined state.
int FluxBox::nComp | ( | ) | const |
const Box& FluxBox::box | ( | ) | const |
Returns cell-centered box which defines fluxBox.
Referenced by define(), NWOViscousTensorOp::getFlux(), and ViscousTensorOp::getFlux().
FArrayBox& FluxBox::getFlux | ( | const int | dir | ) |
Returns face-centered flux in direction dir.
const FArrayBox& FluxBox::getFlux | ( | const int | dir | ) | const |
Returns const reference to face-centered flux in direction dir.
const FArrayBox& FluxBox::operator[] | ( | const int | dir | ) | const |
Constant version.
void FluxBox::setVal | ( | const Real | val | ) |
Set all fluxes to val.
void FluxBox::setVal | ( | const Real | val, | |
const int | dir | |||
) |
Set fluxes in direction dir to val.
void FluxBox::setVal | ( | const Real | val, | |
const int | dir, | |||
const int | startComp, | |||
const int | nComp | |||
) |
More specific setVal.
Sets fluxes on faces surrounding cell-centered box bx.
void FluxBox::setVal | ( | const Real | val, | |
const Box & | bx, | |||
const int | dir, | |||
const int | startComp, | |||
const int | nComp | |||
) |
Most specific setVal.
Sets fluxes on faces surrounding cell-centered box bx
void FluxBox::copy | ( | const FluxBox & | src | ) |
Copy from src to this FluxBox -- sizes must be identical.
void FluxBox::copy | ( | const FluxBox & | src, | |
const int | srcComp, | |||
const int | destComp, | |||
const int | numComp | |||
) |
Copy on overlap, for all directions.
void FluxBox::copy | ( | const FluxBox & | src, | |
const int | dir, | |||
const int | srcComp, | |||
const int | destComp, | |||
const int | numComp | |||
) |
Copy on overlap of FluxBoxes, in direction dir.
void FluxBox::copy | ( | const Box & | R, | |
const Interval & | Cdest, | |||
const FluxBox & | src, | |||
const Interval & | Csrc | |||
) |
Copies from a subsection of one box into another.
Assumes the boxes are both in the same index space, and that box R is completely contained in both the src and destination boxes. This function required by BoxLayoutData
void FluxBox::copy | ( | const Box & | srcbox, | |
const Interval & | destcomps, | |||
const Box & | destbox, | |||
const FluxBox & | src, | |||
const Interval & | srccomps | |||
) |
Modifies this FluxBox by copying the contents of src into it.
This, the most general form of copy, specifies the contents of any sub-box srcbox in `FluxBox' src may be copied into a (possibly different) destbox in the destination `FluxBox'. Note that although the srcbox and the destbox may be disjoint, they must be the same size and shape. If the sizes differ, the copy is undefined and a runtime error results. This copy function is the only one of the copy functions to allow a copy between differing boxes. The user also specifies how many components are copied, starting at component srccomp in src and stored starting at component destcomp. The results are UNDEFINED if the src and dest FluxBoxes are the same and the srcbox and destbox overlap.
FluxBox& FluxBox::negate | ( | int | comp, | |
int | numcomp = 1 | |||
) |
FluxBox& FluxBox::negate | ( | ) |
FluxBox& FluxBox::plus | ( | const FluxBox & | a_src, | |
const Box & | a_subbox, | |||
int | a_srccomp, | |||
int | a_destcomp, | |||
int | a_numcomp = 1 | |||
) |
Modifies this FluxBox by adding src in the CELL-CENTERED sub-box.
Modifies this FluxBox by pointwise addition of values in the argument FArrayBox. Adds src's components (a_srccomp : a_srccomp+a_numcomp-1) to this FluxBox's components (a_destcomp : a_destcomp+numcomp-1) where the domain of this FluxBox intersects the a_subbox. The actual directionally-dependent subbox is a_subbox.surroundingNodes(dir); NOTE: a_subbox must be contained in the cell-centered Box of this FluxBox. Returns *this
FluxBox& FluxBox::minus | ( | const FluxBox & | a_src, | |
const Box & | a_subbox, | |||
int | a_srccomp, | |||
int | a_destcomp, | |||
int | a_numcomp = 1 | |||
) |
Modifies this FluxBox by subtracting src in the CELL-CENTERED sub-box.
Modifies this FluxBox by pointwise addition of values in the argument FArrayBox. Subtracts src's components (a_srccomp : a_srccomp+a_numcomp-1) from this FluxBox's components (a_destcomp : a_destcomp+numcomp-1) where the domain of this FluxBox intersects the a_subbox. The actual directionally-dependent subbox is a_subbox.surroundingNodes(dir); NOTE: a_subbox must be contained in the cell-centered Box of this FluxBox. Returns *this
FluxBox& FluxBox::mult | ( | const FluxBox & | a_src, | |
const Box & | a_subbox, | |||
int | a_srccomp, | |||
int | a_destcomp, | |||
int | a_numcomp = 1 | |||
) |
Modifies this FluxBox by multiplying src in the CELL-CENTERED sub-box.
Modifies this FluxBox by pointwise multiplication of values in the argument FArrayBox. Multiplies src's components (a_srccomp : a_srccomp+a_numcomp-1) with this FluxBox's components (a_destcomp : a_destcomp+numcomp-1) where the domain of this FluxBox intersects the a_subbox. The actual directionally-dependent subbox is a_subbox.surroundingNodes(dir); NOTE: a_subbox must be contained in the cell-centered Box of this FluxBox. Returns *this
FluxBox& FluxBox::divide | ( | const FluxBox & | a_src, | |
const Box & | a_subbox, | |||
int | a_srccomp, | |||
int | a_destcomp, | |||
int | a_numcomp = 1 | |||
) |
Modifies this FluxBox by dividing src in the CELL-CENTERED sub-box.
Modifies this FluxBox by pointwise division of values in the argument FArrayBox. Divides src's components (a_srccomp : a_srccomp+a_numcomp-1) into this FluxBox's components (a_destcomp : a_destcomp+numcomp-1) where the domain of this FluxBox intersects the a_subbox. The actual directionally-dependent subbox is a_subbox.surroundingNodes(dir); NOTE: a_subbox must be contained in the cell-centered Box of this FluxBox. Returns *this
Modifies this FluxBox by adding the scalar Real r to all values.
Modifies this FluxBox by incrementing with the argument FluxBox.
Modifies this FluxBox by pointwise addition of the values of the argument FluxBox. You might come to grief if the domains of the FArrayBoxes don't match, just as in FArrayBox::plus().
Modifies this FluxBox by subtracting the scalar Real r to all values.
Modifies this FluxBox by decrementing with the argument FluxBox.
Modifies this FluxBox by pointwise subtraction of the values of the argument FluxBox. You might come to grief if the domains of the FluxBoxes don't match, just as in FArrayBox::minus().
Modifies this FluxBox by multiplying all values by the scalar Real r.
Modifies this FluxBox by multiplying by the argument FluxBox.
Modifies this FluxBox by pointwise multiplication of the values by the argument FluxBox. You might come to grief if the domains of the FluxBoxes don't match, just as in FArrayBox::mult().
Returns size of linearized data over bx.
Returns size, in number of bytes, of a flat linear representation of data in components comps in faces around cell-centered box R
like linearOut, but returns current position in the buffer
Read a linear representation of the data over the Box R.
Reads in the output of linearOut
like linearInt, but returns current position in the buffer
static int FluxBox::preAllocatable | ( | ) | [inline, static] |
Helper function for linearization.
Box FluxBox::m_bx [protected] |
int FluxBox::m_nvar [protected] |
Number of variables on each face
Vector<FArrayBox*> FluxBox::m_fluxes [protected] |
CH_SPACEDIM FArrayBoxes which hold fluxes