47 if (addr.
size() != pf.size())
50 <<
"sizes of addressing and field are different"
56 intf[addr[facei]] += pf[facei];
70 addToInternalField(addr, tpf(), intf);
84 if (addr.
size() != pf.size())
87 <<
"sizes of addressing and field are different"
93 intf[addr[facei]] -= pf[facei];
107 subtractFromInternalField(addr, tpf(), intf);
119 forAll(internalCoeffs_, patchi)
123 lduAddr().patchAddr(patchi),
124 internalCoeffs_[patchi].
component(solveCmpt),
134 forAll(internalCoeffs_, patchi)
138 lduAddr().patchAddr(patchi),
139 cmptAv(internalCoeffs_[patchi]),
153 forAll(psi_.boundaryField(), patchi)
160 addToInternalField(lduAddr().patchAddr(patchi), pbc, source);
167 const labelUList& addr = lduAddr().patchAddr(patchi);
171 source[addr[facei]] +=
cmptMultiply(pbc[facei], pnf[facei]);
179 template<
template<
class>
class ListType>
183 const ListType<Type>&
values
201 const label celli = cellLabels[i];
202 const Type& value =
values[i];
205 source_[celli] = value*Diag[celli];
207 if (symmetric() || asymmetric())
215 if (
mesh.isInternalFace(facei))
219 if (celli == own[facei])
221 source_[nei[facei]] -=
upper()[facei]*value;
225 source_[own[facei]] -=
upper()[facei]*value;
228 upper()[facei] = 0.0;
232 if (celli == own[facei])
234 source_[nei[facei]] -=
lower()[facei]*value;
238 source_[own[facei]] -=
upper()[facei]*value;
241 upper()[facei] = 0.0;
242 lower()[facei] = 0.0;
247 label patchi =
mesh.boundaryMesh().whichPatch(facei);
249 if (internalCoeffs_[patchi].size())
252 mesh.boundaryMesh()[patchi].whichFace(facei);
254 internalCoeffs_[patchi][patchFacei] =
257 boundaryCoeffs_[patchi][patchFacei] =
280 internalCoeffs_(
psi.mesh().boundary().size()),
281 boundaryCoeffs_(
psi.mesh().boundary().size()),
282 faceFluxCorrectionPtr_(
nullptr)
287 <<
"Constructing fvMatrix<Type> for field " << psi_.name() <<
endl;
298 psi.mesh().boundary()[patchi].size(),
308 psi.mesh().boundary()[patchi].size(),
318 label currentStatePsi = psiRef.eventNo();
320 psiRef.eventNo() = currentStatePsi;
330 dimensions_(fvm.dimensions_),
331 source_(fvm.source_),
332 internalCoeffs_(fvm.internalCoeffs_),
333 boundaryCoeffs_(fvm.boundaryCoeffs_),
334 faceFluxCorrectionPtr_(nullptr)
339 <<
"Copying fvMatrix<Type> for field " << psi_.name() <<
endl;
342 if (fvm.faceFluxCorrectionPtr_)
344 faceFluxCorrectionPtr_ =
new
347 *(fvm.faceFluxCorrectionPtr_)
358 const_cast<
fvMatrix<Type>&>(tfvm()),
362 dimensions_(tfvm().dimensions_),
365 const_cast<
fvMatrix<Type>&>(tfvm()).source_,
370 const_cast<
fvMatrix<Type>&>(tfvm()).internalCoeffs_,
375 const_cast<
fvMatrix<Type>&>(tfvm()).boundaryCoeffs_,
378 faceFluxCorrectionPtr_(nullptr)
383 <<
"Copying fvMatrix<Type> for field " << psi_.name() <<
endl;
386 if (tfvm().faceFluxCorrectionPtr_)
390 faceFluxCorrectionPtr_ = tfvm().faceFluxCorrectionPtr_;
391 tfvm().faceFluxCorrectionPtr_ =
nullptr;
395 faceFluxCorrectionPtr_ =
new
398 *(tfvm().faceFluxCorrectionPtr_)
418 internalCoeffs_(
psi.mesh().boundary().size()),
419 boundaryCoeffs_(
psi.mesh().boundary().size()),
420 faceFluxCorrectionPtr_(
nullptr)
425 <<
"Constructing fvMatrix<Type> for field " << psi_.name() <<
endl;
436 psi.mesh().boundary()[patchi].size(),
446 psi.mesh().boundary()[patchi].size(),
473 <<
"Destroying fvMatrix<Type> for field " << psi_.name() <<
endl;
476 if (faceFluxCorrectionPtr_)
478 delete faceFluxCorrectionPtr_;
492 this->setValuesFromList(cellLabels,
values);
503 this->setValuesFromList(cellLabels,
values);
512 const bool forceReference
515 if ((forceReference || psi_.needReference()) && celli >= 0)
517 source()[celli] +=
diag()[celli]*value;
528 const bool forceReference
531 const bool needRef = (forceReference || psi_.needReference());
553 const bool forceReference
556 const bool needRef = (forceReference || psi_.needReference());
584 <<
"Relaxing " << psi_.name() <<
" by " <<
alpha <<
endl;
595 sumMagOffDiag(sumOff);
598 forAll(psi_.boundaryField(), patchi)
604 const labelUList& pa = lduAddr().patchAddr(patchi);
609 const Field<Type>& pCoeffs = boundaryCoeffs_[patchi];
640 scalar d = (sumOff[celli] -
D[celli])/
mag(
D[celli]);
645 maxNon =
max(maxNon, d);
674 <<
"Matrix dominance test for " << psi_.name() <<
nl
675 <<
" number of non-dominant cells : " << nNon <<
nl
676 <<
" maximum relative non-dominance : " << maxNon <<
nl
677 <<
" average relative non-dominance : " << sumNon <<
nl
686 D[celli] =
max(
mag(
D[celli]), sumOff[celli]);
693 forAll(psi_.boundaryField(), patchi)
699 const labelUList& pa = lduAddr().patchAddr(patchi);
720 S += (
D - D0)*psi_.primitiveField();
729 psi_.mesh().data::template lookupOrDefault<bool>
730 (
"finalIteration",
false)
733 if (psi_.mesh().relaxEquation(
name))
735 relax(psi_.mesh().equationRelaxationFactor(
name));
749 bFields[patchi].manipulateMatrix(*
this);
758 addCmptAvBoundaryDiag(tdiag.
ref());
768 forAll(psi_.boundaryField(), patchi)
772 if (!ptf.
coupled() && ptf.size())
776 lduAddr().patchAddr(patchi),
777 internalCoeffs_[patchi],
796 "A("+psi_.name()+
')',
803 dimensions_/psi_.dimensions()/
dimVol,
804 extrapolatedCalculatedFvPatchScalarField::typeName
825 "H("+psi_.name()+
')',
833 extrapolatedCalculatedFvPatchScalarField::typeName
839 for (
direction cmpt=0; cmpt<Type::nComponents; cmpt++)
841 scalarField psiCmpt(psi_.primitiveField().component(cmpt));
844 addBoundaryDiag(boundaryDiagCmpt, cmpt);
845 boundaryDiagCmpt.negate();
846 addCmptAvBoundaryDiag(boundaryDiagCmpt);
857 typename Type::labelType validComponents
859 psi_.mesh().template validComponents<Type>()
862 for (
direction cmpt=0; cmpt<Type::nComponents; cmpt++)
864 if (validComponents[cmpt] == -1)
894 dimensions_/(
dimVol*psi_.dimensions()),
895 extrapolatedCalculatedFvPatchScalarField::typeName
902 forAll(psi_.boundaryField(), patchi)
906 if (ptf.
coupled() && ptf.size())
910 lduAddr().patchAddr(patchi),
917 H1_.primitiveFieldRef() /= psi_.mesh().V();
918 H1_.correctBoundaryConditions();
929 if (!psi_.mesh().fluxRequired(psi_.name()))
932 <<
"flux requested but " << psi_.name()
933 <<
" not specified in the fluxRequired sub-dictionary"
945 "flux("+psi_.name()+
')',
958 fieldFlux.setOriented();
960 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
971 forAll(InternalContrib, patchi)
973 InternalContrib[patchi] =
976 InternalContrib[patchi],
977 psi_.boundaryField()[patchi].patchInternalField()
983 forAll(NeighbourContrib, patchi)
985 if (psi_.boundaryField()[patchi].coupled())
987 NeighbourContrib[patchi] =
990 NeighbourContrib[patchi],
991 psi_.boundaryField()[patchi].patchNeighbourField()
1001 ffbf[patchi] = InternalContrib[patchi] - NeighbourContrib[patchi];
1004 if (faceFluxCorrectionPtr_)
1006 fieldFlux += *faceFluxCorrectionPtr_;
1013 template<
class Type>
1016 return psi_.mesh().solverDict
1020 psi_.mesh().data::template lookupOrDefault<bool>
1021 (
"finalIteration",
false)
1029 template<
class Type>
1037 if (&psi_ != &(fvmv.psi_))
1040 <<
"different fields"
1044 dimensions_ = fvmv.dimensions_;
1046 source_ = fvmv.source_;
1047 internalCoeffs_ = fvmv.internalCoeffs_;
1048 boundaryCoeffs_ = fvmv.boundaryCoeffs_;
1050 if (faceFluxCorrectionPtr_ && fvmv.faceFluxCorrectionPtr_)
1052 *faceFluxCorrectionPtr_ = *fvmv.faceFluxCorrectionPtr_;
1054 else if (fvmv.faceFluxCorrectionPtr_)
1056 faceFluxCorrectionPtr_ =
1058 (*fvmv.faceFluxCorrectionPtr_);
1063 template<
class Type>
1071 template<
class Type>
1076 internalCoeffs_.negate();
1077 boundaryCoeffs_.negate();
1079 if (faceFluxCorrectionPtr_)
1081 faceFluxCorrectionPtr_->negate();
1086 template<
class Type>
1091 dimensions_ += fvmv.dimensions_;
1093 source_ += fvmv.source_;
1094 internalCoeffs_ += fvmv.internalCoeffs_;
1095 boundaryCoeffs_ += fvmv.boundaryCoeffs_;
1097 if (faceFluxCorrectionPtr_ && fvmv.faceFluxCorrectionPtr_)
1099 *faceFluxCorrectionPtr_ += *fvmv.faceFluxCorrectionPtr_;
1101 else if (fvmv.faceFluxCorrectionPtr_)
1103 faceFluxCorrectionPtr_ =
new
1106 *fvmv.faceFluxCorrectionPtr_
1112 template<
class Type>
1115 operator+=(tfvmv());
1120 template<
class Type>
1125 dimensions_ -= fvmv.dimensions_;
1127 source_ -= fvmv.source_;
1128 internalCoeffs_ -= fvmv.internalCoeffs_;
1129 boundaryCoeffs_ -= fvmv.boundaryCoeffs_;
1131 if (faceFluxCorrectionPtr_ && fvmv.faceFluxCorrectionPtr_)
1133 *faceFluxCorrectionPtr_ -= *fvmv.faceFluxCorrectionPtr_;
1135 else if (fvmv.faceFluxCorrectionPtr_)
1137 faceFluxCorrectionPtr_ =
1139 (-*fvmv.faceFluxCorrectionPtr_);
1144 template<
class Type>
1147 operator-=(tfvmv());
1152 template<
class Type>
1159 source() -= su.mesh().V()*su.field();
1163 template<
class Type>
1174 template<
class Type>
1185 template<
class Type>
1192 source() += su.mesh().V()*su.field();
1196 template<
class Type>
1207 template<
class Type>
1218 template<
class Type>
1224 source() -=
psi().mesh().V()*su;
1228 template<
class Type>
1234 source() +=
psi().mesh().V()*su;
1238 template<
class Type>
1246 template<
class Type>
1254 template<
class Type>
1260 dimensions_ *= dsf.dimensions();
1262 source_ *= dsf.field();
1264 forAll(boundaryCoeffs_, patchi)
1268 dsf.mesh().boundary()[patchi].patchInternalField(dsf.field())
1271 internalCoeffs_[patchi] *= pisf;
1272 boundaryCoeffs_[patchi] *= pisf;
1275 if (faceFluxCorrectionPtr_)
1278 <<
"cannot scale a matrix containing a faceFluxCorrection"
1284 template<
class Type>
1295 template<
class Type>
1306 template<
class Type>
1312 dimensions_ *= ds.dimensions();
1314 source_ *= ds.value();
1315 internalCoeffs_ *= ds.value();
1316 boundaryCoeffs_ *= ds.value();
1318 if (faceFluxCorrectionPtr_)
1320 *faceFluxCorrectionPtr_ *= ds.value();
1327 template<
class Type>
1335 if (&fvm1.
psi() != &fvm2.
psi())
1338 <<
"incompatible fields for operation "
1340 <<
"[" << fvm1.
psi().name() <<
"] "
1342 <<
" [" << fvm2.
psi().name() <<
"]"
1349 <<
"incompatible dimensions for operation "
1359 template<
class Type>
1373 <<
" [" << df.name() << df.
dimensions() <<
" ]"
1379 template<
class Type>
1390 <<
"incompatible dimensions for operation "
1400 template<
class Type>
1403 fvMatrix<Type>& fvm,
1404 const dictionary& solverControls
1407 return fvm.solve(solverControls);
1410 template<
class Type>
1413 const tmp<fvMatrix<Type>>& tfvm,
1414 const dictionary& solverControls
1417 SolverPerformance<Type> solverPerf =
1418 const_cast<fvMatrix<Type>&
>(tfvm()).
solve(solverControls);
1426 template<
class Type>
1432 template<
class Type>
1435 SolverPerformance<Type> solverPerf =
1436 const_cast<fvMatrix<Type>&
>(tfvm()).
solve();
1444 template<
class Type>
1447 const fvMatrix<Type>&
A
1450 tmp<Foam::fvMatrix<Type>> tAcorr =
A - (
A &
A.psi());
1460 template<
class Type>
1463 const tmp<fvMatrix<Type>>& tA
1466 tmp<Foam::fvMatrix<Type>> tAcorr = tA - (tA() & tA().psi());
1478 template<
class Type>
1481 const fvMatrix<Type>&
A,
1482 const fvMatrix<Type>&
B
1489 template<
class Type>
1492 const tmp<fvMatrix<Type>>& tA,
1493 const fvMatrix<Type>&
B
1500 template<
class Type>
1503 const fvMatrix<Type>&
A,
1504 const tmp<fvMatrix<Type>>& tB
1511 template<
class Type>
1514 const tmp<fvMatrix<Type>>& tA,
1515 const tmp<fvMatrix<Type>>& tB
1522 template<
class Type>
1525 const fvMatrix<Type>&
A,
1526 const DimensionedField<Type, volMesh>& su
1530 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1531 tC.ref().source() += su.mesh().V()*su.field();
1535 template<
class Type>
1538 const fvMatrix<Type>&
A,
1539 const tmp<DimensionedField<Type, volMesh>>& tsu
1543 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1544 tC.ref().source() += tsu().mesh().V()*tsu().field();
1549 template<
class Type>
1552 const fvMatrix<Type>&
A,
1553 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
1557 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1558 tC.ref().source() += tsu().mesh().V()*tsu().primitiveField();
1563 template<
class Type>
1566 const tmp<fvMatrix<Type>>& tA,
1567 const DimensionedField<Type, volMesh>& su
1571 tmp<fvMatrix<Type>> tC(tA.ptr());
1572 tC.ref().source() += su.mesh().V()*su.field();
1576 template<
class Type>
1579 const tmp<fvMatrix<Type>>& tA,
1580 const tmp<DimensionedField<Type, volMesh>>& tsu
1584 tmp<fvMatrix<Type>> tC(tA.ptr());
1585 tC.ref().source() += tsu().mesh().V()*tsu().field();
1590 template<
class Type>
1593 const tmp<fvMatrix<Type>>& tA,
1594 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
1598 tmp<fvMatrix<Type>> tC(tA.ptr());
1599 tC.ref().source() += tsu().mesh().V()*tsu().primitiveField();
1604 template<
class Type>
1607 const fvMatrix<Type>&
A,
1608 const dimensioned<Type>& su
1612 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1613 tC.ref().source() +=
A.psi().mesh().V()*su.value();
1617 template<
class Type>
1620 const tmp<fvMatrix<Type>>& tA,
1621 const dimensioned<Type>& su
1625 tmp<fvMatrix<Type>> tC(tA.ptr());
1626 tC.ref().source() += tC().psi().mesh().V()*su.value();
1630 template<
class Type>
1633 const fvMatrix<Type>&
A,
1641 template<
class Type>
1644 const tmp<fvMatrix<Type>>& tA,
1652 template<
class Type>
1655 const fvMatrix<Type>&
A
1658 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1663 template<
class Type>
1666 const tmp<fvMatrix<Type>>& tA
1669 tmp<fvMatrix<Type>> tC(tA.ptr());
1675 template<
class Type>
1678 const fvMatrix<Type>&
A,
1679 const fvMatrix<Type>&
B
1683 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1688 template<
class Type>
1691 const tmp<fvMatrix<Type>>& tA,
1692 const fvMatrix<Type>&
B
1696 tmp<fvMatrix<Type>> tC(tA.
ptr());
1701 template<
class Type>
1704 const fvMatrix<Type>&
A,
1705 const tmp<fvMatrix<Type>>& tB
1709 tmp<fvMatrix<Type>> tC(tB.ptr());
1714 template<
class Type>
1717 const tmp<fvMatrix<Type>>& tA,
1718 const tmp<fvMatrix<Type>>& tB
1722 tmp<fvMatrix<Type>> tC(tA.
ptr());
1728 template<
class Type>
1731 const fvMatrix<Type>&
A,
1732 const DimensionedField<Type, volMesh>& su
1736 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1737 tC.ref().source() -= su.mesh().V()*su.field();
1741 template<
class Type>
1744 const fvMatrix<Type>&
A,
1745 const tmp<DimensionedField<Type, volMesh>>& tsu
1749 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1750 tC.ref().source() -= tsu().mesh().V()*tsu().field();
1755 template<
class Type>
1758 const fvMatrix<Type>&
A,
1759 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
1763 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1764 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
1769 template<
class Type>
1772 const tmp<fvMatrix<Type>>& tA,
1773 const DimensionedField<Type, volMesh>& su
1777 tmp<fvMatrix<Type>> tC(tA.
ptr());
1778 tC.ref().source() -= su.mesh().V()*su.field();
1782 template<
class Type>
1785 const tmp<fvMatrix<Type>>& tA,
1786 const tmp<DimensionedField<Type, volMesh>>& tsu
1790 tmp<fvMatrix<Type>> tC(tA.
ptr());
1791 tC.ref().source() -= tsu().mesh().V()*tsu().field();
1796 template<
class Type>
1799 const tmp<fvMatrix<Type>>& tA,
1800 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
1804 tmp<fvMatrix<Type>> tC(tA.
ptr());
1805 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
1810 template<
class Type>
1813 const DimensionedField<Type, volMesh>& su,
1814 const fvMatrix<Type>&
A
1818 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1819 tC.ref().source() -= su.mesh().V()*su.field();
1823 template<
class Type>
1826 const tmp<DimensionedField<Type, volMesh>>& tsu,
1827 const fvMatrix<Type>&
A
1831 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1832 tC.ref().source() -= tsu().mesh().V()*tsu().field();
1837 template<
class Type>
1840 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu,
1841 const fvMatrix<Type>&
A
1845 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1846 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
1851 template<
class Type>
1854 const DimensionedField<Type, volMesh>& su,
1855 const tmp<fvMatrix<Type>>& tA
1859 tmp<fvMatrix<Type>> tC(tA.
ptr());
1860 tC.ref().source() -= su.mesh().V()*su.field();
1864 template<
class Type>
1867 const tmp<DimensionedField<Type, volMesh>>& tsu,
1868 const tmp<fvMatrix<Type>>& tA
1872 tmp<fvMatrix<Type>> tC(tA.
ptr());
1873 tC.ref().source() -= tsu().mesh().V()*tsu().field();
1878 template<
class Type>
1881 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu,
1882 const tmp<fvMatrix<Type>>& tA
1886 tmp<fvMatrix<Type>> tC(tA.
ptr());
1887 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
1893 template<
class Type>
1896 const fvMatrix<Type>&
A,
1897 const fvMatrix<Type>&
B
1901 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1906 template<
class Type>
1909 const tmp<fvMatrix<Type>>& tA,
1910 const fvMatrix<Type>&
B
1914 tmp<fvMatrix<Type>> tC(tA.
ptr());
1919 template<
class Type>
1922 const fvMatrix<Type>&
A,
1923 const tmp<fvMatrix<Type>>& tB
1927 tmp<fvMatrix<Type>> tC(tB.ptr());
1933 template<
class Type>
1936 const tmp<fvMatrix<Type>>& tA,
1937 const tmp<fvMatrix<Type>>& tB
1941 tmp<fvMatrix<Type>> tC(tA.
ptr());
1947 template<
class Type>
1950 const fvMatrix<Type>&
A,
1951 const DimensionedField<Type, volMesh>& su
1955 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1956 tC.ref().source() += su.mesh().V()*su.field();
1960 template<
class Type>
1963 const fvMatrix<Type>&
A,
1964 const tmp<DimensionedField<Type, volMesh>>& tsu
1968 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1969 tC.ref().source() += tsu().mesh().V()*tsu().field();
1974 template<
class Type>
1977 const fvMatrix<Type>&
A,
1978 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
1982 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1983 tC.ref().source() += tsu().mesh().V()*tsu().primitiveField();
1988 template<
class Type>
1991 const tmp<fvMatrix<Type>>& tA,
1992 const DimensionedField<Type, volMesh>& su
1996 tmp<fvMatrix<Type>> tC(tA.
ptr());
1997 tC.ref().source() += su.mesh().V()*su.field();
2001 template<
class Type>
2004 const tmp<fvMatrix<Type>>& tA,
2005 const tmp<DimensionedField<Type, volMesh>>& tsu
2009 tmp<fvMatrix<Type>> tC(tA.
ptr());
2010 tC.ref().source() += tsu().mesh().V()*tsu().field();
2015 template<
class Type>
2018 const tmp<fvMatrix<Type>>& tA,
2019 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
2023 tmp<fvMatrix<Type>> tC(tA.
ptr());
2024 tC.ref().source() += tsu().mesh().V()*tsu().primitiveField();
2029 template<
class Type>
2032 const DimensionedField<Type, volMesh>& su,
2033 const fvMatrix<Type>&
A
2037 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2039 tC.ref().source() -= su.mesh().V()*su.field();
2043 template<
class Type>
2046 const tmp<DimensionedField<Type, volMesh>>& tsu,
2047 const fvMatrix<Type>&
A
2051 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2053 tC.ref().source() -= tsu().mesh().V()*tsu().field();
2058 template<
class Type>
2061 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu,
2062 const fvMatrix<Type>&
A
2066 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2068 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
2073 template<
class Type>
2076 const DimensionedField<Type, volMesh>& su,
2077 const tmp<fvMatrix<Type>>& tA
2081 tmp<fvMatrix<Type>> tC(tA.
ptr());
2083 tC.ref().source() -= su.mesh().V()*su.field();
2087 template<
class Type>
2090 const tmp<DimensionedField<Type, volMesh>>& tsu,
2091 const tmp<fvMatrix<Type>>& tA
2095 tmp<fvMatrix<Type>> tC(tA.
ptr());
2097 tC.ref().source() -= tsu().mesh().V()*tsu().field();
2102 template<
class Type>
2105 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu,
2106 const tmp<fvMatrix<Type>>& tA
2110 tmp<fvMatrix<Type>> tC(tA.
ptr());
2112 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
2117 template<
class Type>
2120 const fvMatrix<Type>&
A,
2121 const dimensioned<Type>& su
2125 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2126 tC.ref().source() -= su.value()*
A.psi().mesh().V();
2130 template<
class Type>
2133 const tmp<fvMatrix<Type>>& tA,
2134 const dimensioned<Type>& su
2138 tmp<fvMatrix<Type>> tC(tA.
ptr());
2139 tC.ref().source() -= su.value()*tC().psi().mesh().V();
2143 template<
class Type>
2146 const dimensioned<Type>& su,
2147 const fvMatrix<Type>&
A
2151 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2152 tC.ref().source() -= su.value()*
A.psi().mesh().V();
2156 template<
class Type>
2159 const dimensioned<Type>& su,
2160 const tmp<fvMatrix<Type>>& tA
2164 tmp<fvMatrix<Type>> tC(tA.
ptr());
2165 tC.ref().source() -= su.value()*tC().psi().mesh().V();
2169 template<
class Type>
2172 const fvMatrix<Type>&
A,
2173 const dimensioned<Type>& su
2177 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2178 tC.ref().source() += su.value()*tC().psi().mesh().V();
2182 template<
class Type>
2185 const tmp<fvMatrix<Type>>& tA,
2186 const dimensioned<Type>& su
2190 tmp<fvMatrix<Type>> tC(tA.
ptr());
2191 tC.ref().source() += su.value()*tC().psi().mesh().V();
2195 template<
class Type>
2198 const dimensioned<Type>& su,
2199 const fvMatrix<Type>&
A
2203 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2205 tC.ref().source() -= su.value()*
A.psi().mesh().V();
2209 template<
class Type>
2212 const dimensioned<Type>& su,
2213 const tmp<fvMatrix<Type>>& tA
2217 tmp<fvMatrix<Type>> tC(tA.
ptr());
2219 tC.ref().source() -= su.value()*tC().psi().mesh().V();
2224 template<
class Type>
2228 const fvMatrix<Type>&
A
2231 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2236 template<
class Type>
2239 const tmp<volScalarField::Internal>& tdsf,
2240 const fvMatrix<Type>&
A
2243 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2248 template<
class Type>
2251 const tmp<volScalarField>& tvsf,
2252 const fvMatrix<Type>&
A
2255 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2260 template<
class Type>
2264 const tmp<fvMatrix<Type>>& tA
2267 tmp<fvMatrix<Type>> tC(tA.
ptr());
2272 template<
class Type>
2275 const tmp<volScalarField::Internal>& tdsf,
2276 const tmp<fvMatrix<Type>>& tA
2279 tmp<fvMatrix<Type>> tC(tA.
ptr());
2284 template<
class Type>
2287 const tmp<volScalarField>& tvsf,
2288 const tmp<fvMatrix<Type>>& tA
2291 tmp<fvMatrix<Type>> tC(tA.
ptr());
2296 template<
class Type>
2299 const dimensioned<scalar>& ds,
2300 const fvMatrix<Type>&
A
2303 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2308 template<
class Type>
2311 const dimensioned<scalar>& ds,
2312 const tmp<fvMatrix<Type>>& tA
2315 tmp<fvMatrix<Type>> tC(tA.
ptr());
2321 template<
class Type>
2325 const fvMatrix<Type>&
M,
2326 const DimensionedField<Type, volMesh>&
psi
2329 tmp<GeometricField<Type, fvPatchField, volMesh>> tMphi
2331 new GeometricField<Type, fvPatchField, volMesh>
2343 extrapolatedCalculatedFvPatchScalarField::typeName
2346 GeometricField<Type, fvPatchField, volMesh>& Mphi = tMphi.ref();
2351 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
2355 M.addBoundaryDiag(boundaryDiagCmpt, cmpt);
2356 Mphi.primitiveFieldRef().replace(cmpt, -boundaryDiagCmpt*psiCmpt);
2361 Mphi.primitiveFieldRef() =
Zero;
2364 Mphi.primitiveFieldRef() +=
M.lduMatrix::H(
psi.field()) +
M.source();
2365 M.addBoundarySource(Mphi.primitiveFieldRef());
2367 Mphi.primitiveFieldRef() /= -
psi.mesh().V();
2373 template<
class Type>
2377 const fvMatrix<Type>&
M,
2378 const tmp<DimensionedField<Type, volMesh>>& tpsi
2381 tmp<GeometricField<Type, fvPatchField, volMesh>> tMpsi =
M & tpsi();
2386 template<
class Type>
2390 const fvMatrix<Type>&
M,
2391 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tpsi
2394 tmp<GeometricField<Type, fvPatchField, volMesh>> tMpsi =
M & tpsi();
2399 template<
class Type>
2403 const tmp<fvMatrix<Type>>& tM,
2404 const DimensionedField<Type, volMesh>&
psi
2407 tmp<GeometricField<Type, fvPatchField, volMesh>> tMpsi = tM() &
psi;
2412 template<
class Type>
2416 const tmp<fvMatrix<Type>>& tM,
2417 const tmp<DimensionedField<Type, volMesh>>& tpsi
2420 tmp<GeometricField<Type, fvPatchField, volMesh>> tMpsi = tM() & tpsi();
2426 template<
class Type>
2430 const tmp<fvMatrix<Type>>& tM,
2431 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tpsi
2434 tmp<GeometricField<Type, fvPatchField, volMesh>> tMpsi = tM() & tpsi();
2443 template<
class Type>
2446 os << static_cast<const lduMatrix&>(fvm) <<
nl
2447 << fvm.dimensions_ <<
nl
2448 << fvm.source_ <<
nl
2449 << fvm.internalCoeffs_ <<
nl
2450 << fvm.boundaryCoeffs_ <<
endl;