Skip to content

Commit

Permalink
Fixed bug in Xf, Xc
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestglines committed Oct 26, 2022
1 parent a25f0b9 commit 72c6002
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/coordinates/uniform_cartesian.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class UniformCartesian {
template<int dir>
KOKKOS_FORCEINLINE_FUNCTION
Real Xc(const int idx) const {
return xmin_[dir] + (idx + 0.5) * dx_[dir];
return xmin_[dir-1] + (idx + 0.5) * dx_[dir-1];
}

template<int face>
Expand All @@ -107,7 +107,7 @@ class UniformCartesian {
Real Xf(const int idx) const {
//Return position in direction "dir" along index "idx" on face "dir"
if constexpr( dir == face ) {
return xmin_[dir] + (idx + 0.5) * dx_[dir];
return xmin_[dir-1] + idx * dx_[dir-1];
} else {
return Xc<dir>(idx);
}
Expand Down

0 comments on commit 72c6002

Please sign in to comment.