Chombo + EB
3.2
|
#include "NodeFArrayBox.H"
#include "LevelData.H"
#include "IntVectSet.H"
#include "NamespaceHeader.H"
#include "NamespaceFooter.H"
Go to the source code of this file.
Macros | |
#define | _NODESETOPERATIONS_H_ |
Functions | |
void | interiorNodes (IntVectSet &a_ivs, const ProblemDomain &a_base_domain, const DisjointBoxLayout &a_boxes, const Box &a_box) |
Finds interior nodes of a DisjointBoxLayout in a particular box. More... | |
void | interiorNodes (IntVectSet &a_ivs, const Box &a_base_domain, const DisjointBoxLayout &a_boxes, const Box &a_box) |
Finds interior nodes of a DisjointBoxLayout in a particular box. More... | |
void | interiorBoundaryNodes (LayoutData< Vector< IntVectSet > > &a_IVSV, const DisjointBoxLayout &a_boxes, const ProblemDomain &a_domain) |
Finds interior boundary nodes of a DisjointBoxLayout. More... | |
void | interiorBoundaryNodes (LayoutData< Vector< IntVectSet > > &a_IVSV, const DisjointBoxLayout &a_boxes, const Box &a_domain) |
Finds interior boundary nodes of a DisjointBoxLayout. More... | |
void | interiorBoundaryNodes (LayoutData< Vector< IntVectSet > > &a_IVSV, const DisjointBoxLayout &a_dest, const DisjointBoxLayout &a_src, const ProblemDomain &a_domain) |
Finds interior boundary nodes of a DisjointBoxLayout. More... | |
void | interiorBoundaryNodes (LayoutData< Vector< IntVectSet > > &a_IVSV, const DisjointBoxLayout &a_dest, const DisjointBoxLayout &a_src, const Box &a_domain) |
Finds interior boundary nodes of a DisjointBoxLayout. More... | |
void | exteriorBoundaryNodes (LayoutData< Vector< IntVectSet > > &a_exterior, const LayoutData< Vector< IntVectSet > > &a_interior, const DisjointBoxLayout &a_boxes) |
Finds exterior boundary nodes of a DisjointBoxLayout. More... | |
void | zeroBoundaryNodes (BoxLayoutData< NodeFArrayBox > &a_dest, const LayoutData< Vector< IntVectSet > > &a_IVSV) |
Sets data to zero on specified boundary nodes. More... | |
void | copyInteriorNodes (LevelData< NodeFArrayBox > &a_dest, const LevelData< NodeFArrayBox > &a_src, const LayoutData< Vector< IntVectSet > > &a_IVSV) |
Copies data at interior nodes from one LevelData<NodeFArrayBox> to another. More... | |
void | fullIntVectSets (LayoutData< BitSet > &a_IVSVfull, const LayoutData< Vector< IntVectSet > > &a_IVSV) |
Determines which IntVectSets are rectangular. More... | |
void | interiorBoundaryNodes (LayoutData< Vector< Box > > &a_IVSV, const DisjointBoxLayout &a_boxes, const Box &a_domain) |
Finds interior boundary nodes of a DisjointBoxLayout. More... | |
void | interiorBoundaryNodes (LayoutData< Vector< Box > > &a_IVSV, const DisjointBoxLayout &a_boxes, const ProblemDomain &a_domain) |
Finds interior boundary nodes of a DisjointBoxLayout. More... | |
void | interiorBoundaryNodes (LayoutData< Vector< Box > > &a_IVSV, const DisjointBoxLayout &a_dest, const DisjointBoxLayout &a_src, const Box &a_domain) |
Finds interior boundary nodes of a DisjointBoxLayout. More... | |
void | interiorBoundaryNodes (LayoutData< Vector< Box > > &a_IVSV, const DisjointBoxLayout &a_dest, const DisjointBoxLayout &a_src, const ProblemDomain &a_domain) |
Finds interior boundary nodes of a DisjointBoxLayout. More... | |
void | exteriorBoundaryNodes (LayoutData< Vector< Box > > &a_exterior, const LayoutData< Vector< Box > > &a_interior, const DisjointBoxLayout &a_boxes) |
Finds exterior boundary nodes of a DisjointBoxLayout. More... | |
void | copyInteriorNodes (LevelData< NodeFArrayBox > &a_dest, const LevelData< NodeFArrayBox > &a_src, const LayoutData< Vector< Box > > &a_IVSV) |
Copies data at interior nodes from one LevelData<NodeFArrayBox> to another. More... | |
void | zeroBoundaryNodes (BoxLayoutData< NodeFArrayBox > &a_dest, const LayoutData< Vector< Box > > &a_IVSV) |
Sets data to zero on specified boundary nodes. More... | |
void | appendBoxes (Vector< Box > &a_boxes, const Vector< Box > &a_new) |
void | removeBoxFromBoxes (Vector< Box > &a_boxes, const Box &a_remove) |
void | removeBoxesFromBox (Vector< Box > &a_boxes, const Vector< Box > &a_remove, const Box &a_base) |
void | removeBoxFromBox (Vector< Box > &a_boxes, const Box &a_remove, const Box &a_base) |
void | removeBoxesFromBoxes (Vector< Box > &a_boxes, const Vector< Box > &a_remove) |
void | intersectBoxes (Vector< Box > &a_boxes, const Vector< Box > &a_new) |
void | intersectBoxes (Vector< Box > &a_boxes, const Box &a_new) |
void | shiftBoxes (Vector< Box > &a_boxes, const IntVect &a_offset) |
void | cellsToNodes (Vector< Box > &a_boxes) |
void | nodesToCells (Vector< Box > &a_boxes) |
void | exteriorAndInteriorNodes (Vector< LayoutData< Vector< Box > > * > &a_exterior, Vector< LayoutData< Vector< Box > > * > &a_intFinerCoarsened, const Vector< DisjointBoxLayout > &a_layouts, const Vector< ProblemDomain > &a_domain, const Vector< int > &a_nRefFine) |
void | exteriorAndInteriorNodes (Vector< LayoutData< Vector< IntVectSet > > * > &a_exterior, Vector< LayoutData< Vector< IntVectSet > > * > &a_intFinerCoarsened, const Vector< DisjointBoxLayout > &a_layouts, const Vector< ProblemDomain > &a_domain, const Vector< int > &a_nRefFine) |
void | getMaskInteriorNodes (LevelData< NodeFArrayBox > &a_mask, const DisjointBoxLayout &a_dest, const DisjointBoxLayout *a_srcPtr, const Box &a_domain, int a_onoff=1) |
Returns a mask on interior nodes of a DisjointBoxLayout. More... | |
void | getMaskInteriorNodes (LevelData< NodeFArrayBox > &a_mask, const DisjointBoxLayout &a_dest, const DisjointBoxLayout *a_srcPtr, const ProblemDomain &a_domain, int a_onoff=1) |
Returns a mask on interior nodes of a DisjointBoxLayout. More... | |
void | getMaskInteriorNodes (LevelData< NodeFArrayBox > &a_mask, const DisjointBoxLayout &a_dest, const Box &a_domain) |
Returns a mask on interior nodes of a DisjointBoxLayout. More... | |
void | getMaskValidNodes (LevelData< NodeFArrayBox > &a_mask, const DisjointBoxLayout &a_layout, const DisjointBoxLayout *a_finerCoarsenedPtr, const ProblemDomain &a_domain) |
Returns a mask on valid nodes on a level. More... | |
void | getMaskValidNodes (LevelData< NodeFArrayBox > &a_mask, const DisjointBoxLayout &a_layout, const DisjointBoxLayout *a_finerCoarsenedPtr, const Box &a_domain) |
Returns a mask on valid nodes on a level. More... | |
void | getMaskValidNodes (Vector< LevelData< NodeFArrayBox > * > &a_masks, const Vector< DisjointBoxLayout > &a_layouts, const Vector< ProblemDomain > &a_domain, const Vector< int > &a_nRefFine) |
void | getSurroundingNodes (BoxLayout &a_gridsNodes, const BoxLayout &a_gridsCells) |
void | getEnclosedCells (BoxLayout &a_gridsCells, const BoxLayout &a_gridsNodes) |
void | halveIntFaces (BaseFab< int > &a_intFab, const Box &a_bx) |
#define _NODESETOPERATIONS_H_ |
void interiorNodes | ( | IntVectSet & | a_ivs, |
const ProblemDomain & | a_base_domain, | ||
const DisjointBoxLayout & | a_boxes, | ||
const Box & | a_box | ||
) |
Finds interior nodes of a DisjointBoxLayout in a particular box.
Returns nodes inside and surrounding CELL-centered box a_box that are NOT on the interface of (CELL-centered) a_boxes with the next coarser level.
Example: for two particular boxes in the four-grid layout below, the interior nodes are those that are marked "O". For the second box, the nodes marked "Y" are interior nodes if and only if the domain is periodic in the vertical direction and the boxes extend to the top and bottom faces of the domain.
+-----+ +YY---+ | | |OOOOO| | | |OOOOO| | | |OOOOO| +---+OOO--+---+ +---+OOOOO+---+ |OOOOOOO | | | | |OOOOOOO | | | | |OOOOOOO | | | | +---+OOOOOO+------+ +---+------+------+ | | | | | | | | | | | | +----------+ +----------+
The set of interior nodes of a box is the disjoint union of the nodes surrounded by cells of the box, and the interior boundary nodes of the box.
a_ivs | interior nodes of a_box in the layout a_boxes |
a_base_domain | CELL-centered physical domain containing a_boxes |
a_boxes | layout of CELL-centered boxes |
a_box | the box in a_boxes for which we find interior nodes |
void interiorNodes | ( | IntVectSet & | a_ivs, |
const Box & | a_base_domain, | ||
const DisjointBoxLayout & | a_boxes, | ||
const Box & | a_box | ||
) |
Finds interior nodes of a DisjointBoxLayout in a particular box.
Returns nodes inside and surrounding CELL-centered box a_box that are NOT on the interface of (CELL-centered) a_boxes with the next coarser level.
Example: for two particular boxes in the four-grid layout below, the interior nodes are those that are marked "O". For the second box, the nodes marked "Y" are interior nodes if and only if the domain is periodic in the vertical direction and the boxes extend to the top and bottom faces of the domain.
+-----+ +YY---+ | | |OOOOO| | | |OOOOO| | | |OOOOO| +---+OOO--+---+ +---+OOOOO+---+ |OOOOOOO | | | | |OOOOOOO | | | | |OOOOOOO | | | | +---+OOOOOO+------+ +---+------+------+ | | | | | | | | | | | | +----------+ +----------+
The set of interior nodes of a box is the disjoint union of the nodes surrounded by cells of the box, and the interior boundary nodes of the box.
a_ivs | interior nodes of a_box in the layout a_boxes |
a_base_domain | CELL-centered physical domain containing a_boxes |
a_boxes | layout of CELL-centered boxes |
a_box | the box in a_boxes for which we find interior nodes |
void interiorBoundaryNodes | ( | LayoutData< Vector< IntVectSet > > & | a_IVSV, |
const DisjointBoxLayout & | a_boxes, | ||
const ProblemDomain & | a_domain | ||
) |
Finds interior boundary nodes of a DisjointBoxLayout.
Returns a LayoutData containing, for each box in a_boxes, a Vector of IntVectSets that contain the indices of the nodes that lie on faces of the box but are not on the interface of a_boxes with the next coarser level.
Example: for two particular boxes, marked "me", in the four-grid layout below, the interior boundary nodes are those that are marked with "O". For the second box, the nodes marked "Y" are also interior boundary nodes if and only if the domain is periodic in the vertical direction and the grids extend to the top and bottom faces of the domain.
+-----+ +YY---+ | | | | | | | me | | | | | +---+OOO--+---+ +---+OOOOO+---+ | O | | | | | me O | | | | | O | | | | +---+OOOOOO+------+ +---+------+------+ | | | | | | | | | | | | +----------+ +----------+
The result a_IVSV is needed by copyInteriorNodes().
Question: Why not simply store the indices of all interior boundary nodes of a_boxes in a single IntVectSet, rather than a LayoutData< Vector<IntVectSet> >?
Answer: Because of the way IntVectSets are stored, this would be very slow.
The different components of the Vector<IntVectSet> contain indices of nodes on different faces of the box.
a_IVSV | object containing interior boundary nodes of a_boxes |
a_boxes | layout of CELL-centered boxes |
a_domain | CELL-centered physical domain containing a_boxes |
void interiorBoundaryNodes | ( | LayoutData< Vector< IntVectSet > > & | a_IVSV, |
const DisjointBoxLayout & | a_boxes, | ||
const Box & | a_domain | ||
) |
Finds interior boundary nodes of a DisjointBoxLayout.
Returns a LayoutData containing, for each box in a_boxes, a Vector of IntVectSets that contain the indices of the nodes that lie on faces of the box but are not on the interface of a_boxes with the next coarser level.
Example: for two particular boxes, marked "me", in the four-grid layout below, the interior boundary nodes are those that are marked with "O". For the second box, the nodes marked "Y" are also interior boundary nodes if and only if the domain is periodic in the vertical direction and the grids extend to the top and bottom faces of the domain.
+-----+ +YY---+ | | | | | | | me | | | | | +---+OOO--+---+ +---+OOOOO+---+ | O | | | | | me O | | | | | O | | | | +---+OOOOOO+------+ +---+------+------+ | | | | | | | | | | | | +----------+ +----------+
The result a_IVSV is needed by copyInteriorNodes().
Question: Why not simply store the indices of all interior boundary nodes of a_boxes in a single IntVectSet, rather than a LayoutData< Vector<IntVectSet> >?
Answer: Because of the way IntVectSets are stored, this would be very slow.
The different components of the Vector<IntVectSet> contain indices of nodes on different faces of the box.
a_IVSV | object containing interior boundary nodes of a_boxes |
a_boxes | layout of CELL-centered boxes |
a_domain | CELL-centered physical domain containing a_boxes |
void interiorBoundaryNodes | ( | LayoutData< Vector< IntVectSet > > & | a_IVSV, |
const DisjointBoxLayout & | a_dest, | ||
const DisjointBoxLayout & | a_src, | ||
const ProblemDomain & | a_domain | ||
) |
Finds interior boundary nodes of a DisjointBoxLayout.
Returns a LayoutData containing, for each destination box, a Vector of IntVectSets that together represent the nodes of the destination box that are also interior boundary nodes of the source boxes.
Specifically, if IBN(a_src) is the set of interior boundary nodes of a_src, then the Vector<IntVectSet> a_IVSV[dit()] holds the intersection of IBN(a_src) and the nodes surrounding a_dest[dit()].
The result a_IVSV is used in copyInteriorNodes().
a_IVSV | object containing interior boundary nodes of a_boxes |
a_dest | layout of CELL-centered destination boxes |
a_src | layout of CELL-centered source boxes |
a_domain | CELL-centered physical domain containing a_dest and a_src |
void interiorBoundaryNodes | ( | LayoutData< Vector< IntVectSet > > & | a_IVSV, |
const DisjointBoxLayout & | a_dest, | ||
const DisjointBoxLayout & | a_src, | ||
const Box & | a_domain | ||
) |
Finds interior boundary nodes of a DisjointBoxLayout.
Returns a LayoutData containing, for each destination box, a Vector of IntVectSets that together represent the nodes of the destination box that are also interior boundary nodes of the source boxes.
Specifically, if IBN(a_src) is the set of interior boundary nodes of a_src, then the Vector<IntVectSet> a_IVSV[dit()] holds the intersection of IBN(a_src) and the nodes surrounding a_dest[dit()].
The result a_IVSV is used in copyInteriorNodes().
a_IVSV | object containing interior boundary nodes of a_boxes |
a_dest | layout of CELL-centered destination boxes |
a_src | layout of CELL-centered source boxes |
a_domain | CELL-centered physical domain containing a_dest and a_src |
void exteriorBoundaryNodes | ( | LayoutData< Vector< IntVectSet > > & | a_exterior, |
const LayoutData< Vector< IntVectSet > > & | a_interior, | ||
const DisjointBoxLayout & | a_boxes | ||
) |
Finds exterior boundary nodes of a DisjointBoxLayout.
Returns a LayoutData containing, for each box, the exterior boundary nodes of the box.
The exterior boundary nodes are the nodes on a level that are not interior nodes: they lie on the physical boundary and on the interface with the coarser level.
Example: for two particular boxes, marked "me", in the four-grid layout below, the exterior boundary nodes are those that are marked "O". For the second box, the nodes marked "Y" are also exterior boundary nodes, unless the domain is periodic in the vertical direction and the grids extend to the top and bottom faces of the domain.
+-----+ OYYOOOO | | O O | | O me O | | O O OOOOO--+--+---+ +---O--+--O---+ O | | | | | O me | | | | | O | | | | | +---O------O------+ +---+------+------+ | | | | | | | | | | | | +----------+ +----------+
The argument a_interior is obtained from
interiorBoundaryNodes(a_interior, a_boxes, a_domain)
where a_domain is the physical domain.
You don't need the physical domain a_domain as an argument to this function, even to get periodicities, because everything needed from a_domain is put into a_interior.
a_exterior | object containing exterior boundary nodes of a_boxes |
a_interior | object containing interior boundary nodes of a_boxes |
a_boxes | layout of CELL-centered boxes |
void zeroBoundaryNodes | ( | BoxLayoutData< NodeFArrayBox > & | a_dest, |
const LayoutData< Vector< IntVectSet > > & | a_IVSV | ||
) |
Sets data to zero on specified boundary nodes.
Sets a_dest to zero on the nodes in a_IVSV.
Specifically, a_dest[dit()] is set to zero on the nodes in a_IVSV[dit()].
We usually call this function with a_IVSV representing the exterior boundary nodes of a_dest. These are obtained with the sequence of calls:
interiorBoundaryNodes(a_IVSVint, a_dest.boxLayout(), a_domain)
where a_domain is the physical domain, and
exteriorBoundaryNodes(a_IVSV, a_IVSVint, a_dest.boxLayout())
.
a_dest | the data |
a_IVSV | object containing boundary nodes |
void copyInteriorNodes | ( | LevelData< NodeFArrayBox > & | a_dest, |
const LevelData< NodeFArrayBox > & | a_src, | ||
const LayoutData< Vector< IntVectSet > > & | a_IVSV | ||
) |
Copies data at interior nodes from one LevelData<NodeFArrayBox> to another.
Copies data from a_src to a_dest, over the interior nodes of a_src. They need not have the same layout.
The argument a_IVSV is obtained from
interiorBoundaryNodes(a_IVSV, a_dest.boxLayout(), a_src.boxLayout(), a_domain)
where a_domain is the physical domain.
If a_dest and a_src have the same layout, then we may obtain a_IVSV more efficiently from
interiorBoundaryNodes(a_IVSV, a_src.boxLayout(), a_domain)
.
Do not use this shorter form if a_dest and a_src have different layouts.
Example: if a_src has the four-grid layout on the left below, then the nodes from which data are copied to a_dest are marked with "X" and "O" on the right below. (The distinction between "X" and "O" is that nodes marked "O" are on interior boundaries of the layout.) Data are copied from the nodes marked "Y" if and only if the domain is periodic in the vertical direction and the grids extend to the top and bottom faces of the domain.
+-----+ +YY---+ | | |OOOOO| | | |OOOOO| | | |OOOOO| +---+--+--+---+ +---+XXXXX+---+ | | | |OOOOOOXOOOOOO| | | | |OOOOOOXOOOOOO| | | | |OOOOOOXOOOOOO| +---+------+------+ +---+XXXXXX+------+ | | |OOOOOOOOOO| | | |OOOOOOOOOO| | | |OOOOOOOOOO| +----------+ +--------YY+
Both pictures represent the layout of a_src. The layout of a_dest may be completely different from that of a_src.
Data at nodes in a_dest that are not interior boundary nodes of a_src remain unchanged by this function.
a_dest | destination data |
a_src | source data |
a_IVSV | object containing interior boundary nodes of source layout that are also nodes of destination layout |
void fullIntVectSets | ( | LayoutData< BitSet > & | a_IVSVfull, |
const LayoutData< Vector< IntVectSet > > & | a_IVSV | ||
) |
Determines which IntVectSets are rectangular.
Sets the bit a_IVSVfull[dit()][comp] to be true if and only if a_IVSV[dit()][comp] is a full rectangle.
a_IVSVfull | object containing bit settings of whether each component is rectangular |
a_IVSV | object containing interior boundary nodes of a layout |
void interiorBoundaryNodes | ( | LayoutData< Vector< Box > > & | a_IVSV, |
const DisjointBoxLayout & | a_boxes, | ||
const Box & | a_domain | ||
) |
Finds interior boundary nodes of a DisjointBoxLayout.
Returns a LayoutData containing, for each box in a_boxes, a Vector of IntVectSets that contain the indices of the nodes that lie on faces of the box but are not on the interface of a_boxes with the next coarser level.
Example: for two particular boxes, marked "me", in the four-grid layout below, the interior boundary nodes are those that are marked with "O". For the second box, the nodes marked "Y" are also interior boundary nodes if and only if the domain is periodic in the vertical direction and the grids extend to the top and bottom faces of the domain.
+-----+ +YY---+ | | | | | | | me | | | | | +---+OOO--+---+ +---+OOOOO+---+ | O | | | | | me O | | | | | O | | | | +---+OOOOOO+------+ +---+------+------+ | | | | | | | | | | | | +----------+ +----------+
The result a_IVSV is needed by copyInteriorNodes().
Question: Why not simply store the indices of all interior boundary nodes of a_boxes in a single IntVectSet, rather than a LayoutData< Vector<Box> >?
Answer: Because of the way IntVectSets are stored, this would be very slow.
The different components of the Vector<Box> contain indices of nodes on different faces of the box.
a_IVSV | object containing interior boundary nodes of a_boxes |
a_boxes | layout of CELL-centered boxes |
a_domain | CELL-centered physical domain containing a_boxes |
void interiorBoundaryNodes | ( | LayoutData< Vector< Box > > & | a_IVSV, |
const DisjointBoxLayout & | a_boxes, | ||
const ProblemDomain & | a_domain | ||
) |
Finds interior boundary nodes of a DisjointBoxLayout.
Returns a LayoutData containing, for each box in a_boxes, a Vector of IntVectSets that contain the indices of the nodes that lie on faces of the box but are not on the interface of a_boxes with the next coarser level.
Example: for two particular boxes, marked "me", in the four-grid layout below, the interior boundary nodes are those that are marked with "O". For the second box, the nodes marked "Y" are also interior boundary nodes if and only if the domain is periodic in the vertical direction and the grids extend to the top and bottom faces of the domain.
+-----+ +YY---+ | | | | | | | me | | | | | +---+OOO--+---+ +---+OOOOO+---+ | O | | | | | me O | | | | | O | | | | +---+OOOOOO+------+ +---+------+------+ | | | | | | | | | | | | +----------+ +----------+
The result a_IVSV is needed by copyInteriorNodes().
Question: Why not simply store the indices of all interior boundary nodes of a_boxes in a single IntVectSet, rather than a LayoutData< Vector<Box> >?
Answer: Because of the way IntVectSets are stored, this would be very slow.
The different components of the Vector<Box> contain indices of nodes on different faces of the box.
a_IVSV | object containing interior boundary nodes of a_boxes |
a_boxes | layout of CELL-centered boxes |
a_domain | CELL-centered physical domain containing a_boxes |
void interiorBoundaryNodes | ( | LayoutData< Vector< Box > > & | a_IVSV, |
const DisjointBoxLayout & | a_dest, | ||
const DisjointBoxLayout & | a_src, | ||
const Box & | a_domain | ||
) |
Finds interior boundary nodes of a DisjointBoxLayout.
Returns a LayoutData containing, for each destination box, a Vector of IntVectSets that together represent the nodes of the destination box that are also interior boundary nodes of the source boxes.
Specifically, if IBN(a_src) is the set of interior boundary nodes of a_src, then the Vector<Box> a_IVSV[dit()] holds the intersection of IBN(a_src) and the nodes surrounding a_dest[dit()].
The result a_IVSV is used in copyInteriorNodes().
a_IVSV | object containing interior boundary nodes of a_boxes |
a_dest | layout of CELL-centered destination boxes |
a_src | layout of CELL-centered source boxes |
a_domain | CELL-centered physical domain containing a_dest and a_src |
void interiorBoundaryNodes | ( | LayoutData< Vector< Box > > & | a_IVSV, |
const DisjointBoxLayout & | a_dest, | ||
const DisjointBoxLayout & | a_src, | ||
const ProblemDomain & | a_domain | ||
) |
Finds interior boundary nodes of a DisjointBoxLayout.
Returns a LayoutData containing, for each destination box, a Vector of IntVectSets that together represent the nodes of the destination box that are also interior boundary nodes of the source boxes.
Specifically, if IBN(a_src) is the set of interior boundary nodes of a_src, then the Vector<Box> a_IVSV[dit()] holds the intersection of IBN(a_src) and the nodes surrounding a_dest[dit()].
The result a_IVSV is used in copyInteriorNodes().
a_IVSV | object containing interior boundary nodes of a_boxes |
a_dest | layout of CELL-centered destination boxes |
a_src | layout of CELL-centered source boxes |
a_domain | CELL-centered physical domain containing a_dest and a_src |
void exteriorBoundaryNodes | ( | LayoutData< Vector< Box > > & | a_exterior, |
const LayoutData< Vector< Box > > & | a_interior, | ||
const DisjointBoxLayout & | a_boxes | ||
) |
Finds exterior boundary nodes of a DisjointBoxLayout.
Returns a LayoutData containing, for each box, the exterior boundary nodes of the box.
The exterior boundary nodes are the nodes on a level that are not interior nodes: they lie on the physical boundary and on the interface with the coarser level.
Example: for two particular boxes, marked "me", in the four-grid layout below, the exterior boundary nodes are those that are marked "O". For the second box, the nodes marked "Y" are also exterior boundary nodes, unless the domain is periodic in the vertical direction and the grids extend to the top and bottom faces of the domain.
+-----+ OYYOOOO | | O O | | O me O | | O O OOOOO--+--+---+ +---O--+--O---+ O | | | | | O me | | | | | O | | | | | +---O------O------+ +---+------+------+ | | | | | | | | | | | | +----------+ +----------+
The argument a_interior is obtained from
interiorBoundaryNodes(a_interior, a_boxes, a_domain)
where a_domain is the physical domain.
You don't need the physical domain a_domain as an argument to this function, even to get periodicities, because everything needed from a_domain is put into a_interior.
a_exterior | object containing exterior boundary nodes of a_boxes |
a_interior | object containing interior boundary nodes of a_boxes |
a_boxes | layout of CELL-centered boxes |
void copyInteriorNodes | ( | LevelData< NodeFArrayBox > & | a_dest, |
const LevelData< NodeFArrayBox > & | a_src, | ||
const LayoutData< Vector< Box > > & | a_IVSV | ||
) |
Copies data at interior nodes from one LevelData<NodeFArrayBox> to another.
Copies data from a_src to a_dest, over the interior nodes of a_src. They need not have the same layout.
The argument a_IVSV is obtained from
interiorBoundaryNodes(a_IVSV, a_dest.boxLayout(), a_src.boxLayout(), a_domain)
where a_domain is the physical domain.
If a_dest and a_src have the same layout, then we may obtain a_IVSV more efficiently from
interiorBoundaryNodes(a_IVSV, a_src.boxLayout(), a_domain)
.
Do not use this shorter form if a_dest and a_src have different layouts.
Example: if a_src has the four-grid layout on the left below, then the nodes from which data are copied to a_dest are marked with "X" and "O" on the right below. (The distinction between "X" and "O" is that nodes marked "O" are on interior boundaries of the layout.) Data are copied from the nodes marked "Y" if and only if the domain is periodic in the vertical direction and the grids extend to the top and bottom faces of the domain.
+-----+ +YY---+ | | |OOOOO| | | |OOOOO| | | |OOOOO| +---+--+--+---+ +---+XXXXX+---+ | | | |OOOOOOXOOOOOO| | | | |OOOOOOXOOOOOO| | | | |OOOOOOXOOOOOO| +---+------+------+ +---+XXXXXX+------+ | | |OOOOOOOOOO| | | |OOOOOOOOOO| | | |OOOOOOOOOO| +----------+ +--------YY+
Both pictures represent the layout of a_src. The layout of a_dest may be completely different from that of a_src.
Data at nodes in a_dest that are not interior boundary nodes of a_src remain unchanged by this function.
a_dest | destination data |
a_src | source data |
a_IVSV | object containing interior boundary nodes of source layout that are also nodes of destination layout |
void zeroBoundaryNodes | ( | BoxLayoutData< NodeFArrayBox > & | a_dest, |
const LayoutData< Vector< Box > > & | a_IVSV | ||
) |
Sets data to zero on specified boundary nodes.
Sets a_dest to zero on the nodes in a_IVSV.
Specifically, a_dest[dit()] is set to zero on the nodes in a_IVSV[dit()].
We usually call this function with a_IVSV representing the exterior boundary nodes of a_dest. These are obtained with the sequence of calls:
interiorBoundaryNodes(a_IVSVint, a_dest.boxLayout(), a_domain)
where a_domain is the physical domain, and
exteriorBoundaryNodes(a_IVSV, a_IVSVint, a_dest.boxLayout())
.
a_dest | the data |
a_IVSV | object containing boundary nodes |
void removeBoxesFromBox | ( | Vector< Box > & | a_boxes, |
const Vector< Box > & | a_remove, | ||
const Box & | a_base | ||
) |
void exteriorAndInteriorNodes | ( | Vector< LayoutData< Vector< Box > > * > & | a_exterior, |
Vector< LayoutData< Vector< Box > > * > & | a_intFinerCoarsened, | ||
const Vector< DisjointBoxLayout > & | a_layouts, | ||
const Vector< ProblemDomain > & | a_domain, | ||
const Vector< int > & | a_nRefFine | ||
) |
a_exterior | object containing exterior boundary nodes of a_boxes at each level |
a_intFinerCoarsened | object containing interior boundary nodes of coarsened a_boxes at each level except finest |
a_layouts | layouts of CELL-centered boxes |
a_domain | domain of each level |
a_nRefFine | refinement ratio between levels |
void exteriorAndInteriorNodes | ( | Vector< LayoutData< Vector< IntVectSet > > * > & | a_exterior, |
Vector< LayoutData< Vector< IntVectSet > > * > & | a_intFinerCoarsened, | ||
const Vector< DisjointBoxLayout > & | a_layouts, | ||
const Vector< ProblemDomain > & | a_domain, | ||
const Vector< int > & | a_nRefFine | ||
) |
a_exterior | object containing exterior boundary nodes of a_boxes at each level |
a_intFinerCoarsened | object containing interior boundary nodes of coarsened a_boxes at each level except finest |
a_layouts | layouts of CELL-centered boxes |
a_domain | domain of each level |
a_nRefFine | refinement ratio between levels |
void getMaskInteriorNodes | ( | LevelData< NodeFArrayBox > & | a_mask, |
const DisjointBoxLayout & | a_dest, | ||
const DisjointBoxLayout * | a_srcPtr, | ||
const Box & | a_domain, | ||
int | a_onoff = 1 |
||
) |
Returns a mask on interior nodes of a DisjointBoxLayout.
Returns a LevelData on nodes of a_dest that is a_onoff on interior nodes of *a_srcPtr (or of a_dest if a_srcPtr is null); 1 - a_onoff on all other nodes.
a_mask | mask built on a_dest, representing interior nodes of a_src. |
a_dest | layout of CELL-centered destination boxes |
a_srcPtr | layout of CELL-centered source boxes |
a_domain | CELL-centered physical domain containing a_dest and a_src |
a_onoff | 1 or 0, for interior nodes |
void getMaskInteriorNodes | ( | LevelData< NodeFArrayBox > & | a_mask, |
const DisjointBoxLayout & | a_dest, | ||
const DisjointBoxLayout * | a_srcPtr, | ||
const ProblemDomain & | a_domain, | ||
int | a_onoff = 1 |
||
) |
Returns a mask on interior nodes of a DisjointBoxLayout.
Returns a LevelData on nodes of a_dest that is a_onoff on interior nodes of *a_srcPtr (or of a_dest if a_srcPtr is null); 1 - a_onoff on all other nodes.
a_mask | mask built on a_dest, representing interior boundary nodes of a_src. |
a_dest | layout of CELL-centered destination boxes |
a_srcPtr | layout of CELL-centered source boxes |
a_domain | CELL-centered physical domain containing a_dest and a_src |
a_onoff | 1 or 0, for interior nodes |
void getMaskInteriorNodes | ( | LevelData< NodeFArrayBox > & | a_mask, |
const DisjointBoxLayout & | a_dest, | ||
const Box & | a_domain | ||
) |
Returns a mask on interior nodes of a DisjointBoxLayout.
Returns a LevelData on nodes of a_dest that is
a_mask | mask built on a_dest, representing interior nodes of a_dest. |
a_dest | layout of CELL-centered destination boxes |
a_domain | CELL-centered physical domain containing a_dest |
void getMaskValidNodes | ( | LevelData< NodeFArrayBox > & | a_mask, |
const DisjointBoxLayout & | a_layout, | ||
const DisjointBoxLayout * | a_finerCoarsenedPtr, | ||
const ProblemDomain & | a_domain | ||
) |
Returns a mask on valid nodes on a level.
Returns a LevelData on a_layout that is
a_mask | mask built on a_dest, representing valid nodes of a_layout. |
a_layout | layout of CELL-centered boxes on this level |
a_finerCoarsenedPtr | layout of CELL-centered coarsened boxes on finer level |
a_domain | CELL-centered physical domain containing a_layout and a_finerCoarsened |
void getMaskValidNodes | ( | LevelData< NodeFArrayBox > & | a_mask, |
const DisjointBoxLayout & | a_layout, | ||
const DisjointBoxLayout * | a_finerCoarsenedPtr, | ||
const Box & | a_domain | ||
) |
Returns a mask on valid nodes on a level.
Returns a LevelData on a_layout that is
a_mask | mask built on a_dest, representing valid nodes of a_layout. |
a_layout | layout of CELL-centered boxes on this level |
a_finerCoarsenedPtr | layout of CELL-centered coarsened boxes on finer level |
a_domain | CELL-centered physical domain containing a_layout and a_finerCoarsened |
void getMaskValidNodes | ( | Vector< LevelData< NodeFArrayBox > * > & | a_masks, |
const Vector< DisjointBoxLayout > & | a_layouts, | ||
const Vector< ProblemDomain > & | a_domain, | ||
const Vector< int > & | a_nRefFine | ||
) |
a_masks | at each level, a mask for valid nodes |
a_layouts | layouts of CELL-centered boxes |
a_domain | domain of each level |
a_nRefFine | refinement ratio between levels |
Return the NODE-centered layout of NODEs surrounding a CELL-centered layout.
Return the CELL-centered layout of CELLs enclosed by a NODE-centered layout.