-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3063 from boutproject/next-use-isfinite
Use isfinite, fix pvode linking
- Loading branch information
Showing
8 changed files
with
32 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,9 @@ | |
* Class for 2D X-Y profiles | ||
* | ||
************************************************************************** | ||
* Copyright 2010 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu | ||
* Copyright 2010 - 2025 BOUT++ developers | ||
* | ||
* Contact: Ben Dudson, [email protected] | ||
* Contact: Ben Dudson, [email protected] | ||
* | ||
* This file is part of BOUT++. | ||
* | ||
|
@@ -355,7 +355,7 @@ namespace { | |
void checkDataIsFiniteOnRegion(const Field2D& f, const std::string& region) { | ||
// Do full checks | ||
BOUT_FOR_SERIAL(i, f.getRegion(region)) { | ||
if (!::finite(f[i])) { | ||
if (!std::isfinite(f[i])) { | ||
throw BoutException("Field2D: Operation on non-finite data at [{:d}][{:d}]\n", | ||
i.x(), i.y()); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,9 @@ | |
* Class for 3D X-Y-Z scalar fields | ||
* | ||
************************************************************************** | ||
* Copyright 2010 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu | ||
* Copyright 2010 - 2025 BOUT++ developers | ||
* | ||
* Contact: Ben Dudson, [email protected] | ||
* Contact: Ben Dudson, [email protected] | ||
* | ||
* This file is part of BOUT++. | ||
* | ||
|
@@ -751,7 +751,7 @@ namespace { | |
void checkDataIsFiniteOnRegion(const Field3D& f, const std::string& region) { | ||
// Do full checks | ||
BOUT_FOR_SERIAL(i, f.getValidRegionWithDefault(region)) { | ||
if (!finite(f[i])) { | ||
if (!std::isfinite(f[i])) { | ||
throw BoutException("Field3D: Operation on non-finite data at [{:d}][{:d}][{:d}]\n", | ||
i.x(), i.y(), i.z()); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,9 @@ | |
* Class for 2D X-Z slices | ||
* | ||
************************************************************************** | ||
* Copyright 2010 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu | ||
* Copyright 2010 - 2025 BOUT++ developers | ||
* | ||
* Contact: Ben Dudson, [email protected] | ||
* Contact: Ben Dudson, [email protected] | ||
* | ||
* This file is part of BOUT++. | ||
* | ||
|
@@ -175,7 +175,7 @@ const FieldPerp sliceXZ(const Field3D& f, int y) { | |
void checkDataIsFiniteOnRegion(const FieldPerp& f, const std::string& region) { | ||
// Do full checks | ||
BOUT_FOR_SERIAL(i, f.getRegion(region)) { | ||
if (!::finite(f[i])) { | ||
if (!std::isfinite(f[i])) { | ||
throw BoutException("FieldPerp: Operation on non-finite data at [{:d}][{:d}]\n", | ||
i.x(), i.z()); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
************************************************************************** | ||
* Copyright 2020 Joseph Parker | ||
* | ||
* Contact: Ben Dudson, [email protected] | ||
* Contact: Ben Dudson, [email protected] | ||
* | ||
* This file is part of BOUT++. | ||
* | ||
|
@@ -575,8 +575,8 @@ FieldPerp LaplaceIPT::solve(const FieldPerp& b, const FieldPerp& x0) { | |
#if CHECK > 2 | ||
for (int ix = 0; ix < 4; ix++) { | ||
for (int kz = 0; kz < nmode; kz++) { | ||
if (!finite(levels[0].xloc(ix, kz).real()) | ||
or !finite(levels[0].xloc(ix, kz).imag())) { | ||
if (!std::isfinite(levels[0].xloc(ix, kz).real()) | ||
or !std::isfinite(levels[0].xloc(ix, kz).imag())) { | ||
throw BoutException("Non-finite xloc at {:d}, {:d}, {:d}", ix, jy, kz); | ||
} | ||
} | ||
|
@@ -595,7 +595,7 @@ FieldPerp LaplaceIPT::solve(const FieldPerp& b, const FieldPerp& x0) { | |
#if CHECK > 2 | ||
for (int ix = 0; ix < ncx; ix++) { | ||
for (int kz = 0; kz < nmode; kz++) { | ||
if (!finite(xk1d(kz, ix).real()) or !finite(xk1d(kz, ix).imag())) { | ||
if (!std::isfinite(xk1d(kz, ix).real()) or !std::isfinite(xk1d(kz, ix).imag())) { | ||
throw BoutException("Non-finite xloc at {:d}, {:d}, {:d}", ix, jy, kz); | ||
} | ||
} | ||
|
@@ -636,7 +636,7 @@ FieldPerp LaplaceIPT::solve(const FieldPerp& b, const FieldPerp& x0) { | |
|
||
#if CHECK > 2 | ||
for (int kz = 0; kz < ncz; kz++) { | ||
if (!finite(x(ix, kz))) { | ||
if (!std::isfinite(x(ix, kz))) { | ||
throw BoutException("Non-finite at {:d}, {:d}, {:d}", ix, jy, kz); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,9 @@ | |
* Using PETSc Solvers | ||
* | ||
************************************************************************** | ||
* Copyright 2013 J. Buchanan, J.Omotani | ||
* Copyright 2013 - 2025 BOUT++ developers | ||
* | ||
* Contact: Ben Dudson, [email protected] | ||
* Contact: Ben Dudson, [email protected] | ||
* | ||
* This file is part of BOUT++. | ||
* | ||
|
@@ -466,7 +466,7 @@ FieldPerp LaplacePetsc::solve(const FieldPerp& b, const FieldPerp& x0) { | |
BoutReal A0, A1, A2, A3, A4, A5; | ||
A0 = A(x, y, z); | ||
|
||
ASSERT3(finite(A0)); | ||
ASSERT3(std::isfinite(A0)); | ||
|
||
// Set the matrix coefficients | ||
Coeffs(x, y, z, A1, A2, A3, A4, A5); | ||
|
@@ -477,11 +477,11 @@ FieldPerp LaplacePetsc::solve(const FieldPerp& b, const FieldPerp& x0) { | |
BoutReal dz2 = SQ(dz); | ||
BoutReal dxdz = dx * dz; | ||
|
||
ASSERT3(finite(A1)); | ||
ASSERT3(finite(A2)); | ||
ASSERT3(finite(A3)); | ||
ASSERT3(finite(A4)); | ||
ASSERT3(finite(A5)); | ||
ASSERT3(std::isfinite(A1)); | ||
ASSERT3(std::isfinite(A2)); | ||
ASSERT3(std::isfinite(A3)); | ||
ASSERT3(std::isfinite(A4)); | ||
ASSERT3(std::isfinite(A5)); | ||
|
||
// Set Matrix Elements | ||
PetscScalar val = 0.; | ||
|
@@ -913,7 +913,7 @@ void LaplacePetsc::Element(int i, int x, int z, int xshift, int zshift, PetscSca | |
int index = (row_new * meshz) + col_new; | ||
|
||
#if CHECK > 2 | ||
if (!finite(ele)) { | ||
if (!std::isfinite(ele)) { | ||
throw BoutException("Non-finite element at x={:d}, z={:d}, row={:d}, col={:d}\n", x, | ||
z, i, index); | ||
} | ||
|
@@ -978,8 +978,8 @@ void LaplacePetsc::Coeffs(int x, int y, int z, BoutReal& coef1, BoutReal& coef2, | |
coef4 = coords->G1(x, y, z); // X 1st derivative | ||
coef5 = coords->G3(x, y, z); // Z 1st derivative | ||
|
||
ASSERT3(finite(coef4)); | ||
ASSERT3(finite(coef5)); | ||
ASSERT3(std::isfinite(coef4)); | ||
ASSERT3(std::isfinite(coef5)); | ||
} | ||
|
||
if (nonuniform) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,9 @@ | |
* and tridiagonal solver. | ||
* | ||
************************************************************************** | ||
* Copyright 2010 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu | ||
* Copyright 2010 - 2025 BOUT++ developers | ||
* | ||
* Contact: Ben Dudson, [email protected] | ||
* Contact: Ben Dudson, [email protected] | ||
* | ||
* This file is part of BOUT++. | ||
* | ||
|
@@ -235,7 +235,7 @@ FieldPerp LaplaceSerialTri::solve(const FieldPerp& b, const FieldPerp& x0) { | |
|
||
#if CHECK > 2 | ||
for (int kz = 0; kz < ncz; kz++) { | ||
if (!finite(x(ix, kz))) { | ||
if (!std::isfinite(x(ix, kz))) { | ||
throw BoutException("Non-finite at {:d}, {:d}, {:d}", ix, jy, kz); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,9 @@ | |
* possible to just swap in the FCI approach for the standard BOUT++ | ||
* Grad_par operator. | ||
************************************************************************** | ||
* Copyright 2014 B.D.Dudson, P. Hill | ||
* Copyright 2014 - 2025 BOUT++ developers | ||
* | ||
* Contact: Ben Dudson, [email protected] | ||
* Contact: Ben Dudson, [email protected] | ||
* | ||
* This file is part of BOUT++. | ||
* | ||
|
@@ -292,7 +292,7 @@ Field3D FCIMap::integrate(Field3D& f) const { | |
// which would include cell edges and corners | ||
result[inext] = 0.5 * (f_c + 0.25 * (f_pp + f_mp + f_pm + f_mm)); | ||
} | ||
ASSERT2(finite(result[inext])); | ||
ASSERT2(std::isfinite(result[inext])); | ||
} | ||
return result; | ||
} | ||
|