|
| AMRData () |
| Trivial Constructor. More...
|
|
| AMRData (AMRGrid &a_grid, Point a_ghost) |
| Grid Constructor. More...
|
|
| AMRData (std::vector< std::shared_ptr< LevelBoxData< T, C, MEM, CTR >>> a_data) |
| Alias Constructor. More...
|
|
void | define (AMRGrid &a_grid, Point a_ghost) |
| Define. More...
|
|
void | define (std::vector< std::shared_ptr< LevelBoxData< T, C, MEM, CTR >>> a_data) |
| Alias Define. More...
|
|
void | regrid (AMRGrid &a_newgrid, int a_lbase, int a_order) |
| Reinitialize grids and data due to regridding. More...
|
|
const AMRGrid & | grid () const |
| Grid Access (Const) More...
|
|
AMRGrid & | grid () |
| Grid Access (Non-Const) More...
|
|
const LevelBoxData< T, C, MEM, CTR > & | operator[] (unsigned int a_level) const |
| Level Data Access (Const) More...
|
|
LevelBoxData< T, C, MEM, CTR > & | operator[] (unsigned int a_level) |
| Level Data Access (Non-Const) More...
|
|
void | setToZero () |
| Zero Initialize. More...
|
|
template<typename Func , typename... Srcs> |
void | initialize (T a_dx0, Func &a_func, Srcs... a_srcs) |
| Function Initialization. More...
|
|
template<typename Func , typename... Srcs> |
void | initialize (const Array< T, DIM > a_dx0, Func &a_func, Srcs... a_srcs) |
|
void | averageDown () |
| Function Initialization (With Convolution) More...
|
|
void | increment (AMRData< T, C, MEM, CTR > &a_data, T a_scale=1.0) |
| Average Down Single Level. More...
|
|
void | operator*= (T a_value) |
| Multiply by a Constant. More...
|
|
void | operator+= (T a_value) |
| Increment by a Constant. More...
|
|
T | integrate (T a_cdx, unsigned int a_c=0) |
| Compute Integral. More...
|
|
T | integrate (const Array< T, DIM > &a_cdx, unsigned int a_c=0) |
|
T | integrateAbs (T a_cdx, unsigned int a_c=0) |
| Compute Integral of Absolute Value. More...
|
|
T | integrateAbs (const Array< T, DIM > &a_cdx, unsigned int a_c=0) |
|
T | absMax (unsigned int a_c=0) |
| Compute Max Norm. More...
|
|
void | exchange () |
| Exchange. More...
|
|
void | copyTo (AMRData< T, C, MEM, CTR > &a_rhs) |
| Copy To. More...
|
|
int | numLevels () const |
| Get Number of Levels. More...
|
|
int | maxLevels () const |
| Get Max Levels. More...
|
|
template<typename T, unsigned int C = 1, MemType MEM = MEMTYPE_DEFAULT, Centering CTR = PR_CELL>
class Proto::AMRData< T, C, MEM, CTR >
AMR Data Hierarchy.
A nested hierarchy of data defined on an AMRGrid. Each level is stored as a LevelBoxData<T, C, MEM, CTR>.
- Template Parameters
-
T | Type of data in array (int, double, etc.) |
C | Number of components |
MEM | Proto::MemType. HOST or DEVICE. |
CTR | Centering of underlying LevelBoxData |
template<typename T, unsigned int C = 1, MemType MEM = MEMTYPE_DEFAULT, Centering CTR = PR_CELL>
template<typename T , unsigned int C, MemType MEM, Centering CTR>
Define.
Lazy construction. If *this is not yet defined, data holders are created based on the inputs. TODO: If *this was previously defined, redefine it based on the new grid TODO: Determine how exiting data should be moved / reinitialized
Referenced by Proto::AMRData< T, C, MEM, CTR >::AMRData().
template<typename T , unsigned int C, MemType MEM, Centering CTR>
Reinitialize grids and data due to regridding.
For all levels starting at level a_lbase + 1, initialize new data holders. (1) Define new DisjointBoxLayout, LevelBoxData. (2) Interpolate / initialize from next coarser level. (3) Copy on intersection from ald data at this level.
template<typename T , unsigned int C, MemType MEM, Centering CTR>
template<typename Func , typename... Srcs>
void Proto::AMRData< T, C, MEM, CTR >::initialize |
( |
T |
a_dx0, |
|
|
Func & |
a_func, |
|
|
Srcs... |
a_srcs |
|
) |
| |
|
inline |
Function Initialization.
Initializes *this using a function with a signature similar to that used by Proto::forallInPlace_p. The input function must have the signature:
void a_func(Point& a_point, Var<T, C, MEM>& a_thisData, Array<T, DIM> a_dx, ... )
Unlike Proto::forall and its variants, this function cannot manage additional data holders (e.g. Srcs should not include a LevelBoxData or similar complex object). Unlike LevelBoxData::initialize(...), valid input functions must also include a double argument representing the grid spacing, even if it is not used by the function itself. Elements of a_srcs should be plain-old-data such as single values, Points, or Boxes.
- Parameters
-
dx0 | Isotropic grid spacing on the coarsest level |
func | Initialization function |
srcs | Variadic arguments after the grid spacing in func |
Referenced by Proto::AMRData< T, C, MEM, CTR >::grid().
template<typename T , unsigned int C, MemType MEM, Centering CTR>
Function Initialization (With Convolution)
Initialize *this as in initialize
and then convolve the result using a 4th-order convolution stencil to yield a cell-averaged field useful for finite volume operations. TODO: Do the correct thing here if CTR != PR_CELL
- Parameters
-
dx0 | Isotropic grid spacing on the coarsest level |
func | Initialization function |
srcs | Variadic arguments after the grid spacing in funcAverage Down All Levels Synchronizes data between levels by recursively replacing coarse level data with the geometric average of overlying fine data where it exists. |
TODO: Do the correct thing here if CTR != PR_CELL TODO: Remove this from the AMRData API and make standalone(?)
Referenced by Proto::AMRData< T, C, MEM, CTR >::grid().
template<typename T , unsigned int C, MemType MEM, Centering CTR>
Average Down Single Level.
Replace the data on a specified level with the geometric average of the overlying fine data should any exist. If the specified level is the finest in the hierarchy, this function is a null-op. There are more than one level finer than the specified level, the average down is NOT computed recursively as in averageDown()
. TODO: Do the correct thing here if CTR != PR_CELL TODO: Remove this from the AMRData API and make standalone(?)
- Parameters
-
crseLevel | The level onto which finer level data will be averaged. Interpolate Fine Boundaries Populate coarse-fine boundary ghost cells with data interpolated from the next coarser level for all levels > 0. |
TODO: figure out how this should be defined for CTR != 0 (if at all) TODO: Remove this from the AMRData API and make standalone
- Parameters
-
a_order | Order of interpolation. Valid values: 3, 5 (default 5)Interpolate Fine Boundaries Populate coarse-fine boundary ghost cells with data interpolated from the next coarser level for the specified fine level ( > 0 ) |
TODO: figure out how this should be defined for CTR != 0 (if at all) TODO: Remove this from the AMRData API and make standalone
- Parameters
-
a_order | Order of interpolation. Valid values: 3, 5 (default 5)Increment Add a scaled multiple of another AMRData to this. This function will fail if the two AMRData do not share an AMRGrid configuration. TODO: Implement += and -= operators for completeness |
data | Another AMRData with the same AMRGrid configuration as *this |
scale | Optional scaling for the right-hand side data |
template<typename T , unsigned int C, MemType MEM, Centering CTR>
T Proto::AMRData< T, C, MEM, CTR >::integrateAbs |
( |
T |
a_cdx, |
|
|
unsigned int |
a_c = 0 |
|
) |
| |
|
inline |
Compute Integral of Absolute Value.
Compute the discrete integral over all valid data. TODO: Right now this is just the integral over level 0. This is the correct thing to do so long as averageDown has been called prior.
- Parameters
-
cdx | Coarsest grid spacing (Level 0) |
template<typename T, unsigned int C = 1, MemType MEM = MEMTYPE_DEFAULT, Centering CTR = PR_CELL>