Chombo + EB  3.0
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | List of all members
FluxBox Class Reference

A FArrayBox-like container for face-centered fluxes. More...

#include <FluxBox.H>

Public Member Functions

 FluxBox ()
 Default constructor. More...
 
 FluxBox (const Box &bx, int n=1)
 Constructs FluxBox on cell-centered box with n components. More...
 
 ~FluxBox ()
 Destructor. More...
 
void resize (const Box &bx, int n=1)
 Resize FluxBox similar to BaseFab::resize() More...
 
void define (const Box &bx, int n=1)
 Define function. More...
 
void define (const FluxBox &a_fb)
 
void clear ()
 Returns the FluxBox to the undefined state. More...
 
int nComp () const
 Number of components. More...
 
const Boxbox () const
 Returns cell-centered box which defines fluxBox. More...
 
FArrayBoxgetFlux (const int dir)
 Returns face-centered flux in direction dir. More...
 
const FArrayBoxgetFlux (const int dir) const
 Returns const reference to face-centered flux in direction dir. More...
 
FArrayBoxoperator[] (const int dir)
 Returns FArrayBox in direction dir. More...
 
const FArrayBoxoperator[] (const int dir) const
 Constant version. More...
 
void setVal (const Real val)
 Set all fluxes to val. More...
 
void setVal (const Real val, const int dir)
 Set fluxes in direction dir to val. More...
 
void setVal (const Real val, const int dir, const int startComp, const int nComp)
 More specific setVal. More...
 
void setVal (const Real val, const Box &bx)
 Sets fluxes on faces surrounding cell-centered box bx. More...
 
void setVal (const Real val, const Box &bx, const int dir, const int startComp, const int nComp)
 Most specific setVal. More...
 
void copy (const FluxBox &src)
 Copy from src to this FluxBox – sizes must be identical. More...
 
void copy (const FluxBox &src, const int srcComp, const int destComp, const int numComp)
 Copy on overlap, for all directions. More...
 
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. More...
 
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. More...
 
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. More...
 
FluxBoxnegate (const Box &subbox, int comp=0, int numcomp=1)
 Modifies this FluxBox to its additive inverse. More...
 
FluxBoxnegate (int comp, int numcomp=1)
 Modifies this FluxBox to its additive inverse. More...
 
FluxBoxnegate ()
 Modifies this FluxBox to its additive inverse. More...
 
FluxBoxplus (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. More...
 
FluxBoxminus (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. More...
 
FluxBoxmult (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. More...
 
FluxBoxdivide (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. More...
 
FluxBoxoperator+= (Real r)
 Modifies this FluxBox by adding the scalar Real r to all values. More...
 
FluxBoxoperator+= (const FluxBox &f)
 Modifies this FluxBox by incrementing with the argument FluxBox. More...
 
FluxBoxoperator-= (Real r)
 Modifies this FluxBox by subtracting the scalar Real r to all values. More...
 
FluxBoxoperator-= (const FluxBox &f)
 Modifies this FluxBox by decrementing with the argument FluxBox. More...
 
FluxBoxoperator*= (Real r)
 Modifies this FluxBox by multiplying all values by the scalar Real r. More...
 
FluxBoxoperator*= (const FluxBox &f)
 Modifies this FluxBox by multiplying by the argument FluxBox. More...
 
FluxBoxshift (const IntVect &v)
 Modifies this FluxBox by shifting its domain box. More...
 
int size (const Box &bx, const Interval &comps) const
 Returns size of linearized data over bx. More...
 
void linearOut (void *buf, const Box &R, const Interval &comps) const
 Writes a linear representation of this FluxBox. More...
 
void * linearOut2 (void *buf, const Box &R, const Interval &comps) const
 like linearOut, but returns current position in the buffer More...
 
void linearIn (void *buf, const Box &R, const Interval &comps)
 Read a linear representation of the data over the Box R. More...
 
void * linearIn2 (void *buf, const Box &R, const Interval &comps)
 like linearInt, but returns current position in the buffer More...
 

Static Public Member Functions

static int preAllocatable ()
 Helper function for linearization. More...
 

Protected Attributes

Box m_bx
 
int m_nvar
 
Vector< FArrayBox * > m_fluxes
 

Private Member Functions

 FluxBox (const FluxBox &)
 Disallowed. More...
 
FluxBoxoperator= (const FluxBox &)
 Disallowed. More...
 

Detailed Description

A FArrayBox-like container for face-centered fluxes.

This is a class to contain face-centered fluxes on a box.

Constructor & Destructor Documentation

◆ FluxBox() [1/3]

FluxBox::FluxBox ( )

Default constructor.

◆ FluxBox() [2/3]

FluxBox::FluxBox ( const Box bx,
int  n = 1 
)

Constructs FluxBox on cell-centered box with n components.

◆ ~FluxBox()

FluxBox::~FluxBox ( )

Destructor.

◆ FluxBox() [3/3]

FluxBox::FluxBox ( const FluxBox )
private

Disallowed.

Member Function Documentation

◆ resize()

void FluxBox::resize ( const Box bx,
int  n = 1 
)

Resize FluxBox similar to BaseFab::resize()

◆ define() [1/2]

void FluxBox::define ( const Box bx,
int  n = 1 
)

Define function.

Referenced by define(), ViscousTensorOp::getFlux(), and AMRPoissonOp::getFlux().

◆ define() [2/2]

void FluxBox::define ( const FluxBox a_fb)
inline

◆ clear()

void FluxBox::clear ( )

Returns the FluxBox to the undefined state.

Referenced by define().

◆ nComp()

int FluxBox::nComp ( ) const

Number of components.

Referenced by define().

◆ box()

const Box& FluxBox::box ( ) const

Returns cell-centered box which defines fluxBox.

Referenced by define(), and ViscousTensorOp::getFlux().

◆ getFlux() [1/2]

FArrayBox& FluxBox::getFlux ( const int  dir)

Returns face-centered flux in direction dir.

Referenced by define().

◆ getFlux() [2/2]

const FArrayBox& FluxBox::getFlux ( const int  dir) const

Returns const reference to face-centered flux in direction dir.

◆ operator[]() [1/2]

FArrayBox& FluxBox::operator[] ( const int  dir)

Returns FArrayBox in direction dir.

Referenced by define().

◆ operator[]() [2/2]

const FArrayBox& FluxBox::operator[] ( const int  dir) const

Constant version.

◆ setVal() [1/5]

void FluxBox::setVal ( const Real  val)

Set all fluxes to val.

Referenced by define().

◆ setVal() [2/5]

void FluxBox::setVal ( const Real  val,
const int  dir 
)

Set fluxes in direction dir to val.

◆ setVal() [3/5]

void FluxBox::setVal ( const Real  val,
const int  dir,
const int  startComp,
const int  nComp 
)

More specific setVal.

◆ setVal() [4/5]

void FluxBox::setVal ( const Real  val,
const Box bx 
)

Sets fluxes on faces surrounding cell-centered box bx.

◆ setVal() [5/5]

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

◆ copy() [1/6]

void FluxBox::copy ( const FluxBox src)

Copy from src to this FluxBox – sizes must be identical.

Referenced by define().

◆ copy() [2/6]

void FluxBox::copy ( const FluxBox src,
const int  srcComp,
const int  destComp,
const int  numComp 
)

Copy on overlap, for all directions.

◆ copy() [3/6]

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.

◆ copy() [4/6]

void FluxBox::copy ( const FluxBox a_src,
const Box a_destbox 
)

Modifies this FluxBox by copying the contents of the argument src into it. A copy within the intersecting region of the domains of the two FluxBoxes and the specified Box a_destbox is performed. All components are copied.

◆ copy() [5/6]

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

◆ copy() [6/6]

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.

◆ negate() [1/3]

FluxBox& FluxBox::negate ( const Box subbox,
int  comp = 0,
int  numcomp = 1 
)

Modifies this FluxBox to its additive inverse.

Modifies this FluxBox by replacing each value with its additive inverse, for the given range of components and within the given subbox. Returns *this.

◆ negate() [2/3]

FluxBox& FluxBox::negate ( int  comp,
int  numcomp = 1 
)

Modifies this FluxBox to its additive inverse.

Modifies this FluxBox by replacing each value with its additive inverse, for the given range of components over the whole domain of the FluxBox. Returns *this.

◆ negate() [3/3]

FluxBox& FluxBox::negate ( )

Modifies this FluxBox to its additive inverse.

Modifies this FluxBox by replacing each value with its additive inverse for all components over the whole domain of the FluxBox. Returns *this.

Referenced by define().

◆ plus()

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

Referenced by define().

◆ minus()

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

Referenced by define().

◆ mult()

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

Referenced by define().

◆ divide()

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

Referenced by define().

◆ operator+=() [1/2]

FluxBox& FluxBox::operator+= ( Real  r)

Modifies this FluxBox by adding the scalar Real r to all values.

Referenced by define().

◆ operator+=() [2/2]

FluxBox& FluxBox::operator+= ( const FluxBox f)

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().

◆ operator-=() [1/2]

FluxBox& FluxBox::operator-= ( Real  r)

Modifies this FluxBox by subtracting the scalar Real r to all values.

Referenced by define().

◆ operator-=() [2/2]

FluxBox& FluxBox::operator-= ( const FluxBox f)

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().

◆ operator*=() [1/2]

FluxBox& FluxBox::operator*= ( Real  r)

Modifies this FluxBox by multiplying all values by the scalar Real r.

Referenced by define().

◆ operator*=() [2/2]

FluxBox& FluxBox::operator*= ( const FluxBox f)

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().

◆ shift()

FluxBox& FluxBox::shift ( const IntVect v)

Modifies this FluxBox by shifting its domain box.

Referenced by define().

◆ size()

int FluxBox::size ( const Box bx,
const Interval comps 
) const

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

Referenced by define().

◆ linearOut()

void FluxBox::linearOut ( void *  buf,
const Box R,
const Interval comps 
) const

Writes a linear representation of this FluxBox.

Write a linear representaion of the internal data for the faces surrounding cell-centered box R. Assumes that sufficient memory for the buffer has already been allocated by the caller

Referenced by define().

◆ linearOut2()

void* FluxBox::linearOut2 ( void *  buf,
const Box R,
const Interval comps 
) const

like linearOut, but returns current position in the buffer

Referenced by define().

◆ linearIn()

void FluxBox::linearIn ( void *  buf,
const Box R,
const Interval comps 
)

Read a linear representation of the data over the Box R.

Reads in the output of linearOut

Referenced by define().

◆ linearIn2()

void* FluxBox::linearIn2 ( void *  buf,
const Box R,
const Interval comps 
)

like linearInt, but returns current position in the buffer

Referenced by define().

◆ preAllocatable()

static int FluxBox::preAllocatable ( )
inlinestatic

Helper function for linearization.

◆ operator=()

FluxBox& FluxBox::operator= ( const FluxBox )
private

Disallowed.

Member Data Documentation

◆ m_bx

Box FluxBox::m_bx
protected

Cell-centered Box over which this FluxBox is defined

◆ m_nvar

int FluxBox::m_nvar
protected

Number of variables on each face

◆ m_fluxes

Vector<FArrayBox*> FluxBox::m_fluxes
protected

CH_SPACEDIM FArrayBoxes which hold fluxes


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