33template<
class Type,
class DType,
class LUType>
51template<
class Type,
class DType,
class LUType>
69template<
class Type,
class DType,
class LUType>
89template<
class Type,
class DType,
class LUType>
98 if (lowerPtr_ || upperPtr_)
102 Type* __restrict__ HpsiPtr = Hpsi.
begin();
104 const Type* __restrict__ psiPtr =
psi.begin();
106 const label* __restrict__ uPtr = lduAddr().upperAddr().begin();
107 const label* __restrict__ lPtr = lduAddr().lowerAddr().begin();
109 const LUType* __restrict__ lowerPtr = lower().begin();
110 const LUType* __restrict__ upperPtr = upper().begin();
112 const label
nFaces = upper().size();
116 HpsiPtr[uPtr[
face]] -= lowerPtr[
face]*psiPtr[lPtr[
face]];
117 HpsiPtr[lPtr[
face]] -= upperPtr[
face]*psiPtr[uPtr[
face]];
124template<
class Type,
class DType,
class LUType>
134template<
class Type,
class DType,
class LUType>
157template<
class Type,
class DType,
class LUType>
169template<
class Type,
class DType,
class LUType>
204 source() =
A.source();
207 interfacesUpper_ =
A.interfacesUpper_;
208 interfacesLower_ =
A.interfacesLower_;
212template<
class Type,
class DType,
class LUType>
232 sourcePtr_->negate();
240template<
class Type,
class DType,
class LUType>
250 source() +=
A.source();
253 if (symmetric() &&
A.symmetric())
255 upper() +=
A.upper();
257 else if (symmetric() &&
A.asymmetric())
268 upper() +=
A.upper();
269 lower() +=
A.lower();
271 else if (asymmetric() &&
A.symmetric())
275 lower() +=
A.upper();
276 upper() +=
A.upper();
280 lower() +=
A.lower();
281 upper() +=
A.lower();
285 else if (asymmetric() &&
A.asymmetric())
287 lower() +=
A.lower();
288 upper() +=
A.upper();
302 else if (
A.diagonal())
308 <<
"Unknown matrix type combination"
312 interfacesUpper_ +=
A.interfacesUpper_;
313 interfacesLower_ +=
A.interfacesLower_;
317template<
class Type,
class DType,
class LUType>
327 source() -=
A.source();
330 if (symmetric() &&
A.symmetric())
332 upper() -=
A.upper();
334 else if (symmetric() &&
A.asymmetric())
345 upper() -=
A.upper();
346 lower() -=
A.lower();
348 else if (asymmetric() &&
A.symmetric())
352 lower() -=
A.upper();
353 upper() -=
A.upper();
357 lower() -=
A.lower();
358 upper() -=
A.lower();
362 else if (asymmetric() &&
A.asymmetric())
364 lower() -=
A.lower();
365 upper() -=
A.upper();
371 upper() = -
A.upper();
376 lower() = -
A.lower();
379 else if (
A.diagonal())
385 <<
"Unknown matrix type combination"
389 interfacesUpper_ -=
A.interfacesUpper_;
390 interfacesLower_ -=
A.interfacesLower_;
394template<
class Type,
class DType,
class LUType>
412 if (symmetric() || asymmetric())
432 <<
"Scaling a matrix by scalarField is not currently supported\n"
433 "because scaling interfacesUpper_ and interfacesLower_ "
434 "require special transfers"
442template<
class Type,
class DType,
class LUType>
465 interfacesUpper_ *=
s;
466 interfacesLower_ *=
s;
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
Generic templated field type.
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Field< LUType > & upper()
void operator+=(const LduMatrix< Type, DType, LUType > &)
void operator=(const LduMatrix< Type, DType, LUType > &)
void operator*=(const scalarField &)
void sumMagOffDiag(Field< LUType > &sumOff) const
tmp< Field< Type > > faceH(const Field< Type > &) const
void operator-=(const LduMatrix< Type, DType, LUType > &)
Field< LUType > & lower()
iterator begin() noexcept
Return an iterator to begin traversing the UList.
void size(const label n)
Older name for setAddressableSize.
tmp< GeometricField< Type, faPatchField, areaMesh > > H() const
Return the H operation source.
A face is a list of labels corresponding to mesh vertices.
A class for managing temporary objects.
const volScalarField & psi
volScalarField H(IOobject("H", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimLength, Zero))
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
void negate(FieldField< Field, Type > &res, const FieldField< Field, Type > &f)
errorManip< error > abort(error &err)
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)