33 template<
class Type,
class DType,
class LUType>
40 Type* __restrict__ ApsiPtr = Apsi.
begin();
43 const Type*
const __restrict__ psiPtr =
psi.begin();
45 const DType*
const __restrict__ diagPtr =
diag().begin();
47 const label*
const __restrict__ uPtr = lduAddr().upperAddr().begin();
48 const label*
const __restrict__ lPtr = lduAddr().lowerAddr().begin();
50 const LUType*
const __restrict__ upperPtr =
upper().begin();
51 const LUType*
const __restrict__ lowerPtr =
lower().begin();
53 const label startRequest = UPstream::nRequests();
64 const label nCells =
diag().size();
71 const label nFaces =
upper().size();
79 updateMatrixInterfaces
92 template<
class Type,
class DType,
class LUType>
99 Type* __restrict__ TpsiPtr = Tpsi.
begin();
102 const Type*
const __restrict__ psiPtr =
psi.begin();
104 const DType*
const __restrict__ diagPtr =
diag().begin();
106 const label*
const __restrict__ uPtr = lduAddr().upperAddr().begin();
107 const label*
const __restrict__ lPtr = lduAddr().lowerAddr().begin();
109 const LUType*
const __restrict__ lowerPtr =
lower().begin();
110 const LUType*
const __restrict__ upperPtr =
upper().begin();
112 const label startRequest = UPstream::nRequests();
123 const label nCells =
diag().size();
129 const label nFaces =
upper().size();
130 for (label face=0; face<nFaces; face++)
132 TpsiPtr[uPtr[face]] +=
dot(upperPtr[face], psiPtr[lPtr[face]]);
133 TpsiPtr[lPtr[face]] +=
dot(lowerPtr[face], psiPtr[uPtr[face]]);
137 updateMatrixInterfaces
150 template<
class Type,
class DType,
class LUType>
156 Type* __restrict__ sumAPtr = sumA.
begin();
158 const DType* __restrict__ diagPtr =
diag().begin();
160 const label* __restrict__ uPtr = lduAddr().upperAddr().begin();
161 const label* __restrict__ lPtr = lduAddr().lowerAddr().begin();
163 const LUType* __restrict__ lowerPtr =
lower().begin();
164 const LUType* __restrict__ upperPtr =
upper().begin();
166 const label nCells =
diag().size();
167 const label nFaces =
upper().size();
174 for (label face=0; face<nFaces; face++)
176 sumAPtr[uPtr[face]] +=
dot(lowerPtr[face], pTraits<Type>::one);
177 sumAPtr[lPtr[face]] +=
dot(upperPtr[face], pTraits<Type>::one);
182 forAll(interfaces_, patchi)
184 if (interfaces_.set(patchi))
186 const labelUList& pa = lduAddr().patchAddr(patchi);
187 const Field<LUType>& pCoeffs = interfacesUpper_[patchi];
191 sumAPtr[pa[face]] -=
dot(pCoeffs[face], pTraits<Type>::one);
198 template<
class Type,
class DType,
class LUType>
202 const Field<Type>&
psi 205 Type* __restrict__ rAPtr = rA.begin();
207 const Type*
const __restrict__ psiPtr =
psi.begin();
208 const DType*
const __restrict__ diagPtr =
diag().begin();
209 const Type*
const __restrict__ sourcePtr = source().begin();
211 const label*
const __restrict__ uPtr = lduAddr().upperAddr().begin();
212 const label*
const __restrict__ lPtr = lduAddr().lowerAddr().begin();
214 const LUType*
const __restrict__ upperPtr =
upper().begin();
215 const LUType*
const __restrict__ lowerPtr =
lower().begin();
221 const label startRequest = UPstream::nRequests();
232 const label nCells =
diag().size();
233 for (label cell=0; cell<nCells; cell++)
235 rAPtr[cell] = sourcePtr[cell] -
dot(diagPtr[cell], psiPtr[cell]);
239 const label nFaces =
upper().size();
240 for (label face=0; face<nFaces; face++)
242 rAPtr[uPtr[face]] -=
dot(lowerPtr[face], psiPtr[lPtr[face]]);
243 rAPtr[lPtr[face]] -=
dot(upperPtr[face], psiPtr[uPtr[face]]);
247 updateMatrixInterfaces
258 template<
class Type,
class DType,
class LUType>
265 residual(trA.ref(),
psi);
A face is a list of labels corresponding to mesh vertices.
A traits class, which is primarily used for primitives and vector-space.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
UList< label > labelUList
A UList of labels.
void sumA(Field< Type > &) const
Sum the coefficients on each row of the matrix.
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
#define forAll(list, i)
Loop across all elements in list.
void Amul(Field< Type > &, const tmp< Field< Type >> &) const
Matrix multiplication.
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
Generic templated field type.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
void residual(Field< Type > &rA, const Field< Type > &psi) const
void Tmul(Field< Type > &, const tmp< Field< Type >> &) const
Matrix transpose multiplication.
string lower(const std::string &s)
Return string copy transformed with std::tolower on each character.
A cell is defined as a list of faces with extra functionality.
const volScalarField & psi
A class for managing temporary objects.