33 * Using PETSc Solvers
44 *
55 **************************************************************************
6- * Copyright 2013 J. Buchanan, J.Omotani
6+ * Copyright 2013 - 2025 BOUT++ developers
77 *
8- * Contact: Ben Dudson, bd512@york.ac.uk
8+ * Contact: Ben Dudson, dudson2@llnl.gov
99 *
1010 * This file is part of BOUT++.
1111 *
@@ -466,7 +466,7 @@ FieldPerp LaplacePetsc::solve(const FieldPerp& b, const FieldPerp& x0) {
466466 BoutReal A0, A1, A2, A3, A4, A5;
467467 A0 = A (x, y, z);
468468
469- ASSERT3 (finite (A0));
469+ ASSERT3 (std::isfinite (A0));
470470
471471 // Set the matrix coefficients
472472 Coeffs (x, y, z, A1, A2, A3, A4, A5);
@@ -477,11 +477,11 @@ FieldPerp LaplacePetsc::solve(const FieldPerp& b, const FieldPerp& x0) {
477477 BoutReal dz2 = SQ (dz);
478478 BoutReal dxdz = dx * dz;
479479
480- ASSERT3 (finite (A1));
481- ASSERT3 (finite (A2));
482- ASSERT3 (finite (A3));
483- ASSERT3 (finite (A4));
484- ASSERT3 (finite (A5));
480+ ASSERT3 (std::isfinite (A1));
481+ ASSERT3 (std::isfinite (A2));
482+ ASSERT3 (std::isfinite (A3));
483+ ASSERT3 (std::isfinite (A4));
484+ ASSERT3 (std::isfinite (A5));
485485
486486 // Set Matrix Elements
487487 PetscScalar val = 0 .;
@@ -913,7 +913,7 @@ void LaplacePetsc::Element(int i, int x, int z, int xshift, int zshift, PetscSca
913913 int index = (row_new * meshz) + col_new;
914914
915915#if CHECK > 2
916- if (!finite (ele)) {
916+ if (!std::isfinite (ele)) {
917917 throw BoutException (" Non-finite element at x={:d}, z={:d}, row={:d}, col={:d}\n " , x,
918918 z, i, index);
919919 }
@@ -978,8 +978,8 @@ void LaplacePetsc::Coeffs(int x, int y, int z, BoutReal& coef1, BoutReal& coef2,
978978 coef4 = coords->G1 (x, y, z); // X 1st derivative
979979 coef5 = coords->G3 (x, y, z); // Z 1st derivative
980980
981- ASSERT3 (finite (coef4));
982- ASSERT3 (finite (coef5));
981+ ASSERT3 (std::isfinite (coef4));
982+ ASSERT3 (std::isfinite (coef5));
983983 }
984984
985985 if (nonuniform) {
0 commit comments