30 void Foam::GAMGSolver::interpolate
35 const FieldField<Field, scalar>& interfaceBouCoeffs,
40 scalar* __restrict__ psiPtr = psi.begin();
42 const label*
const __restrict__ uPtr = m.lduAddr().upperAddr().begin();
43 const label*
const __restrict__ lPtr = m.lduAddr().lowerAddr().begin();
45 const scalar*
const __restrict__ diagPtr = m.diag().begin();
46 const scalar*
const __restrict__ upperPtr = m.upper().begin();
47 const scalar*
const __restrict__ lowerPtr = m.lower().begin();
50 scalar* __restrict__ ApsiPtr = Apsi.begin();
52 m.initMatrixInterfaces
61 const label nFaces = m.upper().size();
62 for (
label face=0; face<nFaces; face++)
64 ApsiPtr[uPtr[face]] += lowerPtr[face]*psiPtr[lPtr[face]];
65 ApsiPtr[lPtr[face]] += upperPtr[face]*psiPtr[uPtr[face]];
68 m.updateMatrixInterfaces
77 const label nCells = m.diag().size();
78 for (
label celli=0; celli<nCells; celli++)
80 psiPtr[celli] = -ApsiPtr[celli]/(diagPtr[celli]);
85 void Foam::GAMGSolver::interpolate
90 const FieldField<Field, scalar>& interfaceBouCoeffs,
107 const label nCells = m.diag().size();
108 scalar* __restrict__ psiPtr = psi.begin();
109 const scalar*
const __restrict__ diagPtr = m.diag().begin();
111 const label nCCells = psiC.size();
115 for (
label celli=0; celli<nCells; celli++)
117 corrC[restrictAddressing[celli]] += diagPtr[celli]*psiPtr[celli];
118 diagC[restrictAddressing[celli]] += diagPtr[celli];
121 for (
label ccelli=0; ccelli<nCCells; ccelli++)
123 corrC[ccelli] = psiC[ccelli] - corrC[ccelli]/diagC[ccelli];
126 for (
label celli=0; celli<nCells; celli++)
128 psiPtr[celli] += corrC[restrictAddressing[celli]];
UPtrList< const lduInterfaceField > lduInterfaceFieldPtrsList
List of coupled interface fields to be used in coupling.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
List< label > labelList
A List of labels.
volScalarField scalarField(fieldObject, mesh)
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.