Skip to content

Commit

Permalink
Format and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lroberts36 committed Aug 17, 2023
1 parent f2c4284 commit 6475500
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
9 changes: 6 additions & 3 deletions src/coordinates/uniform_cartesian.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,12 @@ class UniformCartesian {
template <int dir, TopologicalElement el>
KOKKOS_FORCEINLINE_FUNCTION Real X(const int idx) const {
using TE = TopologicalElement;
[[maybe_unused]] bool constexpr X1EDGE = el == TE::F1 || el == TE::E2 || el == TE::E3 || el == TE::NN;
[[maybe_unused]] bool constexpr X2EDGE = el == TE::F2 || el == TE::E3 || el == TE::E1 || el == TE::NN;
[[maybe_unused]] bool constexpr X3EDGE = el == TE::F3 || el == TE::E1 || el == TE::E2 || el == TE::NN;
[[maybe_unused]] bool constexpr X1EDGE =
el == TE::F1 || el == TE::E2 || el == TE::E3 || el == TE::NN;
[[maybe_unused]] bool constexpr X2EDGE =
el == TE::F2 || el == TE::E3 || el == TE::E1 || el == TE::NN;
[[maybe_unused]] bool constexpr X3EDGE =
el == TE::F3 || el == TE::E1 || el == TE::E2 || el == TE::NN;
if constexpr (dir == X1DIR && X1EDGE) {
return xmin_[dir - 1] + idx * dx_[dir - 1]; // idx - 1/2
} else if constexpr (dir == X2DIR && X2EDGE) {
Expand Down
9 changes: 6 additions & 3 deletions src/mesh/logical_location.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,12 @@ std::unordered_set<LogicalLocation> LogicalLocation::GetPossibleNeighborsImpl(
const int extra1 = (rg_info.n[0] % down_shift > 0);
const int extra2 = (rg_info.n[1] % down_shift > 0);
const int extra3 = (rg_info.n[2] % down_shift > 0);
int n1_cells_level = std::max(n_per_root_block * (rg_info.n[0] / down_shift + extra1), 1);
int n2_cells_level = std::max(n_per_root_block * (rg_info.n[1] / down_shift + extra2), 1);
int n3_cells_level = std::max(n_per_root_block * (rg_info.n[2] / down_shift + extra3), 1);
int n1_cells_level =
std::max(n_per_root_block * (rg_info.n[0] / down_shift + extra1), 1);
int n2_cells_level =
std::max(n_per_root_block * (rg_info.n[1] / down_shift + extra2), 1);
int n3_cells_level =
std::max(n_per_root_block * (rg_info.n[2] / down_shift + extra3), 1);
for (int i : irange) {
for (int j : jrange) {
for (int k : krange) {
Expand Down
11 changes: 6 additions & 5 deletions src/mesh/mesh-gmg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,12 @@ void Mesh::BuildGMGHierarchy(int nbs, ParameterInput *pin, ApplicationInput *app
BoundaryFlag block_bcs[6];
auto block_size = block_size_default;
SetBlockSizeAndBoundaries(loc, block_size, block_bcs);
printf("gid = %i gmg_level = %i loc.level() = %i nx = (%i, %i) l=(%i, %i) x1=(%e, %e) x2=(%e, "
"%e)\n", gid_rank.first,
gmg_level, loc.level(), block_size.nx(X1DIR), block_size.nx(X2DIR),
loc.lx1(), loc.lx2(), block_size.xmin(X1DIR), block_size.xmax(X1DIR),
block_size.xmin(X2DIR), block_size.xmax(X2DIR));
printf("gid = %i gmg_level = %i loc.level() = %i nx = (%i, %i) l=(%i, %i) "
"x1=(%e, %e) x2=(%e, "
"%e)\n",
gid_rank.first, gmg_level, loc.level(), block_size.nx(X1DIR),
block_size.nx(X2DIR), loc.lx1(), loc.lx2(), block_size.xmin(X1DIR),
block_size.xmax(X1DIR), block_size.xmin(X2DIR), block_size.xmax(X2DIR));
gmg_block_lists[gmg_level].push_back(
MeshBlock::Make(gid_rank.first, -1, loc, block_size, block_bcs, this, pin,
app_in, packages, resolved_packages, gflag));
Expand Down

0 comments on commit 6475500

Please sign in to comment.