Skip to content

Commit

Permalink
Making m_info and m_info_device in CartGrid private
Browse files Browse the repository at this point in the history
  • Loading branch information
itopcuoglu committed Dec 31, 2024
1 parent 591bff5 commit ee3b2e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/CartGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ class CartGrid
bool own_data_ptrs{true};
bool own_amr_mesh_info{false};

TIOGA::AMRMeshInfo* m_info{nullptr};
TIOGA::AMRMeshInfo* m_info_device{nullptr};

int* global_id{nullptr};
int* level_num{nullptr};
int* proc_id{nullptr};
int* local_id{nullptr};
int myid{0};

public:
TIOGA::AMRMeshInfo* m_info{nullptr};
TIOGA::AMRMeshInfo* m_info_device{nullptr};

int* ilo{nullptr};

Check warning on line 51 in src/CartGrid.h

View workflow job for this annotation

GitHub Actions / Lint-clang-tidy

member variable 'ilo' has public visibility [misc-non-private-member-variables-in-classes]
int* ihi{nullptr};

Check warning on line 52 in src/CartGrid.h

View workflow job for this annotation

GitHub Actions / Lint-clang-tidy

member variable 'ihi' has public visibility [misc-non-private-member-variables-in-classes]
int* dims{nullptr};

Check warning on line 53 in src/CartGrid.h

View workflow job for this annotation

GitHub Actions / Lint-clang-tidy

member variable 'dims' has public visibility [misc-non-private-member-variables-in-classes]
Expand All @@ -71,6 +71,8 @@ class CartGrid
}

void create_mesh_info();

TIOGA::AMRMeshInfo* get_mesh_info() { return m_info; }
int get_proc_id(int index) { return proc_id[index]; }
int get_local_id(int index) { return local_id[index]; }
void set_myid(int rank_id) { myid = rank_id; }
Expand Down
6 changes: 3 additions & 3 deletions src/tioga.C
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ void tioga::register_amr_grid(TIOGA::AMRMeshInfo* minfo)

void tioga::register_amr_solution()
{
auto* minfo = cg->m_info;
auto* minfo = cg->get_mesh_info();
for (int ic = 0; ic < ncart; ++ic) {
cb[ic].registerSolution(ic, minfo);
}
Expand Down Expand Up @@ -1469,7 +1469,7 @@ void tioga::preprocess_amr_data(int root)

// Let all processes know the number of global AMR patches so that they can
// create buffers for MPI broadcast.
int ngrids_global = (root == myid) ? cg->m_info->ngrids_global : 0;
int ngrids_global = (root == myid) ? cg->get_mesh_info()->ngrids_global : 0;
MPI_Bcast(&ngrids_global, 1, MPI_INT, root, scomm);

// Buffers that will be used to perform MPI communications. The data layout
Expand All @@ -1482,7 +1482,7 @@ void tioga::preprocess_amr_data(int root)
// On root MPI process for the AMR solver, populate the buffer for broadcast
// to all processes.
if (root == myid) {
const auto* ainfo = cg->m_info;
const auto* ainfo = cg->get_mesh_info();
for (int pp = 0; pp < ngrids_global; ++pp) {
int const i3 = pp * 3;
int const i6 = pp * 6;
Expand Down

0 comments on commit ee3b2e7

Please sign in to comment.