diff --git a/src/CartBlock.C b/src/CartBlock.C index 90149c4..766f245 100644 --- a/src/CartBlock.C +++ b/src/CartBlock.C @@ -171,10 +171,11 @@ void CartBlock::preprocess(CartGrid* cg) for (int n = 0; n < 3; n++) { dx[n] = cg->dx[(3 * global_id) + n]; } - dims[0] = cg->ihi[static_cast(3 * global_id)] - - cg->ilo[static_cast(3 * global_id)] + 1; - dims[1] = cg->ihi[(3 * global_id) + 1] - cg->ilo[(3 * global_id) + 1] + 1; - dims[2] = cg->ihi[(3 * global_id) + 2] - cg->ilo[(3 * global_id) + 2] + 1; + dims[0] = cg->get_ihi((3 * global_id)) - cg->get_ilo((3 * global_id)) + 1; + dims[1] = + cg->get_ihi((3 * global_id) + 1) - cg->get_ilo((3 * global_id) + 1) + 1; + dims[2] = + cg->get_ihi((3 * global_id) + 2) - cg->get_ilo((3 * global_id) + 2) + 1; nf = cg->nf; myid = cg->get_myid(); donor_frac = cg->donor_frac; diff --git a/src/CartGrid.h b/src/CartGrid.h index 4d081c3..3a77ae8 100644 --- a/src/CartGrid.h +++ b/src/CartGrid.h @@ -46,10 +46,10 @@ class CartGrid int* proc_id{nullptr}; int* local_id{nullptr}; int myid{0}; - -public: int* ilo{nullptr}; int* ihi{nullptr}; + +public: int* dims{nullptr}; int nf{0}; double* xlo{nullptr}; @@ -77,6 +77,8 @@ class CartGrid int get_local_id(int index) { return local_id[index]; } void set_myid(int rank_id) { myid = rank_id; } int get_myid() { return myid; } + int get_ilo(int index) { return ilo[index]; } + int get_ihi(int index) { return ihi[index]; } }; #endif /* CARTGRID_H */