aboutsummaryrefslogtreecommitdiff
path: root/src/AMRHierLib/AMRGridCell.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/AMRHierLib/AMRGridCell.cc')
-rw-r--r--src/AMRHierLib/AMRGridCell.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/AMRHierLib/AMRGridCell.cc b/src/AMRHierLib/AMRGridCell.cc
new file mode 100644
index 0000000..6d6cdf1
--- /dev/null
+++ b/src/AMRHierLib/AMRGridCell.cc
@@ -0,0 +1,32 @@
+//------------------------------------------------------------------------------
+//
+// Project: AMR Visualization
+// Module: $RCSfile$
+// Language: C++
+// Date: $Date$
+// Author: $Author$
+// Version: $Revision$
+//
+//------------------------------------------------------------------------------
+
+#include <AMRGridCell.hh>
+
+AMRGridCell::AMRGridCell(AMRGrid *g, int i, int j, int k, int id) : mGrid(g), mRefiningGridId(id)
+{
+ mIdx[0] = i;
+ mIdx[1] = j;
+ mIdx[2] = k;
+ assert(0<=i && i<mGrid->dims[0]);
+ assert(0<=j && j<mGrid->dims[1]);
+ assert(0<=k && k<mGrid->dims[2]);
+}
+
+AMRGridCell::AMRGridCell(AMRGrid *g, int i[3], int id) : mGrid(g), mRefiningGridId(id)
+{
+ mIdx[0] = i[0];
+ mIdx[1] = i[1];
+ mIdx[2] = i[2];
+ assert(0<=i[0] && i[0]<mGrid->dims[0]);
+ assert(0<=i[1] && i[1]<mGrid->dims[1]);
+ assert(0<=i[2] && i[2]<mGrid->dims[2]);
+}