Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members
NodeFArrayBox Class Reference
A wrapper for an FArrayBox to contain NODE-centered data.
More...
#include <NodeFArrayBox.H>
List of all members.
Public Methods |
| NodeFArrayBox () |
| {\bf constructors, destructor and defines}
|
| NodeFArrayBox (const Box &a_bx, int a_nComp=1) |
| ~NodeFArrayBox () |
void | define (const Box &a_bx, int a_nComp=1) |
const Box & | box () const |
| {\bf access functions}
|
FArrayBox & | getFab () |
const FArrayBox & | getFab () const |
Real | integral (const Real a_dx, const Box &a_subbox, const int a_startComp=0, const int a_numComp=1) const |
Real | integral (const Real a_dx, const int a_startComp=0, const int a_numComp=1) const |
Real | norm (const Real a_dx, const Box &a_subbox, const int a_p=2, const int a_startComp=0, const int a_numComp=1) const |
Real | norm (const Real a_dx, const int a_p=2, const int a_startComp=0, const int a_numComp=1) const |
Real | maxnorm (const Box &a_subbox, const int a_startComp=0, const int a_numComp=1) const |
Real | maxnorm (const int a_startComp=0, const int a_numComp=1) const |
void | copy (const NodeFArrayBox &a_src) |
| {\bf data modification functions}
|
void | copy (const Box &a_regionFrom, const Interval &a_Cdest, const Box &a_regionTo, const NodeFArrayBox &a_src, const Interval &a_Csrc) |
int | 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) |
void | linearIn (void *a_buf, const Box &a_R, const Interval &a_comps) |
Static Public Methods |
bool | preAllocatable () |
Protected Attributes |
Box | m_box |
FArrayBox | m_fab |
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--+ | | | | | | | | | | | | +---+--+--+---+ +---2223222---+ | | | | 2 | | | | | 2 | | | | | 2 | +---+------+------+ X---22222223------X | | | | | | | | | | | | +----------+ +-------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. Vertically periodic domain: nodes "Y" shared by two grids.
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.
So whenever we want to use src.copyTo(dest), unless we are sure that src and dest have the same layout, we do the following: \
- define BoxLayoutData<NodeFArrayBox> destExpanded on the BoxLayout of dest with each box expanded by one in each dimension; \
- do src.copyTo(destExpanded); \
- box by box, copy destExpanded to dest.
Constructor & Destructor Documentation
NodeFArrayBox::NodeFArrayBox |
( |
|
) |
|
|
|
{\bf constructors, destructor and defines}
Default constructor. User must subsequently call define(). |
NodeFArrayBox::NodeFArrayBox |
( |
const Box & |
a_bx, |
|
|
int |
a_nComp = 1 |
|
) |
|
|
|
Constructs NodeFArrayBox on CELL-centered box a_bx with a_nComp components. Data space is allocated but not initialized. |
NodeFArrayBox::~NodeFArrayBox |
( |
|
) |
|
|
Member Function Documentation
const Box& NodeFArrayBox::box |
( |
|
) |
const |
|
|
{\bf access functions}
Returns the CELL-centered domain where the array is defined. |
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>. |
void NodeFArrayBox::copy |
( |
const NodeFArrayBox & |
a_src |
) |
|
|
|
{\bf data modification functions}
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, then
+--------+ | | | this | | | +--------+ <- data copied here from a_src to this | | | a_src | | | +--------+
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. |
void NodeFArrayBox::define |
( |
const Box & |
a_bx, |
|
|
int |
a_nComp = 1 |
|
) |
|
|
|
Defines NodeFArrayBox on CELL-centered box a_bx with a_nComp components. |
const FArrayBox& NodeFArrayBox::getFab |
( |
|
) |
const |
|
|
Returns a constant reference to the NODE-centered FArrayBox containing the data. |
FArrayBox& NodeFArrayBox::getFab |
( |
|
) |
|
|
|
Returns a modifiable reference to the NODE-centered FArrayBox containing the data. |
Real NodeFArrayBox::integral |
( |
const Real |
a_dx, |
|
|
const int |
a_startComp = 0, |
|
|
const int |
a_numComp = 1 |
|
) |
const |
|
|
Returns the integral of the data. |
Real NodeFArrayBox::integral |
( |
const Real |
a_dx, |
|
|
const Box & |
a_subbox, |
|
|
const int |
a_startComp = 0, |
|
|
const int |
a_numComp = 1 |
|
) |
const |
|
|
Returns the integral of the data. |
void NodeFArrayBox::linearIn |
( |
void * |
a_buf, |
|
|
const Box & |
a_R, |
|
|
const Interval & |
a_comps |
|
) |
|
|
void NodeFArrayBox::linearIn |
( |
void * |
a_buf |
) |
|
|
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>. |
Real NodeFArrayBox::maxnorm |
( |
const int |
a_startComp = 0, |
|
|
const int |
a_numComp = 1 |
|
) |
const |
|
|
Returns the maximum norm of the data. |
Real NodeFArrayBox::maxnorm |
( |
const Box & |
a_subbox, |
|
|
const int |
a_startComp = 0, |
|
|
const int |
a_numComp = 1 |
|
) |
const |
|
|
Returns the maximum norm of the data. |
Real NodeFArrayBox::norm |
( |
const Real |
a_dx, |
|
|
const int |
a_p = 2, |
|
|
const int |
a_startComp = 0, |
|
|
const int |
a_numComp = 1 |
|
) |
const |
|
|
Returns the L^p norm of the data. |
Real NodeFArrayBox::norm |
( |
const Real |
a_dx, |
|
|
const Box & |
a_subbox, |
|
|
const int |
a_p = 2, |
|
|
const int |
a_startComp = 0, |
|
|
const int |
a_numComp = 1 |
|
) |
const |
|
|
Returns the L^p norm of the data. |
bool NodeFArrayBox::preAllocatable |
( |
|
) |
[inline, static] |
|
int 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>. |
Member Data Documentation
Box NodeFArrayBox::m_box [protected]
|
|
FArrayBox NodeFArrayBox::m_fab [protected]
|
|
The documentation for this class was generated from the following file:
Generated on Tue Apr 15 18:34:54 2003 for AMRNodeElliptic by
1.2.16