Skip to content
Commits on Source (3)
......@@ -323,11 +323,11 @@ Foam::solverPerformance Foam::petscSolver::scalarSolve
void (*f)(void) = NULL;
PetscBool hypre_device = PETSC_FALSE;
AssertPETSc(KSPGetPC(ksp, &pc));
PetscObjectQueryFunction((PetscObject)pc, "PCSetCoordinates_C", &f);
#ifdef PETSC_HAVE_HYPRE_DEVICE
AssertPETSc(PetscObjectTypeCompare((PetscObject)pc, PCHYPRE, &hypre_device));
#endif
AssertPETSc(KSPGetPC(ksp, &pc));
PetscObjectQueryFunction((PetscObject)pc, "PCSetCoordinates_C", &f);
// Cell-centres are contiguous in memory (array of structures)
// Not sure about const-ness here
......
......@@ -39,6 +39,11 @@ License
#define PetscInt_FMT "D"
#endif
// For PETSc < 3.19.0
#ifndef PETSC_SUCCESS
#define PETSC_SUCCESS 0
#endif
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
Foam::solveScalar Foam::gAverage(Vec input)
......@@ -133,6 +138,7 @@ Foam::scalar Foam::PetscUtils::normFactor
);
}
PetscErrorCode Foam::PetscUtils::foamKSPMonitorFoam
(
KSP ksp,
......@@ -205,7 +211,7 @@ PetscErrorCode Foam::PetscUtils::foamKSPMonitorFoam
));
}
PetscCall(PetscViewerASCIISubtractTab(viewer, tablevel));
PetscFunctionReturn(0);
PetscFunctionReturn(PETSC_SUCCESS);
}
......@@ -218,13 +224,13 @@ PetscErrorCode Foam::PetscUtils::foamKSPMonitorRecordInit
)
{
PetscFunctionBeginUser;
if (it) PetscFunctionReturn(0);
if (it) PetscFunctionReturn(PETSC_SUCCESS);
auto* ctx = static_cast<petscLinearSolverContext*>(cctx);
solverPerformance& solverPerf = ctx->performance;
solverPerf.initialResidual() = rnorm;
PetscFunctionReturn(0);
PetscFunctionReturn(PETSC_SUCCESS);
}
......@@ -289,7 +295,7 @@ PetscErrorCode Foam::PetscUtils::foamKSPConverge
}
solverPerf.finalResidual() = residual;
PetscFunctionReturn(0);
PetscFunctionReturn(PETSC_SUCCESS);
}
void Foam::PetscUtils::setFlag
......