Commit 1ac4a0fa authored by mattijs's avatar mattijs Committed by Andrew Heather
Browse files

COMP: lduMatrix: fix solveScalar compilation

parent cd36562d
......@@ -253,6 +253,7 @@ public:
//- Read and reset the solver parameters from the given stream
virtual void read(const dictionary&);
//- Solve with given field and rhs
virtual solverPerformance solve
(
scalarField& psi,
......@@ -260,6 +261,15 @@ public:
const direction cmpt=0
) const = 0;
//- Solve with given field and rhs (in solveScalar precision).
// Default is to call solve routine
virtual solverPerformance scalarSolve
(
solveScalarField& psi,
const solveScalarField& source,
const direction cmpt=0
) const;
//- Return the matrix norm used to normalise the residual for the
//- stopping criterion
solveScalarField::cmptType normFactor
......
......@@ -27,6 +27,7 @@ License
#include "lduMatrix.H"
#include "diagonalSolver.H"
#include "PrecisionAdaptor.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -170,6 +171,23 @@ void Foam::lduMatrix::solver::read(const dictionary& solverControls)
}
Foam::solverPerformance Foam::lduMatrix::solver::scalarSolve
(
solveScalarField& psi,
const solveScalarField& source,
const direction cmpt
) const
{
PrecisionAdaptor<scalar, solveScalar> tpsi_s(psi);
return solve
(
tpsi_s.ref(),
ConstPrecisionAdaptor<scalar, solveScalar>(source)(),
cmpt
);
}
Foam::solveScalarField::cmptType Foam::lduMatrix::solver::normFactor
(
const solveScalarField& psi,
......
......@@ -695,7 +695,7 @@ void Foam::GAMGSolver::solveCoarsestLevel
coarsestCorrField = 0;
const solverPerformance coarseSolverPerf
(
coarsestSolverPtr_->solve
coarsestSolverPtr_->scalarSolve
(
coarsestCorrField,
coarsestSource
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment