44 if (addr.
size() != pf.size())
47 <<
"sizes of addressing and field are different"
53 intf[addr[faceI]] += pf[faceI];
67 addToInternalField(addr, tpf(), intf);
81 if (addr.
size() != pf.size())
84 <<
"sizes of addressing and field are different"
90 intf[addr[faceI]] -= pf[faceI];
104 subtractFromInternalField(addr, tpf(), intf);
116 forAll(internalCoeffs_, patchI)
120 lduAddr().patchAddr(patchI),
121 internalCoeffs_[patchI].
component(solveCmpt),
131 forAll(internalCoeffs_, patchI)
135 lduAddr().patchAddr(patchI),
136 cmptAv(internalCoeffs_[patchI]),
150 forAll(psi_.boundaryField(), patchI)
157 addToInternalField(lduAddr().patchAddr(patchI), pbc, source);
164 const labelUList& addr = lduAddr().patchAddr(patchI);
168 source[addr[facei]] +=
cmptMultiply(pbc[facei], pnf[facei]);
176 template<
template<
class>
class ListType>
180 const ListType<Type>& values
198 const label celli = cellLabels[i];
199 const Type& value = values[i];
202 source_[celli] = value*Diag[celli];
204 if (symmetric() || asymmetric())
212 if (
mesh.isInternalFace(facei))
216 if (celli == own[facei])
218 source_[nei[facei]] -= upper()[facei]*value;
222 source_[own[facei]] -= upper()[facei]*value;
225 upper()[facei] = 0.0;
229 if (celli == own[facei])
231 source_[nei[facei]] -= lower()[facei]*value;
235 source_[own[facei]] -= upper()[facei]*value;
238 upper()[facei] = 0.0;
239 lower()[facei] = 0.0;
246 if (internalCoeffs_[
patchi].size())
251 internalCoeffs_[
patchi][patchFacei] =
254 boundaryCoeffs_[
patchi][patchFacei] =
279 faceFluxCorrectionPtr_(NULL)
283 Info<<
"fvMatrix<Type>(GeometricField<Type, fvPatchField, volMesh>&,"
284 " const dimensionSet&) : "
285 "constructing fvMatrix<Type> for field " << psi_.name()
297 psi.mesh().boundary()[patchI].size(),
307 psi.mesh().boundary()[patchI].size(),
314 GeometricField<Type, fvPatchField, volMesh>& psiRef =
315 const_cast<GeometricField<Type, fvPatchField, volMesh>&
>(psi_);
317 label currentStatePsi = psiRef.eventNo();
318 psiRef.boundaryField().updateCoeffs();
319 psiRef.eventNo() = currentStatePsi;
329 dimensions_(fvm.dimensions_),
330 source_(fvm.source_),
331 internalCoeffs_(fvm.internalCoeffs_),
332 boundaryCoeffs_(fvm.boundaryCoeffs_),
333 faceFluxCorrectionPtr_(NULL)
337 Info<<
"fvMatrix<Type>::fvMatrix(const fvMatrix<Type>&) : "
338 <<
"copying fvMatrix<Type> for field " << psi_.name()
342 if (fvm.faceFluxCorrectionPtr_)
344 faceFluxCorrectionPtr_ =
new
345 GeometricField<Type, fvsPatchField, surfaceMesh>
347 *(fvm.faceFluxCorrectionPtr_)
353 #ifndef NoConstructFromTmp
360 const_cast<fvMatrix<Type>&>(tfvm()),
364 dimensions_(tfvm().dimensions_),
367 const_cast<fvMatrix<Type>&>(tfvm()).source_,
372 const_cast<fvMatrix<Type>&>(tfvm()).internalCoeffs_,
377 const_cast<fvMatrix<Type>&>(tfvm()).boundaryCoeffs_,
380 faceFluxCorrectionPtr_(NULL)
384 Info<<
"fvMatrix<Type>::fvMatrix(const tmp<fvMatrix<Type> >&) : "
385 <<
"copying fvMatrix<Type> for field " << psi_.name()
389 if (tfvm().faceFluxCorrectionPtr_)
393 faceFluxCorrectionPtr_ = tfvm().faceFluxCorrectionPtr_;
394 tfvm().faceFluxCorrectionPtr_ = NULL;
398 faceFluxCorrectionPtr_ =
new
399 GeometricField<Type, fvsPatchField, surfaceMesh>
401 *(tfvm().faceFluxCorrectionPtr_)
414 const GeometricField<Type, fvPatchField, volMesh>&
psi,
424 faceFluxCorrectionPtr_(NULL)
428 Info<<
"fvMatrix<Type>"
429 "(GeometricField<Type, fvPatchField, volMesh>&, Istream&) : "
430 "constructing fvMatrix<Type> for field " << psi_.name()
442 psi.mesh().boundary()[patchI].size(),
452 psi.mesh().boundary()[patchI].size(),
466 Info<<
"fvMatrix<Type>::~fvMatrix<Type>() : "
467 <<
"destroying fvMatrix<Type> for field " << psi_.name()
471 if (faceFluxCorrectionPtr_)
473 delete faceFluxCorrectionPtr_;
487 this->setValuesFromList(cellLabels, values);
495 const UIndirectList<Type>& values
498 this->setValuesFromList(cellLabels, values);
507 const bool forceReference
510 if ((forceReference || psi_.needReference()) && celli >= 0)
512 source()[celli] +=
diag()[celli]*value;
529 <<
"Relaxing " << psi_.name() <<
" by " <<
alpha
541 sumMagOffDiag(sumOff);
544 forAll(psi_.boundaryField(), patchI)
550 const labelUList& pa = lduAddr().patchAddr(patchI);
555 const Field<Type>& pCoeffs = boundaryCoeffs_[patchI];
586 scalar d = (sumOff[celli] - D[celli])/
mag(D[celli]);
591 maxNon =
max(maxNon, d);
620 <<
"Matrix dominance test for " << psi_.name() <<
nl
621 <<
" number of non-dominant cells : " << nNon <<
nl
622 <<
" maximum relative non-dominance : " << maxNon <<
nl
623 <<
" average relative non-dominance : " << sumNon <<
nl
632 D[celli] =
max(
mag(D[celli]), sumOff[celli]);
639 forAll(psi_.boundaryField(), patchI)
645 const labelUList& pa = lduAddr().patchAddr(patchI);
666 S += (D - D0)*psi_.internalField();
675 psi_.mesh().data::template lookupOrDefault<bool>
676 (
"finalIteration",
false)
679 if (psi_.mesh().relaxEquation(
name))
681 relax(psi_.mesh().equationRelaxationFactor(
name));
690 GeometricBoundaryField& bFields
695 bFields[patchI].manipulateMatrix(*
this);
704 addCmptAvBoundaryDiag(tdiag());
714 forAll(psi_.boundaryField(), patchI)
718 if (!ptf.
coupled() && ptf.size())
722 lduAddr().patchAddr(patchI),
723 internalCoeffs_[patchI],
742 "A("+psi_.name()+
')',
749 dimensions_/psi_.dimensions()/
dimVol,
750 zeroGradientFvPatchScalarField::typeName
754 tAphi().internalField() = D()/psi_.mesh().V();
755 tAphi().correctBoundaryConditions();
771 "H("+psi_.name()+
')',
779 zeroGradientFvPatchScalarField::typeName
785 for (
direction cmpt=0; cmpt<Type::nComponents; cmpt++)
787 scalarField psiCmpt(psi_.internalField().component(cmpt));
790 addBoundaryDiag(boundaryDiagCmpt, cmpt);
791 boundaryDiagCmpt.
negate();
792 addCmptAvBoundaryDiag(boundaryDiagCmpt);
797 Hphi.
internalField() += lduMatrix::H(psi_.internalField()) + source_;
803 typename Type::labelType validComponents
805 psi_.mesh().template validComponents<Type>()
808 for (
direction cmpt=0; cmpt<Type::nComponents; cmpt++)
810 if (validComponents[cmpt] == -1)
840 dimensions_/(
dimVol*psi_.dimensions()),
841 zeroGradientFvPatchScalarField::typeName
848 forAll(psi_.boundaryField(), patchI)
852 if (ptf.
coupled() && ptf.size())
856 lduAddr().patchAddr(patchI),
875 if (!psi_.mesh().fluxRequired(psi_.name()))
878 <<
"flux requested but " << psi_.name()
879 <<
" not specified in the fluxRequired sub-dictionary"
891 "flux("+psi_.name()+
')',
903 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
908 lduMatrix::faceH(psi_.internalField().component(cmpt))
914 forAll(InternalContrib, patchI)
916 InternalContrib[patchI] =
919 InternalContrib[patchI],
920 psi_.boundaryField()[patchI].patchInternalField()
926 forAll(NeighbourContrib, patchI)
928 if (psi_.boundaryField()[patchI].coupled())
930 NeighbourContrib[patchI] =
933 NeighbourContrib[patchI],
934 psi_.boundaryField()[patchI].patchNeighbourField()
942 InternalContrib[patchI] - NeighbourContrib[patchI];
945 if (faceFluxCorrectionPtr_)
947 fieldFlux += *faceFluxCorrectionPtr_;
962 <<
"attempted assignment to self"
966 if (&psi_ != &(fvmv.
psi_))
969 <<
"different fields"
974 lduMatrix::operator=(fvmv);
985 faceFluxCorrectionPtr_ =
986 new GeometricField<Type, fvsPatchField, surfaceMesh>
1000 template<
class Type>
1005 internalCoeffs_.negate();
1006 boundaryCoeffs_.negate();
1008 if (faceFluxCorrectionPtr_)
1010 faceFluxCorrectionPtr_->negate();
1015 template<
class Type>
1021 lduMatrix::operator+=(fvmv);
1032 faceFluxCorrectionPtr_ =
new
1033 GeometricField<Type, fvsPatchField, surfaceMesh>
1041 template<
class Type>
1044 operator+=(tfvmv());
1049 template<
class Type>
1054 dimensions_ -= fvmv.dimensions_;
1055 lduMatrix::operator-=(fvmv);
1056 source_ -= fvmv.source_;
1057 internalCoeffs_ -= fvmv.internalCoeffs_;
1058 boundaryCoeffs_ -= fvmv.boundaryCoeffs_;
1060 if (faceFluxCorrectionPtr_ && fvmv.faceFluxCorrectionPtr_)
1062 *faceFluxCorrectionPtr_ -= *fvmv.faceFluxCorrectionPtr_;
1064 else if (fvmv.faceFluxCorrectionPtr_)
1066 faceFluxCorrectionPtr_ =
1067 new GeometricField<Type, fvsPatchField, surfaceMesh>
1068 (-*fvmv.faceFluxCorrectionPtr_);
1073 template<
class Type>
1076 operator-=(tfvmv());
1081 template<
class Type>
1084 const DimensionedField<Type, volMesh>& su
1088 source() -= su.mesh().V()*su.field();
1092 template<
class Type>
1095 const tmp<DimensionedField<Type, volMesh> >& tsu
1103 template<
class Type>
1106 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tsu
1114 template<
class Type>
1117 const DimensionedField<Type, volMesh>& su
1121 source() += su.mesh().V()*su.field();
1125 template<
class Type>
1128 const tmp<DimensionedField<Type, volMesh> >& tsu
1136 template<
class Type>
1139 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tsu
1147 template<
class Type>
1150 const dimensioned<Type>& su
1153 source() -=
psi().mesh().V()*su;
1157 template<
class Type>
1160 const dimensioned<Type>& su
1163 source() +=
psi().mesh().V()*su;
1167 template<
class Type>
1175 template<
class Type>
1183 template<
class Type>
1189 dimensions_ *= dsf.dimensions();
1190 lduMatrix::operator*=(dsf.field());
1191 source_ *= dsf.field();
1193 forAll(boundaryCoeffs_, patchI)
1197 dsf.mesh().boundary()[patchI].patchInternalField(dsf.field())
1200 internalCoeffs_[patchI] *= pisf;
1201 boundaryCoeffs_[patchI] *= pisf;
1204 if (faceFluxCorrectionPtr_)
1207 <<
"cannot scale a matrix containing a faceFluxCorrection"
1213 template<
class Type>
1216 const tmp<DimensionedField<scalar, volMesh> >& tdsf
1224 template<
class Type>
1227 const tmp<volScalarField>& tvsf
1235 template<
class Type>
1238 const dimensioned<scalar>& ds
1241 dimensions_ *= ds.dimensions();
1242 lduMatrix::operator*=(ds.value());
1243 source_ *= ds.value();
1244 internalCoeffs_ *= ds.value();
1245 boundaryCoeffs_ *= ds.value();
1247 if (faceFluxCorrectionPtr_)
1249 *faceFluxCorrectionPtr_ *= ds.value();
1256 template<
class Type>
1264 if (&fvm1.
psi() != &fvm2.
psi())
1267 <<
"incompatible fields for operation "
1269 <<
"[" << fvm1.
psi().name() <<
"] "
1271 <<
" [" << fvm2.
psi().name() <<
"]"
1278 <<
"incompatible dimensions for operation "
1288 template<
class Type>
1302 <<
" [" << df.name() << df.
dimensions() <<
" ]"
1308 template<
class Type>
1319 <<
"incompatible dimensions for operation "
1329 template<
class Type>
1332 fvMatrix<Type>& fvm,
1333 const dictionary& solverControls
1336 return fvm.solve(solverControls);
1339 template<
class Type>
1342 const tmp<fvMatrix<Type> >& tfvm,
1343 const dictionary& solverControls
1346 SolverPerformance<Type> solverPerf =
1347 const_cast<fvMatrix<Type>&
>(tfvm()).
solve(solverControls);
1355 template<
class Type>
1361 template<
class Type>
1364 SolverPerformance<Type> solverPerf =
1365 const_cast<fvMatrix<Type>&
>(tfvm()).
solve();
1373 template<
class Type>
1376 const fvMatrix<Type>&
A
1379 tmp<Foam::fvMatrix<Type> > tAcorr =
A - (
A &
A.psi());
1383 (
A.hasUpper() ||
A.hasLower())
1384 &&
A.psi().mesh().fluxRequired(
A.psi().name())
1387 tAcorr().faceFluxCorrectionPtr() = (-
A.flux()).ptr();
1394 template<
class Type>
1397 const tmp<fvMatrix<Type> >& tA
1400 tmp<Foam::fvMatrix<Type> > tAcorr = tA - (tA() & tA().psi());
1403 const fvMatrix<Type>&
A = tAcorr();
1407 (
A.hasUpper() ||
A.hasLower())
1408 &&
A.psi().mesh().fluxRequired(
A.psi().name())
1411 tAcorr().faceFluxCorrectionPtr() = (-
A.flux()).ptr();
1420 template<
class Type>
1423 const fvMatrix<Type>&
A,
1424 const fvMatrix<Type>& B
1431 template<
class Type>
1434 const tmp<fvMatrix<Type> >& tA,
1435 const fvMatrix<Type>& B
1442 template<
class Type>
1445 const fvMatrix<Type>&
A,
1446 const tmp<fvMatrix<Type> >& tB
1453 template<
class Type>
1456 const tmp<fvMatrix<Type> >& tA,
1457 const tmp<fvMatrix<Type> >& tB
1464 template<
class Type>
1467 const fvMatrix<Type>&
A,
1468 const DimensionedField<Type, volMesh>& su
1472 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1473 tC().source() += su.mesh().V()*su.field();
1477 template<
class Type>
1480 const fvMatrix<Type>&
A,
1481 const tmp<DimensionedField<Type, volMesh> >& tsu
1485 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1486 tC().source() += tsu().mesh().V()*tsu().field();
1491 template<
class Type>
1494 const fvMatrix<Type>&
A,
1495 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tsu
1499 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1500 tC().source() += tsu().mesh().V()*tsu().internalField();
1505 template<
class Type>
1508 const tmp<fvMatrix<Type> >& tA,
1509 const DimensionedField<Type, volMesh>& su
1513 tmp<fvMatrix<Type> > tC(tA.ptr());
1514 tC().source() += su.mesh().V()*su.field();
1518 template<
class Type>
1521 const tmp<fvMatrix<Type> >& tA,
1522 const tmp<DimensionedField<Type, volMesh> >& tsu
1526 tmp<fvMatrix<Type> > tC(tA.ptr());
1527 tC().source() += tsu().mesh().V()*tsu().field();
1532 template<
class Type>
1535 const tmp<fvMatrix<Type> >& tA,
1536 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tsu
1540 tmp<fvMatrix<Type> > tC(tA.ptr());
1541 tC().source() += tsu().mesh().V()*tsu().internalField();
1546 template<
class Type>
1549 const fvMatrix<Type>&
A,
1550 const dimensioned<Type>& su
1554 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1555 tC().source() +=
A.psi().mesh().V()*su.value();
1559 template<
class Type>
1562 const tmp<fvMatrix<Type> >& tA,
1563 const dimensioned<Type>& su
1567 tmp<fvMatrix<Type> > tC(tA.ptr());
1568 tC().source() += tC().psi().mesh().V()*su.value();
1572 template<
class Type>
1575 const fvMatrix<Type>&
A,
1583 template<
class Type>
1586 const tmp<fvMatrix<Type> >& tA,
1594 template<
class Type>
1597 const fvMatrix<Type>&
A
1600 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1605 template<
class Type>
1608 const tmp<fvMatrix<Type> >& tA
1611 tmp<fvMatrix<Type> > tC(tA.ptr());
1617 template<
class Type>
1620 const fvMatrix<Type>&
A,
1621 const fvMatrix<Type>& B
1625 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1630 template<
class Type>
1633 const tmp<fvMatrix<Type> >& tA,
1634 const fvMatrix<Type>& B
1638 tmp<fvMatrix<Type> > tC(tA.
ptr());
1643 template<
class Type>
1646 const fvMatrix<Type>&
A,
1647 const tmp<fvMatrix<Type> >& tB
1651 tmp<fvMatrix<Type> > tC(tB.ptr());
1656 template<
class Type>
1659 const tmp<fvMatrix<Type> >& tA,
1660 const tmp<fvMatrix<Type> >& tB
1664 tmp<fvMatrix<Type> > tC(tA.
ptr());
1670 template<
class Type>
1673 const fvMatrix<Type>&
A,
1674 const DimensionedField<Type, volMesh>& su
1678 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1679 tC().source() -= su.mesh().V()*su.field();
1683 template<
class Type>
1686 const fvMatrix<Type>&
A,
1687 const tmp<DimensionedField<Type, volMesh> >& tsu
1691 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1692 tC().source() -= tsu().mesh().V()*tsu().field();
1697 template<
class Type>
1700 const fvMatrix<Type>&
A,
1701 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tsu
1705 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1706 tC().source() -= tsu().mesh().V()*tsu().internalField();
1711 template<
class Type>
1714 const tmp<fvMatrix<Type> >& tA,
1715 const DimensionedField<Type, volMesh>& su
1719 tmp<fvMatrix<Type> > tC(tA.
ptr());
1720 tC().source() -= su.mesh().V()*su.field();
1724 template<
class Type>
1727 const tmp<fvMatrix<Type> >& tA,
1728 const tmp<DimensionedField<Type, volMesh> >& tsu
1732 tmp<fvMatrix<Type> > tC(tA.
ptr());
1733 tC().source() -= tsu().mesh().V()*tsu().field();
1738 template<
class Type>
1741 const tmp<fvMatrix<Type> >& tA,
1742 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tsu
1746 tmp<fvMatrix<Type> > tC(tA.
ptr());
1747 tC().source() -= tsu().mesh().V()*tsu().internalField();
1752 template<
class Type>
1755 const DimensionedField<Type, volMesh>& su,
1756 const fvMatrix<Type>&
A
1760 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1761 tC().source() -= su.mesh().V()*su.field();
1765 template<
class Type>
1768 const tmp<DimensionedField<Type, volMesh> >& tsu,
1769 const fvMatrix<Type>&
A
1773 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1774 tC().source() -= tsu().mesh().V()*tsu().field();
1779 template<
class Type>
1782 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tsu,
1783 const fvMatrix<Type>&
A
1787 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1788 tC().source() -= tsu().mesh().V()*tsu().internalField();
1793 template<
class Type>
1796 const DimensionedField<Type, volMesh>& su,
1797 const tmp<fvMatrix<Type> >& tA
1801 tmp<fvMatrix<Type> > tC(tA.
ptr());
1802 tC().source() -= su.mesh().V()*su.field();
1806 template<
class Type>
1809 const tmp<DimensionedField<Type, volMesh> >& tsu,
1810 const tmp<fvMatrix<Type> >& tA
1814 tmp<fvMatrix<Type> > tC(tA.
ptr());
1815 tC().source() -= tsu().mesh().V()*tsu().field();
1820 template<
class Type>
1823 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tsu,
1824 const tmp<fvMatrix<Type> >& tA
1828 tmp<fvMatrix<Type> > tC(tA.
ptr());
1829 tC().source() -= tsu().mesh().V()*tsu().internalField();
1835 template<
class Type>
1838 const fvMatrix<Type>&
A,
1839 const fvMatrix<Type>& B
1843 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1848 template<
class Type>
1851 const tmp<fvMatrix<Type> >& tA,
1852 const fvMatrix<Type>& B
1856 tmp<fvMatrix<Type> > tC(tA.
ptr());
1861 template<
class Type>
1864 const fvMatrix<Type>&
A,
1865 const tmp<fvMatrix<Type> >& tB
1869 tmp<fvMatrix<Type> > tC(tB.ptr());
1875 template<
class Type>
1878 const tmp<fvMatrix<Type> >& tA,
1879 const tmp<fvMatrix<Type> >& tB
1883 tmp<fvMatrix<Type> > tC(tA.
ptr());
1889 template<
class Type>
1892 const fvMatrix<Type>&
A,
1893 const DimensionedField<Type, volMesh>& su
1897 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1898 tC().source() += su.mesh().V()*su.field();
1902 template<
class Type>
1905 const fvMatrix<Type>&
A,
1906 const tmp<DimensionedField<Type, volMesh> >& tsu
1910 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1911 tC().source() += tsu().mesh().V()*tsu().field();
1916 template<
class Type>
1919 const fvMatrix<Type>&
A,
1920 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tsu
1924 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1925 tC().source() += tsu().mesh().V()*tsu().internalField();
1930 template<
class Type>
1933 const tmp<fvMatrix<Type> >& tA,
1934 const DimensionedField<Type, volMesh>& su
1938 tmp<fvMatrix<Type> > tC(tA.
ptr());
1939 tC().source() += su.mesh().V()*su.field();
1943 template<
class Type>
1946 const tmp<fvMatrix<Type> >& tA,
1947 const tmp<DimensionedField<Type, volMesh> >& tsu
1951 tmp<fvMatrix<Type> > tC(tA.
ptr());
1952 tC().source() += tsu().mesh().V()*tsu().field();
1957 template<
class Type>
1960 const tmp<fvMatrix<Type> >& tA,
1961 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tsu
1965 tmp<fvMatrix<Type> > tC(tA.
ptr());
1966 tC().source() += tsu().mesh().V()*tsu().internalField();
1971 template<
class Type>
1974 const DimensionedField<Type, volMesh>& su,
1975 const fvMatrix<Type>&
A
1979 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1981 tC().source() -= su.mesh().V()*su.field();
1985 template<
class Type>
1988 const tmp<DimensionedField<Type, volMesh> >& tsu,
1989 const fvMatrix<Type>&
A
1993 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
1995 tC().source() -= tsu().mesh().V()*tsu().field();
2000 template<
class Type>
2003 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tsu,
2004 const fvMatrix<Type>&
A
2008 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
2010 tC().source() -= tsu().mesh().V()*tsu().internalField();
2015 template<
class Type>
2018 const DimensionedField<Type, volMesh>& su,
2019 const tmp<fvMatrix<Type> >& tA
2023 tmp<fvMatrix<Type> > tC(tA.
ptr());
2025 tC().source() -= su.mesh().V()*su.field();
2029 template<
class Type>
2032 const tmp<DimensionedField<Type, volMesh> >& tsu,
2033 const tmp<fvMatrix<Type> >& tA
2037 tmp<fvMatrix<Type> > tC(tA.
ptr());
2039 tC().source() -= tsu().mesh().V()*tsu().field();
2044 template<
class Type>
2047 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tsu,
2048 const tmp<fvMatrix<Type> >& tA
2052 tmp<fvMatrix<Type> > tC(tA.
ptr());
2054 tC().source() -= tsu().mesh().V()*tsu().internalField();
2059 template<
class Type>
2062 const fvMatrix<Type>&
A,
2063 const dimensioned<Type>& su
2067 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
2068 tC().source() -= su.value()*
A.psi().mesh().V();
2072 template<
class Type>
2075 const tmp<fvMatrix<Type> >& tA,
2076 const dimensioned<Type>& su
2080 tmp<fvMatrix<Type> > tC(tA.
ptr());
2081 tC().source() -= su.value()*tC().psi().mesh().V();
2085 template<
class Type>
2088 const dimensioned<Type>& su,
2089 const fvMatrix<Type>&
A
2093 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
2094 tC().source() -= su.value()*
A.psi().mesh().V();
2098 template<
class Type>
2101 const dimensioned<Type>& su,
2102 const tmp<fvMatrix<Type> >& tA
2106 tmp<fvMatrix<Type> > tC(tA.
ptr());
2107 tC().source() -= su.value()*tC().psi().mesh().V();
2111 template<
class Type>
2114 const fvMatrix<Type>&
A,
2115 const dimensioned<Type>& su
2119 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
2120 tC().source() += su.value()*tC().psi().mesh().V();
2124 template<
class Type>
2127 const tmp<fvMatrix<Type> >& tA,
2128 const dimensioned<Type>& su
2132 tmp<fvMatrix<Type> > tC(tA.
ptr());
2133 tC().source() += su.value()*tC().psi().mesh().V();
2137 template<
class Type>
2140 const dimensioned<Type>& su,
2141 const fvMatrix<Type>&
A
2145 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
2147 tC().source() -= su.value()*
A.psi().mesh().V();
2151 template<
class Type>
2154 const dimensioned<Type>& su,
2155 const tmp<fvMatrix<Type> >& tA
2159 tmp<fvMatrix<Type> > tC(tA.
ptr());
2161 tC().source() -= su.value()*tC().psi().mesh().V();
2166 template<
class Type>
2169 const DimensionedField<scalar, volMesh>& dsf,
2170 const fvMatrix<Type>&
A
2173 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
2178 template<
class Type>
2181 const tmp< DimensionedField<scalar, volMesh> >& tdsf,
2182 const fvMatrix<Type>&
A
2185 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
2190 template<
class Type>
2193 const tmp<volScalarField>& tvsf,
2194 const fvMatrix<Type>&
A
2197 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
2202 template<
class Type>
2205 const DimensionedField<scalar, volMesh>& dsf,
2206 const tmp<fvMatrix<Type> >& tA
2209 tmp<fvMatrix<Type> > tC(tA.
ptr());
2214 template<
class Type>
2217 const tmp<DimensionedField<scalar, volMesh> >& tdsf,
2218 const tmp<fvMatrix<Type> >& tA
2221 tmp<fvMatrix<Type> > tC(tA.
ptr());
2226 template<
class Type>
2229 const tmp<volScalarField>& tvsf,
2230 const tmp<fvMatrix<Type> >& tA
2233 tmp<fvMatrix<Type> > tC(tA.
ptr());
2238 template<
class Type>
2241 const dimensioned<scalar>& ds,
2242 const fvMatrix<Type>&
A
2245 tmp<fvMatrix<Type> > tC(
new fvMatrix<Type>(
A));
2250 template<
class Type>
2253 const dimensioned<scalar>& ds,
2254 const tmp<fvMatrix<Type> >& tA
2257 tmp<fvMatrix<Type> > tC(tA.
ptr());
2263 template<
class Type>
2267 const fvMatrix<Type>&
M,
2268 const DimensionedField<Type, volMesh>&
psi
2271 tmp<GeometricField<Type, fvPatchField, volMesh> > tMphi
2273 new GeometricField<Type, fvPatchField, volMesh>
2285 zeroGradientFvPatchScalarField::typeName
2288 GeometricField<Type, fvPatchField, volMesh>& Mphi = tMphi();
2293 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
2297 M.addBoundaryDiag(boundaryDiagCmpt, cmpt);
2298 Mphi.internalField().replace(cmpt, -boundaryDiagCmpt*psiCmpt);
2303 Mphi.internalField() = pTraits<Type>::zero;
2306 Mphi.internalField() +=
M.lduMatrix::H(
psi.field()) +
M.source();
2307 M.addBoundarySource(Mphi.internalField());
2309 Mphi.internalField() /= -
psi.mesh().V();
2310 Mphi.correctBoundaryConditions();
2315 template<
class Type>
2319 const fvMatrix<Type>&
M,
2320 const tmp<DimensionedField<Type, volMesh> >& tpsi
2323 tmp<GeometricField<Type, fvPatchField, volMesh> > tMpsi =
M & tpsi();
2328 template<
class Type>
2332 const fvMatrix<Type>&
M,
2333 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tpsi
2336 tmp<GeometricField<Type, fvPatchField, volMesh> > tMpsi =
M & tpsi();
2341 template<
class Type>
2345 const tmp<fvMatrix<Type> >& tM,
2346 const DimensionedField<Type, volMesh>&
psi
2349 tmp<GeometricField<Type, fvPatchField, volMesh> > tMpsi = tM() &
psi;
2354 template<
class Type>
2358 const tmp<fvMatrix<Type> >& tM,
2359 const tmp<DimensionedField<Type, volMesh> >& tpsi
2362 tmp<GeometricField<Type, fvPatchField, volMesh> > tMpsi = tM() & tpsi();
2368 template<
class Type>
2372 const tmp<fvMatrix<Type> >& tM,
2373 const tmp<GeometricField<Type, fvPatchField, volMesh> >& tpsi
2376 tmp<GeometricField<Type, fvPatchField, volMesh> > tMpsi = tM() & tpsi();
2385 template<
class Type>
2388 os << static_cast<const lduMatrix&>(fvm) <<
nl
2389 << fvm.dimensions_ <<
nl
2390 << fvm.source_ <<
nl
2391 << fvm.internalCoeffs_ <<
nl
2392 << fvm.boundaryCoeffs_ <<
endl;
2394 os.
check(
"Ostream& operator<<(Ostream&, fvMatrix<Type>&");