/** * @file grid_properties.cpp * @author Julian Iseringhausen * @date Mon Apr 18 12:54:05 2011 * * @brief VMG::GlobalIndices, VMG::LocalIndices and VMG::SpatialExtent * */ #ifdef HAVE_CONFIG_H #include #endif #include "grid/grid_properties.hpp" using namespace VMG; GlobalIndices::GlobalIndices() { begin_finest = end_finest = size_finest = 0; begin_local = end_local = size_local = 0; size_global = 0; boundary = EmptyGrid; } LocalIndices::LocalIndices() { size = 0; sizeTotal = 0; begin = 0; end = 0; haloBegin1 = 0; haloEnd1 = 0; haloBegin2 = 0; haloEnd2 = 0; boundaryBegin1 = 0; boundaryEnd1 = 0; boundaryBegin2 = 0; boundaryEnd2 = 0; } SpatialExtent::SpatialExtent() { size = 0.0; size_factor = 0; begin = 0.0; end = 0.0; meshWidth = 0.0; } Index LocalIndices::HasHalo1() const { Index has_halo; for (int i=0; i<3; ++i) has_halo[i] = (haloEnd1[i]-haloBegin1[i] > 0 ? 1 : 0); return has_halo; } Index LocalIndices::HasHalo2() const { Index has_halo; for (int i=0; i<3; ++i) has_halo[i] = (haloEnd2[i]-haloBegin2[i] > 0 ? 1 : 0); return has_halo; } Index LocalIndices::HasBoundary1() const { Index has_bound; for (int i=0; i<3; ++i) has_bound[i] = (boundaryEnd1[i]-boundaryBegin1[i] > 0 ? 1 : 0); return has_bound; } Index LocalIndices::HasBoundary2() const { Index has_bound; for (int i=0; i<3; ++i) has_bound[i] = (boundaryEnd2[i]-boundaryBegin2[i] > 0 ? 1 : 0); return has_bound; }