diff options
Diffstat (limited to 'src/AMRHierLib/AMRGridCell.icc')
-rw-r--r-- | src/AMRHierLib/AMRGridCell.icc | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/AMRHierLib/AMRGridCell.icc b/src/AMRHierLib/AMRGridCell.icc new file mode 100644 index 0000000..4365728 --- /dev/null +++ b/src/AMRHierLib/AMRGridCell.icc @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// +// Project: AMR Visualization +// Module: $RCSfile$ +// Language: C++ +// Date: $Date$ +// Author: $Author$ +// Version: $Revision$ +// +//------------------------------------------------------------------------------ + +inline Vertex AMRGridCell::pos() const +{ + return Vertex( + mGrid->origin[0] + (mIdx[0]+0.5) * mGrid->delta[0], + mGrid->origin[1] + (mIdx[1]+0.5) * mGrid->delta[1], + mGrid->origin[2] + (mIdx[2]+0.5) * mGrid->delta[2] + ); +} + +inline double AMRGridCell::val() const +{ + return mGrid->getValue(mIdx[0], mIdx[1], mIdx[2]); +} + +inline AMRHierarchy::GridId AMRGridCell::containingId() const +{ + return mGrid->index(); +} + +inline AMRHierarchy::GridId AMRGridCell::refiningId() const +{ + if (mRefiningGridId == AMRGrid::Unknown) { + mRefiningGridId = mGrid->getCellRefiningGridId(mIdx); + } + return mRefiningGridId; +} + +inline AMRGrid* AMRGridCell::grid() const +{ + return mGrid; +} + +inline int AMRGridCell::idx(AxisType axis) const +{ + return mIdx[axis]; +} |