48 "fvMatrix<Type>::addToInternalField(const labelUList&, " 49 "const Field&, Field&)" 50 ) <<
"sizes of addressing and field are different" 56 intf[addr[faceI]] += pf[faceI];
70 addToInternalField(addr, tpf(), intf);
88 "fvMatrix<Type>::addToInternalField(const labelUList&, " 89 "const Field&, Field&)" 90 ) <<
"sizes of addressing and field are different" 96 intf[addr[faceI]] -= pf[faceI];
102 template<
class Type2>
110 subtractFromInternalField(addr, tpf(), intf);
122 forAll(internalCoeffs_, patchI)
126 lduAddr().patchAddr(patchI),
127 internalCoeffs_[patchI].
component(solveCmpt),
137 forAll(internalCoeffs_, patchI)
141 lduAddr().patchAddr(patchI),
142 cmptAv(internalCoeffs_[patchI]),
156 forAll(psi_.boundaryField(), patchI)
163 addToInternalField(lduAddr().patchAddr(patchI), pbc, source);
170 const labelUList& addr = lduAddr().patchAddr(patchI);
174 source[addr[facei]] +=
cmptMultiply(pbc[facei], pnf[facei]);
182 template<
template<
class>
class ListType>
186 const ListType<Type>& values
204 const label celli = cellLabels[i];
205 const Type& value = values[i];
208 source_[celli] = value*Diag[celli];
210 if (symmetric() || asymmetric())
212 const cell&
c = cells[celli];
216 const label facei = c[j];
222 if (celli == own[facei])
224 source_[nei[facei]] -= upper()[facei]*value;
228 source_[own[facei]] -= upper()[facei]*value;
231 upper()[facei] = 0.0;
235 if (celli == own[facei])
237 source_[nei[facei]] -= lower()[facei]*value;
241 source_[own[facei]] -= upper()[facei]*value;
244 upper()[facei] = 0.0;
245 lower()[facei] = 0.0;
252 if (internalCoeffs_[patchi].size())
257 internalCoeffs_[
patchi][patchFacei] =
260 boundaryCoeffs_[
patchi][patchFacei] =
283 internalCoeffs_(psi.
mesh().boundary().size()),
284 boundaryCoeffs_(psi.
mesh().boundary().size()),
285 faceFluxCorrectionPtr_(NULL)
289 Info<<
"fvMatrix<Type>(GeometricField<Type, fvPatchField, volMesh>&," 290 " const dimensionSet&) : " 291 "constructing fvMatrix<Type> for field " << psi_.name()
303 psi.
mesh().boundary()[patchI].size(),
313 psi.
mesh().boundary()[patchI].size(),
325 psiRef.
eventNo() = currentStatePsi;
335 dimensions_(fvm.dimensions_),
336 source_(fvm.source_),
337 internalCoeffs_(fvm.internalCoeffs_),
338 boundaryCoeffs_(fvm.boundaryCoeffs_),
339 faceFluxCorrectionPtr_(NULL)
343 Info<<
"fvMatrix<Type>::fvMatrix(const fvMatrix<Type>&) : " 344 <<
"copying fvMatrix<Type> for field " << psi_.name()
348 if (fvm.faceFluxCorrectionPtr_)
350 faceFluxCorrectionPtr_ =
new 353 *(fvm.faceFluxCorrectionPtr_)
359 #ifndef NoConstructFromTmp 366 const_cast<
fvMatrix<Type>&>(tfvm()),
370 dimensions_(tfvm().dimensions_),
373 const_cast<
fvMatrix<Type>&>(tfvm()).source_,
378 const_cast<
fvMatrix<Type>&>(tfvm()).internalCoeffs_,
383 const_cast<
fvMatrix<Type>&>(tfvm()).boundaryCoeffs_,
386 faceFluxCorrectionPtr_(NULL)
390 Info<<
"fvMatrix<Type>::fvMatrix(const tmp<fvMatrix<Type> >&) : " 391 <<
"copying fvMatrix<Type> for field " << psi_.name()
395 if (tfvm().faceFluxCorrectionPtr_)
399 faceFluxCorrectionPtr_ = tfvm().faceFluxCorrectionPtr_;
400 tfvm().faceFluxCorrectionPtr_ = NULL;
404 faceFluxCorrectionPtr_ =
new 407 *(tfvm().faceFluxCorrectionPtr_)
428 internalCoeffs_(psi.
mesh().boundary().size()),
429 boundaryCoeffs_(psi.
mesh().boundary().size()),
430 faceFluxCorrectionPtr_(NULL)
434 Info<<
"fvMatrix<Type>" 435 "(GeometricField<Type, fvPatchField, volMesh>&, Istream&) : " 436 "constructing fvMatrix<Type> for field " << psi_.name()
448 psi.
mesh().boundary()[patchI].size(),
458 psi.
mesh().boundary()[patchI].size(),
472 Info<<
"fvMatrix<Type>::~fvMatrix<Type>() : " 473 <<
"destroying fvMatrix<Type> for field " << psi_.name()
477 if (faceFluxCorrectionPtr_)
479 delete faceFluxCorrectionPtr_;
513 const bool forceReference
516 if ((forceReference || psi_.needReference()) && celli >= 0)
534 InfoIn(
"fvMatrix<Type>::relax(const scalar alpha)")
535 <<
"Relaxing " << psi_.name() <<
" by " << alpha
550 forAll(psi_.boundaryField(), patchI)
561 const Field<Type>& pCoeffs = boundaryCoeffs_[patchI];
592 scalar d = (sumOff[celli] - D[celli])/
mag(D[celli]);
597 maxNon =
max(maxNon, d);
625 InfoIn(
"fvMatrix<Type>::relax(const scalar alpha)")
626 <<
"Matrix dominance test for " << psi_.name() <<
nl 627 <<
" number of non-dominant cells : " << nNon <<
nl 628 <<
" maximum relative non-dominance : " << maxNon <<
nl 629 <<
" average relative non-dominance : " << sumNon <<
nl 638 D[celli] =
max(
mag(D[celli]), sumOff[celli]);
645 forAll(psi_.boundaryField(), patchI)
672 S += (D - D0)*psi_.internalField();
681 psi_.mesh().data::template lookupOrDefault<bool>
682 (
"finalIteration",
false)
685 if (psi_.mesh().relaxEquation(name))
687 relax(psi_.mesh().equationRelaxationFactor(name));
696 GeometricBoundaryField& bFields
701 bFields[patchI].manipulateMatrix(*
this);
720 forAll(psi_.boundaryField(), patchI)
729 internalCoeffs_[patchI],
748 "A("+psi_.name()+
')',
755 dimensions_/psi_.dimensions()/
dimVol,
756 zeroGradientFvPatchScalarField::typeName
760 tAphi().internalField() =
D()/psi_.mesh().V();
761 tAphi().correctBoundaryConditions();
777 "H("+psi_.name()+
')',
785 zeroGradientFvPatchScalarField::typeName
791 for (
direction cmpt=0; cmpt<Type::nComponents; cmpt++)
793 scalarField psiCmpt(psi_.internalField().component(cmpt));
797 boundaryDiagCmpt.negate();
800 Hphi.
internalField().replace(cmpt, boundaryDiagCmpt*psiCmpt);
809 typename Type::labelType validComponents
813 psi_.mesh().solutionD(),
818 for (
direction cmpt=0; cmpt<Type::nComponents; cmpt++)
820 if (validComponents[cmpt] == -1)
850 dimensions_/(
dimVol*psi_.dimensions()),
851 zeroGradientFvPatchScalarField::typeName
858 forAll(psi_.boundaryField(), patchI)
873 H1_.internalField() /= psi_.mesh().V();
874 H1_.correctBoundaryConditions();
885 if (!psi_.mesh().fluxRequired(psi_.name()))
888 <<
"flux requested but " << psi_.name()
889 <<
" not specified in the fluxRequired sub-dictionary" 901 "flux("+psi_.name()+
')',
913 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
924 forAll(InternalContrib, patchI)
926 InternalContrib[patchI] =
929 InternalContrib[patchI],
930 psi_.boundaryField()[patchI].patchInternalField()
936 forAll(NeighbourContrib, patchI)
938 if (psi_.boundaryField()[patchI].coupled())
940 NeighbourContrib[patchI] =
943 NeighbourContrib[patchI],
944 psi_.boundaryField()[patchI].patchNeighbourField()
952 InternalContrib[patchI] - NeighbourContrib[patchI];
955 if (faceFluxCorrectionPtr_)
957 fieldFlux += *faceFluxCorrectionPtr_;
971 FatalErrorIn(
"fvMatrix<Type>::operator=(const fvMatrix<Type>&)")
972 <<
"attempted assignment to self" 976 if (&psi_ != &(fvmv.psi_))
978 FatalErrorIn(
"fvMatrix<Type>::operator=(const fvMatrix<Type>&)")
979 <<
"different fields" 983 dimensions_ = fvmv.dimensions_;
985 source_ = fvmv.source_;
986 internalCoeffs_ = fvmv.internalCoeffs_;
987 boundaryCoeffs_ = fvmv.boundaryCoeffs_;
989 if (faceFluxCorrectionPtr_ && fvmv.faceFluxCorrectionPtr_)
991 *faceFluxCorrectionPtr_ = *fvmv.faceFluxCorrectionPtr_;
993 else if (fvmv.faceFluxCorrectionPtr_)
995 faceFluxCorrectionPtr_ =
997 (*fvmv.faceFluxCorrectionPtr_);
1002 template<
class Type>
1010 template<
class Type>
1015 internalCoeffs_.negate();
1016 boundaryCoeffs_.negate();
1018 if (faceFluxCorrectionPtr_)
1020 faceFluxCorrectionPtr_->negate();
1025 template<
class Type>
1030 dimensions_ += fvmv.dimensions_;
1032 source_ += fvmv.source_;
1033 internalCoeffs_ += fvmv.internalCoeffs_;
1034 boundaryCoeffs_ += fvmv.boundaryCoeffs_;
1036 if (faceFluxCorrectionPtr_ && fvmv.faceFluxCorrectionPtr_)
1038 *faceFluxCorrectionPtr_ += *fvmv.faceFluxCorrectionPtr_;
1040 else if (fvmv.faceFluxCorrectionPtr_)
1042 faceFluxCorrectionPtr_ =
new 1045 *fvmv.faceFluxCorrectionPtr_
1051 template<
class Type>
1059 template<
class Type>
1064 dimensions_ -= fvmv.dimensions_;
1066 source_ -= fvmv.source_;
1067 internalCoeffs_ -= fvmv.internalCoeffs_;
1068 boundaryCoeffs_ -= fvmv.boundaryCoeffs_;
1070 if (faceFluxCorrectionPtr_ && fvmv.faceFluxCorrectionPtr_)
1072 *faceFluxCorrectionPtr_ -= *fvmv.faceFluxCorrectionPtr_;
1074 else if (fvmv.faceFluxCorrectionPtr_)
1076 faceFluxCorrectionPtr_ =
1078 (-*fvmv.faceFluxCorrectionPtr_);
1083 template<
class Type>
1091 template<
class Type>
1092 void Foam::fvMatrix<Type>::operator+=
1098 source() -= su.mesh().V()*su.field();
1102 template<
class Type>
1103 void Foam::fvMatrix<Type>::operator+=
1113 template<
class Type>
1114 void Foam::fvMatrix<Type>::operator+=
1124 template<
class Type>
1125 void Foam::fvMatrix<Type>::operator-=
1131 source() += su.mesh().V()*su.field();
1135 template<
class Type>
1136 void Foam::fvMatrix<Type>::operator-=
1146 template<
class Type>
1147 void Foam::fvMatrix<Type>::operator-=
1157 template<
class Type>
1158 void Foam::fvMatrix<Type>::operator+=
1167 template<
class Type>
1168 void Foam::fvMatrix<Type>::operator-=
1177 template<
class Type>
1178 void Foam::fvMatrix<Type>::operator+=
1185 template<
class Type>
1186 void Foam::fvMatrix<Type>::operator-=
1193 template<
class Type>
1194 void Foam::fvMatrix<Type>::operator*=
1199 dimensions_ *= dsf.dimensions();
1201 source_ *= dsf.field();
1203 forAll(boundaryCoeffs_, patchI)
1207 dsf.mesh().boundary()[patchI].patchInternalField(dsf.field())
1210 internalCoeffs_[patchI] *= pisf;
1211 boundaryCoeffs_[patchI] *= pisf;
1214 if (faceFluxCorrectionPtr_)
1218 "fvMatrix<Type>::operator*=" 1219 "(const DimensionedField<scalar, volMesh>&)" 1220 ) <<
"cannot scale a matrix containing a faceFluxCorrection" 1226 template<
class Type>
1227 void Foam::fvMatrix<Type>::operator*=
1237 template<
class Type>
1238 void Foam::fvMatrix<Type>::operator*=
1248 template<
class Type>
1249 void Foam::fvMatrix<Type>::operator*=
1254 dimensions_ *= ds.dimensions();
1256 source_ *= ds.value();
1257 internalCoeffs_ *= ds.value();
1258 boundaryCoeffs_ *= ds.value();
1260 if (faceFluxCorrectionPtr_)
1262 *faceFluxCorrectionPtr_ *= ds.value();
1269 template<
class Type>
1277 if (&fvm1.
psi() != &fvm2.
psi())
1281 "checkMethod(const fvMatrix<Type>&, const fvMatrix<Type>&)" 1282 ) <<
"incompatible fields for operation " 1284 <<
"[" << fvm1.
psi().name() <<
"] " 1286 <<
" [" << fvm2.
psi().name() <<
"]" 1294 "checkMethod(const fvMatrix<Type>&, const fvMatrix<Type>&)" 1295 ) <<
"incompatible dimensions for operation " 1305 template<
class Type>
1317 "checkMethod(const fvMatrix<Type>&, const GeometricField<Type, " 1318 "fvPatchField, volMesh>&)" 1319 ) <<
"incompatible dimensions for operation " 1329 template<
class Type>
1341 "checkMethod(const fvMatrix<Type>&, const dimensioned<Type>&)" 1342 ) <<
"incompatible dimensions for operation " 1352 template<
class Type>
1359 return fvm.
solve(solverControls);
1362 template<
class Type>
1378 template<
class Type>
1384 template<
class Type>
1396 template<
class Type>
1407 && A.
psi().mesh().fluxRequired(A.
psi().name())
1410 tAcorr().faceFluxCorrectionPtr() = (-A.
flux()).ptr();
1417 template<
class Type>
1430 (A.hasUpper() || A.hasLower())
1431 && A.psi().mesh().fluxRequired(A.psi().name())
1434 tAcorr().faceFluxCorrectionPtr() = (-A.flux()).ptr();
1443 template<
class Type>
1454 template<
class Type>
1465 template<
class Type>
1476 template<
class Type>
1487 template<
class Type>
1496 tC().source() += su.mesh().V()*su.field();
1500 template<
class Type>
1509 tC().source() += tsu().mesh().V()*tsu().field();
1514 template<
class Type>
1523 tC().source() += tsu().mesh().V()*tsu().internalField();
1528 template<
class Type>
1537 tC().source() += su.mesh().V()*su.field();
1541 template<
class Type>
1550 tC().source() += tsu().mesh().V()*tsu().field();
1555 template<
class Type>
1564 tC().source() += tsu().mesh().V()*tsu().internalField();
1569 template<
class Type>
1578 tC().source() += A.
psi().mesh().V()*su.value();
1582 template<
class Type>
1591 tC().source() += tC().psi().mesh().V()*su.value();
1595 template<
class Type>
1606 template<
class Type>
1617 template<
class Type>
1628 template<
class Type>
1640 template<
class Type>
1653 template<
class Type>
1666 template<
class Type>
1679 template<
class Type>
1693 template<
class Type>
1702 tC().source() -= su.mesh().V()*su.field();
1706 template<
class Type>
1715 tC().source() -= tsu().mesh().V()*tsu().field();
1720 template<
class Type>
1729 tC().source() -= tsu().mesh().V()*tsu().internalField();
1734 template<
class Type>
1743 tC().source() -= su.mesh().V()*su.field();
1747 template<
class Type>
1756 tC().source() -= tsu().mesh().V()*tsu().field();
1761 template<
class Type>
1770 tC().source() -= tsu().mesh().V()*tsu().internalField();
1775 template<
class Type>
1784 tC().source() -= su.mesh().V()*su.field();
1788 template<
class Type>
1797 tC().source() -= tsu().mesh().V()*tsu().field();
1802 template<
class Type>
1811 tC().source() -= tsu().mesh().V()*tsu().internalField();
1816 template<
class Type>
1825 tC().source() -= su.mesh().V()*su.field();
1829 template<
class Type>
1838 tC().source() -= tsu().mesh().V()*tsu().field();
1843 template<
class Type>
1852 tC().source() -= tsu().mesh().V()*tsu().internalField();
1858 template<
class Type>
1871 template<
class Type>
1884 template<
class Type>
1898 template<
class Type>
1912 template<
class Type>
1921 tC().source() += su.mesh().V()*su.field();
1925 template<
class Type>
1934 tC().source() += tsu().mesh().V()*tsu().field();
1939 template<
class Type>
1948 tC().source() += tsu().mesh().V()*tsu().internalField();
1953 template<
class Type>
1962 tC().source() += su.mesh().V()*su.field();
1966 template<
class Type>
1975 tC().source() += tsu().mesh().V()*tsu().field();
1980 template<
class Type>
1989 tC().source() += tsu().mesh().V()*tsu().internalField();
1994 template<
class Type>
2004 tC().source() -= su.mesh().V()*su.field();
2008 template<
class Type>
2018 tC().source() -= tsu().mesh().V()*tsu().field();
2023 template<
class Type>
2033 tC().source() -= tsu().mesh().V()*tsu().internalField();
2038 template<
class Type>
2048 tC().source() -= su.mesh().V()*su.field();
2052 template<
class Type>
2062 tC().source() -= tsu().mesh().V()*tsu().field();
2067 template<
class Type>
2077 tC().source() -= tsu().mesh().V()*tsu().internalField();
2082 template<
class Type>
2091 tC().source() -= su.value()*A.psi().mesh().V();
2095 template<
class Type>
2104 tC().source() -= su.value()*tC().psi().mesh().V();
2108 template<
class Type>
2117 tC().source() -= su.value()*A.psi().mesh().V();
2121 template<
class Type>
2130 tC().source() -= su.value()*tC().psi().mesh().V();
2134 template<
class Type>
2143 tC().source() += su.value()*tC().psi().mesh().V();
2147 template<
class Type>
2156 tC().source() += su.value()*tC().psi().mesh().V();
2160 template<
class Type>
2170 tC().source() -= su.value()*A.psi().mesh().V();
2174 template<
class Type>
2184 tC().source() -= su.value()*tC().psi().mesh().V();
2189 template<
class Type>
2201 template<
class Type>
2213 template<
class Type>
2225 template<
class Type>
2237 template<
class Type>
2249 template<
class Type>
2261 template<
class Type>
2273 template<
class Type>
2286 template<
class Type>
2308 zeroGradientFvPatchScalarField::typeName
2316 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
2320 M.addBoundaryDiag(boundaryDiagCmpt, cmpt);
2321 Mphi.
internalField().replace(cmpt, -boundaryDiagCmpt*psiCmpt);
2338 template<
class Type>
2351 template<
class Type>
2364 template<
class Type>
2377 template<
class Type>
2391 template<
class Type>
2408 template<
class Type>
2409 Foam::Ostream& Foam::operator<<(Ostream& os, const fvMatrix<Type>& fvm)
2411 os << static_cast<const lduMatrix&>(fvm) <<
nl 2412 << fvm.dimensions_ <<
nl 2413 << fvm.source_ <<
nl 2414 << fvm.internalCoeffs_ <<
nl 2415 << fvm.boundaryCoeffs_ <<
endl;
2417 os.
check(
"Ostream& operator<<(Ostream&, fvMatrix<Type>&");
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
T * ptr() const
Return tmp pointer for reuse.
void sumMagOffDiag(scalarField &sumOff) const
label eventNo() const
Event number at last update.
tmp< Field< Type > > H(const Field< Type > &) const
Mesh data needed to do the Finite Volume discretisation.
const dimensionSet & dimensions() const
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
void checkMethod(const fvMatrix< Type > &, const fvMatrix< Type > &, const char *)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
void operator=(const fvMatrix< Type > &)
const Field< Type > & field() const
dimensioned< scalar > mag(const dimensioned< Type > &)
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
void operator+=(const fvMatrix< Type > &)
word name(const complex &)
Return a string representation of a complex.
A cell is defined as a list of faces with extra functionality.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux() const
Return the face-flux field from the matrix.
void operator*=(const scalarField &)
void clear() const
If object pointer points to valid object:
tmp< volScalarField > H1() const
Return H(1)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void addCmptAvBoundaryDiag(scalarField &diag) const
SolverPerformance is the class returned by the LduMatrix solver containing performance statistics...
const dimensionSet dimVol(dimVolume)
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
const fileName & instance() const
InternalField & internalField()
Return internal field.
const labelUList & owner() const
Internal face owner.
const cellList & cells() const
void setValuesFromList(const labelUList &cells, const ListType< Type > &values)
Set solution in given cells to the specified values.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
const Mesh & mesh() const
Return mesh.
tmp< GeometricField< Type, fvPatchField, volMesh > > H() const
Return the H operation source.
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual bool coupled() const
Return true if this patch field is coupled.
const lduAddressing & lduAddr() const
Return the LDU addressing.
const dimensionSet & dimensions() const
Return const reference to dimensions.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
A face is a list of labels corresponding to mesh vertices.
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
const GeometricField< Type, fvPatchField, volMesh > & psi() const
Generic dimensioned Type class.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< scalarField > H1() const
tmp< Field< Type > > DD() const
Return the matrix Type diagonal.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A List with indirect addressing.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
const word & name() const
Return const reference to name.
void addBoundaryDiag(scalarField &diag, const direction cmpt) const
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
lduMatrix is a general matrix class in which the coefficients are stored as three arrays...
Dimension set for the base types.
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
static int & msgType()
Message tag of standard messages.
label size() const
Return the number of elements in the UList.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
lduMatrix(const lduMesh &)
Construct given an LDU addressed mesh.
const dimensionSet & dimensions() const
Return dimensions.
solverPerformance solve(const dictionary &)
Solve segregated or coupled returning the solution statistics.
#define InfoIn(functionName)
Report a information message using Foam::Info.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Pre-declare SubField and related Field type.
errorManip< error > abort(error &err)
const word & name() const
Return name.
Reference counter for various OpenFOAM components.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
virtual const labelUList & patchAddr(const label patchNo) const =0
Return patch to internal addressing given patch number.
void operator=(const lduMatrix &)
const cellShapeList & cells
Generic GeometricField class.
tmp< volScalarField > A() const
Return the central coefficient.
solverPerformance solve(fvMatrix< Type > &, const dictionary &)
Solve returning the solution statistics given convergence tolerance.
Traits class for primitives.
void addBoundarySource(Field< Type > &source, const bool couples=true) const
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
void correctBoundaryConditions()
Correct boundary field.
void operator*=(const DimensionedField< scalar, volMesh > &)
fvMatrix(const GeometricField< Type, fvPatchField, volMesh > &, const dimensionSet &)
Construct given a field to solve for.
void replace(const direction, const GeometricField< cmptType, PatchField, GeoMesh > &)
const dimensionSet dimVolume(pow3(dimLength))
void setReference(const label celli, const Type &value, const bool forceReference=false)
Set reference level for solution.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void boundaryManipulate(typename GeometricField< Type, fvPatchField, volMesh >::GeometricBoundaryField &values)
Manipulate based on a boundary field.
void operator-=(const fvMatrix< Type > &)
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
void addToInternalField(const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
Add patch contribution to internal field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const dimensionedScalar c
Speed of light in a vacuum.
void relax()
Relax matrix (for steady-state solution).
void subtractFromInternalField(const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
Subtract patch contribution from internal field.
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &df)
void operator-=(const lduMatrix &)
solverPerformance solve()
Solve returning the solution statistics.
const labelUList & neighbour() const
Internal face neighbour.
tmp< Field< Type > > faceH(const Field< Type > &) const
void operator+=(const lduMatrix &)
tmp< scalarField > D() const
Return the matrix scalar diagonal.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A class for managing temporary objects.
conserve internalField()+
void setValues(const labelUList &cells, const UList< Type > &values)
Set solution in given cells to the specified values.
virtual ~fvMatrix()
Destructor.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.