49 <<
"addressing (" << addr.
size()
50 <<
") and field (" << pf.
size() <<
") are different sizes"
56 intf[addr[faceI]] += pf[faceI];
65 const labelUList& addr,
66 const tmp<Field<Type2>>& tpf,
87 <<
"addressing (" << addr.
size()
88 <<
") and field (" << pf.
size() <<
") are different sizes"
94 intf[addr[faceI]] -= pf[faceI];
103 const labelUList& addr,
104 const tmp<Field<Type2>>& tpf,
120 forAll(internalCoeffs_, patchI)
124 lduAddr().patchAddr(patchI),
125 internalCoeffs_[patchI].
component(solveCmpt),
135 forAll(internalCoeffs_, patchI)
139 lduAddr().patchAddr(patchI),
140 cmptAv(internalCoeffs_[patchI]),
154 forAll(psi_.boundaryField(), patchI)
156 const faPatchField<Type>& ptf = psi_.boundaryField()[patchI];
157 const Field<Type>& pbc = boundaryCoeffs_[patchI];
161 addToInternalField(lduAddr().patchAddr(patchI), pbc, source);
165 tmp<Field<Type>> tpnf = ptf.patchNeighbourField();
166 const Field<Type>& pnf = tpnf();
168 const labelUList& addr = lduAddr().patchAddr(patchI);
172 source[addr[facei]] +=
cmptMultiply(pbc[facei], pnf[facei]);
184 const GeometricField<Type, faPatchField, areaMesh>&
psi,
185 const dimensionSet& ds
191 source_(
psi.size(), Zero),
196 <<
"constructing faMatrix<Type> for field " << psi_.
name()
205 new Field<Type>(
psi.mesh().boundary()[patchi].size(),
Zero)
211 new Field<Type>(
psi.mesh().boundary()[patchi].size(),
Zero)
216 auto& psiRef = psi_.constCast();
218 const label currentStatePsi = psiRef.eventNo();
219 psiRef.boundaryFieldRef().updateCoeffs();
220 psiRef.eventNo() = currentStatePsi;
229 dimensions_(
fam.dimensions_),
230 source_(
fam.source_),
231 internalCoeffs_(
fam.internalCoeffs_),
232 boundaryCoeffs_(
fam.boundaryCoeffs_)
235 <<
"Copying faMatrix<Type> for field " << psi_.
name() <<
endl;
237 if (
fam.faceFluxCorrectionPtr_)
239 faceFluxCorrectionPtr_ = std::make_unique<faceFluxFieldType>
241 *(fam.faceFluxCorrectionPtr_)
250 lduMatrix(tmat.constCast(), tmat.movable()),
252 dimensions_(tmat().dimensions_),
253 source_(tmat.constCast().source_, tmat.movable()),
254 internalCoeffs_(tmat.constCast().internalCoeffs_, tmat.movable()),
255 boundaryCoeffs_(tmat.constCast().boundaryCoeffs_, tmat.movable())
258 <<
"Copy/Move faMatrix<Type> for field " << psi_.
name() <<
endl;
260 if (tmat().faceFluxCorrectionPtr_)
264 faceFluxCorrectionPtr_ =
265 std::move(tmat.constCast().faceFluxCorrectionPtr_);
267 else if (tmat().faceFluxCorrectionPtr_)
269 faceFluxCorrectionPtr_ = std::make_unique<faceFluxFieldType>
271 *(tmat().faceFluxCorrectionPtr_)
286 <<
"Destroying faMatrix<Type> for field " << psi_.name() <<
endl;
293template<
template<
class>
class ListType>
297 const ListType<Type>& values
304 this->eliminatedEqns().insert(i);
308 const faMesh&
mesh = psi_.mesh();
315 Field<Type>&
psi = psi_.constCast().primitiveFieldRef();
323 if (symmetric() || asymmetric())
328 const Type& value = values[i];
330 for (
const label edgei : edges[facei])
332 if (
mesh.isInternalEdge(edgei))
336 if (facei == own[edgei])
338 source_[nei[edgei]] -= upper()[edgei]*value;
342 source_[own[edgei]] -=
upper()[edgei]*value;
345 upper()[edgei] = 0.0;
349 if (facei == own[edgei])
351 source_[nei[edgei]] -=
lower()[edgei]*value;
355 source_[own[edgei]] -=
upper()[edgei]*value;
358 upper()[edgei] = 0.0;
359 lower()[edgei] = 0.0;
366 if (internalCoeffs_[patchi].size())
368 const label patchEdgei =
371 internalCoeffs_[patchi][patchEdgei] =
Zero;
372 boundaryCoeffs_[patchi][patchEdgei] =
Zero;
384 const Type& value =
values[i];
387 source_[facei] = value*Diag[facei];
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())
472 const bool forceReference
475 if (forceReference || psi_.needReference())
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);
583 scalar relaxCoeff = 0;
585 if (psi_.mesh().relaxEquation(psi_.name(), relaxCoeff))
592 <<
"No relaxation specified for field " << psi_.name() <<
nl;
611 "A(" + psi_.name() +
')',
613 dimensions_/psi_.dimensions()/
dimArea,
617 tAphi.ref().primitiveFieldRef() =
D()/psi_.mesh().S();
618 tAphi.ref().correctBoundaryConditions();
630 "H(" + psi_.name() +
')',
635 auto& Hphi = tHphi.ref();
638 for (
direction cmpt=0; cmpt<Type::nComponents; ++cmpt)
640 scalarField psiCmpt(psi_.primitiveField().component(cmpt));
643 addBoundaryDiag(boundaryDiagCmpt, cmpt);
644 boundaryDiagCmpt.
negate();
645 addCmptAvBoundaryDiag(boundaryDiagCmpt);
647 Hphi.primitiveFieldRef().replace(cmpt, boundaryDiagCmpt*psiCmpt);
650 Hphi.primitiveFieldRef() +=
lduMatrix::H(psi_.primitiveField()) + source_;
651 addBoundarySource(Hphi.primitiveFieldRef());
653 Hphi.primitiveFieldRef() /= psi_.mesh().S();
654 Hphi.correctBoundaryConditions();
664 if (!psi_.mesh().fluxRequired(psi_.name()))
667 <<
"flux requested but " << psi_.name()
668 <<
" not specified in the fluxRequired sub-dictionary of faSchemes"
674 "flux(" + psi_.name() +
')',
679 auto& fieldFlux = tfieldFlux.ref();
683 FieldField<Field, Type> InternalContrib = internalCoeffs_;
685 forAll(InternalContrib, patchI)
687 InternalContrib[patchI] =
690 InternalContrib[patchI],
691 psi_.boundaryField()[patchI].patchInternalField()
697 forAll(NeighbourContrib, patchI)
699 if (psi_.boundaryField()[patchI].coupled())
701 NeighbourContrib[patchI] =
704 NeighbourContrib[patchI],
705 psi_.boundaryField()[patchI].patchNeighbourField()
711 auto& ffbf = fieldFlux.boundaryFieldRef();
715 ffbf[patchi] = InternalContrib[patchi] - NeighbourContrib[patchi];
719 if (faceFluxCorrectionPtr_)
721 fieldFlux += *faceFluxCorrectionPtr_;
734 return psi_.mesh().solverDict(
name);
741 return psi_.mesh().solverDict
758 if (&psi_ != &(famv.psi_))
761 <<
"different fields"
766 source_ = famv.source_;
767 internalCoeffs_ = famv.internalCoeffs_;
768 boundaryCoeffs_ = famv.boundaryCoeffs_;
770 if (faceFluxCorrectionPtr_ && famv.faceFluxCorrectionPtr_)
772 *faceFluxCorrectionPtr_ = *famv.faceFluxCorrectionPtr_;
774 else if (famv.faceFluxCorrectionPtr_)
776 faceFluxCorrectionPtr_ = std::make_unique<faceFluxFieldType>
778 *famv.faceFluxCorrectionPtr_
797 internalCoeffs_.negate();
798 boundaryCoeffs_.negate();
800 if (faceFluxCorrectionPtr_)
802 faceFluxCorrectionPtr_->negate();
812 dimensions_ += famv.dimensions_;
814 source_ += famv.source_;
815 internalCoeffs_ += famv.internalCoeffs_;
816 boundaryCoeffs_ += famv.boundaryCoeffs_;
818 if (faceFluxCorrectionPtr_ && famv.faceFluxCorrectionPtr_)
820 *faceFluxCorrectionPtr_ += *famv.faceFluxCorrectionPtr_;
822 else if (famv.faceFluxCorrectionPtr_)
824 faceFluxCorrectionPtr_ = std::make_unique<faceFluxFieldType>
826 *famv.faceFluxCorrectionPtr_
845 dimensions_ -= famv.dimensions_;
847 source_ -= famv.source_;
848 internalCoeffs_ -= famv.internalCoeffs_;
849 boundaryCoeffs_ -= famv.boundaryCoeffs_;
851 if (faceFluxCorrectionPtr_ && famv.faceFluxCorrectionPtr_)
853 *faceFluxCorrectionPtr_ -= *famv.faceFluxCorrectionPtr_;
855 else if (famv.faceFluxCorrectionPtr_)
857 faceFluxCorrectionPtr_ = std::make_unique<faceFluxFieldType>
859 -*famv.faceFluxCorrectionPtr_
880 source() -= su.mesh().S()*su.field();
913 source() += su.mesh().S()*su.field();
965 dimensions_ *= dsf.dimensions();
967 source_ *= dsf.field();
969 forAll(boundaryCoeffs_, patchi)
973 dsf.mesh().boundary()[patchi].patchInternalField(dsf.field())
975 internalCoeffs_[patchi] *= pisf;
976 boundaryCoeffs_[patchi] *= pisf;
979 if (faceFluxCorrectionPtr_)
982 <<
"cannot scale a matrix containing a faceFluxCorrection"
991 const tmp<areaScalarField::Internal>& tfld
1016 dimensions_ *= ds.dimensions();
1018 source_ *= ds.value();
1019 internalCoeffs_ *= ds.value();
1020 boundaryCoeffs_ *= ds.value();
1022 if (faceFluxCorrectionPtr_)
1024 *faceFluxCorrectionPtr_ *= ds.value();
1039 if (&mat1.psi() != &mat2.psi())
1042 <<
"Incompatible fields for operation\n "
1043 <<
"[" << mat1.psi().name() <<
"] "
1045 <<
" [" << mat2.psi().name() <<
"]"
1052 && mat1.dimensions() != mat2.dimensions()
1056 <<
"Incompatible dimensions for operation\n "
1057 <<
"[" << mat1.psi().name() << mat1.dimensions()/
dimArea <<
" ] "
1059 <<
" [" << mat2.psi().name() << mat2.dimensions()/
dimArea <<
" ]"
1076 && mat.dimensions()/
dimArea !=
fld.dimensions()
1080 <<
"Incompatible dimensions for operation\n "
1081 <<
"[" << mat.psi().name() << mat.dimensions()/
dimArea <<
" ] "
1083 <<
" [" <<
fld.name() <<
fld.dimensions() <<
" ]"
1100 && mat.dimensions()/
dimArea != dt.dimensions()
1104 <<
"Incompatible dimensions for operation\n "
1105 <<
"[" << mat.psi().name() << mat.dimensions()/
dimArea <<
" ] "
1107 <<
" [" << dt.name() << dt.dimensions() <<
" ]"
1120 return mat.
solve(solverControls);
1146 return mat.solve(
name);
1186Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1200Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1214Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1228Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1243Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1255Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1267Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1281Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1295Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1310Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1325Foam::tmp<Foam::faMatrix<Type>> Foam::operator==
1337Foam::tmp<Foam::faMatrix<Type>> Foam::operator==
1349Foam::tmp<Foam::faMatrix<Type>> Foam::operator==
1361Foam::tmp<Foam::faMatrix<Type>> Foam::operator==
1373Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1381 tC.ref().source() -= su.mesh().S()*su.field();
1387Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1395 tC.ref().source() -= tsu().mesh().S()*tsu().field();
1402Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1410 tC.ref().source() -= tsu().mesh().S()*tsu().primitiveField();
1417Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1425 tC.ref().source() -= su.mesh().S()*su.field();
1431Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1439 tC.ref().source() -= tsu().mesh().S()*tsu().field();
1446Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1454 tC.ref().source() -= tsu().mesh().S()*tsu().primitiveField();
1461Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1469 tC.ref().source() -= su.mesh().S()*su.field();
1475Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1483 tC.ref().source() -= tsu().mesh().S()*tsu().field();
1490Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1498 tC.ref().source() -= tsu().mesh().S()*tsu().primitiveField();
1505Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1513 tC.ref().source() -= su.mesh().S()*su.field();
1519Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1527 tC.ref().source() -= tsu().mesh().S()*tsu().field();
1534Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1542 tC.ref().source() -= tsu().mesh().S()*tsu().primitiveField();
1549Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1557 tC.ref().source() += su.mesh().S()*su.field();
1563Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1571 tC.ref().source() += tsu().mesh().S()*tsu().field();
1578Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1586 tC.ref().source() += tsu().mesh().S()*tsu().primitiveField();
1593Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1601 tC.ref().source() += su.mesh().S()*su.field();
1607Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1615 tC.ref().source() += tsu().mesh().S()*tsu().field();
1622Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1630 tC.ref().source() += tsu().mesh().S()*tsu().primitiveField();
1637Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1646 tC.ref().source() -= su.mesh().S()*su.field();
1652Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1661 tC.ref().source() -= tsu().mesh().S()*tsu().field();
1668Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1677 tC.ref().source() -= tsu().mesh().S()*tsu().primitiveField();
1684Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1693 tC.ref().source() -= su.mesh().S()*su.field();
1699Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1708 tC.ref().source() -= tsu().mesh().S()*tsu().field();
1715Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1724 tC.ref().source() -= tsu().mesh().S()*tsu().primitiveField();
1731Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1739 tC.ref().source() -= su.value()*
A.psi().mesh().S();
1745Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1753 tC.ref().source() -= su.value()*tC().psi().mesh().S();
1759Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1767 tC.ref().source() -= su.value()*
A.psi().mesh().S();
1773Foam::tmp<Foam::faMatrix<Type>> Foam::operator+
1781 tC.ref().source() -= su.value()*tC().psi().mesh().S();
1787Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1795 tC.ref().source() += su.value()*tC().psi().mesh().S();
1801Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1809 tC.ref().source() += su.value()*tC().psi().mesh().S();
1815Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1824 tC.ref().source() -= su.value()*
A.psi().mesh().S();
1830Foam::tmp<Foam::faMatrix<Type>> Foam::operator-
1839 tC.ref().source() -= su.value()*tC().psi().mesh().S();
1845Foam::tmp<Foam::faMatrix<Type>> Foam::operator==
1853 tC.ref().source() += su.mesh().S()*su.field();
1859Foam::tmp<Foam::faMatrix<Type>> Foam::operator==
1867 tC.ref().source() += tsu().mesh().S()*tsu().field();
1874Foam::tmp<Foam::faMatrix<Type>> Foam::operator==
1882 tC.ref().source() += tsu().mesh().S()*tsu().primitiveField();
1889Foam::tmp<Foam::faMatrix<Type>> Foam::operator==
1897 tC.ref().source() += su.mesh().S()*su.field();
1903Foam::tmp<Foam::faMatrix<Type>> Foam::operator==
1911 tC.ref().source() += tsu().mesh().S()*tsu().field();
1918Foam::tmp<Foam::faMatrix<Type>> Foam::operator==
1926 tC.ref().source() += tsu().mesh().S()*tsu().primitiveField();
1933Foam::tmp<Foam::faMatrix<Type>> Foam::operator==
1941 tC.ref().source() +=
A.psi().mesh().S()*su.value();
1947Foam::tmp<Foam::faMatrix<Type>> Foam::operator==
1955 tC.ref().source() += tC().psi().mesh().S()*su.value();
1961Foam::tmp<Foam::faMatrix<Type>> Foam::operator==
1972Foam::tmp<Foam::faMatrix<Type>> Foam::operator==
1983Foam::tmp<Foam::faMatrix<Type>> Foam::operator*
1996Foam::tmp<Foam::faMatrix<Type>> Foam::operator*
2009Foam::tmp<Foam::faMatrix<Type>> Foam::operator*
2022Foam::tmp<Foam::faMatrix<Type>> Foam::operator*
2035Foam::tmp<Foam::faMatrix<Type>> Foam::operator*
2048Foam::tmp<Foam::faMatrix<Type>> Foam::operator*
2061Foam::tmp<Foam::faMatrix<Type>> Foam::operator*
2074Foam::tmp<Foam::faMatrix<Type>> Foam::operator*
2087Foam::tmp<Foam::GeometricField<Type, Foam::faPatchField, Foam::areaMesh>>
2101 auto& Mphi = tMphi.ref();
2106 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
2110 M.addBoundaryDiag(boundaryDiagCmpt, cmpt);
2111 Mphi.primitiveFieldRef().replace(cmpt, -boundaryDiagCmpt*psiCmpt);
2116 Mphi.primitiveFieldRef() =
Zero;
2119 Mphi.primitiveFieldRef() +=
M.lduMatrix::H(
psi.
field()) +
M.source();
2120 M.addBoundarySource(Mphi.primitiveFieldRef());
2122 Mphi.primitiveFieldRef() /= -
psi.
mesh().S();
2123 Mphi.correctBoundaryConditions();
2130Foam::tmp<Foam::GeometricField<Type, Foam::faPatchField, Foam::areaMesh>>
2144Foam::tmp<Foam::GeometricField<Type, Foam::faPatchField, Foam::areaMesh>>
2158Foam::tmp<Foam::GeometricField<Type, Foam::faPatchField, Foam::areaMesh>>
2172Foam::tmp<Foam::GeometricField<Type, Foam::faPatchField, Foam::areaMesh>>
2187Foam::tmp<Foam::GeometricField<Type, Foam::faPatchField, Foam::areaMesh>>
2207 <<
fam.dimensions_ <<
nl
2208 <<
fam.source_ <<
nl
2209 <<
fam.internalCoeffs_ <<
nl
2210 <<
fam.boundaryCoeffs_ <<
endl;
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678)
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
labelList faceLabels(nFaceLabels)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const DynamicField< Type > & field() const noexcept
Return const-reference to the primitive field values.
const Mesh & mesh() const noexcept
Return const reference to mesh.
A field of fields is a PtrList of fields with reference counting.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
void negate()
Inplace negate this field (negative).
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
Generic GeometricField class.
static tmp< GeometricField< scalar, faPatchField, areaMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=faPatchField< scalar >::calculatedType())
DimensionedField< scalar, areaMesh > Internal
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.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
static bool checking(bool on) noexcept
Turn dimension checking on/off.
Generic dimensioned Type class.
const dimensionSet & dimensions() const noexcept
Return const reference to dimensions.
const word & name() const noexcept
Return const reference to name.
A special matrix type and solver, designed for finite area solutions of scalar equations....
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
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)
Set solution in given faces to the specified value and eliminate the corresponding equations from the...
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.
faMatrix(const GeometricField< Type, faPatchField, areaMesh > &psi, const dimensionSet &ds)
Construct given a field to solve for.
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.
Field< Type > & source() noexcept
const dictionary & solverDict() const
Return the solver dictionary for psi.
void operator*=(const areaScalarField::Internal &)
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
virtual bool coupled() const
True if the patch field is coupled.
static const word & extrapolatedCalculatedType() noexcept
The type name for extrapolatedCalculated patch fields combines zero-gradient and calculated.
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.
const Field< Type > & primitiveField() const noexcept
Return const-reference to the internal field values.
A face is a list of labels corresponding to mesh vertices.
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
lduMatrix(const lduMesh &mesh)
Construct (without coefficients) for an LDU addressed mesh.
void operator=(const lduMatrix &)
Copy assignment.
tmp< Field< Type > > faceH(const Field< Type > &) const
const lduAddressing & lduAddr() const
Return the LDU addressing.
bool asymmetric() const noexcept
Matrix is asymmetric (ie, full).
const scalarField & diag() const
bool symmetric() const noexcept
Matrix is symmetric.
const scalarField & upper() const
void operator*=(const scalarField &)
tmp< Field< Type > > H(const Field< Type > &) const
void operator+=(const lduMatrix &)
const scalarField & lower() const
void sumMagOffDiag(scalarField &sumOff) const
const lduMesh & mesh() const noexcept
Return the LDU mesh from which the addressing is obtained.
void operator-=(const lduMatrix &)
A class for managing temporary objects.
void clear() const noexcept
If object pointer points to valid object: delete object and set pointer to nullptr.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
T * ptr() const
Return managed pointer for reuse, or clone() the object reference.
A class for handling words, derived from Foam::string.
const volScalarField & psi
#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.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
string lower(const std::string &s)
Return string copy transformed with std::tolower on each character.
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.
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.
List< labelList > labelListList
List of labelList.
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.
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh > > cmptAv(const DimensionedField< Type, GeoMesh > &f1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManip< error > abort(error &err)
SolverPerformance< Type > solve(faMatrix< Type > &, const dictionary &solverControls)
Solve returning the solution statistics given convergence tolerance.
static constexpr const zero Zero
Global zero (0).
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)
UList< label > labelUList
A UList of labels.
constexpr char nl
The newline '\n' character (0x0a).
Calculate the matrix for the second temporal derivative.
const dimensionedScalar & D
#define forAll(list, i)
Loop across all elements in list.