34 void Foam::GAMGSolver::scale
39 const FieldField<Field, scalar>& interfaceLevelBouCoeffs,
49 interfaceLevelBouCoeffs,
55 const label nCells =
field.size();
56 solveScalar* __restrict__ fieldPtr =
field.begin();
57 const solveScalar*
const __restrict__ sourcePtr = source.begin();
58 const solveScalar*
const __restrict__ AcfPtr = Acf.begin();
61 FixedList<solveScalar, 2> scalingFactor(
Zero);
63 for (label i=0; i<nCells; i++)
65 scalingFactor[0] += fieldPtr[i]*sourcePtr[i];
66 scalingFactor[1] += fieldPtr[i]*AcfPtr[i];
69 A.mesh().reduce(scalingFactor, sumOp<solveScalar>());
71 const solveScalar sf =
74 /
stabilise(scalingFactor[1], pTraits<solveScalar>::vsmall)
83 const scalar*
const __restrict__ DPtr =
D.begin();
85 for (label i=0; i<nCells; i++)
87 fieldPtr[i] = sf*fieldPtr[i] + (sourcePtr[i] - sf*AcfPtr[i])/DPtr[i];
UPtrList< const lduInterfaceField > lduInterfaceFieldPtrsList
List of coupled interface fields to be used in coupling.
Field< solveScalar > solveScalarField
dimensionedScalar stabilise(const dimensionedScalar &x, const dimensionedScalar &y)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
int debug
Static debugging option.
const dimensionedScalar & D
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
static constexpr const zero Zero
Global zero (0)