49 if (addr.
size() != pf.size())
52 <<
"addressing (" << addr.
size()
53 <<
") and field (" << pf.size() <<
") are different sizes" <<
endl
59 intf[addr[facei]] += pf[facei];
73 addToInternalField(addr, tpf(), intf);
87 if (addr.
size() != pf.size())
90 <<
"addressing (" << addr.
size()
91 <<
") and field (" << pf.size() <<
") are different sizes" <<
endl
97 intf[addr[facei]] -= pf[facei];
103 template<
class Type2>
111 subtractFromInternalField(addr, tpf(), intf);
123 forAll(internalCoeffs_, patchi)
127 lduAddr().patchAddr(patchi),
128 internalCoeffs_[patchi].
component(solveCmpt),
138 forAll(internalCoeffs_, patchi)
142 lduAddr().patchAddr(patchi),
143 cmptAv(internalCoeffs_[patchi]),
157 forAll(psi_.boundaryField(), patchi)
164 addToInternalField(lduAddr().patchAddr(patchi), pbc, source);
171 const labelUList& addr = lduAddr().patchAddr(patchi);
175 source[addr[facei]] +=
cmptMultiply(pbc[facei], pnf[facei]);
183 template<
template<
class>
class ListType>
187 const ListType<Type>&
values
205 const label celli = cellLabels[i];
206 const Type& value =
values[i];
209 source_[celli] = value*Diag[celli];
211 if (symmetric() || asymmetric())
213 for (
const label facei :
cells[celli])
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 const label patchi =
mesh.boundaryMesh().whichPatch(facei);
249 if (internalCoeffs_[patchi].size())
251 const label patchFacei =
252 mesh.boundaryMesh()[patchi].whichFace(facei);
254 internalCoeffs_[patchi][patchFacei] =
Zero;
255 boundaryCoeffs_[patchi][patchFacei] =
Zero;
277 internalCoeffs_(
psi.mesh().boundary().size()),
278 boundaryCoeffs_(
psi.mesh().boundary().size()),
279 faceFluxCorrectionPtr_(
nullptr)
282 <<
"Constructing fvMatrix<Type> for field " << psi_.name() <<
endl;
292 psi.mesh().boundary()[patchi].size(),
302 psi.mesh().boundary()[patchi].size(),
312 const label currentStatePsi = psiRef.eventNo();
314 psiRef.eventNo() = currentStatePsi;
324 dimensions_(fvm.dimensions_),
325 source_(fvm.source_),
326 internalCoeffs_(fvm.internalCoeffs_),
327 boundaryCoeffs_(fvm.boundaryCoeffs_),
328 faceFluxCorrectionPtr_(nullptr)
331 <<
"Copying fvMatrix<Type> for field " << psi_.name() <<
endl;
333 if (fvm.faceFluxCorrectionPtr_)
335 faceFluxCorrectionPtr_ =
338 *(fvm.faceFluxCorrectionPtr_)
349 const_cast<
fvMatrix<Type>&>(tfvm()),
353 dimensions_(tfvm().dimensions_),
356 const_cast<
fvMatrix<Type>&>(tfvm()).source_,
361 const_cast<
fvMatrix<Type>&>(tfvm()).internalCoeffs_,
366 const_cast<
fvMatrix<Type>&>(tfvm()).boundaryCoeffs_,
369 faceFluxCorrectionPtr_(nullptr)
372 <<
"Copying fvMatrix<Type> for field " << psi_.name() <<
endl;
374 if (tfvm().faceFluxCorrectionPtr_)
378 faceFluxCorrectionPtr_ = tfvm().faceFluxCorrectionPtr_;
379 tfvm().faceFluxCorrectionPtr_ =
nullptr;
383 faceFluxCorrectionPtr_ =
386 *(tfvm().faceFluxCorrectionPtr_)
406 internalCoeffs_(
psi.mesh().boundary().size()),
407 boundaryCoeffs_(
psi.mesh().boundary().size()),
408 faceFluxCorrectionPtr_(
nullptr)
411 <<
"Constructing fvMatrix<Type> for field " << psi_.name() <<
endl;
421 psi.mesh().boundary()[patchi].size(),
431 psi.mesh().boundary()[patchi].size(),
455 <<
"Destroying fvMatrix<Type> for field " << psi_.name() <<
endl;
481 this->setValuesFromList(cellLabels,
values);
492 this->setValuesFromList(cellLabels,
values);
501 const bool forceReference
504 if ((forceReference || psi_.needReference()) && celli >= 0)
506 source()[celli] +=
diag()[celli]*value;
517 const bool forceReference
520 if (forceReference || psi_.needReference())
524 const label
cellId = cellLabels[celli];
540 const bool forceReference
543 if (forceReference || psi_.needReference())
547 const label
cellId = cellLabels[celli];
567 <<
"Relaxing " << psi_.name() <<
" by " <<
alpha <<
endl;
577 sumMagOffDiag(sumOff);
580 forAll(psi_.boundaryField(), patchi)
586 const labelUList& pa = lduAddr().patchAddr(patchi);
591 const Field<Type>& pCoeffs = boundaryCoeffs_[patchi];
622 scalar d = (sumOff[celli] -
D[celli])/
mag(
D[celli]);
627 maxNon =
max(maxNon, d);
656 <<
"Matrix dominance test for " << psi_.name() <<
nl
657 <<
" number of non-dominant cells : " << nNon <<
nl
658 <<
" maximum relative non-dominance : " << maxNon <<
nl
659 <<
" average relative non-dominance : " << sumNon <<
nl
668 D[celli] =
max(
mag(
D[celli]), sumOff[celli]);
675 forAll(psi_.boundaryField(), patchi)
681 const labelUList& pa = lduAddr().patchAddr(patchi);
702 S += (
D - D0)*psi_.primitiveField();
711 psi_.mesh().data::template getOrDefault<bool>
712 (
"finalIteration",
false)
715 if (psi_.mesh().relaxEquation(
name))
717 relax(psi_.mesh().equationRelaxationFactor(
name));
731 bFields[patchi].manipulateMatrix(*
this);
740 addCmptAvBoundaryDiag(tdiag.
ref());
750 forAll(psi_.boundaryField(), patchi)
754 if (!ptf.
coupled() && ptf.size())
758 lduAddr().patchAddr(patchi),
759 internalCoeffs_[patchi],
778 "A("+psi_.name()+
')',
785 dimensions_/psi_.dimensions()/
dimVol,
786 extrapolatedCalculatedFvPatchScalarField::typeName
807 "H("+psi_.name()+
')',
815 extrapolatedCalculatedFvPatchScalarField::typeName
821 for (
direction cmpt=0; cmpt<Type::nComponents; cmpt++)
823 scalarField psiCmpt(psi_.primitiveField().component(cmpt));
826 addBoundaryDiag(boundaryDiagCmpt, cmpt);
827 boundaryDiagCmpt.negate();
828 addCmptAvBoundaryDiag(boundaryDiagCmpt);
839 typename Type::labelType validComponents
841 psi_.mesh().template validComponents<Type>()
844 for (
direction cmpt=0; cmpt<Type::nComponents; cmpt++)
846 if (validComponents[cmpt] == -1)
876 dimensions_/(
dimVol*psi_.dimensions()),
877 extrapolatedCalculatedFvPatchScalarField::typeName
884 forAll(psi_.boundaryField(), patchi)
888 if (ptf.
coupled() && ptf.size())
892 lduAddr().patchAddr(patchi),
899 H1_.primitiveFieldRef() /= psi_.mesh().V();
900 H1_.correctBoundaryConditions();
911 if (!psi_.mesh().fluxRequired(psi_.name()))
914 <<
"flux requested but " << psi_.name()
915 <<
" not specified in the fluxRequired sub-dictionary"
927 "flux("+psi_.name()+
')',
940 fieldFlux.setOriented();
942 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
953 forAll(InternalContrib, patchi)
955 InternalContrib[patchi] =
958 InternalContrib[patchi],
959 psi_.boundaryField()[patchi].patchInternalField()
965 forAll(NeighbourContrib, patchi)
967 if (psi_.boundaryField()[patchi].coupled())
969 NeighbourContrib[patchi] =
972 NeighbourContrib[patchi],
973 psi_.boundaryField()[patchi].patchNeighbourField()
983 ffbf[patchi] = InternalContrib[patchi] - NeighbourContrib[patchi];
986 if (faceFluxCorrectionPtr_)
988 fieldFlux += *faceFluxCorrectionPtr_;
998 return psi_.mesh().solverDict
1002 psi_.mesh().data::template getOrDefault<bool>
1003 (
"finalIteration",
false)
1011 template<
class Type>
1019 if (&psi_ != &(fvmv.psi_))
1022 <<
"different fields"
1026 dimensions_ = fvmv.dimensions_;
1028 source_ = fvmv.source_;
1029 internalCoeffs_ = fvmv.internalCoeffs_;
1030 boundaryCoeffs_ = fvmv.boundaryCoeffs_;
1032 if (faceFluxCorrectionPtr_ && fvmv.faceFluxCorrectionPtr_)
1034 *faceFluxCorrectionPtr_ = *fvmv.faceFluxCorrectionPtr_;
1036 else if (fvmv.faceFluxCorrectionPtr_)
1038 faceFluxCorrectionPtr_ =
1040 (*fvmv.faceFluxCorrectionPtr_);
1045 template<
class Type>
1053 template<
class Type>
1058 internalCoeffs_.negate();
1059 boundaryCoeffs_.negate();
1061 if (faceFluxCorrectionPtr_)
1063 faceFluxCorrectionPtr_->negate();
1068 template<
class Type>
1073 dimensions_ += fvmv.dimensions_;
1075 source_ += fvmv.source_;
1076 internalCoeffs_ += fvmv.internalCoeffs_;
1077 boundaryCoeffs_ += fvmv.boundaryCoeffs_;
1079 if (faceFluxCorrectionPtr_ && fvmv.faceFluxCorrectionPtr_)
1081 *faceFluxCorrectionPtr_ += *fvmv.faceFluxCorrectionPtr_;
1083 else if (fvmv.faceFluxCorrectionPtr_)
1085 faceFluxCorrectionPtr_ =
new
1088 *fvmv.faceFluxCorrectionPtr_
1094 template<
class Type>
1097 operator+=(tfvmv());
1102 template<
class Type>
1107 dimensions_ -= fvmv.dimensions_;
1109 source_ -= fvmv.source_;
1110 internalCoeffs_ -= fvmv.internalCoeffs_;
1111 boundaryCoeffs_ -= fvmv.boundaryCoeffs_;
1113 if (faceFluxCorrectionPtr_ && fvmv.faceFluxCorrectionPtr_)
1115 *faceFluxCorrectionPtr_ -= *fvmv.faceFluxCorrectionPtr_;
1117 else if (fvmv.faceFluxCorrectionPtr_)
1119 faceFluxCorrectionPtr_ =
1121 (-*fvmv.faceFluxCorrectionPtr_);
1126 template<
class Type>
1129 operator-=(tfvmv());
1134 template<
class Type>
1141 source() -= su.mesh().V()*su.field();
1145 template<
class Type>
1156 template<
class Type>
1167 template<
class Type>
1174 source() += su.mesh().V()*su.field();
1178 template<
class Type>
1189 template<
class Type>
1200 template<
class Type>
1206 source() -=
psi().mesh().V()*su;
1210 template<
class Type>
1216 source() +=
psi().mesh().V()*su;
1220 template<
class Type>
1228 template<
class Type>
1236 template<
class Type>
1242 dimensions_ *= dsf.dimensions();
1244 source_ *= dsf.field();
1246 forAll(boundaryCoeffs_, patchi)
1250 dsf.mesh().boundary()[patchi].patchInternalField(dsf.field())
1253 internalCoeffs_[patchi] *= pisf;
1254 boundaryCoeffs_[patchi] *= pisf;
1257 if (faceFluxCorrectionPtr_)
1260 <<
"cannot scale a matrix containing a faceFluxCorrection"
1266 template<
class Type>
1277 template<
class Type>
1288 template<
class Type>
1294 dimensions_ *= ds.dimensions();
1296 source_ *= ds.value();
1297 internalCoeffs_ *= ds.value();
1298 boundaryCoeffs_ *= ds.value();
1300 if (faceFluxCorrectionPtr_)
1302 *faceFluxCorrectionPtr_ *= ds.value();
1309 template<
class Type>
1317 if (&fvm1.
psi() != &fvm2.
psi())
1320 <<
"incompatible fields for operation "
1322 <<
"[" << fvm1.
psi().name() <<
"] "
1324 <<
" [" << fvm2.
psi().name() <<
"]"
1331 <<
"incompatible dimensions for operation "
1341 template<
class Type>
1355 <<
" [" << df.name() << df.
dimensions() <<
" ]"
1361 template<
class Type>
1372 <<
"incompatible dimensions for operation "
1382 template<
class Type>
1385 fvMatrix<Type>& fvm,
1386 const dictionary& solverControls
1389 return fvm.solve(solverControls);
1392 template<
class Type>
1395 const tmp<fvMatrix<Type>>& tfvm,
1396 const dictionary& solverControls
1399 SolverPerformance<Type> solverPerf =
1400 const_cast<fvMatrix<Type>&
>(tfvm()).
solve(solverControls);
1408 template<
class Type>
1414 template<
class Type>
1417 SolverPerformance<Type> solverPerf =
1418 const_cast<fvMatrix<Type>&
>(tfvm()).
solve();
1426 template<
class Type>
1429 const fvMatrix<Type>&
A
1432 tmp<Foam::fvMatrix<Type>> tAcorr =
A - (
A &
A.psi());
1442 template<
class Type>
1445 const tmp<fvMatrix<Type>>& tA
1448 tmp<Foam::fvMatrix<Type>> tAcorr = tA - (tA() & tA().psi());
1460 template<
class Type>
1463 const fvMatrix<Type>&
A,
1464 const fvMatrix<Type>&
B
1471 template<
class Type>
1474 const tmp<fvMatrix<Type>>& tA,
1475 const fvMatrix<Type>&
B
1482 template<
class Type>
1485 const fvMatrix<Type>&
A,
1486 const tmp<fvMatrix<Type>>& tB
1493 template<
class Type>
1496 const tmp<fvMatrix<Type>>& tA,
1497 const tmp<fvMatrix<Type>>& tB
1504 template<
class Type>
1507 const fvMatrix<Type>&
A,
1508 const DimensionedField<Type, volMesh>& su
1512 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1513 tC.ref().source() += su.mesh().V()*su.field();
1517 template<
class Type>
1520 const fvMatrix<Type>&
A,
1521 const tmp<DimensionedField<Type, volMesh>>& tsu
1525 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1526 tC.ref().source() += tsu().mesh().V()*tsu().field();
1531 template<
class Type>
1534 const fvMatrix<Type>&
A,
1535 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
1539 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1540 tC.ref().source() += tsu().mesh().V()*tsu().primitiveField();
1545 template<
class Type>
1548 const tmp<fvMatrix<Type>>& tA,
1549 const DimensionedField<Type, volMesh>& su
1553 tmp<fvMatrix<Type>> tC(tA.ptr());
1554 tC.ref().source() += su.mesh().V()*su.field();
1558 template<
class Type>
1561 const tmp<fvMatrix<Type>>& tA,
1562 const tmp<DimensionedField<Type, volMesh>>& tsu
1566 tmp<fvMatrix<Type>> tC(tA.ptr());
1567 tC.ref().source() += tsu().mesh().V()*tsu().field();
1572 template<
class Type>
1575 const tmp<fvMatrix<Type>>& tA,
1576 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
1580 tmp<fvMatrix<Type>> tC(tA.ptr());
1581 tC.ref().source() += tsu().mesh().V()*tsu().primitiveField();
1586 template<
class Type>
1589 const fvMatrix<Type>&
A,
1590 const dimensioned<Type>& su
1594 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1595 tC.ref().source() +=
A.psi().mesh().V()*su.value();
1599 template<
class Type>
1602 const tmp<fvMatrix<Type>>& tA,
1603 const dimensioned<Type>& su
1607 tmp<fvMatrix<Type>> tC(tA.ptr());
1608 tC.ref().source() += tC().psi().mesh().V()*su.value();
1612 template<
class Type>
1615 const fvMatrix<Type>&
A,
1623 template<
class Type>
1626 const tmp<fvMatrix<Type>>& tA,
1634 template<
class Type>
1637 const fvMatrix<Type>&
A
1640 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1645 template<
class Type>
1648 const tmp<fvMatrix<Type>>& tA
1651 tmp<fvMatrix<Type>> tC(tA.ptr());
1657 template<
class Type>
1660 const fvMatrix<Type>&
A,
1661 const fvMatrix<Type>&
B
1665 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1670 template<
class Type>
1673 const tmp<fvMatrix<Type>>& tA,
1674 const fvMatrix<Type>&
B
1678 tmp<fvMatrix<Type>> tC(tA.
ptr());
1683 template<
class Type>
1686 const fvMatrix<Type>&
A,
1687 const tmp<fvMatrix<Type>>& tB
1691 tmp<fvMatrix<Type>> tC(tB.ptr());
1696 template<
class Type>
1699 const tmp<fvMatrix<Type>>& tA,
1700 const tmp<fvMatrix<Type>>& tB
1704 tmp<fvMatrix<Type>> tC(tA.
ptr());
1710 template<
class Type>
1713 const fvMatrix<Type>&
A,
1714 const DimensionedField<Type, volMesh>& su
1718 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1719 tC.ref().source() -= su.mesh().V()*su.field();
1723 template<
class Type>
1726 const fvMatrix<Type>&
A,
1727 const tmp<DimensionedField<Type, volMesh>>& tsu
1731 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1732 tC.ref().source() -= tsu().mesh().V()*tsu().field();
1737 template<
class Type>
1740 const fvMatrix<Type>&
A,
1741 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
1745 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1746 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
1751 template<
class Type>
1754 const tmp<fvMatrix<Type>>& tA,
1755 const DimensionedField<Type, volMesh>& su
1759 tmp<fvMatrix<Type>> tC(tA.
ptr());
1760 tC.ref().source() -= su.mesh().V()*su.field();
1764 template<
class Type>
1767 const tmp<fvMatrix<Type>>& tA,
1768 const tmp<DimensionedField<Type, volMesh>>& tsu
1772 tmp<fvMatrix<Type>> tC(tA.
ptr());
1773 tC.ref().source() -= tsu().mesh().V()*tsu().field();
1778 template<
class Type>
1781 const tmp<fvMatrix<Type>>& tA,
1782 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
1786 tmp<fvMatrix<Type>> tC(tA.
ptr());
1787 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
1792 template<
class Type>
1795 const DimensionedField<Type, volMesh>& su,
1796 const fvMatrix<Type>&
A
1800 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1801 tC.ref().source() -= su.mesh().V()*su.field();
1805 template<
class Type>
1808 const tmp<DimensionedField<Type, volMesh>>& tsu,
1809 const fvMatrix<Type>&
A
1813 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1814 tC.ref().source() -= tsu().mesh().V()*tsu().field();
1819 template<
class Type>
1822 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu,
1823 const fvMatrix<Type>&
A
1827 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1828 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
1833 template<
class Type>
1836 const DimensionedField<Type, volMesh>& su,
1837 const tmp<fvMatrix<Type>>& tA
1841 tmp<fvMatrix<Type>> tC(tA.
ptr());
1842 tC.ref().source() -= su.mesh().V()*su.field();
1846 template<
class Type>
1849 const tmp<DimensionedField<Type, volMesh>>& tsu,
1850 const tmp<fvMatrix<Type>>& tA
1854 tmp<fvMatrix<Type>> tC(tA.
ptr());
1855 tC.ref().source() -= tsu().mesh().V()*tsu().field();
1860 template<
class Type>
1863 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu,
1864 const tmp<fvMatrix<Type>>& tA
1868 tmp<fvMatrix<Type>> tC(tA.
ptr());
1869 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
1875 template<
class Type>
1878 const fvMatrix<Type>&
A,
1879 const fvMatrix<Type>&
B
1883 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1888 template<
class Type>
1891 const tmp<fvMatrix<Type>>& tA,
1892 const fvMatrix<Type>&
B
1896 tmp<fvMatrix<Type>> tC(tA.
ptr());
1901 template<
class Type>
1904 const fvMatrix<Type>&
A,
1905 const tmp<fvMatrix<Type>>& tB
1909 tmp<fvMatrix<Type>> tC(tB.ptr());
1915 template<
class Type>
1918 const tmp<fvMatrix<Type>>& tA,
1919 const tmp<fvMatrix<Type>>& tB
1923 tmp<fvMatrix<Type>> tC(tA.
ptr());
1929 template<
class Type>
1932 const fvMatrix<Type>&
A,
1933 const DimensionedField<Type, volMesh>& su
1937 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1938 tC.ref().source() += su.mesh().V()*su.field();
1942 template<
class Type>
1945 const fvMatrix<Type>&
A,
1946 const tmp<DimensionedField<Type, volMesh>>& tsu
1950 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1951 tC.ref().source() += tsu().mesh().V()*tsu().field();
1956 template<
class Type>
1959 const fvMatrix<Type>&
A,
1960 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
1964 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1965 tC.ref().source() += tsu().mesh().V()*tsu().primitiveField();
1970 template<
class Type>
1973 const tmp<fvMatrix<Type>>& tA,
1974 const DimensionedField<Type, volMesh>& su
1978 tmp<fvMatrix<Type>> tC(tA.
ptr());
1979 tC.ref().source() += su.mesh().V()*su.field();
1983 template<
class Type>
1986 const tmp<fvMatrix<Type>>& tA,
1987 const tmp<DimensionedField<Type, volMesh>>& tsu
1991 tmp<fvMatrix<Type>> tC(tA.
ptr());
1992 tC.ref().source() += tsu().mesh().V()*tsu().field();
1997 template<
class Type>
2000 const tmp<fvMatrix<Type>>& tA,
2001 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
2005 tmp<fvMatrix<Type>> tC(tA.
ptr());
2006 tC.ref().source() += tsu().mesh().V()*tsu().primitiveField();
2011 template<
class Type>
2014 const DimensionedField<Type, volMesh>& su,
2015 const fvMatrix<Type>&
A
2019 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2021 tC.ref().source() -= su.mesh().V()*su.field();
2025 template<
class Type>
2028 const tmp<DimensionedField<Type, volMesh>>& tsu,
2029 const fvMatrix<Type>&
A
2033 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2035 tC.ref().source() -= tsu().mesh().V()*tsu().field();
2040 template<
class Type>
2043 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu,
2044 const fvMatrix<Type>&
A
2048 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2050 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
2055 template<
class Type>
2058 const DimensionedField<Type, volMesh>& su,
2059 const tmp<fvMatrix<Type>>& tA
2063 tmp<fvMatrix<Type>> tC(tA.
ptr());
2065 tC.ref().source() -= su.mesh().V()*su.field();
2069 template<
class Type>
2072 const tmp<DimensionedField<Type, volMesh>>& tsu,
2073 const tmp<fvMatrix<Type>>& tA
2077 tmp<fvMatrix<Type>> tC(tA.
ptr());
2079 tC.ref().source() -= tsu().mesh().V()*tsu().field();
2084 template<
class Type>
2087 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu,
2088 const tmp<fvMatrix<Type>>& tA
2092 tmp<fvMatrix<Type>> tC(tA.
ptr());
2094 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
2099 template<
class Type>
2102 const fvMatrix<Type>&
A,
2103 const dimensioned<Type>& su
2107 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2108 tC.ref().source() -= su.value()*
A.psi().mesh().V();
2112 template<
class Type>
2115 const tmp<fvMatrix<Type>>& tA,
2116 const dimensioned<Type>& su
2120 tmp<fvMatrix<Type>> tC(tA.
ptr());
2121 tC.ref().source() -= su.value()*tC().psi().mesh().V();
2125 template<
class Type>
2128 const dimensioned<Type>& su,
2129 const fvMatrix<Type>&
A
2133 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2134 tC.ref().source() -= su.value()*
A.psi().mesh().V();
2138 template<
class Type>
2141 const dimensioned<Type>& su,
2142 const tmp<fvMatrix<Type>>& tA
2146 tmp<fvMatrix<Type>> tC(tA.
ptr());
2147 tC.ref().source() -= su.value()*tC().psi().mesh().V();
2151 template<
class Type>
2154 const fvMatrix<Type>&
A,
2155 const dimensioned<Type>& su
2159 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2160 tC.ref().source() += su.value()*tC().psi().mesh().V();
2164 template<
class Type>
2167 const tmp<fvMatrix<Type>>& tA,
2168 const dimensioned<Type>& su
2172 tmp<fvMatrix<Type>> tC(tA.
ptr());
2173 tC.ref().source() += su.value()*tC().psi().mesh().V();
2177 template<
class Type>
2180 const dimensioned<Type>& su,
2181 const fvMatrix<Type>&
A
2185 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2187 tC.ref().source() -= su.value()*
A.psi().mesh().V();
2191 template<
class Type>
2194 const dimensioned<Type>& su,
2195 const tmp<fvMatrix<Type>>& tA
2199 tmp<fvMatrix<Type>> tC(tA.
ptr());
2201 tC.ref().source() -= su.value()*tC().psi().mesh().V();
2206 template<
class Type>
2210 const fvMatrix<Type>&
A
2213 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2218 template<
class Type>
2221 const tmp<volScalarField::Internal>& tdsf,
2222 const fvMatrix<Type>&
A
2225 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2230 template<
class Type>
2233 const tmp<volScalarField>& tvsf,
2234 const fvMatrix<Type>&
A
2237 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2242 template<
class Type>
2246 const tmp<fvMatrix<Type>>& tA
2249 tmp<fvMatrix<Type>> tC(tA.
ptr());
2254 template<
class Type>
2257 const tmp<volScalarField::Internal>& tdsf,
2258 const tmp<fvMatrix<Type>>& tA
2261 tmp<fvMatrix<Type>> tC(tA.
ptr());
2266 template<
class Type>
2269 const tmp<volScalarField>& tvsf,
2270 const tmp<fvMatrix<Type>>& tA
2273 tmp<fvMatrix<Type>> tC(tA.
ptr());
2278 template<
class Type>
2281 const dimensioned<scalar>& ds,
2282 const fvMatrix<Type>&
A
2285 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2290 template<
class Type>
2293 const dimensioned<scalar>& ds,
2294 const tmp<fvMatrix<Type>>& tA
2297 tmp<fvMatrix<Type>> tC(tA.
ptr());
2303 template<
class Type>
2307 const fvMatrix<Type>&
M,
2308 const DimensionedField<Type, volMesh>&
psi
2311 tmp<GeometricField<Type, fvPatchField, volMesh>> tMphi
2313 new GeometricField<Type, fvPatchField, volMesh>
2325 extrapolatedCalculatedFvPatchScalarField::typeName
2328 GeometricField<Type, fvPatchField, volMesh>& Mphi = tMphi.ref();
2333 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
2337 M.addBoundaryDiag(boundaryDiagCmpt, cmpt);
2338 Mphi.primitiveFieldRef().replace(cmpt, -boundaryDiagCmpt*psiCmpt);
2343 Mphi.primitiveFieldRef() =
Zero;
2346 Mphi.primitiveFieldRef() +=
M.lduMatrix::H(
psi.field()) +
M.source();
2347 M.addBoundarySource(Mphi.primitiveFieldRef());
2349 Mphi.primitiveFieldRef() /= -
psi.mesh().V();
2355 template<
class Type>
2359 const fvMatrix<Type>&
M,
2360 const tmp<DimensionedField<Type, volMesh>>& tpsi
2363 tmp<GeometricField<Type, fvPatchField, volMesh>> tMpsi =
M & tpsi();
2368 template<
class Type>
2372 const fvMatrix<Type>&
M,
2373 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tpsi
2376 tmp<GeometricField<Type, fvPatchField, volMesh>> tMpsi =
M & tpsi();
2381 template<
class Type>
2385 const tmp<fvMatrix<Type>>& tM,
2386 const DimensionedField<Type, volMesh>&
psi
2389 tmp<GeometricField<Type, fvPatchField, volMesh>> tMpsi = tM() &
psi;
2394 template<
class Type>
2398 const tmp<fvMatrix<Type>>& tM,
2399 const tmp<DimensionedField<Type, volMesh>>& tpsi
2402 tmp<GeometricField<Type, fvPatchField, volMesh>> tMpsi = tM() & tpsi();
2408 template<
class Type>
2412 const tmp<fvMatrix<Type>>& tM,
2413 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tpsi
2416 tmp<GeometricField<Type, fvPatchField, volMesh>> tMpsi = tM() & tpsi();
2425 template<
class Type>
2428 os << static_cast<const lduMatrix&>(fvm) <<
nl
2429 << fvm.dimensions_ <<
nl
2430 << fvm.source_ <<
nl
2431 << fvm.internalCoeffs_ <<
nl
2432 << fvm.boundaryCoeffs_ <<
endl;