|
IBAMR
IBAMR version 0.19.
|
#include <PatchCellDataNormOpsReal.h>

Public Member Functions | |
| PatchCellDataNormOpsReal () | |
| virtual | ~PatchCellDataNormOpsReal () |
| int | numberOfEntries (const tbox::Pointer< pdat::CellData< DIM, TYPE > > &data, const hier::Box< DIM > &box) const |
| double | sumControlVolumes (const tbox::Pointer< pdat::CellData< DIM, TYPE > > &data, const tbox::Pointer< pdat::CellData< DIM, double > > &cvol, const hier::Box< DIM > &box) const |
| void | abs (tbox::Pointer< pdat::CellData< DIM, TYPE > > &dst, const tbox::Pointer< pdat::CellData< DIM, TYPE > > &src, const hier::Box< DIM > &box) const |
| double | L1Norm (const tbox::Pointer< pdat::CellData< DIM, TYPE > > &data, const hier::Box< DIM > &box, const tbox::Pointer< pdat::CellData< DIM, double > > cvol=NULL) const |
| double | L2Norm (const tbox::Pointer< pdat::CellData< DIM, TYPE > > &data, const hier::Box< DIM > &box, const tbox::Pointer< pdat::CellData< DIM, double > > cvol=NULL) const |
| double | weightedL2Norm (const tbox::Pointer< pdat::CellData< DIM, TYPE > > &data, const tbox::Pointer< pdat::CellData< DIM, TYPE > > &weight, const hier::Box< DIM > &box, const tbox::Pointer< pdat::CellData< DIM, double > > cvol=NULL) const |
| double | RMSNorm (const tbox::Pointer< pdat::CellData< DIM, TYPE > > &data, const hier::Box< DIM > &box, const tbox::Pointer< pdat::CellData< DIM, double > > cvol=NULL) const |
| double | weightedRMSNorm (const tbox::Pointer< pdat::CellData< DIM, TYPE > > &data, const tbox::Pointer< pdat::CellData< DIM, TYPE > > &weight, const hier::Box< DIM > &box, const tbox::Pointer< pdat::CellData< DIM, double > > cvol=NULL) const |
| double | maxNorm (const tbox::Pointer< pdat::CellData< DIM, TYPE > > &data, const hier::Box< DIM > &box, const tbox::Pointer< pdat::CellData< DIM, double > > cvol=((pdat::CellData< DIM, double > *) NULL)) const |
| TYPE | dot (const tbox::Pointer< pdat::CellData< DIM, TYPE > > &data1, const tbox::Pointer< pdat::CellData< DIM, TYPE > > &data2, const hier::Box< DIM > &box, const tbox::Pointer< pdat::CellData< DIM, double > > cvol=NULL) const |
| TYPE | integral (const tbox::Pointer< pdat::CellData< DIM, TYPE > > &data, const hier::Box< DIM > &box, const tbox::Pointer< pdat::CellData< DIM, double > > vol) const |
Private Member Functions | |
| PatchCellDataNormOpsReal (const PatchCellDataNormOpsReal< DIM, TYPE > &) | |
| void | operator= (const PatchCellDataNormOpsReal< DIM, TYPE > &) |
Private Attributes | |
| ArrayDataNormOpsReal< DIM, TYPE > | d_array_ops |
Class PatchCellDataNormOpsReal<DIM> provides a collection of common norm operations that may be applied to real (double or float) numerical cell-centered patch data. The primary intent of this class is to define part of the interface for an PatchCellDataOpsReal<DIM> object which provides access operations that may be used to manipulate cell-centered patch data. Each member function accepts a box argument indicating the region of index space on which the operation should be performed. The operation will be performed on the intersection of this box and those boxes corresponding to the patch data objects. Also, each operation allows an additional cell-centered patch data object to be used to represent a control volume that weights the contribution of each data entry in the given norm calculation. Note that the control volume patch data must be of type double and have cell-centered geometry (i.e., the same as the data itself). The use of control volumes is important when these operations are used in vector kernels where the data resides over multiple levels of spatial resolution in an AMR hierarchy. If the control volume is not given in the function call, it will be ignored in the calculation. Also, note that the depth of the control volume patch data object must be either 1 or be equal to the depth of the other data objects.
These operations typically apply only to the numerical standard built-in types, such as double, float, and the complex type (which may or may not be a built-in type depending on the C++ compiler). This templated class should only be used to instantiate objects with double or float as the template parameter. Note that a similar set of norm operations is implemented for complex patch data in the class PatchCellDataNormOpsComplex<DIM>.
| SAMRAI::math::PatchCellDataNormOpsReal< DIM, TYPE >::PatchCellDataNormOpsReal | ( | ) |
Empty constructor and destructor.
|
virtual |
|
private |
| int SAMRAI::math::PatchCellDataNormOpsReal< DIM, TYPE >::numberOfEntries | ( | const tbox::Pointer< pdat::CellData< DIM, TYPE > > & | data, |
| const hier::Box< DIM > & | box | ||
| ) | const |
Return the number of data values for the cell-centered data object in the given box.
| double SAMRAI::math::PatchCellDataNormOpsReal< DIM, TYPE >::sumControlVolumes | ( | const tbox::Pointer< pdat::CellData< DIM, TYPE > > & | data, |
| const tbox::Pointer< pdat::CellData< DIM, double > > & | cvol, | ||
| const hier::Box< DIM > & | box | ||
| ) | const |
Return sum of control volume entries for the cell-centered data object.
| void SAMRAI::math::PatchCellDataNormOpsReal< DIM, TYPE >::abs | ( | tbox::Pointer< pdat::CellData< DIM, TYPE > > & | dst, |
| const tbox::Pointer< pdat::CellData< DIM, TYPE > > & | src, | ||
| const hier::Box< DIM > & | box | ||
| ) | const |
Set destination component to absolute value of source component. That is, each destination entry is set to \(d_i = \| s_i \|\).
| double SAMRAI::math::PatchCellDataNormOpsReal< DIM, TYPE >::L1Norm | ( | const tbox::Pointer< pdat::CellData< DIM, TYPE > > & | data, |
| const hier::Box< DIM > & | box, | ||
| const tbox::Pointer< pdat::CellData< DIM, double > > | cvol = NULL |
||
| ) | const |
Return discrete \(L_1\)-norm of the data using the control volume to weight the contribution of each data entry to the sum. That is, the return value is the sum \(\sum_i ( \| data_i \| cvol_i )\). If the control volume is NULL, the return value is \(\sum_i ( \| data_i \| )\).
| double SAMRAI::math::PatchCellDataNormOpsReal< DIM, TYPE >::L2Norm | ( | const tbox::Pointer< pdat::CellData< DIM, TYPE > > & | data, |
| const hier::Box< DIM > & | box, | ||
| const tbox::Pointer< pdat::CellData< DIM, double > > | cvol = NULL |
||
| ) | const |
Return discrete \(L_2\)-norm of the data using the control volume to weight the contribution of each data entry to the sum. That is, the return value is the sum \(\sqrt{ \sum_i ( (data_i)^2 cvol_i ) }\). If the control volume is NULL, the return value is \(\sqrt{ \sum_i ( (data_i)^2 cvol_i ) }\).
| double SAMRAI::math::PatchCellDataNormOpsReal< DIM, TYPE >::weightedL2Norm | ( | const tbox::Pointer< pdat::CellData< DIM, TYPE > > & | data, |
| const tbox::Pointer< pdat::CellData< DIM, TYPE > > & | weight, | ||
| const hier::Box< DIM > & | box, | ||
| const tbox::Pointer< pdat::CellData< DIM, double > > | cvol = NULL |
||
| ) | const |
Return discrete weighted \(L_2\)-norm of the data using the control volume to weight the contribution of the data and weight entries to the sum. That is, the return value is the sum \(\sqrt{ \sum_i ( (data_i * weight_i)^2 cvol_i ) }\). If the control volume is NULL, the return value is \(\sqrt{ \sum_i ( (data_i * weight_i)^2 ) }\).
| double SAMRAI::math::PatchCellDataNormOpsReal< DIM, TYPE >::RMSNorm | ( | const tbox::Pointer< pdat::CellData< DIM, TYPE > > & | data, |
| const hier::Box< DIM > & | box, | ||
| const tbox::Pointer< pdat::CellData< DIM, double > > | cvol = NULL |
||
| ) | const |
Return discrete root mean squared norm of the data. If the control volume is not NULL, the return value is the \(L_2\)-norm divided by the square root of the sum of the control volumes. Otherwise, the return value is the \(L_2\)-norm divided by the square root of the number of data entries.
| double SAMRAI::math::PatchCellDataNormOpsReal< DIM, TYPE >::weightedRMSNorm | ( | const tbox::Pointer< pdat::CellData< DIM, TYPE > > & | data, |
| const tbox::Pointer< pdat::CellData< DIM, TYPE > > & | weight, | ||
| const hier::Box< DIM > & | box, | ||
| const tbox::Pointer< pdat::CellData< DIM, double > > | cvol = NULL |
||
| ) | const |
Return discrete weighted root mean squared norm of the data. If the control volume is not NULL, the return value is the weighted \(L_2\)-norm divided by the square root of the sum of the control volumes. Otherwise, the return value is the weighted \(L_2\)-norm divided by the square root of the number of data entries.
| double SAMRAI::math::PatchCellDataNormOpsReal< DIM, TYPE >::maxNorm | ( | const tbox::Pointer< pdat::CellData< DIM, TYPE > > & | data, |
| const hier::Box< DIM > & | box, | ||
| const tbox::Pointer< pdat::CellData< DIM, double > > | cvol = ((pdat::CellData< DIM, double > *) NULL) |
||
| ) | const |
Return the \(\max\)-norm of the data using the control volume to weight the contribution of each data entry to the maximum. That is, the return value is \(\max_i ( \| data_i \| )\), where the max is over the data elements where \(cvol_i > 0\). If the control volume is NULL, it is ignored during the computation of the maximum.
| TYPE SAMRAI::math::PatchCellDataNormOpsReal< DIM, TYPE >::dot | ( | const tbox::Pointer< pdat::CellData< DIM, TYPE > > & | data1, |
| const tbox::Pointer< pdat::CellData< DIM, TYPE > > & | data2, | ||
| const hier::Box< DIM > & | box, | ||
| const tbox::Pointer< pdat::CellData< DIM, double > > | cvol = NULL |
||
| ) | const |
Return the dot product of the two data arrays using the control volume to weight the contribution of each product to the sum. That is, the return value is the sum \(\sum_i ( data1_i * data2_i * cvol_i )\). If the control volume is NULL, it is ignored during the summation.
| TYPE SAMRAI::math::PatchCellDataNormOpsReal< DIM, TYPE >::integral | ( | const tbox::Pointer< pdat::CellData< DIM, TYPE > > & | data, |
| const hier::Box< DIM > & | box, | ||
| const tbox::Pointer< pdat::CellData< DIM, double > > | vol | ||
| ) | const |
Return the integral of the function represented by the data array. The return value is the sum \(\sum_i ( data_i * vol_i )\).
|
private |
|
private |
1.8.17