51 <<
"addressing (" << addr.
size()
52 <<
") and field (" << pf.
size() <<
") are different sizes" <<
endl
58 intf[addr[faceI]] += pf[faceI];
72 addToInternalField(addr, tpf(), intf);
89 <<
"addressing (" << addr.
size()
90 <<
") and field (" << pf.
size() <<
") are different sizes" <<
endl
96 intf[addr[faceI]] -= pf[faceI];
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]);
193 source_(
psi.size(), Zero),
196 faceFluxCorrectionPtr_(nullptr)
199 <<
"constructing faMatrix<Type> for field " << psi_.
name()
222 const label currentStatePsi = psiRef.
eventNo();
223 psiRef.boundaryFieldRef().updateCoeffs();
224 psiRef.eventNo() = currentStatePsi;
233 dimensions_(
fam.dimensions_),
234 source_(
fam.source_),
235 internalCoeffs_(
fam.internalCoeffs_),
236 boundaryCoeffs_(
fam.boundaryCoeffs_),
237 faceFluxCorrectionPtr_(nullptr)
240 <<
"Copying faMatrix<Type> for field " << psi_.
name() <<
endl;
242 if (
fam.faceFluxCorrectionPtr_)
244 faceFluxCorrectionPtr_ =
247 *(
fam.faceFluxCorrectionPtr_)
256 lduMatrix(tmat.constCast(), tmat.movable()),
258 dimensions_(tmat().dimensions_),
259 source_(tmat.constCast().source_, tmat.movable()),
260 internalCoeffs_(tmat.constCast().internalCoeffs_, tmat.movable()),
261 boundaryCoeffs_(tmat.constCast().boundaryCoeffs_, tmat.movable()),
262 faceFluxCorrectionPtr_(nullptr)
265 <<
"Copy/Move faMatrix<Type> for field " << psi_.
name() <<
endl;
267 if (tmat().faceFluxCorrectionPtr_)
271 faceFluxCorrectionPtr_ = tmat().faceFluxCorrectionPtr_;
272 tmat().faceFluxCorrectionPtr_ =
nullptr;
276 faceFluxCorrectionPtr_ =
279 *(tmat().faceFluxCorrectionPtr_)
294 <<
"Destroying faMatrix<Type> for field " << psi_.name() <<
endl;
303template<
template<
class>
class ListType>
307 const ListType<Type>& values
312 for (
const label i : faceLabels)
314 this->eliminatedEqns().insert(i);
333 const label facei = faceLabels[i];
334 const Type& value = values[i];
337 source_[facei] = value*Diag[facei];
339 if (symmetric() || asymmetric())
341 for (
const label edgei : edges[facei])
343 if (
mesh.isInternalEdge(edgei))
347 if (facei == own[edgei])
349 source_[nei[edgei]] -= upper()[edgei]*value;
353 source_[own[edgei]] -= upper()[edgei]*value;
356 upper()[edgei] = 0.0;
360 if (facei == own[edgei])
362 source_[nei[edgei]] -= lower()[edgei]*value;
366 source_[own[edgei]] -= upper()[edgei]*value;
369 upper()[edgei] = 0.0;
370 lower()[edgei] = 0.0;
377 if (internalCoeffs_[patchi].size())
379 const label patchEdgei =
382 internalCoeffs_[patchi][patchEdgei] =
Zero;
383 boundaryCoeffs_[patchi][patchEdgei] =
Zero;
410 this->setValuesFromList(faceLabels, values);
421 this->setValuesFromList(faceLabels, values);
430 const bool forceReference
433 if ((forceReference || psi_.needReference()) && facei >= 0)
437 source()[facei] +=
diag()[facei]*value;
449 const bool forceReference
452 if (forceReference || psi_.needReference())
456 const label
faceId = faceLabels[facei];
472 const bool forceReference
475 if (forceReference || psi_.needReference())
479 const label
faceId = faceLabels[facei];
506 sumMagOffDiag(sumOff);
509 forAll(psi_.boundaryField(), patchI)
515 const labelUList& pa = lduAddr().patchAddr(patchI);
520 const Field<Type>& pCoeffs = boundaryCoeffs_[patchI];
538 Type iCoeff0 = iCoeffs[
face];
556 forAll(psi_.boundaryField(), patchI)
562 const labelUList& pa = lduAddr().patchAddr(patchI);
576 S += (
D - D0)*psi_.primitiveField();
583 if (psi_.mesh().relaxEquation(psi_.name()))
585 relax(psi_.mesh().equationRelaxationFactor(psi_.name()));
590 <<
"Relaxation factor for field " << psi_.name()
591 <<
" not found. Relaxation will not be used." <<
endl;
600 addCmptAvBoundaryDiag(tdiag.
ref());
614 "A("+psi_.name()+
')',
619 dimensions_/psi_.dimensions()/
dimArea,
620 zeroGradientFaPatchScalarField::typeName
624 tAphi.
ref().primitiveFieldRef() =
D()/psi_.mesh().S();
625 tAphi.
ref().correctBoundaryConditions();
641 "H("+psi_.name()+
')',
647 zeroGradientFaPatchScalarField::typeName
653 for (
direction cmpt=0; cmpt<Type::nComponents; ++cmpt)
655 scalarField psiCmpt(psi_.primitiveField().component(cmpt));
658 addBoundaryDiag(boundaryDiagCmpt, cmpt);
659 boundaryDiagCmpt.
negate();
660 addCmptAvBoundaryDiag(boundaryDiagCmpt);
679 if (!psi_.mesh().fluxRequired(psi_.name()))
682 <<
"flux requested but " << psi_.name()
683 <<
" not specified in the fluxRequired sub-dictionary of faSchemes"
694 "flux("+psi_.name()+
')',
705 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; ++cmpt)
716 forAll(InternalContrib, patchI)
718 InternalContrib[patchI] =
721 InternalContrib[patchI],
722 psi_.boundaryField()[patchI].patchInternalField()
728 forAll(NeighbourContrib, patchI)
730 if (psi_.boundaryField()[patchI].coupled())
732 NeighbourContrib[patchI] =
735 NeighbourContrib[patchI],
736 psi_.boundaryField()[patchI].patchNeighbourField()
744 InternalContrib[patchI] - NeighbourContrib[patchI];
747 if (faceFluxCorrectionPtr_)
749 fieldFlux += *faceFluxCorrectionPtr_;
766 if (&psi_ != &(famv.psi_))
769 <<
"different fields"
774 source_ = famv.source_;
775 internalCoeffs_ = famv.internalCoeffs_;
776 boundaryCoeffs_ = famv.boundaryCoeffs_;
778 if (faceFluxCorrectionPtr_ && famv.faceFluxCorrectionPtr_)
780 *faceFluxCorrectionPtr_ = *famv.faceFluxCorrectionPtr_;
782 else if (famv.faceFluxCorrectionPtr_)
784 faceFluxCorrectionPtr_ =
786 (*famv.faceFluxCorrectionPtr_);
804 internalCoeffs_.negate();
805 boundaryCoeffs_.negate();
807 if (faceFluxCorrectionPtr_)
809 faceFluxCorrectionPtr_->negate();
819 dimensions_ += famv.dimensions_;
821 source_ += famv.source_;
822 internalCoeffs_ += famv.internalCoeffs_;
823 boundaryCoeffs_ += famv.boundaryCoeffs_;
825 if (faceFluxCorrectionPtr_ && famv.faceFluxCorrectionPtr_)
827 *faceFluxCorrectionPtr_ += *famv.faceFluxCorrectionPtr_;
829 else if (famv.faceFluxCorrectionPtr_)
831 faceFluxCorrectionPtr_ =
new
834 *famv.faceFluxCorrectionPtr_
853 dimensions_ -= famv.dimensions_;
855 source_ -= famv.source_;
856 internalCoeffs_ -= famv.internalCoeffs_;
857 boundaryCoeffs_ -= famv.boundaryCoeffs_;
859 if (faceFluxCorrectionPtr_ && famv.faceFluxCorrectionPtr_)
861 *faceFluxCorrectionPtr_ -= *famv.faceFluxCorrectionPtr_;
863 else if (famv.faceFluxCorrectionPtr_)
865 faceFluxCorrectionPtr_ =
867 (-*famv.faceFluxCorrectionPtr_);
887 source() -= su.mesh().S()*su.field();
920 source() += su.mesh().S()*su.field();
952 source() -=
psi().
mesh().S()*su;
962 source() +=
psi().
mesh().S()*su;
982 dimensions_ *= dsf.dimensions();
984 source_ *= dsf.field();
986 forAll(boundaryCoeffs_, patchi)
990 dsf.mesh().boundary()[patchi].patchInternalField(dsf.field())
992 internalCoeffs_[patchi] *= pisf;
993 boundaryCoeffs_[patchi] *= pisf;
996 if (faceFluxCorrectionPtr_)
999 <<
"cannot scale a matrix containing a faceFluxCorrection"
1033 dimensions_ *= ds.dimensions();
1035 source_ *= ds.value();
1036 internalCoeffs_ *= ds.value();
1037 boundaryCoeffs_ *= ds.value();
1039 if (faceFluxCorrectionPtr_)
1041 *faceFluxCorrectionPtr_ *= ds.value();
1056 if (&mat1.
psi() != &mat2.
psi())
1059 <<
"Incompatible fields for operation\n "
1060 <<
"[" << mat1.
psi().name() <<
"] "
1062 <<
" [" << mat2.
psi().name() <<
"]"
1073 <<
"Incompatible dimensions for operation\n "
1097 <<
"Incompatible dimensions for operation\n "
1100 <<
" [" <<
fld.name() <<
fld.dimensions() <<
" ]"
1121 <<
"Incompatible dimensions for operation\n "
1133 faMatrix<Type>&
fam,
1134 const dictionary& solverControls
1137 return fam.solve(solverControls);
1144 const tmp<faMatrix<Type>>& tmat,
1145 const dictionary& solverControls
1148 SolverPerformance<Type> solverPerf(tmat.constCast().solve(solverControls));
1166 SolverPerformance<Type> solverPerf(tmat.constCast().solve());
1179 const faMatrix<Type>&
A,
1180 const faMatrix<Type>&
B
1184 tmp<faMatrix<Type>> tC(
new faMatrix<Type>(
A));
1193 const tmp<faMatrix<Type>>& tA,
1194 const faMatrix<Type>&
B
1198 tmp<faMatrix<Type>> tC(tA.
ptr());
1207 const faMatrix<Type>&
A,
1208 const tmp<faMatrix<Type>>& tB
1212 tmp<faMatrix<Type>> tC(tB.ptr());
1221 const tmp<faMatrix<Type>>& tA,
1222 const tmp<faMatrix<Type>>& tB
1226 tmp<faMatrix<Type>> tC(tA.
ptr());
1236 const faMatrix<Type>&
A
1239 tmp<faMatrix<Type>> tC(
new faMatrix<Type>(
A));
1248 const tmp<faMatrix<Type>>& tA
1251 tmp<faMatrix<Type>> tC(tA.
ptr());
1260 const faMatrix<Type>&
A,
1261 const faMatrix<Type>&
B
1265 tmp<faMatrix<Type>> tC(
new faMatrix<Type>(
A));
1274 const tmp<faMatrix<Type>>& tA,
1275 const faMatrix<Type>&
B
1279 tmp<faMatrix<Type>> tC(tA.
ptr());
1288 const faMatrix<Type>&
A,
1289 const tmp<faMatrix<Type>>& tB
1293 tmp<faMatrix<Type>> tC(tB.ptr());
1303 const tmp<faMatrix<Type>>& tA,
1304 const tmp<faMatrix<Type>>& tB
1308 tmp<faMatrix<Type>> tC(tA.
ptr());
1318 const faMatrix<Type>&
A,
1319 const faMatrix<Type>&
B
1330 const tmp<faMatrix<Type>>& tA,
1331 const faMatrix<Type>&
B
1342 const faMatrix<Type>&
A,
1343 const tmp<faMatrix<Type>>& tB
1354 const tmp<faMatrix<Type>>& tA,
1355 const tmp<faMatrix<Type>>& tB
1366 const faMatrix<Type>&
A,
1367 const DimensionedField<Type, areaMesh>& su
1372 tC.ref().source() -= su.mesh().S()*su.field();
1380 const faMatrix<Type>&
A,
1381 const tmp<DimensionedField<Type, areaMesh>>& tsu
1386 tC.ref().source() -= tsu().mesh().S()*tsu().field();
1395 const faMatrix<Type>&
A,
1396 const tmp<GeometricField<Type, faPatchField, areaMesh>>& tsu
1401 tC.ref().source() -= tsu().mesh().S()*tsu().primitiveField();
1410 const tmp<faMatrix<Type>>& tA,
1411 const DimensionedField<Type, areaMesh>& su
1415 tmp<faMatrix<Type>> tC(tA.
ptr());
1416 tC.ref().source() -= su.mesh().S()*su.field();
1424 const tmp<faMatrix<Type>>& tA,
1425 const tmp<DimensionedField<Type, areaMesh>>& tsu
1429 tmp<faMatrix<Type>> tC(tA.
ptr());
1430 tC.ref().source() -= tsu().mesh().S()*tsu().field();
1439 const tmp<faMatrix<Type>>& tA,
1440 const tmp<GeometricField<Type, faPatchField, areaMesh>>& tsu
1444 tmp<faMatrix<Type>> tC(tA.
ptr());
1445 tC.ref().source() -= tsu().mesh().S()*tsu().primitiveField();
1454 const DimensionedField<Type, areaMesh>& su,
1455 const faMatrix<Type>&
A
1460 tC.ref().source() -= su.mesh().S()*su.field();
1468 const tmp<DimensionedField<Type, areaMesh>>& tsu,
1469 const faMatrix<Type>&
A
1474 tC.ref().source() -= tsu().mesh().S()*tsu().field();
1483 const tmp<GeometricField<Type, faPatchField, areaMesh>>& tsu,
1484 const faMatrix<Type>&
A
1489 tC.ref().source() -= tsu().mesh().S()*tsu().primitiveField();
1498 const DimensionedField<Type, areaMesh>& su,
1499 const tmp<faMatrix<Type>>& tA
1503 tmp<faMatrix<Type>> tC(tA.
ptr());
1504 tC.ref().source() -= su.mesh().S()*su.field();
1512 const tmp<DimensionedField<Type, areaMesh>>& tsu,
1513 const tmp<faMatrix<Type>>& tA
1517 tmp<faMatrix<Type>> tC(tA.
ptr());
1518 tC.ref().source() -= tsu().mesh().S()*tsu().field();
1527 const tmp<GeometricField<Type, faPatchField, areaMesh>>& tsu,
1528 const tmp<faMatrix<Type>>& tA
1532 tmp<faMatrix<Type>> tC(tA.
ptr());
1533 tC.ref().source() -= tsu().mesh().S()*tsu().primitiveField();
1542 const faMatrix<Type>&
A,
1543 const DimensionedField<Type, areaMesh>& su
1548 tC.ref().source() += su.mesh().S()*su.field();
1556 const faMatrix<Type>&
A,
1557 const tmp<DimensionedField<Type, areaMesh>>& tsu
1562 tC.ref().source() += tsu().mesh().S()*tsu().field();
1571 const faMatrix<Type>&
A,
1572 const tmp<GeometricField<Type, faPatchField, areaMesh>>& tsu
1577 tC.ref().source() += tsu().mesh().S()*tsu().primitiveField();
1586 const tmp<faMatrix<Type>>& tA,
1587 const DimensionedField<Type, areaMesh>& su
1591 tmp<faMatrix<Type>> tC(tA.
ptr());
1592 tC.ref().source() += su.mesh().S()*su.field();
1600 const tmp<faMatrix<Type>>& tA,
1601 const tmp<DimensionedField<Type, areaMesh>>& tsu
1605 tmp<faMatrix<Type>> tC(tA.
ptr());
1606 tC.ref().source() += tsu().mesh().S()*tsu().field();
1615 const tmp<faMatrix<Type>>& tA,
1616 const tmp<GeometricField<Type, faPatchField, areaMesh>>& tsu
1620 tmp<faMatrix<Type>> tC(tA.
ptr());
1621 tC.ref().source() += tsu().mesh().S()*tsu().primitiveField();
1630 const DimensionedField<Type, areaMesh>& su,
1631 const faMatrix<Type>&
A
1637 tC.ref().source() -= su.mesh().S()*su.field();
1645 const tmp<DimensionedField<Type, areaMesh>>& tsu,
1646 const faMatrix<Type>&
A
1652 tC.ref().source() -= tsu().mesh().S()*tsu().field();
1661 const tmp<GeometricField<Type, faPatchField, areaMesh>>& tsu,
1662 const faMatrix<Type>&
A
1668 tC.ref().source() -= tsu().mesh().S()*tsu().primitiveField();
1677 const DimensionedField<Type, areaMesh>& su,
1678 const tmp<faMatrix<Type>>& tA
1682 tmp<faMatrix<Type>> tC(tA.
ptr());
1684 tC.ref().source() -= su.mesh().S()*su.field();
1692 const tmp<DimensionedField<Type, areaMesh>>& tsu,
1693 const tmp<faMatrix<Type>>& tA
1697 tmp<faMatrix<Type>> tC(tA.
ptr());
1699 tC.ref().source() -= tsu().mesh().S()*tsu().field();
1708 const tmp<GeometricField<Type, faPatchField, areaMesh>>& tsu,
1709 const tmp<faMatrix<Type>>& tA
1713 tmp<faMatrix<Type>> tC(tA.
ptr());
1715 tC.ref().source() -= tsu().mesh().S()*tsu().primitiveField();
1724 const faMatrix<Type>&
A,
1725 const dimensioned<Type>& su
1730 tC.ref().source() -= su.value()*
A.psi().mesh().S();
1738 const tmp<faMatrix<Type>>& tA,
1739 const dimensioned<Type>& su
1743 tmp<faMatrix<Type>> tC(tA.
ptr());
1744 tC.ref().source() -= su.value()*tC().psi().mesh().S();
1752 const dimensioned<Type>& su,
1753 const faMatrix<Type>&
A
1758 tC.ref().source() -= su.value()*
A.psi().mesh().S();
1766 const dimensioned<Type>& su,
1767 const tmp<faMatrix<Type>>& tA
1771 tmp<faMatrix<Type>> tC(tA.
ptr());
1772 tC.ref().source() -= su.value()*tC().psi().mesh().S();
1780 const faMatrix<Type>&
A,
1781 const dimensioned<Type>& su
1786 tC.ref().source() += su.value()*tC().psi().mesh().S();
1794 const tmp<faMatrix<Type>>& tA,
1795 const dimensioned<Type>& su
1799 tmp<faMatrix<Type>> tC(tA.
ptr());
1800 tC.ref().source() += su.value()*tC().psi().mesh().S();
1808 const dimensioned<Type>& su,
1809 const faMatrix<Type>&
A
1815 tC.ref().source() -= su.value()*
A.psi().mesh().S();
1823 const dimensioned<Type>& su,
1824 const tmp<faMatrix<Type>>& tA
1828 tmp<faMatrix<Type>> tC(tA.
ptr());
1830 tC.ref().source() -= su.value()*tC().psi().mesh().S();
1838 const faMatrix<Type>&
A,
1839 const DimensionedField<Type, areaMesh>& su
1844 tC.ref().source() += su.mesh().S()*su.field();
1852 const faMatrix<Type>&
A,
1853 const tmp<DimensionedField<Type, areaMesh>>& tsu
1858 tC.ref().source() += tsu().mesh().S()*tsu().field();
1867 const faMatrix<Type>&
A,
1868 const tmp<GeometricField<Type, faPatchField, areaMesh>>& tsu
1873 tC.ref().source() += tsu().mesh().S()*tsu().primitiveField();
1882 const tmp<faMatrix<Type>>& tA,
1883 const DimensionedField<Type, areaMesh>& su
1887 tmp<faMatrix<Type>> tC(tA.ptr());
1888 tC.ref().source() += su.mesh().S()*su.field();
1896 const tmp<faMatrix<Type>>& tA,
1897 const tmp<DimensionedField<Type, areaMesh>>& tsu
1901 tmp<faMatrix<Type>> tC(tA.ptr());
1902 tC.ref().source() += tsu().mesh().S()*tsu().field();
1911 const tmp<faMatrix<Type>>& tA,
1912 const tmp<GeometricField<Type, faPatchField, areaMesh>>& tsu
1916 tmp<faMatrix<Type>> tC(tA.ptr());
1917 tC.ref().source() += tsu().mesh().S()*tsu().primitiveField();
1926 const faMatrix<Type>&
A,
1927 const dimensioned<Type>& su
1932 tC.ref().source() +=
A.psi().mesh().S()*su.value();
1940 const tmp<faMatrix<Type>>& tA,
1941 const dimensioned<Type>& su
1945 tmp<faMatrix<Type>> tC(tA.ptr());
1946 tC.ref().source() += tC().psi().mesh().S()*su.value();
1954 const faMatrix<Type>&
A,
1965 const tmp<faMatrix<Type>>& tA,
1977 const faMatrix<Type>&
A
1989 const tmp<areaScalarField::Internal>& tdsf,
1990 const faMatrix<Type>&
A
2002 const tmp<areaScalarField>& tvsf,
2003 const faMatrix<Type>&
A
2016 const tmp<faMatrix<Type>>& tA
2019 tmp<faMatrix<Type>> tC(tA.ptr());
2028 const tmp<areaScalarField::Internal>& tdsf,
2029 const tmp<faMatrix<Type>>& tA
2032 tmp<faMatrix<Type>> tC(tA.ptr());
2041 const tmp<areaScalarField>& tvsf,
2042 const tmp<faMatrix<Type>>& tA
2045 tmp<faMatrix<Type>> tC(tA.ptr());
2054 const dimensioned<scalar>& ds,
2055 const faMatrix<Type>&
A
2067 const dimensioned<scalar>& ds,
2068 const tmp<faMatrix<Type>>& tA
2071 tmp<faMatrix<Type>> tC(tA.ptr());
2082 os << static_cast<const lduMatrix&>(
fam) <<
nl
2083 <<
fam.dimensions_ <<
nl
2084 <<
fam.source_ <<
nl
2085 <<
fam.internalCoeffs_ <<
nl
2086 <<
fam.boundaryCoeffs_ <<
endl;
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678)
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const Mesh & mesh() const
Return mesh.
A field of fields is a PtrList of fields with reference counting.
Generic templated field type.
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
void negate()
Inplace negate this field (negative).
Generic GeometricField class.
DimensionedField< scalar, areaMesh > Internal
The internal field type from which this GeometricField is derived.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
void correctBoundaryConditions()
Correct boundary field.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A List with indirect addressing. Like IndirectList but does not store addressing.
void size(const label n)
Older name for setAddressableSize.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
static bool checking() noexcept
True if dimension checking is enabled (the usual default)
Generic dimensioned Type class.
const dimensionSet & dimensions() const
Return const reference to dimensions.
const word & name() const
Return const reference to name.
A special matrix type and solver, designed for finite area solutions of scalar equations....
void addToInternalField(const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
Add patch contribution to internal field.
void operator=(const faMatrix< Type > &)
void relax()
Relax matrix (for steady-state solution).
tmp< GeometricField< Type, faePatchField, edgeMesh > > flux() const
Return the face-flux field from the matrix.
void setValues(const labelUList &faceLabels, const Type &value)
void setReference(const label facei, const Type &value, const bool forceReference=false)
Set reference level for solution.
void setReferences(const labelUList &faceLabels, const Type &value, const bool forceReference=false)
Set reference level for solution.
void operator+=(const faMatrix< Type > &)
const GeometricField< Type, faPatchField, areaMesh > & psi() const
const dimensionSet & dimensions() const noexcept
tmp< GeometricField< Type, faPatchField, areaMesh > > H() const
Return the H operation source.
void addCmptAvBoundaryDiag(scalarField &diag) const
void addBoundarySource(Field< Type > &source, const bool couples=true) const
virtual ~faMatrix()
Destructor.
tmp< areaScalarField > A() const
Return the central coefficient.
void operator-=(const faMatrix< Type > &)
void addBoundaryDiag(scalarField &diag, const direction cmpt) const
void negate()
Inplace negate.
void setValuesFromList(const labelUList &faceLabels, const ListType< Type > &values)
Set solution in given faces to the specified values.
tmp< scalarField > D() const
Return the matrix diagonal.
void subtractFromInternalField(const labelUList &addr, const Field< Type2 > &pf, Field< Type2 > &intf) const
Subtract patch contribution from internal field.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
virtual bool coupled() const
Return true if this patch field is coupled.
A face is a list of labels corresponding to mesh vertices.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
const labelUList & owner() const
Internal face owner. Note bypassing virtual mechanism so.
const labelUList & neighbour() const
Internal face neighbour.
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
void operator=(const lduMatrix &)
tmp< Field< Type > > faceH(const Field< Type > &) const
void operator*=(const scalarField &)
void operator+=(const lduMatrix &)
void operator-=(const lduMatrix &)
const labelListList & faceEdges() const
label eventNo() const noexcept
Event number at last update.
splitCell * master() const
A class for managing temporary objects.
void clear() const noexcept
T * ptr() const
Return managed pointer for reuse, or clone() the object reference.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
const volScalarField & psi
Template functions to aid in the implementation of demand driven data.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Finite-Area matrix basic solvers.
OBJstream os(runTime.globalPath()/outputName)
#define DebugInFunction
Report an information message using Foam::Info.
void checkMethod(const faMatrix< Type > &, const faMatrix< Type > &, const char *)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
const dimensionSet dimArea(sqr(dimLength))
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh > > cmptAv(const DimensionedField< Type, GeoMesh > &df)
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
void deleteDemandDrivenData(DataPtr &dataPtr)
constexpr char nl
The newline '\n' character (0x0a)
SolverPerformance< Type > solve(faMatrix< Type > &, const dictionary &)
Solve returning the solution statistics given convergence tolerance.
Calculate the matrix for the second temporal derivative.
const dimensionedScalar & D
#define forAll(list, i)
Loop across all elements in list.
conserve primitiveFieldRef()+