33 void Foam::GAMGSolver::interpolate
38 const FieldField<Field, scalar>& interfaceBouCoeffs,
43 solveScalar* __restrict__ psiPtr =
psi.begin();
45 const label*
const __restrict__ uPtr = m.lduAddr().upperAddr().begin();
46 const label*
const __restrict__ lPtr = m.lduAddr().lowerAddr().begin();
48 const scalar*
const __restrict__ diagPtr = m.diag().begin();
49 const scalar*
const __restrict__ upperPtr = m.upper().begin();
50 const scalar*
const __restrict__ lowerPtr = m.lower().begin();
53 solveScalar* __restrict__ ApsiPtr = Apsi.begin();
57 m.initMatrixInterfaces
67 const label nFaces = m.upper().size();
68 for (label face=0; face<nFaces; face++)
70 ApsiPtr[uPtr[face]] += lowerPtr[face]*psiPtr[lPtr[face]];
71 ApsiPtr[lPtr[face]] += upperPtr[face]*psiPtr[uPtr[face]];
74 m.updateMatrixInterfaces
85 const label nCells = m.diag().size();
86 for (label celli=0; celli<nCells; celli++)
88 psiPtr[celli] = -ApsiPtr[celli]/(diagPtr[celli]);
93 void Foam::GAMGSolver::interpolate
98 const FieldField<Field, scalar>& interfaceBouCoeffs,
115 const label nCells = m.diag().size();
116 solveScalar* __restrict__ psiPtr =
psi.
begin();
117 const scalar*
const __restrict__ diagPtr = m.diag().begin();
118 const solveScalar*
const __restrict__ psiCPtr = psiC.begin();
121 const label nCCells = psiC.size();
123 solveScalar* __restrict__ corrCPtr = corrC.begin();
126 solveScalar* __restrict__ diagCPtr = diagC.begin();
128 for (label celli=0; celli<nCells; celli++)
130 corrCPtr[restrictAddressing[celli]] += diagPtr[celli]*psiPtr[celli];
131 diagCPtr[restrictAddressing[celli]] += diagPtr[celli];
134 for (label ccelli=0; ccelli<nCCells; ccelli++)
136 corrCPtr[ccelli] = psiCPtr[ccelli] - corrCPtr[ccelli]/diagCPtr[ccelli];
139 for (label celli=0; celli<nCells; celli++)
141 psiPtr[celli] += corrCPtr[restrictAddressing[celli]];
UPtrList< const lduInterfaceField > lduInterfaceFieldPtrsList
List of coupled interface fields to be used in coupling.
const FieldField< Field, scalar > & interfaceBouCoeffs() const noexcept
Field< solveScalar > solveScalarField
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
static label nRequests() noexcept
Number of outstanding requests (on the internal list of requests)
const lduInterfaceFieldPtrsList & interfaces() const noexcept
iterator begin() noexcept
Return an iterator to begin traversing the UList.
const volScalarField & psi
List< label > labelList
A List of labels.