30 template<
class Type,
class DType,
class LUType>
33 if (!lowerPtr_ && !upperPtr_)
53 template<
class Type,
class DType,
class LUType>
56 if (!lowerPtr_ && !upperPtr_)
76 template<
class Type,
class DType,
class LUType>
82 if (!lowerPtr_ && !upperPtr_)
101 template<
class Type,
class DType,
class LUType>
110 if (lowerPtr_ || upperPtr_)
114 Type* __restrict__ HpsiPtr = Hpsi.
begin();
116 const Type* __restrict__ psiPtr =
psi.begin();
118 const label* __restrict__ uPtr = lduAddr().upperAddr().begin();
119 const label* __restrict__ lPtr = lduAddr().lowerAddr().begin();
121 const LUType* __restrict__ lowerPtr = lower().begin();
122 const LUType* __restrict__ upperPtr = upper().begin();
124 const label nFaces = upper().size();
128 HpsiPtr[uPtr[
face]] -= lowerPtr[
face]*psiPtr[lPtr[
face]];
129 HpsiPtr[lPtr[
face]] -= upperPtr[
face]*psiPtr[uPtr[
face]];
136 template<
class Type,
class DType,
class LUType>
146 template<
class Type,
class DType,
class LUType>
169 template<
class Type,
class DType,
class LUType>
181 template<
class Type,
class DType,
class LUType>
187 <<
"attempted assignment to self"
218 source() =
A.source();
221 interfacesUpper_ =
A.interfacesUpper_;
222 interfacesLower_ =
A.interfacesLower_;
226 template<
class Type,
class DType,
class LUType>
246 sourcePtr_->negate();
254 template<
class Type,
class DType,
class LUType>
264 source() +=
A.source();
267 if (symmetric() &&
A.symmetric())
269 upper() +=
A.upper();
271 else if (symmetric() &&
A.asymmetric())
282 upper() +=
A.upper();
283 lower() +=
A.lower();
285 else if (asymmetric() &&
A.symmetric())
289 lower() +=
A.upper();
290 upper() +=
A.upper();
294 lower() +=
A.lower();
295 upper() +=
A.lower();
299 else if (asymmetric() &&
A.asymmetric())
301 lower() +=
A.lower();
302 upper() +=
A.upper();
316 else if (
A.diagonal())
322 <<
"Unknown matrix type combination"
326 interfacesUpper_ +=
A.interfacesUpper_;
327 interfacesLower_ +=
A.interfacesLower_;
331 template<
class Type,
class DType,
class LUType>
341 source() -=
A.source();
344 if (symmetric() &&
A.symmetric())
346 upper() -=
A.upper();
348 else if (symmetric() &&
A.asymmetric())
359 upper() -=
A.upper();
360 lower() -=
A.lower();
362 else if (asymmetric() &&
A.symmetric())
366 lower() -=
A.upper();
367 upper() -=
A.upper();
371 lower() -=
A.lower();
372 upper() -=
A.lower();
376 else if (asymmetric() &&
A.asymmetric())
378 lower() -=
A.lower();
379 upper() -=
A.upper();
385 upper() = -
A.upper();
390 lower() = -
A.lower();
393 else if (
A.diagonal())
399 <<
"Unknown matrix type combination"
403 interfacesUpper_ -=
A.interfacesUpper_;
404 interfacesLower_ -=
A.interfacesLower_;
408 template<
class Type,
class DType,
class LUType>
426 if (symmetric() || asymmetric())
446 <<
"Scaling a matrix by scalarField is not currently supported\n"
447 "because scaling interfacesUpper_ and interfacesLower_ "
448 "require special transfers"
456 template<
class Type,
class DType,
class LUType>
479 interfacesUpper_ *=
s;
480 interfacesLower_ *=
s;
static const Foam::dimensionedScalar A("A", Foam::dimPressure, 611.21)
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
tmp< Field< Type > > H(const Field< Type > &) const
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()
void size(const label)
Override size to be inconsistent with allocated storage.
label size() const
Return the number of elements in the UList.
iterator begin()
Return an iterator to begin traversing the UList.
A face is a list of labels corresponding to mesh vertices.
A class for managing temporary objects.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
volScalarField sf(fieldObject, mesh)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const volScalarField & psi
void negate(FieldField< Field, Type > &res, const FieldField< Field, Type > &f)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManip< error > abort(error &err)
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
dimensionSet cmptMag(const dimensionSet &)