48 if (addr.
size() != pf.size())
51 <<
"sizes of addressing and field are different"
57 intf[addr[facei]] += pf[facei];
71 addToInternalField(addr, tpf(), intf);
85 if (addr.
size() != pf.size())
88 <<
"sizes of addressing and field are different"
94 intf[addr[facei]] -= pf[facei];
100 template<
class Type2>
108 subtractFromInternalField(addr, tpf(), intf);
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)
161 addToInternalField(lduAddr().patchAddr(patchi), pbc, source);
168 const labelUList& addr = lduAddr().patchAddr(patchi);
172 source[addr[facei]] +=
cmptMultiply(pbc[facei], pnf[facei]);
180 template<
template<
class>
class ListType>
184 const ListType<Type>&
values
202 const label celli = cellLabels[i];
203 const Type& value =
values[i];
206 source_[celli] = value*Diag[celli];
208 if (symmetric() || asymmetric())
214 const label facei =
c[j];
216 if (
mesh.isInternalFace(facei))
220 if (celli == own[facei])
222 source_[nei[facei]] -=
upper()[facei]*value;
226 source_[own[facei]] -=
upper()[facei]*value;
229 upper()[facei] = 0.0;
233 if (celli == own[facei])
235 source_[nei[facei]] -=
lower()[facei]*value;
239 source_[own[facei]] -=
upper()[facei]*value;
242 upper()[facei] = 0.0;
243 lower()[facei] = 0.0;
248 label patchi =
mesh.boundaryMesh().whichPatch(facei);
250 if (internalCoeffs_[patchi].size())
253 mesh.boundaryMesh()[patchi].whichFace(facei);
255 internalCoeffs_[patchi][patchFacei] =
258 boundaryCoeffs_[patchi][patchFacei] =
281 internalCoeffs_(
psi.mesh().boundary().size()),
282 boundaryCoeffs_(
psi.mesh().boundary().size()),
283 faceFluxCorrectionPtr_(
nullptr)
286 <<
"Constructing fvMatrix<Type> for field " << psi_.name() <<
endl;
296 psi.mesh().boundary()[patchi].size(),
306 psi.mesh().boundary()[patchi].size(),
316 label currentStatePsi = psiRef.eventNo();
318 psiRef.eventNo() = currentStatePsi;
328 dimensions_(fvm.dimensions_),
329 source_(fvm.source_),
330 internalCoeffs_(fvm.internalCoeffs_),
331 boundaryCoeffs_(fvm.boundaryCoeffs_),
332 faceFluxCorrectionPtr_(nullptr)
335 <<
"Copying fvMatrix<Type> for field " << psi_.name() <<
endl;
337 if (fvm.faceFluxCorrectionPtr_)
339 faceFluxCorrectionPtr_ =
new
342 *(fvm.faceFluxCorrectionPtr_)
353 const_cast<
fvMatrix<Type>&>(tfvm()),
357 dimensions_(tfvm().dimensions_),
360 const_cast<
fvMatrix<Type>&>(tfvm()).source_,
365 const_cast<
fvMatrix<Type>&>(tfvm()).internalCoeffs_,
370 const_cast<
fvMatrix<Type>&>(tfvm()).boundaryCoeffs_,
373 faceFluxCorrectionPtr_(nullptr)
376 <<
"Copying fvMatrix<Type> for field " << psi_.name() <<
endl;
378 if (tfvm().faceFluxCorrectionPtr_)
382 faceFluxCorrectionPtr_ = tfvm().faceFluxCorrectionPtr_;
383 tfvm().faceFluxCorrectionPtr_ =
nullptr;
387 faceFluxCorrectionPtr_ =
new
390 *(tfvm().faceFluxCorrectionPtr_)
410 internalCoeffs_(
psi.mesh().boundary().size()),
411 boundaryCoeffs_(
psi.mesh().boundary().size()),
412 faceFluxCorrectionPtr_(
nullptr)
415 <<
"Constructing fvMatrix<Type> for field " << psi_.name() <<
endl;
425 psi.mesh().boundary()[patchi].size(),
435 psi.mesh().boundary()[patchi].size(),
460 <<
"Destroying fvMatrix<Type> for field " << psi_.name() <<
endl;
462 if (faceFluxCorrectionPtr_)
464 delete faceFluxCorrectionPtr_;
478 this->setValuesFromList(cellLabels,
values);
489 this->setValuesFromList(cellLabels,
values);
498 const bool forceReference
501 if ((forceReference || psi_.needReference()) && celli >= 0)
503 source()[celli] +=
diag()[celli]*value;
514 const bool forceReference
517 const bool needRef = (forceReference || psi_.needReference());
523 const label
cellId = cellLabels[celli];
539 const bool forceReference
542 const bool needRef = (forceReference || psi_.needReference());
548 const label
cellId = cellLabels[celli];
568 <<
"Relaxing " << psi_.name() <<
" by " <<
alpha <<
endl;
578 sumMagOffDiag(sumOff);
581 forAll(psi_.boundaryField(), patchi)
587 const labelUList& pa = lduAddr().patchAddr(patchi);
592 const Field<Type>& pCoeffs = boundaryCoeffs_[patchi];
623 scalar d = (sumOff[celli] -
D[celli])/
mag(
D[celli]);
628 maxNon =
max(maxNon, d);
657 <<
"Matrix dominance test for " << psi_.name() <<
nl
658 <<
" number of non-dominant cells : " << nNon <<
nl
659 <<
" maximum relative non-dominance : " << maxNon <<
nl
660 <<
" average relative non-dominance : " << sumNon <<
nl
669 D[celli] =
max(
mag(
D[celli]), sumOff[celli]);
676 forAll(psi_.boundaryField(), patchi)
682 const labelUList& pa = lduAddr().patchAddr(patchi);
703 S += (
D - D0)*psi_.primitiveField();
712 psi_.mesh().data::template getOrDefault<bool>
713 (
"finalIteration",
false)
716 if (psi_.mesh().relaxEquation(
name))
718 relax(psi_.mesh().equationRelaxationFactor(
name));
732 bFields[patchi].manipulateMatrix(*
this);
741 addCmptAvBoundaryDiag(tdiag.
ref());
751 forAll(psi_.boundaryField(), patchi)
755 if (!ptf.
coupled() && ptf.size())
759 lduAddr().patchAddr(patchi),
760 internalCoeffs_[patchi],
779 "A("+psi_.name()+
')',
786 dimensions_/psi_.dimensions()/
dimVol,
787 extrapolatedCalculatedFvPatchScalarField::typeName
808 "H("+psi_.name()+
')',
816 extrapolatedCalculatedFvPatchScalarField::typeName
822 for (
direction cmpt=0; cmpt<Type::nComponents; cmpt++)
824 scalarField psiCmpt(psi_.primitiveField().component(cmpt));
827 addBoundaryDiag(boundaryDiagCmpt, cmpt);
828 boundaryDiagCmpt.negate();
829 addCmptAvBoundaryDiag(boundaryDiagCmpt);
840 typename Type::labelType validComponents
842 psi_.mesh().template validComponents<Type>()
845 for (
direction cmpt=0; cmpt<Type::nComponents; cmpt++)
847 if (validComponents[cmpt] == -1)
877 dimensions_/(
dimVol*psi_.dimensions()),
878 extrapolatedCalculatedFvPatchScalarField::typeName
885 forAll(psi_.boundaryField(), patchi)
889 if (ptf.
coupled() && ptf.size())
893 lduAddr().patchAddr(patchi),
900 H1_.primitiveFieldRef() /= psi_.mesh().V();
901 H1_.correctBoundaryConditions();
912 if (!psi_.mesh().fluxRequired(psi_.name()))
915 <<
"flux requested but " << psi_.name()
916 <<
" not specified in the fluxRequired sub-dictionary"
928 "flux("+psi_.name()+
')',
941 fieldFlux.setOriented();
943 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
954 forAll(InternalContrib, patchi)
956 InternalContrib[patchi] =
959 InternalContrib[patchi],
960 psi_.boundaryField()[patchi].patchInternalField()
966 forAll(NeighbourContrib, patchi)
968 if (psi_.boundaryField()[patchi].coupled())
970 NeighbourContrib[patchi] =
973 NeighbourContrib[patchi],
974 psi_.boundaryField()[patchi].patchNeighbourField()
984 ffbf[patchi] = InternalContrib[patchi] - NeighbourContrib[patchi];
987 if (faceFluxCorrectionPtr_)
989 fieldFlux += *faceFluxCorrectionPtr_;
999 return psi_.mesh().solverDict
1003 psi_.mesh().data::template getOrDefault<bool>
1004 (
"finalIteration",
false)
1012 template<
class Type>
1020 if (&psi_ != &(fvmv.psi_))
1023 <<
"different fields"
1027 dimensions_ = fvmv.dimensions_;
1029 source_ = fvmv.source_;
1030 internalCoeffs_ = fvmv.internalCoeffs_;
1031 boundaryCoeffs_ = fvmv.boundaryCoeffs_;
1033 if (faceFluxCorrectionPtr_ && fvmv.faceFluxCorrectionPtr_)
1035 *faceFluxCorrectionPtr_ = *fvmv.faceFluxCorrectionPtr_;
1037 else if (fvmv.faceFluxCorrectionPtr_)
1039 faceFluxCorrectionPtr_ =
1041 (*fvmv.faceFluxCorrectionPtr_);
1046 template<
class Type>
1054 template<
class Type>
1059 internalCoeffs_.negate();
1060 boundaryCoeffs_.negate();
1062 if (faceFluxCorrectionPtr_)
1064 faceFluxCorrectionPtr_->negate();
1069 template<
class Type>
1074 dimensions_ += fvmv.dimensions_;
1076 source_ += fvmv.source_;
1077 internalCoeffs_ += fvmv.internalCoeffs_;
1078 boundaryCoeffs_ += fvmv.boundaryCoeffs_;
1080 if (faceFluxCorrectionPtr_ && fvmv.faceFluxCorrectionPtr_)
1082 *faceFluxCorrectionPtr_ += *fvmv.faceFluxCorrectionPtr_;
1084 else if (fvmv.faceFluxCorrectionPtr_)
1086 faceFluxCorrectionPtr_ =
new
1089 *fvmv.faceFluxCorrectionPtr_
1095 template<
class Type>
1098 operator+=(tfvmv());
1103 template<
class Type>
1108 dimensions_ -= fvmv.dimensions_;
1110 source_ -= fvmv.source_;
1111 internalCoeffs_ -= fvmv.internalCoeffs_;
1112 boundaryCoeffs_ -= fvmv.boundaryCoeffs_;
1114 if (faceFluxCorrectionPtr_ && fvmv.faceFluxCorrectionPtr_)
1116 *faceFluxCorrectionPtr_ -= *fvmv.faceFluxCorrectionPtr_;
1118 else if (fvmv.faceFluxCorrectionPtr_)
1120 faceFluxCorrectionPtr_ =
1122 (-*fvmv.faceFluxCorrectionPtr_);
1127 template<
class Type>
1130 operator-=(tfvmv());
1135 template<
class Type>
1142 source() -= su.mesh().V()*su.field();
1146 template<
class Type>
1157 template<
class Type>
1168 template<
class Type>
1175 source() += su.mesh().V()*su.field();
1179 template<
class Type>
1190 template<
class Type>
1201 template<
class Type>
1207 source() -=
psi().mesh().V()*su;
1211 template<
class Type>
1217 source() +=
psi().mesh().V()*su;
1221 template<
class Type>
1229 template<
class Type>
1237 template<
class Type>
1243 dimensions_ *= dsf.dimensions();
1245 source_ *= dsf.field();
1247 forAll(boundaryCoeffs_, patchi)
1251 dsf.mesh().boundary()[patchi].patchInternalField(dsf.field())
1254 internalCoeffs_[patchi] *= pisf;
1255 boundaryCoeffs_[patchi] *= pisf;
1258 if (faceFluxCorrectionPtr_)
1261 <<
"cannot scale a matrix containing a faceFluxCorrection"
1267 template<
class Type>
1278 template<
class Type>
1289 template<
class Type>
1295 dimensions_ *= ds.dimensions();
1297 source_ *= ds.value();
1298 internalCoeffs_ *= ds.value();
1299 boundaryCoeffs_ *= ds.value();
1301 if (faceFluxCorrectionPtr_)
1303 *faceFluxCorrectionPtr_ *= ds.value();
1310 template<
class Type>
1318 if (&fvm1.
psi() != &fvm2.
psi())
1321 <<
"incompatible fields for operation "
1323 <<
"[" << fvm1.
psi().name() <<
"] "
1325 <<
" [" << fvm2.
psi().name() <<
"]"
1332 <<
"incompatible dimensions for operation "
1342 template<
class Type>
1356 <<
" [" << df.name() << df.
dimensions() <<
" ]"
1362 template<
class Type>
1373 <<
"incompatible dimensions for operation "
1383 template<
class Type>
1386 fvMatrix<Type>& fvm,
1387 const dictionary& solverControls
1390 return fvm.solve(solverControls);
1393 template<
class Type>
1396 const tmp<fvMatrix<Type>>& tfvm,
1397 const dictionary& solverControls
1400 SolverPerformance<Type> solverPerf =
1401 const_cast<fvMatrix<Type>&
>(tfvm()).
solve(solverControls);
1409 template<
class Type>
1415 template<
class Type>
1418 SolverPerformance<Type> solverPerf =
1419 const_cast<fvMatrix<Type>&
>(tfvm()).
solve();
1427 template<
class Type>
1430 const fvMatrix<Type>&
A
1433 tmp<Foam::fvMatrix<Type>> tAcorr =
A - (
A &
A.psi());
1443 template<
class Type>
1446 const tmp<fvMatrix<Type>>& tA
1449 tmp<Foam::fvMatrix<Type>> tAcorr = tA - (tA() & tA().psi());
1461 template<
class Type>
1464 const fvMatrix<Type>&
A,
1465 const fvMatrix<Type>&
B
1472 template<
class Type>
1475 const tmp<fvMatrix<Type>>& tA,
1476 const fvMatrix<Type>&
B
1483 template<
class Type>
1486 const fvMatrix<Type>&
A,
1487 const tmp<fvMatrix<Type>>& tB
1494 template<
class Type>
1497 const tmp<fvMatrix<Type>>& tA,
1498 const tmp<fvMatrix<Type>>& tB
1505 template<
class Type>
1508 const fvMatrix<Type>&
A,
1509 const DimensionedField<Type, volMesh>& su
1513 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1514 tC.ref().source() += su.mesh().V()*su.field();
1518 template<
class Type>
1521 const fvMatrix<Type>&
A,
1522 const tmp<DimensionedField<Type, volMesh>>& tsu
1526 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1527 tC.ref().source() += tsu().mesh().V()*tsu().field();
1532 template<
class Type>
1535 const fvMatrix<Type>&
A,
1536 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
1540 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1541 tC.ref().source() += tsu().mesh().V()*tsu().primitiveField();
1546 template<
class Type>
1549 const tmp<fvMatrix<Type>>& tA,
1550 const DimensionedField<Type, volMesh>& su
1554 tmp<fvMatrix<Type>> tC(tA.ptr());
1555 tC.ref().source() += su.mesh().V()*su.field();
1559 template<
class Type>
1562 const tmp<fvMatrix<Type>>& tA,
1563 const tmp<DimensionedField<Type, volMesh>>& tsu
1567 tmp<fvMatrix<Type>> tC(tA.ptr());
1568 tC.ref().source() += tsu().mesh().V()*tsu().field();
1573 template<
class Type>
1576 const tmp<fvMatrix<Type>>& tA,
1577 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
1581 tmp<fvMatrix<Type>> tC(tA.ptr());
1582 tC.ref().source() += tsu().mesh().V()*tsu().primitiveField();
1587 template<
class Type>
1590 const fvMatrix<Type>&
A,
1591 const dimensioned<Type>& su
1595 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1596 tC.ref().source() +=
A.psi().mesh().V()*su.value();
1600 template<
class Type>
1603 const tmp<fvMatrix<Type>>& tA,
1604 const dimensioned<Type>& su
1608 tmp<fvMatrix<Type>> tC(tA.ptr());
1609 tC.ref().source() += tC().psi().mesh().V()*su.value();
1613 template<
class Type>
1616 const fvMatrix<Type>&
A,
1624 template<
class Type>
1627 const tmp<fvMatrix<Type>>& tA,
1635 template<
class Type>
1638 const fvMatrix<Type>&
A
1641 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1646 template<
class Type>
1649 const tmp<fvMatrix<Type>>& tA
1652 tmp<fvMatrix<Type>> tC(tA.ptr());
1658 template<
class Type>
1661 const fvMatrix<Type>&
A,
1662 const fvMatrix<Type>&
B
1666 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1671 template<
class Type>
1674 const tmp<fvMatrix<Type>>& tA,
1675 const fvMatrix<Type>&
B
1679 tmp<fvMatrix<Type>> tC(tA.
ptr());
1684 template<
class Type>
1687 const fvMatrix<Type>&
A,
1688 const tmp<fvMatrix<Type>>& tB
1692 tmp<fvMatrix<Type>> tC(tB.ptr());
1697 template<
class Type>
1700 const tmp<fvMatrix<Type>>& tA,
1701 const tmp<fvMatrix<Type>>& tB
1705 tmp<fvMatrix<Type>> tC(tA.
ptr());
1711 template<
class Type>
1714 const fvMatrix<Type>&
A,
1715 const DimensionedField<Type, volMesh>& su
1719 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1720 tC.ref().source() -= su.mesh().V()*su.field();
1724 template<
class Type>
1727 const fvMatrix<Type>&
A,
1728 const tmp<DimensionedField<Type, volMesh>>& tsu
1732 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1733 tC.ref().source() -= tsu().mesh().V()*tsu().field();
1738 template<
class Type>
1741 const fvMatrix<Type>&
A,
1742 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
1746 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1747 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
1752 template<
class Type>
1755 const tmp<fvMatrix<Type>>& tA,
1756 const DimensionedField<Type, volMesh>& su
1760 tmp<fvMatrix<Type>> tC(tA.
ptr());
1761 tC.ref().source() -= su.mesh().V()*su.field();
1765 template<
class Type>
1768 const tmp<fvMatrix<Type>>& tA,
1769 const tmp<DimensionedField<Type, volMesh>>& tsu
1773 tmp<fvMatrix<Type>> tC(tA.
ptr());
1774 tC.ref().source() -= tsu().mesh().V()*tsu().field();
1779 template<
class Type>
1782 const tmp<fvMatrix<Type>>& tA,
1783 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
1787 tmp<fvMatrix<Type>> tC(tA.
ptr());
1788 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
1793 template<
class Type>
1796 const DimensionedField<Type, volMesh>& su,
1797 const fvMatrix<Type>&
A
1801 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1802 tC.ref().source() -= su.mesh().V()*su.field();
1806 template<
class Type>
1809 const tmp<DimensionedField<Type, volMesh>>& tsu,
1810 const fvMatrix<Type>&
A
1814 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1815 tC.ref().source() -= tsu().mesh().V()*tsu().field();
1820 template<
class Type>
1823 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu,
1824 const fvMatrix<Type>&
A
1828 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1829 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
1834 template<
class Type>
1837 const DimensionedField<Type, volMesh>& su,
1838 const tmp<fvMatrix<Type>>& tA
1842 tmp<fvMatrix<Type>> tC(tA.
ptr());
1843 tC.ref().source() -= su.mesh().V()*su.field();
1847 template<
class Type>
1850 const tmp<DimensionedField<Type, volMesh>>& tsu,
1851 const tmp<fvMatrix<Type>>& tA
1855 tmp<fvMatrix<Type>> tC(tA.
ptr());
1856 tC.ref().source() -= tsu().mesh().V()*tsu().field();
1861 template<
class Type>
1864 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu,
1865 const tmp<fvMatrix<Type>>& tA
1869 tmp<fvMatrix<Type>> tC(tA.
ptr());
1870 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
1876 template<
class Type>
1879 const fvMatrix<Type>&
A,
1880 const fvMatrix<Type>&
B
1884 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1889 template<
class Type>
1892 const tmp<fvMatrix<Type>>& tA,
1893 const fvMatrix<Type>&
B
1897 tmp<fvMatrix<Type>> tC(tA.
ptr());
1902 template<
class Type>
1905 const fvMatrix<Type>&
A,
1906 const tmp<fvMatrix<Type>>& tB
1910 tmp<fvMatrix<Type>> tC(tB.ptr());
1916 template<
class Type>
1919 const tmp<fvMatrix<Type>>& tA,
1920 const tmp<fvMatrix<Type>>& tB
1924 tmp<fvMatrix<Type>> tC(tA.
ptr());
1930 template<
class Type>
1933 const fvMatrix<Type>&
A,
1934 const DimensionedField<Type, volMesh>& su
1938 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1939 tC.ref().source() += su.mesh().V()*su.field();
1943 template<
class Type>
1946 const fvMatrix<Type>&
A,
1947 const tmp<DimensionedField<Type, volMesh>>& tsu
1951 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1952 tC.ref().source() += tsu().mesh().V()*tsu().field();
1957 template<
class Type>
1960 const fvMatrix<Type>&
A,
1961 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
1965 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
1966 tC.ref().source() += tsu().mesh().V()*tsu().primitiveField();
1971 template<
class Type>
1974 const tmp<fvMatrix<Type>>& tA,
1975 const DimensionedField<Type, volMesh>& su
1979 tmp<fvMatrix<Type>> tC(tA.
ptr());
1980 tC.ref().source() += su.mesh().V()*su.field();
1984 template<
class Type>
1987 const tmp<fvMatrix<Type>>& tA,
1988 const tmp<DimensionedField<Type, volMesh>>& tsu
1992 tmp<fvMatrix<Type>> tC(tA.
ptr());
1993 tC.ref().source() += tsu().mesh().V()*tsu().field();
1998 template<
class Type>
2001 const tmp<fvMatrix<Type>>& tA,
2002 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu
2006 tmp<fvMatrix<Type>> tC(tA.
ptr());
2007 tC.ref().source() += tsu().mesh().V()*tsu().primitiveField();
2012 template<
class Type>
2015 const DimensionedField<Type, volMesh>& su,
2016 const fvMatrix<Type>&
A
2020 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2022 tC.ref().source() -= su.mesh().V()*su.field();
2026 template<
class Type>
2029 const tmp<DimensionedField<Type, volMesh>>& tsu,
2030 const fvMatrix<Type>&
A
2034 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2036 tC.ref().source() -= tsu().mesh().V()*tsu().field();
2041 template<
class Type>
2044 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu,
2045 const fvMatrix<Type>&
A
2049 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2051 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
2056 template<
class Type>
2059 const DimensionedField<Type, volMesh>& su,
2060 const tmp<fvMatrix<Type>>& tA
2064 tmp<fvMatrix<Type>> tC(tA.
ptr());
2066 tC.ref().source() -= su.mesh().V()*su.field();
2070 template<
class Type>
2073 const tmp<DimensionedField<Type, volMesh>>& tsu,
2074 const tmp<fvMatrix<Type>>& tA
2078 tmp<fvMatrix<Type>> tC(tA.
ptr());
2080 tC.ref().source() -= tsu().mesh().V()*tsu().field();
2085 template<
class Type>
2088 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tsu,
2089 const tmp<fvMatrix<Type>>& tA
2093 tmp<fvMatrix<Type>> tC(tA.
ptr());
2095 tC.ref().source() -= tsu().mesh().V()*tsu().primitiveField();
2100 template<
class Type>
2103 const fvMatrix<Type>&
A,
2104 const dimensioned<Type>& su
2108 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2109 tC.ref().source() -= su.value()*
A.psi().mesh().V();
2113 template<
class Type>
2116 const tmp<fvMatrix<Type>>& tA,
2117 const dimensioned<Type>& su
2121 tmp<fvMatrix<Type>> tC(tA.
ptr());
2122 tC.ref().source() -= su.value()*tC().psi().mesh().V();
2126 template<
class Type>
2129 const dimensioned<Type>& su,
2130 const fvMatrix<Type>&
A
2134 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2135 tC.ref().source() -= su.value()*
A.psi().mesh().V();
2139 template<
class Type>
2142 const dimensioned<Type>& su,
2143 const tmp<fvMatrix<Type>>& tA
2147 tmp<fvMatrix<Type>> tC(tA.
ptr());
2148 tC.ref().source() -= su.value()*tC().psi().mesh().V();
2152 template<
class Type>
2155 const fvMatrix<Type>&
A,
2156 const dimensioned<Type>& su
2160 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2161 tC.ref().source() += su.value()*tC().psi().mesh().V();
2165 template<
class Type>
2168 const tmp<fvMatrix<Type>>& tA,
2169 const dimensioned<Type>& su
2173 tmp<fvMatrix<Type>> tC(tA.
ptr());
2174 tC.ref().source() += su.value()*tC().psi().mesh().V();
2178 template<
class Type>
2181 const dimensioned<Type>& su,
2182 const fvMatrix<Type>&
A
2186 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2188 tC.ref().source() -= su.value()*
A.psi().mesh().V();
2192 template<
class Type>
2195 const dimensioned<Type>& su,
2196 const tmp<fvMatrix<Type>>& tA
2200 tmp<fvMatrix<Type>> tC(tA.
ptr());
2202 tC.ref().source() -= su.value()*tC().psi().mesh().V();
2207 template<
class Type>
2211 const fvMatrix<Type>&
A
2214 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2219 template<
class Type>
2222 const tmp<volScalarField::Internal>& tdsf,
2223 const fvMatrix<Type>&
A
2226 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2231 template<
class Type>
2234 const tmp<volScalarField>& tvsf,
2235 const fvMatrix<Type>&
A
2238 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2243 template<
class Type>
2247 const tmp<fvMatrix<Type>>& tA
2250 tmp<fvMatrix<Type>> tC(tA.
ptr());
2255 template<
class Type>
2258 const tmp<volScalarField::Internal>& tdsf,
2259 const tmp<fvMatrix<Type>>& tA
2262 tmp<fvMatrix<Type>> tC(tA.
ptr());
2267 template<
class Type>
2270 const tmp<volScalarField>& tvsf,
2271 const tmp<fvMatrix<Type>>& tA
2274 tmp<fvMatrix<Type>> tC(tA.
ptr());
2279 template<
class Type>
2282 const dimensioned<scalar>& ds,
2283 const fvMatrix<Type>&
A
2286 tmp<fvMatrix<Type>> tC(
new fvMatrix<Type>(
A));
2291 template<
class Type>
2294 const dimensioned<scalar>& ds,
2295 const tmp<fvMatrix<Type>>& tA
2298 tmp<fvMatrix<Type>> tC(tA.
ptr());
2304 template<
class Type>
2308 const fvMatrix<Type>&
M,
2309 const DimensionedField<Type, volMesh>&
psi
2312 tmp<GeometricField<Type, fvPatchField, volMesh>> tMphi
2314 new GeometricField<Type, fvPatchField, volMesh>
2326 extrapolatedCalculatedFvPatchScalarField::typeName
2329 GeometricField<Type, fvPatchField, volMesh>& Mphi = tMphi.ref();
2334 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
2338 M.addBoundaryDiag(boundaryDiagCmpt, cmpt);
2339 Mphi.primitiveFieldRef().replace(cmpt, -boundaryDiagCmpt*psiCmpt);
2344 Mphi.primitiveFieldRef() =
Zero;
2347 Mphi.primitiveFieldRef() +=
M.lduMatrix::H(
psi.field()) +
M.source();
2348 M.addBoundarySource(Mphi.primitiveFieldRef());
2350 Mphi.primitiveFieldRef() /= -
psi.mesh().V();
2356 template<
class Type>
2360 const fvMatrix<Type>&
M,
2361 const tmp<DimensionedField<Type, volMesh>>& tpsi
2364 tmp<GeometricField<Type, fvPatchField, volMesh>> tMpsi =
M & tpsi();
2369 template<
class Type>
2373 const fvMatrix<Type>&
M,
2374 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tpsi
2377 tmp<GeometricField<Type, fvPatchField, volMesh>> tMpsi =
M & tpsi();
2382 template<
class Type>
2386 const tmp<fvMatrix<Type>>& tM,
2387 const DimensionedField<Type, volMesh>&
psi
2390 tmp<GeometricField<Type, fvPatchField, volMesh>> tMpsi = tM() &
psi;
2395 template<
class Type>
2399 const tmp<fvMatrix<Type>>& tM,
2400 const tmp<DimensionedField<Type, volMesh>>& tpsi
2403 tmp<GeometricField<Type, fvPatchField, volMesh>> tMpsi = tM() & tpsi();
2409 template<
class Type>
2413 const tmp<fvMatrix<Type>>& tM,
2414 const tmp<GeometricField<Type, fvPatchField, volMesh>>& tpsi
2417 tmp<GeometricField<Type, fvPatchField, volMesh>> tMpsi = tM() & tpsi();
2426 template<
class Type>
2429 os << static_cast<const lduMatrix&>(fvm) <<
nl
2430 << fvm.dimensions_ <<
nl
2431 << fvm.source_ <<
nl
2432 << fvm.internalCoeffs_ <<
nl
2433 << fvm.boundaryCoeffs_ <<
endl;