Chombo + EB + MF  3.2
Public Member Functions | Protected Attributes | List of all members
NodeFArrayBox Class Reference

A wrapper for an FArrayBox to contain NODE-centered data. More...

#include <NodeFArrayBox.H>

Public Member Functions

void setVal (Real a_x)
 
void setVal (Real a_x, const Box &a_bx, int a_nstart, int a_numcomp)
 
Real norm (const Box &a_subbox, int a_p=2, int a_comp=0, int a_numcomp=1) const
 
Real norm (int a_p=2, int a_comp=0, int a_numcomp=1) const
 
Real sumPow (const Box &a_subbox, int a_p=2, int a_comp=0, int a_numcomp=1) const
 
Real min (int a_comp=0) const
 
Real min (const Box &a_subbox, int a_comp=0) const
 
Real max (int a_comp=0) const
 
Real max (const Box &a_subbox, int a_comp=0) const
 
IntVect minIndex (int a_comp=0) const
 
IntVect minIndex (const Box &a_subbox, int a_comp=0) const
 
IntVect maxIndex (int a_comp=0) const
 
IntVect maxIndex (const Box &a_subbox, int a_comp=0) const
 
int maskLT (BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
 
int maskLE (BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
 
int maskEQ (BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
 
int maskGT (BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
 
int maskGE (BaseFab< int > &a_mask, Real a_val, int a_comp=0) const
 
void abs ()
 
int nComp () const
 
void abs (int a_comp, int a_numcomp=1)
 
void abs (const Box &a_subbox, int a_comp=0, int a_numcomp=1)
 
Real sum (int a_comp, int a_numcomp=1) const
 
Real sum (const Box &a_subbox, int a_comp, int a_numcomp=1) const
 
NodeFArrayBoxinvert (Real a_r)
 
NodeFArrayBoxinvert (Real a_r, int a_comp, int a_numcomp=1)
 
NodeFArrayBoxinvert (Real a_r, const Box &a_subbox, int a_comp=0, int a_numcomp=1)
 
NodeFArrayBoxnegate (const Box &a_subbox, int a_comp=0, int a_numcomp=1)
 
NodeFArrayBoxnegate (int a_comp, int a_numcomp=1)
 
NodeFArrayBoxnegate ()
 
NodeFArrayBoxplus (Real a_r, const Box &a_subbox, int a_comp=0, int a_numcomp=1)
 
NodeFArrayBoxplus (Real a_r, int a_comp, int a_numcomp=1)
 
Realoperator() (const IntVect &a_p, int N=0)
 
const Realoperator() (const IntVect &a_p, int N=0) const
 
NodeFArrayBoxoperator+= (Real a_r)
 
NodeFArrayBoxoperator+= (const NodeFArrayBox &a_x)
 
NodeFArrayBoxplus (Real a_r)
 
NodeFArrayBoxplus_real (Real a_r)
 
NodeFArrayBoxplus (const NodeFArrayBox &a_x)
 
NodeFArrayBoxplus (const NodeFArrayBox &a_src, const Real &a_scale)
 
NodeFArrayBoxplus (const NodeFArrayBox &a_src, const Real &a_scale, int a_srccomp, int a_destcomp, int a_numcomp=1)
 
NodeFArrayBoxplus (const NodeFArrayBox &a_src, int a_srccomp, int a_destcomp, int a_numcomp=1)
 
NodeFArrayBoxplus (const NodeFArrayBox &a_src, const Box &a_subbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
 
NodeFArrayBoxplus (const NodeFArrayBox &a_src, const Box &a_srcbox, const Box &a_destbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
 
NodeFArrayBoxplus (const NodeFArrayBox &a_src, const Box &a_srcbox, const Box &a_destbox, const Real &a_scale, int a_srccomp, int a_destcomp, int a_numcomp=1)
 
NodeFArrayBoxoperator-= (Real a_r)
 
NodeFArrayBoxoperator-= (const NodeFArrayBox &a_x)
 
NodeFArrayBoxminus (const NodeFArrayBox &a_x)
 
NodeFArrayBoxminus (const NodeFArrayBox &a_src, int a_srccomp, int a_destcomp, int a_numcomp=1)
 
NodeFArrayBoxminus (const NodeFArrayBox &a_src, const Box &a_subbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
 
NodeFArrayBoxminus (const NodeFArrayBox &a_src, const Box &a_srcbox, const Box &a_destbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
 
NodeFArrayBoxoperator*= (Real a_r)
 
NodeFArrayBoxmult (Real a_r)
 
NodeFArrayBoxmult (Real a_r, int a_comp, int a_numcomp=1)
 
NodeFArrayBoxmult (Real a_r, const Box &a_subbox, int a_comp=0, int a_numcomp=1)
 
NodeFArrayBoxoperator*= (const NodeFArrayBox &a_x)
 
NodeFArrayBoxmult (const NodeFArrayBox &a_x)
 
NodeFArrayBoxmult (const NodeFArrayBox &a_src, int a_srccomp, int a_destcomp, int a_numcomp=1)
 
NodeFArrayBoxmult (const NodeFArrayBox &a_src, const Box &a_subbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
 
NodeFArrayBoxmult (const NodeFArrayBox &a_src, const Box &a_srcbox, const Box &a_destbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
 
NodeFArrayBoxoperator/= (Real a_r)
 
NodeFArrayBoxdivide (Real a_r)
 
NodeFArrayBoxdivide (Real a_r, int a_comp, int a_numcomp=1)
 
NodeFArrayBoxdivide (Real a_r, const Box &a_subbox, int a_comp=0, int a_numcomp=1)
 
NodeFArrayBoxoperator/= (const NodeFArrayBox &a_x)
 
NodeFArrayBoxdivide (const NodeFArrayBox &a_x)
 
NodeFArrayBoxdivide (const NodeFArrayBox &a_src, int a_srccomp, int a_destcomp, int a_numcomp=1)
 
NodeFArrayBoxdivide (const NodeFArrayBox &a_src, const Box &a_subbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
 
NodeFArrayBoxdivide (const NodeFArrayBox &a_src, const Box &a_srcbox, const Box &a_destbox, int a_srccomp, int a_destcomp, int a_numcomp=1)
 
const int * loVect () const
 
const int * hiVect () const
 
const int * nCompPtr () const
 
RealdataPtr (int a_n=0)
 
const RealdataPtr (int a_n=0) const
 
void shift (const IntVect &iv)
 
Constructors, destructor and defines
 NodeFArrayBox ()
 
 NodeFArrayBox (const Box &a_bx, int a_nComp, Real *a_alias=NULL)
 
 NodeFArrayBox (const Box &a_bx)
 
 NodeFArrayBox (const Interval &a_comps, NodeFArrayBox &a_original)
 
 NodeFArrayBox (NodeFArrayBox &&a_in)=default
 
NodeFArrayBoxoperator= (NodeFArrayBox &&a_in)=default
 
 ~NodeFArrayBox ()
 
void define (const Box &a_bx, int a_nComp=1)
 
void define (const Box &a_bx, int a_nComp, Real *a_dataPtr)
 
Accessors

Change this NodeFArrayBox so it covers the Box a_bx with a_nComps components. If a_alias is not NULL, it is used as the data memory (and is assumed to be large enough).

const Boxbox () const
 
FArrayBoxgetFab ()
 
const FArrayBoxgetFab () const
 
Real dotProduct (const NodeFArrayBox &a_fab2) const
 
Real dotProduct (const NodeFArrayBox &a_fab2, const Box &box) const
 
Data modification functions
void copy (const NodeFArrayBox &a_src)
 
void copy (const Box &a_regionFrom, const Interval &a_Cdest, const Box &a_regionTo, const NodeFArrayBox &a_src, const Interval &a_Csrc)
 

Protected Attributes

Box m_box
 
FArrayBox m_fab
 

Linearization functions

size_t size (const Box &a_R, const Interval &a_comps) const
 
void linearOut (void *a_buf, const Box &a_R, const Interval &a_comps) const
 
void linearIn (void *a_buf, const Box &a_R, const Interval &a_comps)
 
void linearOut (void *a_buf) const
 These functions are required for broadcast & gather. More...
 
void linearIn (const void *const a_buf)
 
int linearSize (void) const
 
static int preAllocatable ()
 

Detailed Description

A wrapper for an FArrayBox to contain NODE-centered data.

This is a class to contain NODE-centered data on a box.
Question: Why not just use NODE-centered FArrayBox?
Answer: We want to use LevelData<NodeFArrayBox>, which requires that the underlying BoxLayout be a DisjointBoxLayout. Adjacent NODE-centered boxes intersect, but adjacent CELL-centered boxes do not.
The underlying DisjointBoxLayout will be CELL-centered.

In a LevelData<NodeFArrayBox>, some of the grids may share nodes. The data on shared nodes must be the same.

Example: A four-grid layout is shown on the left. As shown on the right, the nodes marked "2" are shared by two grids, and those marked "3" are shared by three grids.

:                                   :                                   :
:                +-----+            :                YYYY--+            :
:                |     |            :                |     |            :
:                |  A  |            :                |  A  |            :
:                |     |            :                |     |            :
:            +---+--+--+---+        :            +---2223222---+        :
:            |      |      |        :            |      2      |        :
:            |  B   |  C   |        :            |  B   2  C   |        :
:            |      |      |        :            |      2      |        :
:        +---+------+------+        :        X---22222223------X        :
:        |          |               :        |          |               :
:        |    D     |               :        |    D     |               :
:        |          |               :        |          |               :
:        +----------+               :        +-------YYYY               :
:                                   :                                   :
    

Additional nodes may be shared if the boxes extend to the faces of a domain that is periodic in one or more directions. In the example above, these nodes are marked "X" and "Y".
Horizontally periodic domain: node "X" shared by two grids, C and D.
Vertically periodic domain: nodes "Y" shared by two grids, A and D.

Using copyTo:

One of the most useful features of LevelData<NodeFArrayBox> is the copyTo() function. THE copyTo() FUNCTION MUST BE USED WITH CAUTION if the source and destination have different layouts.

Consider an example where A and B are on layouts of one box each, and these two boxes abut:

    +-------+
    |       |
    |   A   |
    |       |
    =========
    |       |
    |   B   |
    |       |
    +-------+
    

If we do A.copyTo(B), then the data on the nodes of the interface (marked "=") are NOT copied, because the underlying CELL-centered DisjointBoxLayouts of the LevelDatas do not intersect.

In general, doing src.copyTo(dest): if LevelData<NodeFArrayBox> src and LevelData<NodeFArrayBox> dest do NOT have identical underlying boxes in their layouts, then src.copyTo(dest) will NOT copy the interface nodes.

Here are two different ways to make sure the interface nodes are copied:

  1. Do copyTo to a BoxLayoutData<NodeFArrayBox> defined on the BoxLayout of dest with each box expanded by 1 in each dimension. That is:
        BoxLayout destExpandedLayout;
        destExpandedLayout.deepCopy(dest.disjointBoxLayout());
        destExpandedLayout.grow(1);
        destExpandedLayout.closeNoSort();
        src.copyTo(destExpanded);
        for (DataIterator dit = dest.dataIterator(); dit.ok(); ++dit)
          {
            dest[dit].copy(destExpanded[dit]);
          }
    
    2. Define <tt>src</tt> with ghost vector IntVect::Unit, and in copyTo,
    use a Copier with ghost vector IntVect::Unit.
    That is:
    
        Copier myCopier;
        myCopier.ghostDefine(src.disjointBoxLayout(),
                             dest.disjointBoxLayout(),
                             src.disjointBoxLayout().physDomain(),
                             IntVect::Unit);
        src.copyTo(dest, myCopier);
    
    For this to work, src must have been defined with ghost vector IntVect::Unit (at least).

Constructor & Destructor Documentation

◆ NodeFArrayBox() [1/5]

NodeFArrayBox::NodeFArrayBox ( )

Default constructor. User must subsequently call define().

Referenced by NodeFArrayBox().

◆ NodeFArrayBox() [2/5]

NodeFArrayBox::NodeFArrayBox ( const Box a_bx,
int  a_nComp,
Real a_alias = NULL 
)

Constructs NodeFArrayBox on CELL-centered box a_bx with a_nComp. If a_alias is not null this oject does not delete it in the destructor.

◆ NodeFArrayBox() [3/5]

NodeFArrayBox::NodeFArrayBox ( const Box a_bx)
inline

Constructs NodeFArrayBox on CELL-centered box a_bx for just a scalar.

References box(), define(), getFab(), NodeFArrayBox(), operator=(), and ~NodeFArrayBox().

◆ NodeFArrayBox() [4/5]

NodeFArrayBox::NodeFArrayBox ( const Interval a_comps,
NodeFArrayBox a_original 
)

Constructs an aliased NodeFArrayBox.

◆ NodeFArrayBox() [5/5]

NodeFArrayBox::NodeFArrayBox ( NodeFArrayBox &&  a_in)
default

◆ ~NodeFArrayBox()

NodeFArrayBox::~NodeFArrayBox ( )

Destructor.

Referenced by NodeFArrayBox().

Member Function Documentation

◆ operator=()

NodeFArrayBox& NodeFArrayBox::operator= ( NodeFArrayBox &&  a_in)
default

Referenced by NodeFArrayBox().

◆ define() [1/2]

void NodeFArrayBox::define ( const Box a_bx,
int  a_nComp = 1 
)

Defines NodeFArrayBox on CELL-centered box a_bx with a_nComp components. If called more than once on the same instance, the box and FAB will be resize()d.

Referenced by NodeFArrayBox().

◆ define() [2/2]

void NodeFArrayBox::define ( const Box a_bx,
int  a_nComp,
Real a_dataPtr 
)

alias Defines NodeFArrayBox on CELL-centered box a_bx with a_nComp components. If called more than once on the same instance, the box and FAB will be resize()d. Class is not responsible for data pointed to by a_dataPtr

◆ box()

const Box& NodeFArrayBox::box ( ) const

Returns the CELL-centered domain where the array is defined.

Referenced by dotProduct(), and NodeFArrayBox().

◆ getFab() [1/2]

FArrayBox& NodeFArrayBox::getFab ( )

Returns a modifiable reference to the NODE-centered FArrayBox containing the data.

Referenced by NodeFArrayBox().

◆ getFab() [2/2]

const FArrayBox& NodeFArrayBox::getFab ( ) const

Returns a constant reference to the NODE-centered FArrayBox containing the data.

◆ dotProduct() [1/2]

Real NodeFArrayBox::dotProduct ( const NodeFArrayBox a_fab2) const
inline

References FArrayBox::dotProduct(), and m_fab.

◆ dotProduct() [2/2]

Real NodeFArrayBox::dotProduct ( const NodeFArrayBox a_fab2,
const Box box 
) const
inline

◆ copy() [1/2]

void NodeFArrayBox::copy ( const NodeFArrayBox a_src)

Modifies the data in this NodeFArrayBox by copying data from a_src into it, over the nodes that they have in common.
If this NodeFArrayBox and a_src have abutting grids, as shown:

+--------+
|        |
|  this  |
|        |
==========   <- data copied here from a_src to this
|        |
|  a_src |
|        |
+--------+

then the data in this NodeFArrayBox WILL be modified along the edge nodes where they abut – even though this.box() and a_src.box(), being CELL-centered, do NOT intersect.

All components are copied.

Referenced by dotProduct().

◆ copy() [2/2]

void NodeFArrayBox::copy ( const Box a_regionFrom,
const Interval a_Cdest,
const Box a_regionTo,
const NodeFArrayBox a_src,
const Interval a_Csrc 
)

Modifies the data in this NodeFArrayBox by copying the data from a_src into it, over the intersection of:

  • the nodes surrounding the CELL-centered box a_regionFrom;
  • the nodes surrounding the CELL-centered box a_regionTo;
  • the nodes containing data in this NodeFArrayBox;
  • the nodes containing data in a_src.

The components in the interval a_Csrc in a_src are copied to the components in the interval a_Cdest in this NodeFArrayBox.

This function is required in order to have BoxLayoutData<NodeFArrayBox>.

◆ size()

size_t NodeFArrayBox::size ( const Box a_R,
const Interval a_comps 
) const

Returns size, in number of bytes, of a flat linear representation of the data in this object in the area defined by the nodes in CELL-centered box a_R and the component Interval a_comps.

This function is required in order to have BoxLayoutData<NodeFArrayBox>.

Referenced by dotProduct().

◆ linearOut() [1/2]

void NodeFArrayBox::linearOut ( void *  a_buf,
const Box a_R,
const Interval a_comps 
) const

Writes into a_buf a linear representation of the internal data for the nodes surrounding CELL-centered box a_R, over the component Interval a_comps.

Assumes that sufficient memory for the buffer has already been allocated by the caller.

This function is required in order to have BoxLayoutData<NodeFArrayBox>.

Referenced by dotProduct().

◆ linearIn() [1/2]

void NodeFArrayBox::linearIn ( void *  a_buf,
const Box a_R,
const Interval a_comps 
)

Referenced by dotProduct().

◆ linearOut() [2/2]

void NodeFArrayBox::linearOut ( void *  a_buf) const

These functions are required for broadcast & gather.

◆ linearIn() [2/2]

void NodeFArrayBox::linearIn ( const void *const  a_buf)

◆ linearSize()

int NodeFArrayBox::linearSize ( void  ) const

Referenced by dotProduct().

◆ preAllocatable()

static int NodeFArrayBox::preAllocatable ( )
inlinestatic

References setVal().

◆ setVal() [1/2]

void NodeFArrayBox::setVal ( Real  a_x)

Modifies this NodeFArrayBox so that all values of all components are set to the given value, a_x. (FArrayBox inherits such a function from BaseFab.)

Referenced by preAllocatable().

◆ setVal() [2/2]

void NodeFArrayBox::setVal ( Real  a_x,
const Box a_bx,
int  a_nstart,
int  a_numcomp 
)

The setVal functions set subregions in the `BaseFab' to a constant value. This most general form specifies the subbox, the starting component number, and the number of components to be set.

◆ norm() [1/2]

Real NodeFArrayBox::norm ( const Box a_subbox,
int  a_p = 2,
int  a_comp = 0,
int  a_numcomp = 1 
) const
inline

HERE Returns the Lp-norm of this FAB using components (a_comp : a_comp+a_numcomp-1) and within the a_subbox. a_p < 0 -> ERROR a_p = 0 -> infinity norm (max norm) a_p = 1 -> sum of ABS(FAB) a_p > 1 -> Lp-norm

References m_fab, and FArrayBox::norm().

◆ norm() [2/2]

Real NodeFArrayBox::norm ( int  a_p = 2,
int  a_comp = 0,
int  a_numcomp = 1 
) const
inline

Returns the Lp-norm of this FAB using components (a_comp : a_comp+a_numcomp-1). a_p < 0 -> ERROR a_p = 0 -> infinity norm (max norm) a_p = 1 -> sum of ABS(FAB) a_p > 1 -> Lp-norm

References m_fab, and FArrayBox::norm().

◆ sumPow()

Real NodeFArrayBox::sumPow ( const Box a_subbox,
int  a_p = 2,
int  a_comp = 0,
int  a_numcomp = 1 
) const
inline

Returns sum of pow(fab[i,c],p): i in a_subbox, a_comp <= c < a_comp+a_numcomp, a_p >= 2 only

References m_fab, and FArrayBox::sumPow().

◆ min() [1/2]

Real NodeFArrayBox::min ( int  a_comp = 0) const
inline

Returns the minimum value of given component of this NodeFArrayBox.

References m_fab, and FArrayBox::min().

◆ min() [2/2]

Real NodeFArrayBox::min ( const Box a_subbox,
int  a_comp = 0 
) const
inline

Returns the minimum value of given component of this NodeFArrayBox in given a_subbox.

References m_fab, and FArrayBox::min().

◆ max() [1/2]

Real NodeFArrayBox::max ( int  a_comp = 0) const
inline

Returns the maximum value of given component of this NodeFArrayBox.

References m_fab, and FArrayBox::max().

◆ max() [2/2]

Real NodeFArrayBox::max ( const Box a_subbox,
int  a_comp = 0 
) const
inline

Returns the maximum value of given component of this NodeFArrayBox in given a_subbox.

References m_fab, and FArrayBox::max().

◆ minIndex() [1/2]

IntVect NodeFArrayBox::minIndex ( int  a_comp = 0) const
inline

Finds location of minimum value in given component of this NodeFArrayBox.

References m_fab, and FArrayBox::minIndex().

◆ minIndex() [2/2]

IntVect NodeFArrayBox::minIndex ( const Box a_subbox,
int  a_comp = 0 
) const
inline

Returns location of minimum value in given component of this NodeFArrayBox in given a_subbox.

References m_fab, and FArrayBox::minIndex().

◆ maxIndex() [1/2]

IntVect NodeFArrayBox::maxIndex ( int  a_comp = 0) const
inline

Returns location of maximum value in given component of this NodeFArrayBox.

References m_fab, and FArrayBox::maxIndex().

◆ maxIndex() [2/2]

IntVect NodeFArrayBox::maxIndex ( const Box a_subbox,
int  a_comp = 0 
) const
inline

Returns location of maximum value in given component of this NodeFArrayBox in given a_subbox.

References m_fab, and FArrayBox::maxIndex().

◆ maskLT()

int NodeFArrayBox::maskLT ( BaseFab< int > &  a_mask,
Real  a_val,
int  a_comp = 0 
) const
inline

Computes a_mask array with value of 1 in cells where this NodeFArrayBox has value less than a_val, 0 otherwise. a_mask is resized by this function. The number of cells marked with 1 returned.

References m_fab, and FArrayBox::maskLT().

◆ maskLE()

int NodeFArrayBox::maskLE ( BaseFab< int > &  a_mask,
Real  a_val,
int  a_comp = 0 
) const
inline

Computes a_mask array with value of 1 in cells where this NodeFArrayBox has value less than or equal to a_val, 0 otherwise. a_mask is resized by this function. The number of cells marked with 1 returned.

References m_fab, and FArrayBox::maskLE().

◆ maskEQ()

int NodeFArrayBox::maskEQ ( BaseFab< int > &  a_mask,
Real  a_val,
int  a_comp = 0 
) const
inline

Computes a_mask array with value of 1 in cells where this NodeFArrayBox has value equal to a_val, 0 otherwise. a_mask is resized by this function. The number of cells marked with 1 returned.

References m_fab, and FArrayBox::maskEQ().

◆ maskGT()

int NodeFArrayBox::maskGT ( BaseFab< int > &  a_mask,
Real  a_val,
int  a_comp = 0 
) const
inline

Computes a_mask array with value of 1 in cells where this NodeFArrayBox has value greater than a_val, 0 otherwise. a_mask is resized by this function. The number of cells marked with 1 returned.

References m_fab, and FArrayBox::maskGT().

◆ maskGE()

int NodeFArrayBox::maskGE ( BaseFab< int > &  a_mask,
Real  a_val,
int  a_comp = 0 
) const
inline

Computes a_mask array with value of 1 in cells where this NodeFArrayBox has value greater than or equal to a_val, 0 otherwise. a_mask is resized by this function. The number of cells marked with 1 returned.

References m_fab, and FArrayBox::maskGE().

◆ abs() [1/3]

void NodeFArrayBox::abs ( )
inline

Modifies this NodeFArrayBox by replacing each value with its absolute value.

References FArrayBox::abs(), and m_fab.

◆ nComp()

int NodeFArrayBox::nComp ( ) const
inline

References m_fab, and BaseFab< T >::nComp().

◆ abs() [2/3]

void NodeFArrayBox::abs ( int  a_comp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by replacing each value with its absolute value, for components (a_comp : a_comp+a_numcomp-1).

References FArrayBox::abs(), and m_fab.

◆ abs() [3/3]

void NodeFArrayBox::abs ( const Box a_subbox,
int  a_comp = 0,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by replacing eahc value with its absolute value, for components (a_comp : a_comp+a_numcomp-1) and within the a_subbox.

References FArrayBox::abs(), and m_fab.

◆ sum() [1/2]

Real NodeFArrayBox::sum ( int  a_comp,
int  a_numcomp = 1 
) const
inline

Returns sum of given component of NodeFArrayBox.

References m_fab, and FArrayBox::sum().

◆ sum() [2/2]

Real NodeFArrayBox::sum ( const Box a_subbox,
int  a_comp,
int  a_numcomp = 1 
) const
inline

Returns sum of component of this NodeFArrayBox in given a_subbox.

References m_fab, and FArrayBox::sum().

◆ invert() [1/3]

NodeFArrayBox& NodeFArrayBox::invert ( Real  a_r)
inline

Modifies this NodeFArrayBox by replacing each value x with a_r/x.

References FArrayBox::invert(), and m_fab.

◆ invert() [2/3]

NodeFArrayBox& NodeFArrayBox::invert ( Real  a_r,
int  a_comp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by replacing each value x with a_r/x. For given range of components.

References FArrayBox::invert(), and m_fab.

◆ invert() [3/3]

NodeFArrayBox& NodeFArrayBox::invert ( Real  a_r,
const Box a_subbox,
int  a_comp = 0,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by replacing each value x with a_r/x. For given range of components and within given a_subbox.

References FArrayBox::invert(), and m_fab.

◆ negate() [1/3]

NodeFArrayBox& NodeFArrayBox::negate ( const Box a_subbox,
int  a_comp = 0,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by replacing each value with its additive inverse. For given range of components and within given a_subbox.

References m_fab, and FArrayBox::negate().

◆ negate() [2/3]

NodeFArrayBox& NodeFArrayBox::negate ( int  a_comp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by replacing each value with its additive inverse. For given range of components.

References m_fab, and FArrayBox::negate().

◆ negate() [3/3]

NodeFArrayBox& NodeFArrayBox::negate ( )
inline

Modifies this NodeFArrayBox by replacing each value with its additive inverse.

References m_fab, and FArrayBox::negate().

◆ plus() [1/10]

NodeFArrayBox& NodeFArrayBox::plus ( Real  a_r,
const Box a_subbox,
int  a_comp = 0,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by adding the scalar Real a_r to all values. For given range of components and within given a_subbox.

References m_fab, and FArrayBox::plus().

Referenced by plus_real().

◆ plus() [2/10]

NodeFArrayBox& NodeFArrayBox::plus ( Real  a_r,
int  a_comp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by adding the scalar Real a_r to all values. For given range of components.

References m_fab, and FArrayBox::plus().

◆ operator()() [1/2]

Real& NodeFArrayBox::operator() ( const IntVect a_p,
int  N = 0 
)
inline

References m_fab, and N.

◆ operator()() [2/2]

const Real& NodeFArrayBox::operator() ( const IntVect a_p,
int  N = 0 
) const
inline

References m_fab, and N.

◆ operator+=() [1/2]

NodeFArrayBox& NodeFArrayBox::operator+= ( Real  a_r)
inline

Modifies this NodeFArrayBox by adding the scalar Real a_r to all values.

References m_fab.

◆ operator+=() [2/2]

NodeFArrayBox& NodeFArrayBox::operator+= ( const NodeFArrayBox a_x)
inline

Modifies this NodeFArrayBox by pointwise addition of the values of the argument NodeFArrayBox. You might come to grief if the domains of the NodeFArrayBoxes don't match.

References m_fab.

◆ plus() [3/10]

NodeFArrayBox& NodeFArrayBox::plus ( Real  a_r)
inline

Modifies this NodeFArrayBox by adding the scalar Real a_r to all values.

References m_fab.

◆ plus_real()

NodeFArrayBox& NodeFArrayBox::plus_real ( Real  a_r)
inline

References plus().

◆ plus() [4/10]

NodeFArrayBox& NodeFArrayBox::plus ( const NodeFArrayBox a_x)
inline

Modifies this NodeFArrayBox by pointwise addition of the values of the argument NodeFArrayBox. You might come to grief if the domains of the NodeFArrayBoxes don't match. The same as += operator.

References m_fab.

◆ plus() [5/10]

NodeFArrayBox& NodeFArrayBox::plus ( const NodeFArrayBox a_src,
const Real a_scale 
)
inline

Modifies this NodeFArrayBox by pointwise scaled addition of the argument NodeFArrayBox (a[i] <- a[i] + a_scale * a_src[i]). Uses domain of the intersection of these two NodeFArrayBoxes.

References m_fab, and FArrayBox::plus().

◆ plus() [6/10]

NodeFArrayBox& NodeFArrayBox::plus ( const NodeFArrayBox a_src,
const Real a_scale,
int  a_srccomp,
int  a_destcomp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by pointwise scaled addition of the argument NodeFArrayBox (a[i] <- a[i] + a_scale * a_src[i]). Uses domain of the intersection of these two NodeFArrayBoxes.

References m_fab, and FArrayBox::plus().

◆ plus() [7/10]

NodeFArrayBox& NodeFArrayBox::plus ( const NodeFArrayBox a_src,
int  a_srccomp,
int  a_destcomp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by pointwise addition of values in the argument NodeFArrayBox. Adds src's components (a_srccomp : a_srccomp+a_numcomp-1) to this NodeFArrayBox's components (a_destcomp : a_destcomp+a_numcomp-1) where the domains of the two NodeFArrayBoxes intersect.

References m_fab, and FArrayBox::plus().

◆ plus() [8/10]

NodeFArrayBox& NodeFArrayBox::plus ( const NodeFArrayBox a_src,
const Box a_subbox,
int  a_srccomp,
int  a_destcomp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by pointwise addition of values in the argument NodeFArrayBox. Adds src's components (a_srccomp : a_srccomp+a_numcomp-1) to this NodeFArrayBox's components (a_destcomp : a_destcomp+numcomp-1) where the domain of this NodeFArrayBox intersects the a_subbox. NOTE: a_subbox must be contained in this FAB.

References m_fab, and FArrayBox::plus().

◆ plus() [9/10]

NodeFArrayBox& NodeFArrayBox::plus ( const NodeFArrayBox a_src,
const Box a_srcbox,
const Box a_destbox,
int  a_srccomp,
int  a_destcomp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by pointwise addition of values in the argument NodeFArrayBox. Adds src's components (a_srccomp : a_srccomp+a_numcomp-1) in the Box a_srcbox to this NodeFArrayBox's components (a_destcomp : a_destcomp+a_numcomp-1) in the Box a_destbox. Corresponding locations within the two NodeFArrayBoxes are indexed relative to a_srcbox and a_destbox, and will in general not be the same. The a_srcbox and a_destbox must be same size. The results are UNDEFINED if the a_src and dest NodeFArrayBoxes are the same and the a_srcbox and a_destbox overlap.

References m_fab, and FArrayBox::plus().

◆ plus() [10/10]

NodeFArrayBox& NodeFArrayBox::plus ( const NodeFArrayBox a_src,
const Box a_srcbox,
const Box a_destbox,
const Real a_scale,
int  a_srccomp,
int  a_destcomp,
int  a_numcomp = 1 
)
inline

References m_fab, and FArrayBox::plus().

◆ operator-=() [1/2]

NodeFArrayBox& NodeFArrayBox::operator-= ( Real  a_r)
inline

Modifies this NodeFArrayBox by subtracting the scalar Real a_r to all values. Note: use plus(-a_r) for more general operations.

References m_fab.

◆ operator-=() [2/2]

NodeFArrayBox& NodeFArrayBox::operator-= ( const NodeFArrayBox a_x)
inline

Modifies this NodeFArrayBox by pointwise subtraction of the values of the argument NodeFArrayBox. You might come to grief if the domains of the NodeFArrayBoxes don't match.

References m_fab.

◆ minus() [1/4]

NodeFArrayBox& NodeFArrayBox::minus ( const NodeFArrayBox a_x)
inline

Modifies this NodeFArrayBox by pointwise subtraction of the values of the argument NodeFArrayBox. You might come to grief if the domains of the NodeFArrayBoxes don't match. The same as -= operator.

References m_fab.

◆ minus() [2/4]

NodeFArrayBox& NodeFArrayBox::minus ( const NodeFArrayBox a_src,
int  a_srccomp,
int  a_destcomp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by pointwise subtraction of values in the argument NodeFArrayBox. Subtracts a_src's components (a_srccomp : a_srccomp+a_numcomp-1) from this NodeFArrayBox's components (a_destcomp : a_destcomp+a_numcomp-1) where the domains of the two NodeFArrayBoxes intersect.

References m_fab, and FArrayBox::minus().

◆ minus() [3/4]

NodeFArrayBox& NodeFArrayBox::minus ( const NodeFArrayBox a_src,
const Box a_subbox,
int  a_srccomp,
int  a_destcomp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by pointwise subtraction of values in the argument NodeFArrayBox. Subtracts a_src's components (a_srccomp : a_srccomp+a_numcomp-1) from this NodeFArrayBox's components (a_destcomp : a_destcomp+a_numcomp-1) where the domain of this NodeFArrayBox intersects the a_subbox. NOTE: a_subbox must be contained in this FAB.

References m_fab, and FArrayBox::minus().

◆ minus() [4/4]

NodeFArrayBox& NodeFArrayBox::minus ( const NodeFArrayBox a_src,
const Box a_srcbox,
const Box a_destbox,
int  a_srccomp,
int  a_destcomp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by pointwise subtraction of values in the argument NodeFArrayBox. Subtracts a_src's components (a_srccomp : a_srccomp+a_numcomp-1) in the Box a_srcbox from this NodeFArrayBox's components (a_destcomp : a_destcomp+a_numcomp-1) in the Box a_destbox. Corresponding locations within the two NodeFArrayBoxes are indexed relative to a_srcbox and a_destbox, and will in general not be the same. The a_srcbox and a_destbox must be same size. The results are UNDEFINED if the a_src and dest NodeFArrayBoxes are the same and the a_srcbox and a_destbox overlap.

References m_fab, and FArrayBox::minus().

◆ operator*=() [1/2]

NodeFArrayBox& NodeFArrayBox::operator*= ( Real  a_r)
inline

Modifies this NodeFArrayBox by multiplying all values by the scalar Real a_r.

References m_fab.

◆ mult() [1/7]

NodeFArrayBox& NodeFArrayBox::mult ( Real  a_r)
inline

Modifies this NodeFArrayBox by multiplying all values by the scalar Real a_r.

References m_fab.

◆ mult() [2/7]

NodeFArrayBox& NodeFArrayBox::mult ( Real  a_r,
int  a_comp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by multiplying all values by the scalar Real a_r. For given range of components.

References m_fab, and FArrayBox::mult().

◆ mult() [3/7]

NodeFArrayBox& NodeFArrayBox::mult ( Real  a_r,
const Box a_subbox,
int  a_comp = 0,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by multiplying all values by the scalar Real a_r. For given range of components and within given a_subbox.

References m_fab, and FArrayBox::mult().

◆ operator*=() [2/2]

NodeFArrayBox& NodeFArrayBox::operator*= ( const NodeFArrayBox a_x)
inline

Modifies this NodeFArrayBox by pointwise multiplication of the values by the argument NodeFArrayBox. You might come to grief if the domains of the NodeFArrayBoxes don't match.

References m_fab.

◆ mult() [4/7]

NodeFArrayBox& NodeFArrayBox::mult ( const NodeFArrayBox a_x)
inline

Modifies this NodeFArrayBox by pointwise multiplication by the values in the argument NodeFArrayBox. You might come to grief if the domains of the NodeFArrayBoxes don't match. The same as the *= operator.

References m_fab.

◆ mult() [5/7]

NodeFArrayBox& NodeFArrayBox::mult ( const NodeFArrayBox a_src,
int  a_srccomp,
int  a_destcomp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by pointwise multiplication by values in the argument NodeFArrayBox. Multiplies a_src's components (a_srccomp : a_srccomp+a_numcomp-1) by this NodeFArrayBox's components (a_destcomp : a_destcomp+a_numcomp-1) where the domains of the two NodeFArrayBoxes intersect.

References m_fab, and FArrayBox::mult().

◆ mult() [6/7]

NodeFArrayBox& NodeFArrayBox::mult ( const NodeFArrayBox a_src,
const Box a_subbox,
int  a_srccomp,
int  a_destcomp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by pointwise multiplication by values in the argument NodeFArrayBox. Multiplies a_src's components (a_srccomp : a_srccomp+a_numcomp-1) by this NodeFArrayBox's components (a_destcomp : a_destcomp+a_numcomp-1) where the domain of this NodeFArrayBox intersects the a_subbox. NOTE: a_subbox must be contained in this FAB.

References m_fab, and FArrayBox::mult().

◆ mult() [7/7]

NodeFArrayBox& NodeFArrayBox::mult ( const NodeFArrayBox a_src,
const Box a_srcbox,
const Box a_destbox,
int  a_srccomp,
int  a_destcomp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by pointwise multiplication by values in the argument NodeFArrayBox. Multiplies a_src's components (a_srccomp : a_srccomp+a_numcomp-1) in the Box a_srcbox by this NodeFArrayBox's components (a_destcomp : a_destcomp+a_numcomp-1) in the Box a_destbox. Corresponding locations within the two NodeFArrayBoxes are indexed relative to a_srcbox and a_destbox, and will in general not be the same. The a_srcbox and a_destbox must be same size. The results are UNDEFINED if the a_src and dest NodeFArrayBoxes are the same and the a_srcbox and a_destbox overlap.

References m_fab, and FArrayBox::mult().

◆ operator/=() [1/2]

NodeFArrayBox& NodeFArrayBox::operator/= ( Real  a_r)
inline

Modifies this NodeFArrayBox by dividing all values by the scalar Real a_r.

References m_fab.

◆ divide() [1/7]

NodeFArrayBox& NodeFArrayBox::divide ( Real  a_r)
inline

Modifies this NodeFArrayBox by dividing all values by the scalar Real a_r.

References m_fab.

◆ divide() [2/7]

NodeFArrayBox& NodeFArrayBox::divide ( Real  a_r,
int  a_comp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by dividing all values by the scalar Real a_r. For given range of components.

References FArrayBox::divide(), and m_fab.

◆ divide() [3/7]

NodeFArrayBox& NodeFArrayBox::divide ( Real  a_r,
const Box a_subbox,
int  a_comp = 0,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by dividing all values by the scalar Real a_r. For given range of components and within given a_subbox.

References FArrayBox::divide(), and m_fab.

◆ operator/=() [2/2]

NodeFArrayBox& NodeFArrayBox::operator/= ( const NodeFArrayBox a_x)
inline

Modifies this NodeFArrayBox by pointwise division of the values by the argument NodeFArrayBox. You might come to grief if the domains of the NodeFArrayBoxes don't match.

References m_fab.

◆ divide() [4/7]

NodeFArrayBox& NodeFArrayBox::divide ( const NodeFArrayBox a_x)
inline

Modifies this NodeFArrayBox by pointwise division by the values in the argument NodeFArrayBox. You might come to grief if the domains of the NodeFArrayBoxes don't match. The same as the /= operator.

References m_fab.

◆ divide() [5/7]

NodeFArrayBox& NodeFArrayBox::divide ( const NodeFArrayBox a_src,
int  a_srccomp,
int  a_destcomp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by pointwise division by values in the argument NodeFArrayBox. Divides this NodeFArrayBox's components (a_destcomp : a_destcomp+a_numcomp-1) by a_src's components (a_srccomp : a_srccomp+a_numcomp-1) where the domains of the two NodeFArrayBoxes intersect.

References FArrayBox::divide(), and m_fab.

◆ divide() [6/7]

NodeFArrayBox& NodeFArrayBox::divide ( const NodeFArrayBox a_src,
const Box a_subbox,
int  a_srccomp,
int  a_destcomp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by pointwise division by values in the argument NodeFArrayBox. Divides this NodeFArrayBox's components (a_destcomp : a_destcomp+a_numcomp-1) by a_src's components (a_srccomp : a_srccomp+a_numcomp-1) where the domain of this NodeFArrayBox intersects the a_subbox. NOTE: a_subbox must be contained in this FAB.

References FArrayBox::divide(), and m_fab.

◆ divide() [7/7]

NodeFArrayBox& NodeFArrayBox::divide ( const NodeFArrayBox a_src,
const Box a_srcbox,
const Box a_destbox,
int  a_srccomp,
int  a_destcomp,
int  a_numcomp = 1 
)
inline

Modifies this NodeFArrayBox by pointwise division by values in the argument NodeFArrayBox. Divides this NodeFArrayBox's components (a_destcomp : a_destcomp+a_numcomp-1) in the Box a_destbox by a_src's components (a_srccomp : a_srccomp+a_numcomp-1) in the Box a_srcbox. Corresponding locations within the two NodeFArrayBoxes are indexed relative to a_srcbox and a_destbox, and will in general not be the same. The a_srcbox and a_destbox must be same size. The results are UNDEFINED if the a_src and dest NodeFArrayBoxes are the same and the a_srcbox and a_destbox overlap.

References FArrayBox::divide(), and m_fab.

◆ loVect()

const int* NodeFArrayBox::loVect ( ) const
inline

Returns the lower corner of the domain. Instead of returning them in the form of IntVects, as in smallEnd and bigEnd, it returns the values as a pointer to an array of constant integers. This is useful when interfacing to Fortran subroutines. It should not be used in any other context!!!

References BaseFab< T >::loVect(), and m_fab.

◆ hiVect()

const int* NodeFArrayBox::hiVect ( ) const
inline

Returns the upper corner of the domain. Instead of returning them in the form of IntVects, as in smallEnd and bigEnd, it returns the values as a pointer to an array of constant integers. This is useful when interfacing to Fortran subroutines. It should not be used in any other context!!!

References BaseFab< T >::hiVect(), and m_fab.

◆ nCompPtr()

const int* NodeFArrayBox::nCompPtr ( ) const
inline

Returns a pointer to an integer that contains the number of components in the BaseFab. This is useful when interfacing to Fortran subroutines. It should not be used in any other context!!!

References m_fab, and BaseFab< T >::nCompPtr().

◆ dataPtr() [1/2]

Real* NodeFArrayBox::dataPtr ( int  a_n = 0)
inline

Returns a pointer to an object of type T that is the value of the a_nth component associated with the cell at the low end of the domain. This is commonly used to get a pointer to data in the array which is then handed off to a Fortran subroutine. It should not be used in any other context!!! Remember that data is stored in Fortran array order, with the component index coming last. In other words, `dataPtr' returns a pointer to all the a_nth components.

References BaseFab< T >::dataPtr(), and m_fab.

◆ dataPtr() [2/2]

const Real* NodeFArrayBox::dataPtr ( int  a_n = 0) const
inline

Returns a constant pointer to an object of type T that is the value of the a_nth component associated with the cell at the low end of the domain. This is commonly used to get a pointer to data in the array which is then handed off to a Fortran subroutine. It should not be used in any other context!!! Remember that data is stored in Fortran array order, with the component index coming last. In other words, `dataPtr' returns a pointer to all the a_nth components.

References BaseFab< T >::dataPtr(), and m_fab.

◆ shift()

void NodeFArrayBox::shift ( const IntVect iv)
inline

Member Data Documentation

◆ m_box

Box NodeFArrayBox::m_box
protected

Referenced by shift().

◆ m_fab

FArrayBox NodeFArrayBox::m_fab
protected

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