Skip to content

Commit

Permalink
Merge pull request #2791 from boutproject/next-fix-hypre
Browse files Browse the repository at this point in the history
Fix hypre compilation in next branch
  • Loading branch information
bendudson authored Nov 14, 2023
2 parents 50c23e2 + 546fbb6 commit 3ab9e61
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/invert/laplace/impls/hypre3d/hypre3d_laplace.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
#include <bout/solver.hxx>
#include <bout/sys/timer.hxx>
#include <bout/utils.hxx>
#include <datafile.hxx>

#include <cmath>

LaplaceHypre3d::LaplaceHypre3d(Options* opt, const CELL_LOC loc, Mesh* mesh_in,
Solver* solver)
Expand Down Expand Up @@ -146,14 +147,12 @@ LaplaceHypre3d::LaplaceHypre3d(Options* opt, const CELL_LOC loc, Mesh* mesh_in,
}

// FIXME: This needs to be converted to outputVars
if (solver == nullptr or dump == nullptr) {
output_warn << "Warning: Need to pass both a Solver and a Datafile to "
if (solver == nullptr) {
output_warn << "Warning: Need to pass a Solver to "
"Laplacian::create() to get iteration counts in the output."
<< endl;
} else {
solver->addMonitor(&monitor);
auto name = opt->name();
dump->addRepeat(average_iterations, name + "_average_iterations");
}
}

Expand Down Expand Up @@ -182,41 +181,41 @@ Field3D LaplaceHypre3d::solve(const Field3D& b_in, const Field3D& x0) {
// boundary cells are finite
BOUT_FOR_SERIAL(i, indexer->getRegionInnerX()) {
const BoutReal val = (inner_boundary_flags & INVERT_SET) ? x0[i] : 0.;
ASSERT1(finite(val));
ASSERT1(std::isfinite(val));
if (!(inner_boundary_flags & INVERT_RHS)) {
b[i] = val;
} else {
ASSERT1(finite(b[i]));
ASSERT1(std::isfinite(b[i]));
}
}

BOUT_FOR_SERIAL(i, indexer->getRegionOuterX()) {
const BoutReal val = (outer_boundary_flags & INVERT_SET) ? x0[i] : 0.;
ASSERT1(finite(val));
ASSERT1(std::isfinite(val));
if (!(outer_boundary_flags & INVERT_RHS)) {
b[i] = val;
} else {
ASSERT1(finite(b[i]));
ASSERT1(std::isfinite(b[i]));
}
}

BOUT_FOR_SERIAL(i, indexer->getRegionLowerY()) {
const BoutReal val = (lower_boundary_flags & INVERT_SET) ? x0[i] : 0.;
ASSERT1(finite(val));
ASSERT1(std::isfinite(val));
if (!(lower_boundary_flags & INVERT_RHS)) {
b[i] = val;
} else {
ASSERT1(finite(b[i]));
ASSERT1(std::isfinite(b[i]));
}
}

BOUT_FOR_SERIAL(i, indexer->getRegionUpperY()) {
const BoutReal val = (upper_boundary_flags & INVERT_SET) ? x0[i] : 0.;
ASSERT1(finite(val));
ASSERT1(std::isfinite(val));
if (!(upper_boundary_flags & INVERT_RHS)) {
b[i] = val;
} else {
ASSERT1(finite(b[i]));
ASSERT1(std::isfinite(b[i]));
}
}
CALI_MARK_END("LaplaceHypre3d_solve:AdjustBoundary");
Expand Down

0 comments on commit 3ab9e61

Please sign in to comment.