Skip to content

Commit

Permalink
fixup: use global bounds for profile output
Browse files Browse the repository at this point in the history
  • Loading branch information
streeve committed May 29, 2024
1 parent 3426504 commit 9aa62dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CabanaPD_DisplacementProfile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ void createOutputProfile( MPI_Comm comm, const int num_cell,
auto dims = getDim( profile_dim );
double dx1 = particles.dx[dims[0]] / 2.0;
double dx2 = particles.dx[dims[1]] / 2.0;
double center1 = particles.local_mesh_lo[dims[0]] +
double center1 = particles.global_mesh_lo[dims[0]] +
particles.global_mesh_ext[dims[0]] / 2.0;
double center2 = particles.local_mesh_lo[dims[1]] +
double center2 = particles.global_mesh_lo[dims[1]] +
particles.global_mesh_ext[dims[1]] / 2.0;

auto x = particles.sliceReferencePosition();
Expand Down
6 changes: 6 additions & 0 deletions src/CabanaPD_Particles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ class Particles<MemorySpace, PMB, Dimension>

// Simulation total domain.
std::array<double, dim> global_mesh_ext;
std::array<double, dim> global_mesh_lo;
std::array<double, dim> global_mesh_hi;

// Simulation sub domain (single MPI rank).
std::array<double, dim> local_mesh_ext;
Expand Down Expand Up @@ -201,6 +203,8 @@ class Particles<MemorySpace, PMB, Dimension>
std::array<bool, dim> is_periodic;
for ( int d = 0; d < dim; d++ )
{
global_mesh_lo[d] = global_mesh->lowCorner( d );
global_mesh_hi[d] = global_mesh->highCorner( d );
global_mesh_ext[d] = global_mesh->extent( d );
is_periodic[d] = false;
}
Expand Down Expand Up @@ -516,6 +520,8 @@ class Particles<MemorySpace, LPS, Dimension>

// Simulation total domain.
using base_type::global_mesh_ext;
using base_type::global_mesh_hi;
using base_type::global_mesh_lo;

// Simulation sub domain (single MPI rank).
using base_type::ghost_mesh_hi;
Expand Down

0 comments on commit 9aa62dd

Please sign in to comment.