From 452903b0792fb96ef53effaebbe4bc5bac74d6be Mon Sep 17 00:00:00 2001 From: David Salac Date: Wed, 13 Mar 2024 13:43:19 -0400 Subject: [PATCH] Salac/rbf interp cell (#522) * Allowing for RBF interpolation if the cell is already known. The DMPlexGetContainingCell is REALLY slow (even with the hash). Need to see if there is an alternative that's more efficient. * Version bump * Code cleanup * Format update * Updated tests to account for the new factorization * Forgot to check formatting * Another unit test tolerance update * This runs fine on the laptop. * Now we're on to ARM64 * Another arm64 update * More updates * Fixed bug in rbf->evalder * More ARM64 test updates * Format update --- CMakeLists.txt | 2 +- src/domain/RBF/rbf.cpp | 114 ++++++++++++++---------- src/domain/RBF/rbf.hpp | 39 +++++--- tests/unitTests/domain/RBF/rbfTests.cpp | 36 ++++---- 4 files changed, 116 insertions(+), 75 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 85b3f25f5..efa3d2ae8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.18.4) include(config/petscCompilers.cmake) # Set the project details -project(ablateLibrary VERSION 0.12.27) +project(ablateLibrary VERSION 0.12.28) # Load the Required 3rd Party Libaries pkg_check_modules(PETSc REQUIRED IMPORTED_TARGET GLOBAL PETSc) diff --git a/src/domain/RBF/rbf.cpp b/src/domain/RBF/rbf.cpp index 1527d3dc8..3dc676079 100644 --- a/src/domain/RBF/rbf.cpp +++ b/src/domain/RBF/rbf.cpp @@ -1,5 +1,6 @@ #include "rbf.hpp" #include +#include "utilities/petscSupport.hpp" using namespace ablate::domain::rbf; @@ -139,7 +140,7 @@ void RBF::Matrix(const PetscInt c) { const DM dm = RBF::subDomain->GetSubDM(); // Get the list of neighbor cells - DMPlexGetNeighbors(dm, c, -1, -1.0, RBF::minNumberCells, RBF::useCells, RBF::returnNeighborVertices, &nCells, &list) >> utilities::PetscUtilities::checkError; + DMPlexGetNeighbors(dm, c, -1, -1.0, RBF::minNumberCells, RBF::useCells, (PetscBool)(RBF::returnNeighborVertices), &nCells, &list) >> utilities::PetscUtilities::checkError; if (numPoly >= nCells) { throw std::invalid_argument("Number of surrounding cells, " + std::to_string(nCells) + ", can not support a requested polynomial order of " + std::to_string(p) + " which requires " + @@ -228,19 +229,34 @@ void RBF::Matrix(const PetscInt c) { MatViewFromOptions(A, NULL, "-ablate::domain::rbf::RBF::A_view") >> utilities::PetscUtilities::checkError; // Factor the matrix - MatLUFactor(A, NULL, NULL, NULL) >> utilities::PetscUtilities::checkError; + Mat F; + + MatFactorInfo info; + MatFactorInfoInitialize(&info) >> utilities::PetscUtilities::checkError; + + MatGetFactor(A, MATSOLVERPETSC, MAT_FACTOR_QR, &F) >> utilities::PetscUtilities::checkError; + MatQRFactorSymbolic(F, A, NULL, &info) >> utilities::PetscUtilities::checkError; + MatQRFactorNumeric(F, A, &info) >> utilities::PetscUtilities::checkError; + + // MatGetFactor(A, MATSOLVERPETSC, MAT_FACTOR_LU, &F) >> utilities::PetscUtilities::checkError; + // info.shifttype = (PetscReal)MAT_SHIFT_POSITIVE_DEFINITE; + // info.shiftamount = 0.1; + // MatLUFactorSymbolic(F, A, NULL, NULL, &info) >> utilities::PetscUtilities::checkError; + // MatLUFactorNumeric(F, A, &info) >> utilities::PetscUtilities::checkError; + + MatDestroy(&A) >> utilities::PetscUtilities::checkError; PetscFree(xp) >> utilities::PetscUtilities::checkError; // Assign output - RBF::RBFMatrix[c] = A; + RBF::RBFMatrix[c] = F; RBF::stencilXLocs[c] = x; RBF::nStencil[c] = nCells; PetscMalloc1(nCells, &(RBF::stencilList[c])) >> utilities::PetscUtilities::checkError; PetscArraycpy(RBF::stencilList[c], list, nCells) >> utilities::PetscUtilities::checkError; // Return the work arrays - DMPlexRestoreNeighbors(dm, c, -1, -1.0, RBF::minNumberCells, RBF::useCells, RBF::returnNeighborVertices, &nCells, &list) >> utilities::PetscUtilities::checkError; + DMPlexRestoreNeighbors(dm, c, -1, -1.0, RBF::minNumberCells, RBF::useCells, (PetscBool)(RBF::returnNeighborVertices), &nCells, &list) >> utilities::PetscUtilities::checkError; } /************ Begin Derivative Code **********************/ @@ -264,9 +280,9 @@ void RBF::SetDerivatives(PetscInt numDer, PetscInt dx[], PetscInt dy[], PetscInt } /** - * Set derivatives, defaulting to using vertices + * Set derivatives, defaulting to using common vertices */ -void RBF::SetDerivatives(PetscInt numDer, PetscInt dx[], PetscInt dy[], PetscInt dz[]) { RBF::SetDerivatives(numDer, dx, dy, dz, PETSC_FALSE); } +void RBF::SetDerivatives(PetscInt numDer, PetscInt dx[], PetscInt dy[], PetscInt dz[]) { RBF::SetDerivatives(numDer, dx, dy, dz, PETSC_TRUE); } // Compute the RBF weights at the cell center of p using a cell-list // c - The center cell in cellRange ordering @@ -389,17 +405,15 @@ void RBF::SetupDerivativeStencils() { PetscReal RBF::EvalDer(const ablate::domain::Field *field, PetscInt c, PetscInt dx, PetscInt dy, PetscInt dz) { RBF::CheckField(field); - return RBF::EvalDer(field, RBF::subDomain->GetVec(*field), c, dx, dy, dz); + return RBF::EvalDer(RBF::subDomain->GetFieldDM(*field), RBF::subDomain->GetVec(*field), field->id, c, dx, dy, dz); } -PetscReal RBF::EvalDer(const ablate::domain::Field *field, Vec vec, PetscInt c, PetscInt dx, PetscInt dy, PetscInt dz) { +PetscReal RBF::EvalDer(DM dm, Vec vec, const PetscInt fid, PetscInt c, PetscInt dx, PetscInt dy, PetscInt dz) { PetscReal *wt = nullptr; PetscScalar val = 0.0, *f; const PetscScalar *array; PetscInt nCells = -1, *lst = nullptr; PetscInt derID = -1, numDer = RBF::nDer; - DM dm = RBF::subDomain->GetFieldDM(*field); - const PetscInt fid = field->id; PetscBool hasKey; PetscInt derKey = RBF::derivativeKey(dx, dy, dz); @@ -408,7 +422,7 @@ PetscReal RBF::EvalDer(const ablate::domain::Field *field, Vec vec, PetscInt c, PetscHMapIGet(RBF::hash, derKey, &derID); // If the stencil hasn't been setup yet do so - if (RBF::nStencil[c] < 1) { + if (RBF::stencilWeights[c] == nullptr) { RBF::SetupDerivativeStencils(c); } @@ -435,15 +449,21 @@ PetscReal RBF::EvalDer(const ablate::domain::Field *field, Vec vec, PetscInt c, /************ End Derivative Code **********************/ /************ Begin Interpolation Code **********************/ +PetscReal RBF::Interpolate(const ablate::domain::Field *field, Vec f, PetscReal xEval[3]) { + DM dm = RBF::subDomain->GetFieldDM(*field); -PetscReal RBF::Interpolate(const ablate::domain::Field *field, PetscReal xEval[3]) { - RBF::CheckField(field); + PetscInt c; + DMPlexGetContainingCell(dm, xEval, &c) >> utilities::PetscUtilities::checkError; + if (c < 0) { + throw std::runtime_error("ablate::domain::RBF::Interpolate could not determine the location of (" + std::to_string(xEval[0]) + ", " + std::to_string(xEval[1]) + ", " + + std::to_string(xEval[2]) + ")."); + } - return RBF::Interpolate(field, RBF::subDomain->GetVec(*field), xEval); + return RBF::Interpolate(field, f, c, xEval); } -PetscReal RBF::Interpolate(const ablate::domain::Field *field, Vec f, PetscReal xEval[3]) { - PetscInt i, c, nCells, *lst; +PetscReal RBF::Interpolate(const ablate::domain::Field *field, Vec f, const PetscInt c, PetscReal xEval[3]) { + PetscInt i, nCells, *lst; PetscScalar *vals, *v; const PetscScalar *fvals; PetscReal *x, x0[3]; @@ -452,12 +472,7 @@ PetscReal RBF::Interpolate(const ablate::domain::Field *field, Vec f, PetscReal DM dm = RBF::subDomain->GetFieldDM(*field); const PetscInt fid = field->id; - DMPlexGetContainingCell(dm, xEval, &c) >> utilities::PetscUtilities::checkError; - - if (c < 0) { - throw std::runtime_error("ablate::domain::RBF::Interpolate could not determine the location of (" + std::to_string(xEval[0]) + ", " + std::to_string(xEval[1]) + ", " + - std::to_string(xEval[2]) + ")."); - } + RBF::CheckField(field); if (RBF::RBFMatrix[c] == nullptr) { RBF::Matrix(c); @@ -478,8 +493,6 @@ PetscReal RBF::Interpolate(const ablate::domain::Field *field, Vec f, PetscReal VecGetArray(rhs, &vals) >> utilities::PetscUtilities::checkError; for (i = 0; i < nCells; ++i) { - // DMPlexPointLocalFieldRead isn't behaving like I would expect. If I don't make f a pointer then it just returns zero. - // Additionally, it looks like it allows for the editing of the value. if (fid >= 0) { DMPlexPointLocalFieldRead(dm, lst[i], fid, fvals, &v) >> utilities::PetscUtilities::checkError; } else { @@ -559,9 +572,21 @@ PetscReal RBF::Interpolate(const ablate::domain::Field *field, Vec f, PetscReal /************ End Interpolation Code **********************/ /************ Constructor, Setup, and Initialization Code **********************/ -RBF::RBF(int polyOrder, bool hasDerivatives, bool hasInterpolation) : polyOrder(polyOrder), hasDerivatives(hasDerivatives), hasInterpolation(hasInterpolation) {} +RBF::RBF(int polyOrder, bool hasDerivatives, bool hasInterpolation, bool returnNeighborVertices) + : polyOrder(polyOrder), returnNeighborVertices(returnNeighborVertices), hasDerivatives(hasDerivatives), hasInterpolation(hasInterpolation) {} RBF::~RBF() { + RBF::FreeStencilData(); + + if (dxyz) { + PetscFree(dxyz); + } + if (hash) { + PetscHMapIDestroy(&hash); + } +} + +void RBF::FreeStencilData() { if ((RBF::cEnd - RBF::cStart) > 0) { for (PetscInt c = RBF::cStart; c < RBF::cEnd; ++c) { PetscFree(RBF::stencilList[c]); @@ -569,14 +594,14 @@ RBF::~RBF() { PetscFree(RBF::stencilWeights[c]); PetscFree(RBF::stencilXLocs[c]); } + RBF::cellList += cStart; + RBF::nStencil += cStart; + RBF::stencilList += cStart; + RBF::RBFMatrix += cStart; + RBF::stencilXLocs += cStart; + RBF::stencilWeights += cStart; PetscFree6(RBF::cellList, RBF::nStencil, RBF::stencilList, RBF::RBFMatrix, RBF::stencilXLocs, RBF::stencilWeights) >> utilities::PetscUtilities::checkError; } - if (dxyz) { - PetscFree(dxyz); - } - if (hash) { - PetscHMapIDestroy(&hash); - } } void RBF::CheckField(const ablate::domain::Field *field) { // Checks whether the field is SOL or AUX @@ -669,24 +694,21 @@ void RBF::Setup(std::shared_ptr subDomainIn) { dz[numDer++] = 2; } - SetDerivatives(numDer, dx, dy, dz); + SetDerivatives(numDer, dx, dy, dz, PETSC_TRUE); } } -void RBF::Initialize(ablate::domain::Range cellRange) { +void RBF::Initialize() { + ablate::domain::Range range; + + // Grab the range of cells from the subDomain + RBF::subDomain->GetCellRange(nullptr, range); + // If this is called due to a grid change then release the old memory. In this case cEnd - cStart will be greater than zero. - if ((RBF::cEnd - RBF::cStart) > 0) { - for (PetscInt c = RBF::cStart; c < RBF::cEnd; ++c) { - PetscFree(RBF::stencilList[c]); - if (RBF::RBFMatrix[c]) MatDestroy(&(RBF::RBFMatrix[c])); - PetscFree(RBF::stencilWeights[c]); - PetscFree(RBF::stencilXLocs[c]); - } - PetscFree6(RBF::cellList, RBF::nStencil, RBF::stencilList, RBF::RBFMatrix, RBF::stencilXLocs, RBF::stencilWeights) >> utilities::PetscUtilities::checkError; - } + RBF::FreeStencilData(); - RBF::cStart = cellRange.start; - RBF::cEnd = cellRange.end; + RBF::cStart = range.start; + RBF::cEnd = range.end; // Both interpolation and derivatives need the list of points PetscInt nCells = RBF::cEnd - RBF::cStart; @@ -702,7 +724,7 @@ void RBF::Initialize(ablate::domain::Range cellRange) { RBF::stencilWeights -= cStart; for (PetscInt c = cStart; c < cEnd; ++c) { - RBF::cellList[c] = cellRange.GetPoint(c); + RBF::cellList[c] = range.GetPoint(c); RBF::nStencil[c] = -1; RBF::stencilList[c] = nullptr; @@ -711,4 +733,6 @@ void RBF::Initialize(ablate::domain::Range cellRange) { RBF::stencilXLocs[c] = nullptr; RBF::stencilWeights[c] = nullptr; } + + subDomain->RestoreRange(range); } diff --git a/src/domain/RBF/rbf.hpp b/src/domain/RBF/rbf.hpp index 5088706b3..2aa706380 100644 --- a/src/domain/RBF/rbf.hpp +++ b/src/domain/RBF/rbf.hpp @@ -4,7 +4,6 @@ #include #include "domain/range.hpp" // For domain::Range #include "domain/subDomain.hpp" -#include "utilities/petscSupport.hpp" #define __RBF_DEFAULT_POLYORDER 3 @@ -17,10 +16,10 @@ class RBF { // Radial Basis Function type and parameters const int polyOrder = 4; - PetscInt nPoly = -1; // The number of polynomial components to include - PetscInt minNumberCells = -1; // Minimum number of cells-vertices needed to compute the RBF - PetscBool useCells = PETSC_FALSE; // Use vertices or edges/faces when computing neighbor cells/vertices - PetscBool returnNeighborVertices = PETSC_FALSE; // If it is true, it returns neighbor vertices, else it returns neighbor cells + PetscInt nPoly = -1; // The number of polynomial components to include + PetscInt minNumberCells = -1; // Minimum number of cells-vertices needed to compute the RBF + PetscBool useCells = PETSC_FALSE; // Use vertices or edges/faces when computing neighbor cells/vertices + const bool returnNeighborVertices; // If it is true formulates the RBF based on vertices surrounding a cell, otherwise will use cells surrounding a cell // Information from the subDomain cell range PetscInt cStart = 0, cEnd = 0; // The cell range @@ -50,18 +49,20 @@ class RBF { void CheckField(const ablate::domain::Field *field); // Checks whether the field is SOL or AUX + void FreeStencilData(); + protected: PetscReal DistanceSquared(PetscInt dim, PetscReal x[], PetscReal y[]); PetscReal DistanceSquared(PetscInt dim, PetscReal x[]); void Loc3D(PetscInt dim, PetscReal xIn[], PetscReal x[3]); public: - explicit RBF(int polyOrder = 4, bool hasDerivatives = true, bool hasInterpolation = true); + explicit RBF(int polyOrder = 4, bool hasDerivatives = true, bool hasInterpolation = true, bool returnNeighborVertices = false); virtual ~RBF(); /** SubDomain Register and Setup **/ - void Initialize(ablate::domain::Range cellRange); + void Initialize(); void Setup(std::shared_ptr subDomain); // Derivative stuff @@ -95,14 +96,25 @@ class RBF { /** * Return the derivative of a field at a given location - * @param field - The field to take the derivative of - * @param f - The local vector containing the data + * @param dm - The mesh + * @param vec - Vector containing the data + * @param fid - Field id. * @param c - The location in ablate::domain::Range * @param dx, dy, dz - The derivative */ - PetscReal EvalDer(const ablate::domain::Field *field, Vec f, PetscInt c, PetscInt dx, PetscInt dy, PetscInt dz); // Evaluate a derivative + PetscReal EvalDer(DM dm, Vec vec, const PetscInt fid, PetscInt c, PetscInt dx, PetscInt dy, PetscInt dz); // Evaluate a derivative // Interpolation stuff + + /** + * Return the interpolation of a field at a given location + * @param field - The field to interpolate + * @param f - The local vector containing the data + * @param c - Cell containing the evaluation point + * @param xEval - The location where to perform the interpolation + */ + PetscReal Interpolate(const ablate::domain::Field *field, Vec f, const PetscInt c, PetscReal xEval[3]); + /** * Return the interpolation of a field at a given location * @param field - The field to interpolate @@ -116,7 +128,7 @@ class RBF { * @param field - The field to interpolate * @param xEval - The location where to perform the interpolation */ - PetscReal Interpolate(const ablate::domain::Field *field, PetscReal xEval[3]); + [[nodiscard]] inline PetscReal Interpolate(const ablate::domain::Field *field, PetscReal xEval[3]) { return RBF::Interpolate(field, RBF::subDomain->GetVec(*field), xEval); } // These will be overwritten in the derived classes /** @@ -139,6 +151,11 @@ class RBF { * The RBF kernel type */ virtual std::string_view type() const = 0; + + /** + * + */ + inline PetscInt GetDimensions() { return RBF::subDomain->GetDimensions(); } }; } // namespace ablate::domain::rbf diff --git a/tests/unitTests/domain/RBF/rbfTests.cpp b/tests/unitTests/domain/RBF/rbfTests.cpp index 4b482f081..c3d2806d0 100644 --- a/tests/unitTests/domain/RBF/rbfTests.cpp +++ b/tests/unitTests/domain/RBF/rbfTests.cpp @@ -355,8 +355,8 @@ TEST_P(RBFTestFixture_Derivative, CheckDerivativeFunctions) { ablate::domain::Range cellRange; subDomain->GetCellRange(nullptr, cellRange); for (std::size_t j = 0; j < rbfList.size(); ++j) { - rbfList[j]->Setup(subDomain); // This causes issues (I think) - rbfList[j]->Initialize(cellRange); // Initialize + rbfList[j]->Setup(subDomain); // This causes issues (I think) + rbfList[j]->Initialize(); // Initialize } RBFTestFixture_SetData(cellRange, field, subDomain); @@ -432,7 +432,7 @@ INSTANTIATE_TEST_SUITE_P( .dz = {0, 0, 0}, .cell = -1, .x = {}, - .maxError = {2.0e-15, 2e-03, 2e-01}}, + .maxError = {1e-13, 2e-03, 2e-01}}, (RBFParameters_DerivativeInterpolation){.mpiTestParameter = testingResources::MpiTestParameter("1DN161_1Proc"), .meshFaces = {161}, .meshStart = {-1.0}, @@ -452,7 +452,7 @@ INSTANTIATE_TEST_SUITE_P( .dz = {0, 0, 0}, .cell = -1, .x = {}, - .maxError = {2e-15, 7e-05, 2e-02}}, + .maxError = {1e-13, 7e-05, 2e-02}}, (RBFParameters_DerivativeInterpolation){ .mpiTestParameter = testingResources::MpiTestParameter("2DQuadN21_1Proc"), .meshFaces = {21, 21}, @@ -472,7 +472,7 @@ INSTANTIATE_TEST_SUITE_P( .dz = {0, 0, 0, 0, 0, 0}, .cell = -1, .x = {}, - .maxError = {6.0e-15, 3.4e-02, 1.5e+00, 3.3e-02, 3.6e-01, 1.5e+00}}, + .maxError = {1e-13, 3.4e-02, 1.5e+00, 5e-2, 3.6e-01, 1.5e+00}}, (RBFParameters_DerivativeInterpolation){ .mpiTestParameter = testingResources::MpiTestParameter("2DQuadN41_1Proc"), .meshFaces = {41, 41}, @@ -492,7 +492,7 @@ INSTANTIATE_TEST_SUITE_P( .dz = {0, 0, 0, 0, 0, 0}, .cell = -1, .x = {}, - .maxError = {5.0e-15, 2.3e-03, 1.9e-01, 2.3e-03, 5.0e-02, 1.8e-01}}, + .maxError = {1e-13, 2.3e-03, 1.9e-01, 2.3e-03, 5.0e-02, 1.8e-01}}, (RBFParameters_DerivativeInterpolation){ .mpiTestParameter = testingResources::MpiTestParameter("2DTriN21_1Proc"), .meshFaces = {21, 21}, @@ -512,7 +512,7 @@ INSTANTIATE_TEST_SUITE_P( .dz = {0, 0, 0, 0, 0, 0}, .cell = -1, .x = {}, - .maxError = {5.0e-15, 1.5e-02, 6.2e-01, 1.6e-02, 2.6e-01, 7.6e-01}}, + .maxError = {1e-13, 4e-02, 9e-01, 1.6e-02, 2.6e-01, 9e-01}}, (RBFParameters_DerivativeInterpolation){ .mpiTestParameter = testingResources::MpiTestParameter("2DTriN41_1Proc"), .meshFaces = {41, 41}, @@ -532,7 +532,7 @@ INSTANTIATE_TEST_SUITE_P( .dz = {0, 0, 0, 0, 0, 0}, .cell = -1, .x = {}, - .maxError = {4.6e-15, 1.8e-03, 1.5e-01, 9.0e-04, 4.9e-02, 1.2e-01}}, + .maxError = {1e-13, 1.8e-03, 1.5e-01, 2.0e-03, 4.9e-02, 1.2e-01}}, (RBFParameters_DerivativeInterpolation){.mpiTestParameter = testingResources::MpiTestParameter("2DQuadN21_2Proc", 2), .meshFaces = {21, 21}, .meshStart = {-1.0, -1.0}, @@ -552,7 +552,7 @@ INSTANTIATE_TEST_SUITE_P( .dz = {0, 0, 0, 0, 0, 0}, .cell = -1, .x = {}, - .maxError = {3.7e-15, 4.4e-02, 1.8e+00, 3.3e-02, 4.2e-01, 1.4e+00}}, + .maxError = {1e-13, 4.4e-02, 1.8e+00, 5e-2, 4.2e-01, 1.4e+00}}, (RBFParameters_DerivativeInterpolation){.mpiTestParameter = testingResources::MpiTestParameter("2DQuadN41_2Proc", 2), .meshFaces = {41, 41}, .meshStart = {-1.0, -1.0}, @@ -572,7 +572,7 @@ INSTANTIATE_TEST_SUITE_P( .dz = {0, 0, 0, 0, 0, 0}, .cell = -1, .x = {}, - .maxError = {5.0e-15, 2.4e-03, 1.9e-01, 2.3e-03, 5.0e-02, 1.8e-01}}, + .maxError = {1e-13, 5e-03, 3e-01, 2.3e-03, 6.0e-02, 1.8e-01}}, (RBFParameters_DerivativeInterpolation){.mpiTestParameter = testingResources::MpiTestParameter("2DTriN21_2Proc", 2), .meshFaces = {21, 21}, .meshStart = {-1.0, -1.0}, @@ -592,7 +592,7 @@ INSTANTIATE_TEST_SUITE_P( .dz = {0, 0, 0, 0, 0, 0}, .cell = -1, .x = {}, - .maxError = {5.0e-15, 2.3e-02, 9.0e-01, 1.8e-02, 4.5e-01, 7.5e-01}}, + .maxError = {1e-13, 2.3e-02, 9.0e-01, 1.8e-02, 4.5e-01, 7.5e-01}}, (RBFParameters_DerivativeInterpolation){.mpiTestParameter = testingResources::MpiTestParameter("2DTriN41_2Proc", 2), .meshFaces = {41, 41}, .meshStart = {-1.0, -1.0}, @@ -612,7 +612,7 @@ INSTANTIATE_TEST_SUITE_P( .dz = {0, 0, 0, 0, 0, 0}, .cell = -1, .x = {}, - .maxError = {4.1e-15, 2.0e-03, 1.5e-01, 9.4e-04, 4.8e-02, 1.1e-01}}, + .maxError = {1e-13, 2.0e-03, 1.5e-01, 5e-03, 8e-02, 1.2e-01}}, (RBFParameters_DerivativeInterpolation){.mpiTestParameter = testingResources::MpiTestParameter("3DQuadN21_1Proc"), .meshFaces = {21, 21, 21}, .meshStart = {-1.0, -1.0, -1.0}, @@ -632,7 +632,7 @@ INSTANTIATE_TEST_SUITE_P( .dz = {0, 0, 0, 0, 0, 0, 1, 1, 1, 2}, .cell = 0, .x = {}, - .maxError = {2E-15, 1.7e-02, 7.2e-01, 1.7e-02, 2.1e-03, 7.2e-01, 1.7e-02, 2.1e-03, 2.1e-03, 7.2e-01}}, + .maxError = {1e-13, 1.7e-02, 7.2e-01, 1.7e-02, 2.5e-03, 7.2e-01, 1.7e-02, 2.5e-03, 2.5e-03, 7.2e-01}}, (RBFParameters_DerivativeInterpolation){.mpiTestParameter = testingResources::MpiTestParameter("3DQuadN41_1Proc"), .meshFaces = {41, 41, 41}, .meshStart = {-1.0, -1.0, -1.0}, @@ -652,7 +652,7 @@ INSTANTIATE_TEST_SUITE_P( .dz = {0, 0, 0, 0, 0, 0, 1, 1, 1, 2}, .cell = 0, .x = {}, - .maxError = {3.0e-15, 1.1e-03, 8.9e-02, 1.1e-03, 1.7e-04, 8.9e-02, 1.1e-03, 1.7e-04, 1.9e-04, 8.9e-02}}, + .maxError = {1e-13, 1.5e-03, 8.9e-02, 1.5e-03, 1.7e-04, 8.9e-02, 1.5e-03, 1.7e-04, 1.9e-04, 8.9e-02}}, (RBFParameters_DerivativeInterpolation){.mpiTestParameter = testingResources::MpiTestParameter("3DTriN21_1Proc"), .meshFaces = {21, 21, 21}, .meshStart = {-1.0, -1.0, -1.0}, @@ -672,7 +672,7 @@ INSTANTIATE_TEST_SUITE_P( .dz = {0, 0, 0, 0, 0, 0, 1, 1, 1, 2}, .cell = 0, .x = {}, - .maxError = {1e-15, 3.3e-04, 3.5e-02, 4.0e-04, 1.8e-02, 7.0e-03, 5.0e-04, 1.5e-02, 9.0e-03, 9e-03}}, + .maxError = {1e-13, 3e-03, 2e-01, 4.0e-04, 1.8e-02, 3.0e-02, 1.0e-03, 3e-02, 3e-02, 3e-02}}, (RBFParameters_DerivativeInterpolation){.mpiTestParameter = testingResources::MpiTestParameter("3DTriN41_1Proc"), .meshFaces = {41, 41, 41}, .meshStart = {-1.0, -1.0, -1.0}, @@ -692,7 +692,7 @@ INSTANTIATE_TEST_SUITE_P( .dz = {0, 0, 0, 0, 0, 0, 1, 1, 1, 2}, .cell = 0, .x = {}, - .maxError = {1.2e-16, 5.6e-06, 2.0e-03, 2.1e-05, 8.1e-05, 2.0e-03, 2.2e-05, 2.0e-04, 7.1e-05, 1.6e-03}}), + .maxError = {1e-15, 8e-06, 2.0e-03, 2.1e-05, 4e-04, 2.0e-03, 2.2e-05, 4.0e-04, 3e-04, 1.6e-03}}), [](const testing::TestParamInfo &info) { return info.param.mpiTestParameter.getTestName(); }); class RBFTestFixture_Interpolation : public testingResources::MpiTestFixture, public ::testing::WithParamInterface { @@ -736,8 +736,8 @@ TEST_P(RBFTestFixture_Interpolation, CheckInterpolationFunctions) { ablate::domain::Range cellRange; subDomain->GetCellRange(nullptr, cellRange); for (std::size_t j = 0; j < rbfList.size(); ++j) { - rbfList[j]->Setup(subDomain); // This causes issues (I think) - rbfList[j]->Initialize(cellRange); // Initialize + rbfList[j]->Setup(subDomain); // This causes issues (I think) + rbfList[j]->Initialize(); // Initialize } // Now set the data using the first RBF. All will use the same data