46 solveScalar* __restrict__ ApsiPtr = Apsi.
begin();
49 const solveScalar*
const __restrict__ psiPtr =
psi.begin();
51 const scalar*
const __restrict__ diagPtr =
diag().
begin();
56 const scalar*
const __restrict__ upperPtr =
upper().
begin();
57 const scalar*
const __restrict__ lowerPtr =
lower().
begin();
83 ApsiPtr[uPtr[
face]] += lowerPtr[
face]*psiPtr[lPtr[
face]];
84 ApsiPtr[lPtr[
face]] += upperPtr[
face]*psiPtr[uPtr[
face]];
112 solveScalar* __restrict__ TpsiPtr = Tpsi.
begin();
115 const solveScalar*
const __restrict__ psiPtr =
psi.
begin();
117 const scalar*
const __restrict__ diagPtr =
diag().begin();
119 const label*
const __restrict__ uPtr = lduAddr().upperAddr().begin();
120 const label*
const __restrict__ lPtr = lduAddr().lowerAddr().begin();
122 const scalar*
const __restrict__ lowerPtr =
lower().begin();
123 const scalar*
const __restrict__ upperPtr =
upper().begin();
138 const label nCells =
diag().size();
144 const label nFaces =
upper().size();
145 for (label face=0; face<nFaces; face++)
147 TpsiPtr[uPtr[face]] += upperPtr[face]*psiPtr[lPtr[face]];
148 TpsiPtr[lPtr[face]] += lowerPtr[face]*psiPtr[uPtr[face]];
152 updateMatrixInterfaces
174 solveScalar* __restrict__ sumAPtr = sumA.
begin();
176 const scalar* __restrict__ diagPtr =
diag().begin();
178 const label* __restrict__ uPtr = lduAddr().upperAddr().begin();
179 const label* __restrict__ lPtr = lduAddr().lowerAddr().begin();
181 const scalar* __restrict__ lowerPtr =
lower().begin();
182 const scalar* __restrict__ upperPtr =
upper().begin();
184 const label nCells =
diag().size();
185 const label nFaces =
upper().size();
192 for (label face=0; face<nFaces; face++)
194 sumAPtr[uPtr[face]] += lowerPtr[face];
195 sumAPtr[lPtr[face]] += upperPtr[face];
200 forAll(interfaces, patchi)
202 if (interfaces.
set(patchi))
204 const labelUList& pa = lduAddr().patchAddr(patchi);
205 const scalarField& pCoeffs = interfaceBouCoeffs[patchi];
209 sumAPtr[pa[face]] -= pCoeffs[face];
221 const FieldField<Field, scalar>& interfaceBouCoeffs,
226 solveScalar* __restrict__ rAPtr = rA.begin();
228 const solveScalar*
const __restrict__ psiPtr =
psi.
begin();
229 const scalar*
const __restrict__ diagPtr =
diag().begin();
230 const scalar*
const __restrict__ sourcePtr = source.begin();
232 const label*
const __restrict__ uPtr = lduAddr().upperAddr().begin();
233 const label*
const __restrict__ lPtr = lduAddr().lowerAddr().begin();
235 const scalar*
const __restrict__ upperPtr =
upper().begin();
236 const scalar*
const __restrict__ lowerPtr =
lower().begin();
262 const label nCells =
diag().size();
263 for (label cell=0; cell<nCells; cell++)
265 rAPtr[cell] = sourcePtr[cell] - diagPtr[cell]*psiPtr[cell];
269 const label nFaces =
upper().size();
271 for (label face=0; face<nFaces; face++)
273 rAPtr[uPtr[face]] -= lowerPtr[face]*psiPtr[lPtr[face]];
274 rAPtr[lPtr[face]] -= upperPtr[face]*psiPtr[uPtr[face]];
278 updateMatrixInterfaces
301 residual(trA.ref(),
psi, source, interfaceBouCoeffs, interfaces, cmpt);
310 if (lowerPtr_ || upperPtr_)
312 scalar* __restrict__ H1Ptr = tH1.ref().begin();
314 const label* __restrict__ uPtr = lduAddr().upperAddr().begin();
315 const label* __restrict__ lPtr = lduAddr().lowerAddr().begin();
317 const scalar* __restrict__ lowerPtr =
lower().begin();
318 const scalar* __restrict__ upperPtr =
upper().begin();
320 const label nFaces =
upper().size();
324 H1Ptr[uPtr[
face]] -= lowerPtr[
face];
325 H1Ptr[lPtr[
face]] -= upperPtr[
face];
UPtrList< const lduInterfaceField > lduInterfaceFieldPtrsList
List of coupled interface fields to be used in coupling.
const scalarField & diag() const
void size(const label n)
Older name for setAddressableSize.
void Tmul(solveScalarField &, const tmp< solveScalarField > &, const FieldField< Field, scalar > &, const lduInterfaceFieldPtrsList &, const direction cmpt) const
Matrix transpose multiplication with updated interfaces.
A face is a list of labels corresponding to mesh vertices.
Field< solveScalar > solveScalarField
void residual(solveScalarField &rA, const solveScalarField &psi, const scalarField &source, const FieldField< Field, scalar > &interfaceBouCoeffs, const lduInterfaceFieldPtrsList &interfaces, const direction cmpt) const
static label nRequests() noexcept
Number of outstanding requests (on the internal list of requests)
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
tmp< scalarField > H1() const
UList< label > labelUList
A UList of labels.
A field of fields is a PtrList of fields with reference counting.
#define forAll(list, i)
Loop across all elements in list.
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
void Amul(solveScalarField &, const tmp< solveScalarField > &, const FieldField< Field, scalar > &, const lduInterfaceFieldPtrsList &, const direction cmpt) const
Matrix multiplication with updated interfaces.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
void updateMatrixInterfaces(const bool add, const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const solveScalarField &psiif, solveScalarField &result, const direction cmpt, const label startRequest) const
Update interfaced interfaces for matrix operations.
void initMatrixInterfaces(const bool add, const FieldField< Field, scalar > &interfaceCoeffs, const lduInterfaceFieldPtrsList &interfaces, const solveScalarField &psiif, solveScalarField &result, const direction cmpt) const
Initialise the update of interfaced interfaces for matrix operations.
const scalarField & lower() const
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
void sumA(solveScalarField &, const FieldField< Field, scalar > &, const lduInterfaceFieldPtrsList &) const
Sum the coefficients on each row of the matrix.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
const scalarField & upper() const
string lower(const std::string &s)
Return string copy transformed with std::tolower on each character.
const lduAddressing & lduAddr() const
Return the LDU addressing.
A cell is defined as a list of faces with extra functionality.
void clear() const noexcept
If object pointer points to valid object: delete object and set pointer to nullptr.
const volScalarField & psi
A class for managing temporary objects.
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
static constexpr const zero Zero
Global zero (0)