From 50d1ac15ef47b0b34cd7ae6260f29937d5581605 Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Wed, 27 Sep 2017 09:30:59 +0100 Subject: [PATCH] INT: Integration updates in preparation for merge into the develop branch --- .../liquidFilmFoam/liquidFilmFoam.C | 6 +- .../sphereSurfactantFoam/surfactantFoam.C | 6 +- bin/tools/CleanFunctions | 13 +- src/finiteArea/Make/files | 3 +- src/finiteArea/areaMesh/areaFaMesh.H | 2 +- src/finiteArea/edgeMesh/edgeFaMesh.H | 2 +- src/finiteArea/faMatrices/faMatrices.H | 2 +- src/finiteArea/faMatrices/faMatrix/faMatrix.C | 589 +++-- src/finiteArea/faMatrices/faMatrix/faMatrix.H | 283 +-- .../faMatrices/faMatrix/faMatrixSolve.C | 47 +- .../faScalarMatrix/faScalarMatrix.C | 30 +- .../faScalarMatrix/faScalarMatrix.H | 2 +- .../faMesh/faBoundaryMesh/faBoundaryMesh.C | 101 +- .../faMesh/faBoundaryMesh/faBoundaryMesh.H | 3 +- .../faGlobalMeshData/faGlobalMeshData.C | 18 +- .../faGlobalMeshData/faGlobalMeshData.H | 15 +- .../faGlobalMeshData/faProcessorTopology.H | 4 +- src/finiteArea/faMesh/faMesh.C | 351 ++- src/finiteArea/faMesh/faMesh.H | 12 +- .../faMesh/faMeshDemandDrivenData.C | 686 +++--- src/finiteArea/faMesh/faMeshLduAddressing.H | 13 +- .../faMesh/faMeshMapper/faAreaMapper.C | 54 +- .../faMesh/faMeshMapper/faAreaMapper.H | 21 +- .../faMeshMapper/faBoundaryMeshMapper.H | 2 +- .../faMesh/faMeshMapper/faEdgeMapper.C | 19 +- .../faMesh/faMeshMapper/faEdgeMapper.H | 20 +- .../faMesh/faMeshMapper/faMeshMapper.C | 5 +- .../faMesh/faMeshMapper/faPatchMapper.C | 25 +- .../faMesh/faMeshMapper/faPatchMapper.H | 14 +- src/finiteArea/faMesh/faMeshUpdate.C | 12 +- .../faPatches/basic/coupled/coupledFaPatch.C | 18 +- .../faPatches/basic/coupled/coupledFaPatch.H | 8 +- .../constraint/cyclic/cyclicFaPatch.C | 68 +- .../constraint/cyclic/cyclicFaPatch.H | 5 +- .../faPatches/constraint/empty/emptyFaPatch.C | 4 +- .../faPatches/constraint/empty/emptyFaPatch.H | 4 +- .../constraint/processor/processorFaPatch.C | 95 +- .../constraint/processor/processorFaPatch.H | 10 +- .../constraint/symmetry/symmetryFaPatch.C | 32 +- .../constraint/symmetry/symmetryFaPatch.H | 7 +- .../faPatches/constraint/wedge/wedgeFaPatch.C | 49 +- .../faPatches/constraint/wedge/wedgeFaPatch.H | 31 +- .../faMesh/faPatches/faPatch/faPatch.C | 89 +- .../faMesh/faPatches/faPatch/faPatch.H | 25 +- .../faMesh/faPatches/faPatch/faPatchData.H | 9 +- .../faMesh/faPatches/faPatch/faPatchList.H | 2 +- .../faPatch/{newFaPatch.C => faPatchNew.C} | 36 +- .../faPatches/faPatch/faPatchTemplates.C | 4 +- src/finiteArea/faSolution/faSolution.H | 14 +- src/finiteArea/fields/areaFields/areaFields.C | 5 +- src/finiteArea/fields/areaFields/areaFields.H | 4 +- .../fields/areaFields/areaFieldsFwd.H | 1 - src/finiteArea/fields/edgeFields/edgeFields.C | 3 - .../fields/edgeFields/edgeFieldsFwd.H | 1 - .../basicSymmetry/basicSymmetryFaPatchField.C | 30 +- .../basicSymmetry/basicSymmetryFaPatchField.H | 22 +- .../basicSymmetryFaPatchScalarField.C | 19 +- .../basic/calculated/calculatedFaPatchField.C | 72 +- .../basic/calculated/calculatedFaPatchField.H | 20 +- .../calculated/calculatedFaPatchFields.C | 2 - .../calculated/calculatedFaPatchFields.H | 2 +- .../calculated/calculatedFaPatchFieldsFwd.H | 2 +- .../basic/coupled/coupledFaPatchField.C | 41 +- .../basic/coupled/coupledFaPatchField.H | 22 +- .../fixedGradient/fixedGradientFaPatchField.C | 48 +- .../fixedGradient/fixedGradientFaPatchField.H | 27 +- .../fixedGradientFaPatchFields.C | 2 - .../fixedGradientFaPatchFields.H | 2 +- .../fixedGradientFaPatchFieldsFwd.H | 2 +- .../basic/fixedValue/fixedValueFaPatchField.C | 35 +- .../basic/fixedValue/fixedValueFaPatchField.H | 22 +- .../basic/mixed/mixedFaPatchField.C | 42 +- .../basic/mixed/mixedFaPatchField.H | 24 +- .../basic/transform/transformFaPatchField.C | 40 +- .../basic/transform/transformFaPatchField.H | 24 +- .../basic/transform/transformFaPatchFields.C | 2 - .../basic/transform/transformFaPatchFields.H | 2 +- .../transform/transformFaPatchFieldsFwd.H | 3 - .../transform/transformFaPatchScalarField.C | 17 +- .../zeroGradient/zeroGradientFaPatchField.C | 41 +- .../zeroGradient/zeroGradientFaPatchField.H | 26 +- .../zeroGradient/zeroGradientFaPatchFields.C | 2 - .../zeroGradient/zeroGradientFaPatchFields.H | 3 - .../zeroGradientFaPatchFieldsFwd.H | 5 - .../constraint/cyclic/cyclicFaPatchField.C | 64 +- .../constraint/cyclic/cyclicFaPatchField.H | 16 +- .../constraint/empty/emptyFaPatchField.C | 59 +- .../constraint/empty/emptyFaPatchField.H | 35 +- .../constraint/empty/emptyFaPatchFields.C | 2 - .../constraint/empty/emptyFaPatchFields.H | 4 - .../constraint/empty/emptyFaPatchFieldsFwd.H | 5 - .../processor/processorFaPatchField.C | 66 +- .../processor/processorFaPatchField.H | 18 +- .../processor/processorFaPatchScalarField.C | 16 +- .../symmetry/symmetryFaPatchField.C | 43 +- .../symmetry/symmetryFaPatchField.H | 10 +- .../constraint/wedge/wedgeFaPatchField.C | 55 +- .../constraint/wedge/wedgeFaPatchField.H | 18 +- .../constraint/wedge/wedgeFaPatchFields.C | 2 - .../constraint/wedge/wedgeFaPatchFields.H | 8 - .../constraint/wedge/wedgeFaPatchFieldsFwd.H | 3 - .../wedge/wedgeFaPatchScalarField.C | 20 +- .../edgeNormalFixedValueFaPatchVectorField.C | 1 - .../fixedValueOutflowFaPatchField.C | 38 +- .../fixedValueOutflowFaPatchField.H | 22 +- .../fixedValueOutflowFaPatchFields.C | 2 - .../fixedValueOutflowFaPatchFields.H | 9 - .../fixedValueOutflowFaPatchFieldsFwd.H | 5 - .../inletOutlet/inletOutletFaPatchField.C | 29 +- .../inletOutlet/inletOutletFaPatchField.H | 19 +- .../derived/slip/slipFaPatchField.C | 19 +- .../derived/slip/slipFaPatchField.H | 16 +- ...timeVaryingUniformFixedValueFaPatchField.H | 21 +- .../faPatchFields/faPatchField/faPatchField.C | 106 +- .../faPatchFields/faPatchField/faPatchField.H | 53 +- .../faPatchField/faPatchFieldMapper.H | 2 +- .../faPatchField/faPatchFieldMapperPatchRef.H | 2 +- .../faPatchField/faPatchFieldNew.C | 152 ++ .../faPatchField/newFaPatchField.C | 198 -- .../calculated/calculatedFaePatchField.C | 29 +- .../calculated/calculatedFaePatchField.H | 18 +- .../calculated/calculatedFaePatchFieldsFwd.H | 2 +- .../basic/coupled/coupledFaePatchField.C | 23 +- .../basic/coupled/coupledFaePatchField.H | 13 +- .../basic/coupled/coupledFaePatchFieldsFwd.H | 2 +- .../fixedValue/fixedValueFaePatchField.C | 23 +- .../fixedValue/fixedValueFaePatchField.H | 18 +- .../constraint/cyclic/cyclicFaePatchField.C | 43 +- .../constraint/cyclic/cyclicFaePatchField.H | 17 +- .../constraint/empty/emptyFaePatchField.C | 43 +- .../constraint/empty/emptyFaePatchField.H | 16 +- .../constraint/empty/emptyFaePatchFields.C | 2 - .../processor/processorFaePatchField.C | 48 +- .../processor/processorFaePatchField.H | 17 +- .../symmetry/symmetryFaePatchField.C | 43 +- .../symmetry/symmetryFaePatchField.H | 16 +- .../constraint/wedge/wedgeFaePatchField.C | 43 +- .../constraint/wedge/wedgeFaePatchField.H | 14 +- .../faePatchField/faePatchField.C | 97 +- .../faePatchField/faePatchField.H | 118 +- .../faePatchField/faePatchFieldNew.C | 153 ++ .../faePatchField/faePatchFields.H | 2 +- .../faePatchField/faePatchFieldsFwd.H | 2 +- .../faePatchField/newFaePatchField.C | 205 -- .../faConvectionScheme/faConvectionScheme.C | 63 +- .../faConvectionScheme/faConvectionScheme.H | 27 +- .../faConvectionScheme/faConvectionSchemes.C | 4 - .../gaussFaConvectionScheme.C | 12 +- .../gaussFaConvectionScheme.H | 18 +- .../gaussFaConvectionSchemes.C | 2 - .../EulerFaDdtScheme/EulerFaDdtScheme.C | 58 +- .../EulerFaDdtScheme/EulerFaDdtScheme.H | 28 +- .../EulerFaDdtScheme/EulerFaDdtSchemes.C | 2 - .../backwardFaDdtScheme/backwardFaDdtScheme.C | 60 +- .../backwardFaDdtScheme/backwardFaDdtScheme.H | 32 +- .../backwardFaDdtSchemes.C | 2 - .../boundedBackwardFaDdtScheme.C | 33 +- .../boundedBackwardFaDdtScheme.H | 2 +- .../ddtSchemes/faDdtScheme/faDdtScheme.C | 30 +- .../ddtSchemes/faDdtScheme/faDdtScheme.H | 37 +- .../ddtSchemes/faDdtScheme/faDdtSchemes.C | 4 - .../steadyStateFaDdtScheme.C | 46 +- .../steadyStateFaDdtScheme.H | 32 +- .../steadyStateFaDdtSchemes.C | 2 - .../divSchemes/faDivScheme/faDivScheme.C | 35 +- .../divSchemes/faDivScheme/faDivScheme.H | 25 +- .../divSchemes/faDivScheme/faDivSchemes.C | 3 - .../gaussFaDivScheme/gaussFaDivScheme.C | 2 - .../gaussFaDivScheme/gaussFaDivScheme.H | 8 +- .../gaussFaDivScheme/gaussFaDivSchemes.C | 2 - src/finiteArea/finiteArea/fa/fa.C | 3 - src/finiteArea/finiteArea/fa/fa.H | 2 +- .../finiteArea/faSchemes/faSchemes.H | 2 +- src/finiteArea/finiteArea/fac/fac.H | 3 - src/finiteArea/finiteArea/fac/facAverage.C | 18 +- src/finiteArea/finiteArea/fac/facAverage.H | 14 +- src/finiteArea/finiteArea/fac/facDdt.C | 8 +- src/finiteArea/finiteArea/fac/facDdt.H | 14 +- src/finiteArea/finiteArea/fac/facDiv.C | 56 +- src/finiteArea/finiteArea/fac/facDiv.H | 40 +- .../finiteArea/fac/facEdgeIntegrate.C | 20 +- .../finiteArea/fac/facEdgeIntegrate.H | 18 +- src/finiteArea/finiteArea/fac/facGrad.C | 14 +- src/finiteArea/finiteArea/fac/facGrad.H | 14 +- src/finiteArea/finiteArea/fac/facLaplacian.C | 139 +- src/finiteArea/finiteArea/fac/facLaplacian.H | 108 +- src/finiteArea/finiteArea/fac/facLnGrad.C | 16 +- src/finiteArea/finiteArea/fac/facLnGrad.H | 18 +- src/finiteArea/finiteArea/fac/facNDiv.C | 58 +- src/finiteArea/finiteArea/fac/facNDiv.H | 40 +- src/finiteArea/finiteArea/fac/facNGrad.C | 14 +- src/finiteArea/finiteArea/fac/facNGrad.H | 12 +- src/finiteArea/finiteArea/fam/fam.H | 6 - src/finiteArea/finiteArea/fam/famDdt.C | 6 +- src/finiteArea/finiteArea/fam/famDdt.H | 12 +- src/finiteArea/finiteArea/fam/famDiv.C | 14 +- src/finiteArea/finiteArea/fam/famDiv.H | 14 +- src/finiteArea/finiteArea/fam/famLaplacian.C | 50 +- src/finiteArea/finiteArea/fam/famLaplacian.H | 44 +- src/finiteArea/finiteArea/fam/famNDiv.C | 12 +- src/finiteArea/finiteArea/fam/famNDiv.H | 16 +- src/finiteArea/finiteArea/fam/famSup.C | 33 +- src/finiteArea/finiteArea/fam/famSup.H | 24 +- src/finiteArea/finiteArea/fam/vectorFamDiv.C | 2 +- src/finiteArea/finiteArea/fam/vectorFamDiv.H | 6 +- .../gradSchemes/faGradScheme/faGradScheme.C | 34 +- .../gradSchemes/faGradScheme/faGradScheme.H | 21 +- .../gradSchemes/faGradScheme/faGradSchemes.C | 3 - .../gradSchemes/gaussFaGrad/gaussFaGrad.C | 2 +- .../gradSchemes/gaussFaGrad/gaussFaGrad.H | 18 +- .../leastSquaresFaGrad/leastSquaresFaGrad.C | 2 +- .../leastSquaresFaGrad/leastSquaresFaGrad.H | 8 +- .../leastSquaresFaVectors.C | 4 +- .../edgeLimitedFaGrad/edgeLimitedFaGrad.H | 9 +- .../faceLimitedFaGrad/faceLimitedFaGrad.H | 9 +- .../faceLimitedFaGrad/faceLimitedFaGrads.C | 2 +- .../faLaplacianScheme/faLaplacianScheme.C | 36 +- .../faLaplacianScheme/faLaplacianScheme.H | 43 +- .../faLaplacianScheme/faLaplacianSchemes.C | 3 - .../gaussFaLaplacianScheme.C | 12 +- .../gaussFaLaplacianScheme.H | 16 +- .../gaussFaLaplacianSchemes.C | 2 - .../correctedLnGrad/correctedLnGrad.C | 10 +- .../correctedLnGrad/correctedLnGrad.H | 15 +- .../correctedLnGrad/correctedLnGrads.C | 3 - .../lnGradSchemes/fourthLnGrad/fourthLnGrad.C | 14 +- .../lnGradSchemes/fourthLnGrad/fourthLnGrad.H | 21 +- .../fourthLnGrad/fourthLnGrads.C | 3 - .../limitedLnGrad/limitedLnGrad.C | 12 +- .../limitedLnGrad/limitedLnGrad.H | 11 +- .../limitedLnGrad/limitedLnGrads.C | 7 - .../lnGradSchemes/lnGradScheme/lnGradScheme.C | 57 +- .../lnGradSchemes/lnGradScheme/lnGradScheme.H | 29 +- .../lnGradScheme/lnGradSchemes.C | 4 - .../edgeInterpolation/edgeInterpolate.C | 124 +- .../edgeInterpolation/edgeInterpolate.H | 44 +- .../edgeInterpolation/edgeInterpolation.C | 208 +- .../edgeInterpolation/edgeInterpolation.H | 4 +- .../edgeInterpolationScheme.C | 182 +- .../edgeInterpolationScheme.H | 34 +- .../edgeInterpolationSchemes.C | 2 - .../edgeInterpolation/schemes/Gamma/Gamma.H | 4 +- .../Gamma/GammaEdgeInterpolationMake.C | 3 - .../schemes/NVDscheme/faNVDscheme.C | 26 +- .../schemes/NVDscheme/faNVDscheme.H | 12 +- .../blended/blendedEdgeInterpolation.H | 2 +- .../blended/blendedEdgeInterpolationMake.C | 3 - .../schemes/linear/linearEdgeInterpolation.H | 10 +- .../linear/linearEdgeInterpolationMake.C | 3 - .../schemes/linearUpwind/linearUpwind.H | 2 +- .../linearUpwindEdgeInterpolationMake.C | 10 +- .../schemes/upwind/upwindEdgeInterpolation.H | 2 +- .../upwind/upwindEdgeInterpolationMake.C | 3 - .../mapping/faFieldMappers/MapFaAreaField.H | 10 +- .../mapping/faFieldMappers/MapFaEdgeField.H | 12 +- .../volSurfaceMapping/volSurfaceMapping.C | 10 +- .../volSurfaceMapping/volSurfaceMapping.H | 14 +- .../liquidFilmFoam/cylinder/.gitignore | 52 - .../finiteArea/liquidFilmFoam/cylinder/0/Us | 6 +- .../finiteArea/liquidFilmFoam/cylinder/0/h | 6 +- .../liquidFilmFoam/cylinder/0/manningField | 6 +- .../liquidFilmFoam/cylinder/Allclean | 7 +- .../finiteArea/liquidFilmFoam/cylinder/Allrun | 13 +- .../cylinder/constant/faMesh/faBoundary | 292 --- .../cylinder/constant/faMesh/faMeshDefinition | 6 +- .../cylinder/constant/faMesh/faceLabels | 2024 ----------------- .../liquidFilmFoam/cylinder/constant/g | 6 +- .../cylinder/constant/transportProperties | 6 +- .../cylinder/system/blockMeshDict | 6 +- .../cylinder/system/controlDict | 11 +- .../liquidFilmFoam/cylinder/system/faSchemes | 6 +- .../liquidFilmFoam/cylinder/system/faSolution | 6 +- .../liquidFilmFoam/cylinder/system/fvSchemes | 6 +- .../liquidFilmFoam/cylinder/system/fvSolution | 6 +- .../sphereTransport/0/Cs | 6 +- .../sphereTransport/0/Cvf | 2 +- .../sphereTransport/0/U | 2 +- .../sphereTransport/Allclean | 9 + .../sphereTransport/Allrun | 9 + .../constant/faMesh/faMeshDefinition | 6 +- .../constant/polyMesh/boundary | 6 +- .../sphereTransport/constant/polyMesh/cells | 6 +- .../sphereTransport/constant/polyMesh/faces | 6 +- .../constant/polyMesh/neighbour | 6 +- .../sphereTransport/constant/polyMesh/owner | 6 +- .../sphereTransport/constant/polyMesh/points | 6 +- .../sphereTransport/system/controlDict | 8 +- .../sphereTransport/system/faSchemes | 6 +- .../sphereTransport/system/faSolution | 6 +- .../sphereTransport/system/fvSchemes | 6 +- .../sphereTransport/system/fvSolution | 6 +- tutorials/finiteArea/sphereTransport/Allclean | 7 - tutorials/finiteArea/sphereTransport/Allrun | 8 - .../surfactantFoam/planeTransport/0/Cs | 6 +- .../surfactantFoam/planeTransport/0/Us | 6 +- .../surfactantFoam/planeTransport/Allclean | 10 +- .../surfactantFoam/planeTransport/Allrun | 12 +- .../planeTransport/constant/faMesh/faBoundary | 6 +- .../constant/faMesh/faMeshDefinition | 6 +- .../constant/polyMesh/blockMeshDict | 6 +- .../constant/transportProperties | 6 +- .../planeTransport/system/controlDict | 8 +- .../planeTransport/system/decomposeParDict | 6 +- .../planeTransport/system/faSchemes | 6 +- .../planeTransport/system/faSolution | 6 +- .../planeTransport/system/fvSchemes | 6 +- .../planeTransport/system/fvSolution | 6 +- 307 files changed, 3565 insertions(+), 7316 deletions(-) rename src/finiteArea/faMesh/faPatches/faPatch/{newFaPatch.C => faPatchNew.C} (66%) create mode 100644 src/finiteArea/fields/faPatchFields/faPatchField/faPatchFieldNew.C delete mode 100644 src/finiteArea/fields/faPatchFields/faPatchField/newFaPatchField.C create mode 100644 src/finiteArea/fields/faePatchFields/faePatchField/faePatchFieldNew.C delete mode 100644 src/finiteArea/fields/faePatchFields/faePatchField/newFaePatchField.C delete mode 100644 tutorials/finiteArea/liquidFilmFoam/cylinder/.gitignore delete mode 100644 tutorials/finiteArea/liquidFilmFoam/cylinder/constant/faMesh/faBoundary delete mode 100644 tutorials/finiteArea/liquidFilmFoam/cylinder/constant/faMesh/faceLabels rename tutorials/finiteArea/{ => sphereSurfactantFoam}/sphereTransport/0/Cs (78%) rename tutorials/finiteArea/{ => sphereSurfactantFoam}/sphereTransport/0/Cvf (99%) rename tutorials/finiteArea/{ => sphereSurfactantFoam}/sphereTransport/0/U (99%) create mode 100755 tutorials/finiteArea/sphereSurfactantFoam/sphereTransport/Allclean create mode 100755 tutorials/finiteArea/sphereSurfactantFoam/sphereTransport/Allrun rename tutorials/finiteArea/{ => sphereSurfactantFoam}/sphereTransport/constant/faMesh/faMeshDefinition (76%) rename tutorials/finiteArea/{ => sphereSurfactantFoam}/sphereTransport/constant/polyMesh/boundary (77%) rename tutorials/finiteArea/{ => sphereSurfactantFoam}/sphereTransport/constant/polyMesh/cells (99%) rename tutorials/finiteArea/{ => sphereSurfactantFoam}/sphereTransport/constant/polyMesh/faces (99%) rename tutorials/finiteArea/{ => sphereSurfactantFoam}/sphereTransport/constant/polyMesh/neighbour (99%) rename tutorials/finiteArea/{ => sphereSurfactantFoam}/sphereTransport/constant/polyMesh/owner (99%) rename tutorials/finiteArea/{ => sphereSurfactantFoam}/sphereTransport/constant/polyMesh/points (99%) rename tutorials/finiteArea/{ => sphereSurfactantFoam}/sphereTransport/system/controlDict (80%) rename tutorials/finiteArea/{ => sphereSurfactantFoam}/sphereTransport/system/faSchemes (83%) rename tutorials/finiteArea/{ => sphereSurfactantFoam}/sphereTransport/system/faSolution (84%) rename tutorials/finiteArea/{ => sphereSurfactantFoam}/sphereTransport/system/fvSchemes (78%) rename tutorials/finiteArea/{ => sphereSurfactantFoam}/sphereTransport/system/fvSolution (76%) delete mode 100755 tutorials/finiteArea/sphereTransport/Allclean delete mode 100755 tutorials/finiteArea/sphereTransport/Allrun diff --git a/applications/solvers/finiteArea/liquidFilmFoam/liquidFilmFoam.C b/applications/solvers/finiteArea/liquidFilmFoam/liquidFilmFoam.C index 192e69872f..ba08a67a46 100644 --- a/applications/solvers/finiteArea/liquidFilmFoam/liquidFilmFoam.C +++ b/applications/solvers/finiteArea/liquidFilmFoam/liquidFilmFoam.C @@ -143,9 +143,9 @@ int main(int argc, char *argv[]) runTime.write(); } - Info<< "ExecutionTime = " - << scalar(runTime.elapsedCpuTime()) - << " s\n" << endl << endl; + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; } return 0; diff --git a/applications/solvers/finiteArea/sphereSurfactantFoam/surfactantFoam.C b/applications/solvers/finiteArea/sphereSurfactantFoam/surfactantFoam.C index e99f01b19a..408d85e8c1 100644 --- a/applications/solvers/finiteArea/sphereSurfactantFoam/surfactantFoam.C +++ b/applications/solvers/finiteArea/sphereSurfactantFoam/surfactantFoam.C @@ -74,9 +74,9 @@ int main(int argc, char *argv[]) Info<< "Total mass of surfactant: " << sum(Cs.internalField()*aMesh.S()) << endl; - Info<< "ExecutionTime = " - << scalar(runTime.elapsedCpuTime()) - << " s\n" << endl << endl; + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; } return 0; diff --git a/bin/tools/CleanFunctions b/bin/tools/CleanFunctions index 4e92ec6e15..431c52f383 100644 --- a/bin/tools/CleanFunctions +++ b/bin/tools/CleanFunctions @@ -3,7 +3,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -41,7 +41,8 @@ cleanTimeDirectories() done rm -rf \ ./[1-9]* ./-[1-9]* ./log ./log.* ./log-* ./logSummary.* \ - ./.fxLock ./*.xml ./ParaView* ./paraFoam* ./*.OpenFOAM ./*.blockMesh \ + ./.fxLock ./*.xml ./ParaView* ./paraFoam* \ + ./*.blockMesh ./*.foam ./*.OpenFOAM \ ./.setSet > /dev/null 2>&1 } @@ -149,8 +150,12 @@ cleanUcomponents() cleanFaMesh () { - rm -rf ./constant/faMesh/{faceLabels*,faBoundary*} \ - > /dev/null 2>&1 + ( + cd constant/faMesh 2>/dev/null && \ + rm -rf \ + faceLabels* faBoundary* \ + > /dev/null 2>&1 \ + ) } cleanApplication() diff --git a/src/finiteArea/Make/files b/src/finiteArea/Make/files index 9e8ffce869..ada1c980cd 100644 --- a/src/finiteArea/Make/files +++ b/src/finiteArea/Make/files @@ -6,7 +6,7 @@ faMesh/faBoundaryMesh/faBoundaryMesh.C faPatches = faMesh/faPatches $(faPatches)/faPatch/faPatch.C -$(faPatches)/faPatch/newFaPatch.C +$(faPatches)/faPatch/faPatchNew.C $(faPatches)/basic/coupled/coupledFaPatch.C $(faPatches)/constraint/empty/emptyFaPatch.C $(faPatches)/constraint/processor/processorFaPatch.C @@ -24,7 +24,6 @@ faPatchFields = fields/faPatchFields $(faPatchFields)/faPatchField/faPatchFields.C basicFaPatchFields = $(faPatchFields)/basic -$(basicFaPatchFields)/basicSymmetry/basicSymmetryFaPatchFields.C $(basicFaPatchFields)/basicSymmetry/basicSymmetryFaPatchScalarField.C $(basicFaPatchFields)/calculated/calculatedFaPatchFields.C $(basicFaPatchFields)/coupled/coupledFaPatchFields.C diff --git a/src/finiteArea/areaMesh/areaFaMesh.H b/src/finiteArea/areaMesh/areaFaMesh.H index 9899b376d1..2e506b1217 100644 --- a/src/finiteArea/areaMesh/areaFaMesh.H +++ b/src/finiteArea/areaMesh/areaFaMesh.H @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see . Class - areaMesh + Foam::areaMesh Description Mesh data needed to do the Finite Area discretisation. diff --git a/src/finiteArea/edgeMesh/edgeFaMesh.H b/src/finiteArea/edgeMesh/edgeFaMesh.H index f5c5dca635..6631f96c25 100644 --- a/src/finiteArea/edgeMesh/edgeFaMesh.H +++ b/src/finiteArea/edgeMesh/edgeFaMesh.H @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see . Class - edgeMesh + Foam::edgeMesh Description Mesh data needed to do the Finite Area discretisation. diff --git a/src/finiteArea/faMatrices/faMatrices.H b/src/finiteArea/faMatrices/faMatrices.H index 30d12db5db..42368b28ba 100644 --- a/src/finiteArea/faMatrices/faMatrices.H +++ b/src/finiteArea/faMatrices/faMatrices.H @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see . Class - faMatrix + Foam::faMatrix Description A special matrix type and solver, designed for finite area diff --git a/src/finiteArea/faMatrices/faMatrix/faMatrix.C b/src/finiteArea/faMatrices/faMatrix/faMatrix.C index 208a1b72ed..0e7040f453 100644 --- a/src/finiteArea/faMatrices/faMatrix/faMatrix.C +++ b/src/finiteArea/faMatrices/faMatrix/faMatrix.C @@ -23,27 +23,19 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Description - Finite-Area matrix - \*---------------------------------------------------------------------------*/ #include "areaFields.H" #include "edgeFields.H" #include "calculatedFaPatchFields.H" #include "zeroGradientFaPatchFields.H" -#include "coupledFaPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ +#include "demandDrivenData.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template template -void faMatrix::addToInternalField +void Foam::faMatrix::addToInternalField ( const labelUList& addr, const Field& pf, @@ -52,11 +44,8 @@ void faMatrix::addToInternalField { if (addr.size() != pf.size()) { - FatalErrorIn - ( - "faMatrix::addToInternalField(const labelUList&, " - "const Field&, Field&)" - ) << "sizes of addressing and field are different" + FatalErrorInFunction + << "sizes of addressing and field are different" << abort(FatalError); } @@ -69,10 +58,10 @@ void faMatrix::addToInternalField template template -void faMatrix::addToInternalField +void Foam::faMatrix::addToInternalField ( const labelUList& addr, - const tmp >& tpf, + const tmp>& tpf, Field& intf ) const { @@ -83,7 +72,7 @@ void faMatrix::addToInternalField template template -void faMatrix::subtractFromInternalField +void Foam::faMatrix::subtractFromInternalField ( const labelUList& addr, const Field& pf, @@ -92,11 +81,8 @@ void faMatrix::subtractFromInternalField { if (addr.size() != pf.size()) { - FatalErrorIn - ( - "faMatrix::addToInternalField(const labelUList&, " - "const Field&, Field&)" - ) << "sizes of addressing and field are different" + FatalErrorInFunction + << "sizes of addressing and field are different" << abort(FatalError); } @@ -109,10 +95,10 @@ void faMatrix::subtractFromInternalField template template -void faMatrix::subtractFromInternalField +void Foam::faMatrix::subtractFromInternalField ( const labelUList& addr, - const tmp >& tpf, + const tmp>& tpf, Field& intf ) const { @@ -122,7 +108,7 @@ void faMatrix::subtractFromInternalField template -void faMatrix::addBoundaryDiag +void Foam::faMatrix::addBoundaryDiag ( scalarField& diag, const direction solveCmpt @@ -141,7 +127,7 @@ void faMatrix::addBoundaryDiag template -void faMatrix::addCmptAvBoundaryDiag(scalarField& diag) const +void Foam::faMatrix::addCmptAvBoundaryDiag(scalarField& diag) const { forAll(internalCoeffs_, patchI) { @@ -156,7 +142,7 @@ void faMatrix::addCmptAvBoundaryDiag(scalarField& diag) const template -void faMatrix::addBoundarySource +void Foam::faMatrix::addBoundarySource ( Field& source, const bool couples @@ -173,7 +159,7 @@ void faMatrix::addBoundarySource } else if (couples) { - tmp > tpnf = ptf.patchNeighbourField(); + tmp> tpnf = ptf.patchNeighbourField(); const Field& pnf = tpnf(); const labelUList& addr = lduAddr().patchAddr(patchI); @@ -190,7 +176,7 @@ void faMatrix::addBoundarySource // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // template -faMatrix::faMatrix +Foam::faMatrix::faMatrix ( const GeometricField& psi, const dimensionSet& ds @@ -202,18 +188,14 @@ faMatrix::faMatrix source_(psi.size(), pTraits::zero), internalCoeffs_(psi.mesh().boundary().size()), boundaryCoeffs_(psi.mesh().boundary().size()), - faceFluxCorrectionPtr_(NULL) + faceFluxCorrectionPtr_(nullptr) { - if (debug) - { - Info<< "faMatrix(const GeometricField&," - " const dimensionSet&) : " - "constructing faMatrix for field " << psi_.name() - << endl; - } + DebugInFunction + << "constructing faMatrix for field " << psi_.name() + << endl; // Initialise coupling coefficients - forAll (psi.mesh().boundary(), patchI) + forAll(psi.mesh().boundary(), patchI) { internalCoeffs_.set ( @@ -247,7 +229,7 @@ faMatrix::faMatrix template -faMatrix::faMatrix(const faMatrix& fam) +Foam::faMatrix::faMatrix(const faMatrix& fam) : refCount(), lduMatrix(fam), @@ -256,14 +238,11 @@ faMatrix::faMatrix(const faMatrix& fam) source_(fam.source_), internalCoeffs_(fam.internalCoeffs_), boundaryCoeffs_(fam.boundaryCoeffs_), - faceFluxCorrectionPtr_(NULL) + faceFluxCorrectionPtr_(nullptr) { - if (debug) - { - Info<< "faMatrix::faMatrix(const faMatrix&) : " - << "copying faMatrix for field " << psi_.name() - << endl; - } + DebugInFunction + << "copying faMatrix for field " << psi_.name() + << endl; if (fam.faceFluxCorrectionPtr_) { @@ -277,7 +256,7 @@ faMatrix::faMatrix(const faMatrix& fam) template -faMatrix::faMatrix +Foam::faMatrix::faMatrix ( const GeometricField& psi, Istream& is @@ -289,18 +268,14 @@ faMatrix::faMatrix source_(is), internalCoeffs_(psi.mesh().boundary().size()), boundaryCoeffs_(psi.mesh().boundary().size()), - faceFluxCorrectionPtr_(NULL) + faceFluxCorrectionPtr_(nullptr) { - if (debug) - { - Info<< "faMatrix(const GeometricField&," - " Istream&) : " - "constructing faMatrix for field " << psi_.name() - << endl; - } + DebugInFunction + << "constructing faMatrix for field " << psi_.name() + << endl; // Initialise coupling coefficients - forAll (psi.mesh().boundary(), patchI) + forAll(psi.mesh().boundary(), patchI) { internalCoeffs_.set ( @@ -327,28 +302,20 @@ faMatrix::faMatrix template -faMatrix::~faMatrix() +Foam::faMatrix::~faMatrix() { - if (debug) - { - Info<< "faMatrix::~faMatrix() : " - << "destroying faMatrix for field " << psi_.name() - << endl; - } + DebugInFunction + << "destroying faMatrix for field " << psi_.name() + << endl; - if (faceFluxCorrectionPtr_) - { - delete faceFluxCorrectionPtr_; - } + deleteDemandDrivenData(faceFluxCorrectionPtr_); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// Set solution in given faces and eliminate corresponding -// equations from the matrix template -void faMatrix::setValues +void Foam::faMatrix::setValues ( const labelUList& faceLabels, const UList& values @@ -357,9 +324,9 @@ void faMatrix::setValues const faMesh& mesh = psi_.mesh(); // Record face labels of eliminated equations - forAll (faceLabels, i) + for (const label i : faceLabels) { - this->eliminatedEqns().insert(faceLabels[i]); + this->eliminatedEqns().insert(i); } const labelListList& edges = mesh.patch().faceEdges(); @@ -441,9 +408,8 @@ void faMatrix::setValues } -// Set reference level for solution template -void faMatrix::setReference +void Foam::faMatrix::setReference ( const label facei, const Type& value @@ -461,7 +427,7 @@ void faMatrix::setReference template -void faMatrix::relax(const scalar alpha) +void Foam::faMatrix::relax(const scalar alpha) { if (alpha <= 0) { @@ -551,7 +517,7 @@ void faMatrix::relax(const scalar alpha) template -void faMatrix::relax() +void Foam::faMatrix::relax() { if (psi_.mesh().solutionDict().relaxEquation(psi_.name())) { @@ -559,18 +525,15 @@ void faMatrix::relax() } else { - if (debug) - { - InfoIn("void faMatrix::relax()") - << "Relaxation factor for field " << psi_.name() - << " not found. Relaxation will not be used." << endl; - } + DebugInFunction + << "Relaxation factor for field " << psi_.name() + << " not found. Relaxation will not be used." << endl; } } template -tmp faMatrix::D() const +Foam::tmp Foam::faMatrix::D() const { tmp tdiag(new scalarField(diag())); addCmptAvBoundaryDiag(tdiag.ref()); @@ -579,7 +542,7 @@ tmp faMatrix::D() const template -tmp faMatrix::A() const +Foam::tmp Foam::faMatrix::A() const { tmp tAphi ( @@ -605,9 +568,10 @@ tmp faMatrix::A() const template -tmp > faMatrix::H() const +Foam::tmp> +Foam::faMatrix::H() const { - tmp > tHphi + tmp> tHphi ( new GeometricField ( @@ -625,7 +589,7 @@ tmp > faMatrix::H() const GeometricField& Hphi = tHphi.ref(); // Loop over field components - for (direction cmpt=0; cmpt > faMatrix::H() const template -tmp > faMatrix:: -flux() const +Foam::tmp> +Foam::faMatrix::flux() const { if (!psi_.mesh().schemesDict().fluxRequired(psi_.name())) { - FatalErrorIn("faMatrix::flux()") + FatalErrorInFunction << "flux requested but " << psi_.name() << " not specified in the fluxRequired sub-dictionary of faSchemes" << abort(FatalError); } // construct GeometricField - tmp > tfieldFlux + tmp> tfieldFlux ( new GeometricField ( @@ -677,7 +641,7 @@ flux() const GeometricField& fieldFlux = tfieldFlux.ref(); - for (direction cmpt=0; cmpt::nComponents; cmpt++) + for (direction cmpt=0; cmpt::nComponents; ++cmpt) { fieldFlux.primitiveFieldRef().replace ( @@ -731,18 +695,18 @@ flux() const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template -void faMatrix::operator=(const faMatrix& famv) +void Foam::faMatrix::operator=(const faMatrix& famv) { if (this == &famv) { - FatalErrorIn("faMatrix::operator=(const faMatrix&)") + FatalErrorInFunction << "attempted to assignment to self" << abort(FatalError); } if (&psi_ != &(famv.psi_)) { - FatalErrorIn("faMatrix::operator=(const faMatrix&)") + FatalErrorInFunction << "different fields" << abort(FatalError); } @@ -766,7 +730,7 @@ void faMatrix::operator=(const faMatrix& famv) template -void faMatrix::operator=(const tmp >& tfamv) +void Foam::faMatrix::operator=(const tmp>& tfamv) { operator=(tfamv()); tfamv.clear(); @@ -774,7 +738,7 @@ void faMatrix::operator=(const tmp >& tfamv) template -void faMatrix::negate() +void Foam::faMatrix::negate() { lduMatrix::negate(); source_.negate(); @@ -789,7 +753,7 @@ void faMatrix::negate() template -void faMatrix::operator+=(const faMatrix& famv) +void Foam::faMatrix::operator+=(const faMatrix& famv) { checkMethod(*this, famv, "+="); @@ -815,7 +779,7 @@ void faMatrix::operator+=(const faMatrix& famv) template -void faMatrix::operator+=(const tmp >& tfamv) +void Foam::faMatrix::operator+=(const tmp>& tfamv) { operator+=(tfamv()); tfamv.clear(); @@ -823,7 +787,7 @@ void faMatrix::operator+=(const tmp >& tfamv) template -void faMatrix::operator-=(const faMatrix& famv) +void Foam::faMatrix::operator-=(const faMatrix& famv) { checkMethod(*this, famv, "+="); @@ -847,7 +811,7 @@ void faMatrix::operator-=(const faMatrix& famv) template -void faMatrix::operator-=(const tmp >& tfamv) +void Foam::faMatrix::operator-=(const tmp>& tfamv) { operator-=(tfamv()); tfamv.clear(); @@ -855,7 +819,7 @@ void faMatrix::operator-=(const tmp >& tfamv) template -void faMatrix::operator+= +void Foam::faMatrix::operator+= ( const GeometricField& su ) @@ -866,9 +830,9 @@ void faMatrix::operator+= template -void faMatrix::operator+= +void Foam::faMatrix::operator+= ( - const tmp >& tsu + const tmp>& tsu ) { operator+=(tsu()); @@ -877,7 +841,7 @@ void faMatrix::operator+= template -void faMatrix::operator-= +void Foam::faMatrix::operator-= ( const GeometricField& su ) @@ -888,9 +852,9 @@ void faMatrix::operator-= template -void faMatrix::operator-= +void Foam::faMatrix::operator-= ( - const tmp >& tsu + const tmp>& tsu ) { operator-=(tsu()); @@ -899,7 +863,7 @@ void faMatrix::operator-= template -void faMatrix::operator+= +void Foam::faMatrix::operator+= ( const dimensioned& su ) @@ -909,7 +873,7 @@ void faMatrix::operator+= template -void faMatrix::operator-= +void Foam::faMatrix::operator-= ( const dimensioned& su ) @@ -919,7 +883,7 @@ void faMatrix::operator-= template -void faMatrix::operator*= +void Foam::faMatrix::operator*= ( const areaScalarField& vsf ) @@ -937,7 +901,7 @@ void faMatrix::operator*= if (faceFluxCorrectionPtr_) { - FatalErrorIn("faMatrix::operator*=(const tmp&)") + FatalErrorInFunction << "cannot scale a matrix containing a faceFluxCorrection" << abort(FatalError); } @@ -945,7 +909,7 @@ void faMatrix::operator*= template -void faMatrix::operator*= +void Foam::faMatrix::operator*= ( const tmp& tvsf ) @@ -956,7 +920,7 @@ void faMatrix::operator*= template -void faMatrix::operator*= +void Foam::faMatrix::operator*= ( const dimensioned& ds ) @@ -977,7 +941,7 @@ void faMatrix::operator*= // * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * // template -void checkMethod +void Foam::checkMethod ( const faMatrix& fam1, const faMatrix& fam2, @@ -986,10 +950,8 @@ void checkMethod { if (&fam1.psi() != &fam2.psi()) { - FatalErrorIn - ( - "checkMethod(const faMatrix&, const faMatrix&)" - ) << "incompatible fields for operation " + FatalErrorInFunction + << "incompatible fields for operation " << endl << " " << "[" << fam1.psi().name() << "] " << op @@ -999,10 +961,8 @@ void checkMethod if (dimensionSet::debug && fam1.dimensions() != fam2.dimensions()) { - FatalErrorIn - ( - "checkMethod(const faMatrix&, const faMatrix&)" - ) << "incompatible dimensions for operation " + FatalErrorInFunction + << "incompatible dimensions for operation " << endl << " " << "[" << fam1.psi().name() << fam1.dimensions()/dimArea << " ] " << op @@ -1013,7 +973,7 @@ void checkMethod template -void checkMethod +void Foam::checkMethod ( const faMatrix& fam, const GeometricField& vf, @@ -1022,11 +982,8 @@ void checkMethod { if (dimensionSet::debug && fam.dimensions()/dimArea != vf.dimensions()) { - FatalErrorIn - ( - "checkMethod(const faMatrix&, const GeometricField&)" - ) << "incompatible dimensions for operation " + FatalErrorInFunction + << "incompatible dimensions for operation " << endl << " " << "[" << fam.psi().name() << fam.dimensions()/dimArea << " ] " << op @@ -1037,7 +994,7 @@ void checkMethod template -void checkMethod +void Foam::checkMethod ( const faMatrix& fam, const dimensioned& dt, @@ -1046,10 +1003,8 @@ void checkMethod { if (dimensionSet::debug && fam.dimensions()/dimArea != dt.dimensions()) { - FatalErrorIn - ( - "checkMethod(const faMatrix&, const dimensioned&)" - ) << "incompatible dimensions for operation " + FatalErrorInFunction + << "incompatible dimensions for operation " << endl << " " << "[" << fam.psi().name() << fam.dimensions()/dimArea << " ] " << op @@ -1060,7 +1015,7 @@ void checkMethod template -SolverPerformance solve +Foam::SolverPerformance Foam::solve ( faMatrix& fam, Istream& solverControls @@ -1069,10 +1024,11 @@ SolverPerformance solve return fam.solve(solverControls); } + template -SolverPerformance solve +Foam::SolverPerformance Foam::solve ( - const tmp >& tfam, + const tmp>& tfam, Istream& solverControls ) { @@ -1085,13 +1041,14 @@ SolverPerformance solve template -SolverPerformance solve(faMatrix& fam) +Foam::SolverPerformance Foam::solve(faMatrix& fam) { return fam.solve(); } + template -SolverPerformance solve(const tmp >& tfam) +Foam::SolverPerformance Foam::solve(const tmp>& tfam) { SolverPerformance solverPerf = const_cast&>(tfam()).solve(); @@ -1104,56 +1061,56 @@ SolverPerformance solve(const tmp >& tfam) // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // template -tmp > operator+ +Foam::tmp> Foam::operator+ ( const faMatrix& A, const faMatrix& B ) { checkMethod(A, B, "+"); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref() += B; return tC; } template -tmp > operator+ +Foam::tmp> Foam::operator+ ( - const tmp >& tA, + const tmp>& tA, const faMatrix& B ) { checkMethod(tA(), B, "+"); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref() += B; return tC; } template -tmp > operator+ +Foam::tmp> Foam::operator+ ( const faMatrix& A, - const tmp >& tB + const tmp>& tB ) { checkMethod(A, tB(), "+"); - tmp > tC(tB.ptr()); + tmp> tC(tB.ptr()); tC.ref() += A; return tC; } template -tmp > operator+ +Foam::tmp> Foam::operator+ ( - const tmp >& tA, - const tmp >& tB + const tmp>& tA, + const tmp>& tB ) { checkMethod(tA(), tB(), "+"); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref() += tB(); tB.clear(); return tC; @@ -1161,66 +1118,66 @@ tmp > operator+ template -tmp > operator- +Foam::tmp> Foam::operator- ( const faMatrix& A ) { - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref().negate(); return tC; } template -tmp > operator- +Foam::tmp> Foam::operator- ( - const tmp >& tA + const tmp>& tA ) { - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref().negate(); return tC; } template -tmp > operator- +Foam::tmp> Foam::operator- ( const faMatrix& A, const faMatrix& B ) { checkMethod(A, B, "-"); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref() -= B; return tC; } template -tmp > operator- +Foam::tmp> Foam::operator- ( - const tmp >& tA, + const tmp>& tA, const faMatrix& B ) { checkMethod(tA(), B, "-"); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref() -= B; return tC; } template -tmp > operator- +Foam::tmp> Foam::operator- ( const faMatrix& A, - const tmp >& tB + const tmp>& tB ) { checkMethod(A, tB(), "-"); - tmp > tC(tB.ptr()); + tmp> tC(tB.ptr()); tC.ref() -= A; tC.ref().negate(); return tC; @@ -1228,14 +1185,14 @@ tmp > operator- template -tmp > operator- +Foam::tmp> Foam::operator- ( - const tmp >& tA, - const tmp >& tB + const tmp>& tA, + const tmp>& tB ) { checkMethod(tA(), tB(), "-"); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref() -= tB(); tB.clear(); return tC; @@ -1243,7 +1200,7 @@ tmp > operator- template -tmp > operator== +Foam::tmp> Foam::operator== ( const faMatrix& A, const faMatrix& B @@ -1255,9 +1212,9 @@ tmp > operator== template -tmp > operator== +Foam::tmp> Foam::operator== ( - const tmp >& tA, + const tmp>& tA, const faMatrix& B ) { @@ -1267,10 +1224,10 @@ tmp > operator== template -tmp > operator== +Foam::tmp> Foam::operator== ( const faMatrix& A, - const tmp >& tB + const tmp>& tB ) { checkMethod(A, tB(), "=="); @@ -1279,10 +1236,10 @@ tmp > operator== template -tmp > operator== +Foam::tmp> Foam::operator== ( - const tmp >& tA, - const tmp >& tB + const tmp>& tA, + const tmp>& tB ) { checkMethod(tA(), tB(), "=="); @@ -1291,40 +1248,42 @@ tmp > operator== template -tmp > operator+ +Foam::tmp> Foam::operator+ ( const faMatrix& A, const GeometricField& su ) { checkMethod(A, su, "+"); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref().source() -= su.mesh().S()*su.internalField(); return tC; } + template -tmp > operator+ +Foam::tmp> Foam::operator+ ( - const tmp >& tA, + const tmp>& tA, const GeometricField& su ) { checkMethod(tA(), su, "+"); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref().source() -= su.mesh().S()*su.internalField(); return tC; } + template -tmp > operator+ +Foam::tmp> Foam::operator+ ( const faMatrix& A, - const tmp >& tsu + const tmp>& tsu ) { checkMethod(A, tsu(), "+"); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref().source() -= tsu().mesh().S()*tsu().internalField(); tsu.clear(); return tC; @@ -1332,68 +1291,72 @@ tmp > operator+ template -tmp > operator+ +Foam::tmp> Foam::operator+ ( - const tmp >& tA, - const tmp >& tsu + const tmp>& tA, + const tmp>& tsu ) { checkMethod(tA(), tsu(), "+"); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref().source() -= tsu().mesh().S()*tsu().internalField(); tsu.clear(); return tC; } + template -tmp > operator+ +Foam::tmp> Foam::operator+ ( const GeometricField& su, const faMatrix& A ) { checkMethod(A, su, "+"); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref().source() -= su.mesh().S()*su.internalField(); return tC; } + template -tmp > operator+ +Foam::tmp> Foam::operator+ ( const GeometricField& su, - const tmp >& tA + const tmp>& tA ) { checkMethod(tA(), su, "+"); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref().source() -= su.mesh().S()*su.internalField(); return tC; } + template -tmp > operator+ +Foam::tmp> Foam::operator+ ( - const tmp >& tsu, + const tmp>& tsu, const faMatrix& A ) { checkMethod(A, tsu(), "+"); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref().source() -= tsu().mesh().S()*tsu().internalField(); tsu.clear(); return tC; } + template -tmp > operator+ +Foam::tmp> Foam::operator+ ( - const tmp >& tsu, - const tmp >& tA + const tmp>& tsu, + const tmp>& tA ) { checkMethod(tA(), tsu(), "+"); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref().source() -= tsu().mesh().S()*tsu().internalField(); tsu.clear(); return tC; @@ -1401,54 +1364,42 @@ tmp > operator+ template -tmp > operator- +Foam::tmp> Foam::operator- ( const faMatrix& A, const GeometricField& su ) { checkMethod(A, su, "-"); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref().source() += su.mesh().S()*su.internalField(); return tC; } + template -tmp > operator- +Foam::tmp> Foam::operator- ( - const tmp >& tA, + const tmp>& tA, const GeometricField& su ) { checkMethod(tA(), su, "-"); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref().source() += su.mesh().S()*su.internalField(); return tC; } + template -tmp > operator- +Foam::tmp> Foam::operator- ( const faMatrix& A, - const tmp >& tsu + const tmp>& tsu ) { checkMethod(A, tsu(), "-"); - tmp > tC(new faMatrix(A)); - tC.ref().source() += tsu().mesh().S()*tsu().internalField(); - tsu.clear(); - return tC; -} - -template -tmp > operator- -( - const tmp >& tA, - const tmp >& tsu -) -{ - checkMethod(tA(), tsu(), "-"); - tmp > tC(tA.ptr()); + tmp> tC(new faMatrix(A)); tC.ref().source() += tsu().mesh().S()*tsu().internalField(); tsu.clear(); return tC; @@ -1456,14 +1407,29 @@ tmp > operator- template -tmp > operator- +Foam::tmp> Foam::operator- +( + const tmp>& tA, + const tmp>& tsu +) +{ + checkMethod(tA(), tsu(), "-"); + tmp> tC(tA.ptr()); + tC.ref().source() += tsu().mesh().S()*tsu().internalField(); + tsu.clear(); + return tC; +} + + +template +Foam::tmp> Foam::operator- ( const GeometricField& su, const faMatrix& A ) { checkMethod(A, su, "-"); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref().negate(); tC.ref().source() -= su.mesh().S()*su.internalField(); return tC; @@ -1471,28 +1437,29 @@ tmp > operator- template -tmp > operator- +Foam::tmp> Foam::operator- ( const GeometricField& su, - const tmp >& tA + const tmp>& tA ) { checkMethod(tA(), su, "-"); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref().negate(); tC.ref().source() -= su.mesh().S()*su.internalField(); return tC; } + template -tmp > operator- +Foam::tmp> Foam::operator- ( - const tmp >& tsu, + const tmp>& tsu, const faMatrix& A ) { checkMethod(A, tsu(), "-"); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref().negate(); tC.ref().source() -= tsu().mesh().S()*tsu().internalField(); tsu.clear(); @@ -1501,14 +1468,14 @@ tmp > operator- template -tmp > operator- +Foam::tmp> Foam::operator- ( - const tmp >& tsu, - const tmp >& tA + const tmp>& tsu, + const tmp>& tA ) { checkMethod(tA(), tsu(), "-"); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref().negate(); tC.ref().source() -= tsu().mesh().S()*tsu().internalField(); tsu.clear(); @@ -1517,98 +1484,98 @@ tmp > operator- template -tmp > operator+ +Foam::tmp> Foam::operator+ ( const faMatrix& A, const dimensioned& su ) { checkMethod(A, su, "+"); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref().source() -= su.value()*A.psi().mesh().S(); return tC; } template -tmp > operator+ +Foam::tmp> Foam::operator+ ( - const tmp >& tA, + const tmp>& tA, const dimensioned& su ) { checkMethod(tA(), su, "+"); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref().source() -= su.value()*tC().psi().mesh().S(); return tC; } template -tmp > operator+ +Foam::tmp> Foam::operator+ ( const dimensioned& su, const faMatrix& A ) { checkMethod(A, su, "+"); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref().source() -= su.value()*A.psi().mesh().S(); return tC; } template -tmp > operator+ +Foam::tmp> Foam::operator+ ( const dimensioned& su, - const tmp >& tA + const tmp>& tA ) { checkMethod(tA(), su, "+"); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref().source() -= su.value()*tC().psi().mesh().S(); return tC; } template -tmp > operator- +Foam::tmp> Foam::operator- ( const faMatrix& A, const dimensioned& su ) { checkMethod(A, su, "-"); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref().source() += su.value()*tC().psi().mesh().S(); return tC; } template -tmp > operator- +Foam::tmp> Foam::operator- ( - const tmp >& tA, + const tmp>& tA, const dimensioned& su ) { checkMethod(tA(), su, "-"); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref().source() += su.value()*tC().psi().mesh().S(); return tC; } template -tmp > operator- +Foam::tmp> Foam::operator- ( const dimensioned& su, const faMatrix& A ) { checkMethod(A, su, "-"); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref().negate(); tC.ref().source() -= su.value()*A.psi().mesh().S(); return tC; @@ -1616,14 +1583,14 @@ tmp > operator- template -tmp > operator- +Foam::tmp> Foam::operator- ( const dimensioned& su, - const tmp >& tA + const tmp>& tA ) { checkMethod(tA(), su, "-"); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref().negate(); tC.ref().source() -= su.value()*tC().psi().mesh().S(); return tC; @@ -1631,54 +1598,57 @@ tmp > operator- template -tmp > operator== +Foam::tmp> Foam::operator== ( const faMatrix& A, const GeometricField& su ) { checkMethod(A, su, "=="); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref().source() += su.mesh().S()*su.internalField(); return tC; } + template -tmp > operator== +Foam::tmp> Foam::operator== ( - const tmp >& tA, + const tmp>& tA, const GeometricField& su ) { checkMethod(tA(), su, "=="); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref().source() += su.mesh().S()*su.internalField(); return tC; } + template -tmp > operator== +Foam::tmp> Foam::operator== ( const faMatrix& A, - const tmp >& tsu + const tmp>& tsu ) { checkMethod(A, tsu(), "=="); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref().source() += tsu().mesh().S()*tsu().internalField(); tsu.clear(); return tC; } + template -tmp > operator== +Foam::tmp> Foam::operator== ( - const tmp >& tA, - const tmp >& tsu + const tmp>& tA, + const tmp>& tsu ) { checkMethod(tA(), tsu(), "=="); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref().source() += tsu().mesh().S()*tsu().internalField(); tsu.clear(); return tC; @@ -1686,103 +1656,106 @@ tmp > operator== template -tmp > operator== +Foam::tmp> Foam::operator== ( const faMatrix& A, const dimensioned& su ) { checkMethod(A, su, "=="); - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref().source() += A.psi().mesh().S()*su.value(); return tC; } template -tmp > operator== +Foam::tmp> Foam::operator== ( - const tmp >& tA, + const tmp>& tA, const dimensioned& su ) { checkMethod(tA(), su, "=="); - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref().source() += tC().psi().mesh().S()*su.value(); return tC; } template -tmp > operator* +Foam::tmp> Foam::operator* ( const areaScalarField& vsf, const faMatrix& A ) { - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref() *= vsf; return tC; } + template -tmp > operator* +Foam::tmp> Foam::operator* ( const tmp& tvsf, const faMatrix& A ) { - tmp > tC(new faMatrix(A)); - tC.ref() *= tvsf; - return tC; -} - -template -tmp > operator* -( - const areaScalarField& vsf, - const tmp >& tA -) -{ - tmp > tC(tA.ptr()); - tC.ref() *= vsf; - return tC; -} - -template -tmp > operator* -( - const tmp& tvsf, - const tmp >& tA -) -{ - tmp > tC(tA.ptr()); + tmp> tC(new faMatrix(A)); tC.ref() *= tvsf; return tC; } template -tmp > operator* +Foam::tmp> Foam::operator* +( + const areaScalarField& vsf, + const tmp>& tA +) +{ + tmp> tC(tA.ptr()); + tC.ref() *= vsf; + return tC; +} + + +template +Foam::tmp> Foam::operator* +( + const tmp& tvsf, + const tmp>& tA +) +{ + tmp> tC(tA.ptr()); + tC.ref() *= tvsf; + return tC; +} + + +template +Foam::tmp> Foam::operator* ( const dimensioned& ds, const faMatrix& A ) { - tmp > tC(new faMatrix(A)); + tmp> tC(new faMatrix(A)); tC.ref() *= ds; return tC; } template -tmp > operator* +Foam::tmp> Foam::operator* ( const dimensioned& ds, - const tmp >& tA + const tmp>& tA ) { - tmp > tC(tA.ptr()); + tmp> tC(tA.ptr()); tC.ref() *= ds; return tC; } @@ -1791,7 +1764,7 @@ tmp > operator* // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // template -Ostream& operator<<(Ostream& os, const faMatrix& fam) +Foam::Ostream& Foam::operator<<(Ostream& os, const faMatrix& fam) { os << static_cast(fam) << nl << fam.dimensions_ << nl @@ -1799,16 +1772,12 @@ Ostream& operator<<(Ostream& os, const faMatrix& fam) << fam.internalCoeffs_ << nl << fam.boundaryCoeffs_ << endl; - os.check("Ostream& operator<<(Ostream&, faMatrix&"); + os.check(FUNCTION_NAME); return os; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // * * * * * * * * * * * * * * * * Solvers * * * * * * * * * * * * * * * * * // #include "faMatrixSolve.C" diff --git a/src/finiteArea/faMatrices/faMatrix/faMatrix.H b/src/finiteArea/faMatrices/faMatrix/faMatrix.H index 6172216a4b..8c815e404d 100644 --- a/src/finiteArea/faMatrices/faMatrix/faMatrix.H +++ b/src/finiteArea/faMatrices/faMatrix/faMatrix.H @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see . Class - faMatrix + Foam::faMatrix Description Finite-Area matrix. @@ -65,7 +65,7 @@ Ostream& operator<<(Ostream&, const faMatrix&); /*---------------------------------------------------------------------------*\ - Class faMatrix Declaration + Class faMatrix Declaration \*---------------------------------------------------------------------------*/ template @@ -114,7 +114,7 @@ class faMatrix void addToInternalField ( const labelUList& addr, - const tmp >& tpf, + const tmp>& tpf, Field& intf ) const; @@ -131,7 +131,7 @@ class faMatrix void subtractFromInternalField ( const labelUList& addr, - const tmp >& tpf, + const tmp>& tpf, Field& intf ) const; @@ -308,7 +308,7 @@ public: SolverPerformance solve(); //- Return the matrix residual - tmp > residual() const; + tmp> residual() const; //- Return the matrix diagonal tmp D() const; @@ -317,30 +317,30 @@ public: tmp A() const; //- Return the H operation source - tmp > H() const; + tmp> H() const; //- Return the face-flux field from the matrix - tmp > flux() const; + tmp> flux() const; // Member operators void operator=(const faMatrix&); - void operator=(const tmp >&); + void operator=(const tmp>&); void negate(); void operator+=(const faMatrix&); - void operator+=(const tmp >&); + void operator+=(const tmp>&); void operator-=(const faMatrix&); - void operator-=(const tmp >&); + void operator-=(const tmp>&); void operator+=(const GeometricField&); - void operator+=(const tmp >&); + void operator+=(const tmp>&); void operator-=(const GeometricField&); - void operator-=(const tmp >&); + void operator-=(const tmp>&); void operator+=(const dimensioned&); void operator-=(const dimensioned&); @@ -398,7 +398,7 @@ SolverPerformance solve(faMatrix&, Istream&); // deleting temporary matrix after solution. // Solver controls read Istream template -SolverPerformance solve(const tmp >&, Istream&); +SolverPerformance solve(const tmp>&, Istream&); //- Solve returning the solution statistics given convergence tolerance @@ -411,331 +411,358 @@ SolverPerformance solve(faMatrix&); // deleting temporary matrix after solution. // Solver controls read faSolution template -SolverPerformance solve(const tmp >&); +SolverPerformance solve(const tmp>&); // * * * * * * * * * * * * * * * Global operators * * * * * * * * * * * * * // template -tmp > operator- +tmp> operator- ( const faMatrix& ); template -tmp > operator- +tmp> operator- ( - const tmp >& + const tmp>& ); template -tmp > operator+ +tmp> operator+ ( const faMatrix&, const faMatrix& ); template -tmp > operator+ +tmp> operator+ ( - const tmp >&, + const tmp>&, const faMatrix& ); template -tmp > operator+ +tmp> operator+ ( const faMatrix&, - const tmp >& + const tmp>& ); template -tmp > operator+ +tmp> operator+ ( - const tmp >&, - const tmp >& + const tmp>&, + const tmp>& ); template -tmp > operator- +tmp> operator- ( const faMatrix&, const faMatrix& ); template -tmp > operator- +tmp> operator- ( - const tmp >&, + const tmp>&, const faMatrix& ); template -tmp > operator- +tmp> operator- ( const faMatrix&, - const tmp >& + const tmp>& ); template -tmp > operator- +tmp> operator- ( - const tmp >&, - const tmp >& + const tmp>&, + const tmp>& ); template -tmp > operator== +tmp> operator== ( const faMatrix&, const faMatrix& ); template -tmp > operator== +tmp> operator== ( - const tmp >&, + const tmp>&, const faMatrix& ); template -tmp > operator== +tmp> operator== ( const faMatrix&, - const tmp >& + const tmp>& ); template -tmp > operator== +tmp> operator== ( - const tmp >&, - const tmp >& + const tmp>&, + const tmp>& ); template -tmp > operator+ +tmp> operator+ ( const faMatrix&, const GeometricField& ); template -tmp > operator+ +tmp> operator+ ( - const tmp >&, + const tmp>&, const GeometricField& ); template -tmp > operator+ +tmp> operator+ ( const faMatrix&, - const tmp >& + const tmp>& ); template -tmp > operator+ +tmp> operator+ ( - const tmp >&, - const tmp >& + const tmp>&, + const tmp>& ); template -tmp > operator+ +tmp> operator+ ( const GeometricField&, const faMatrix& ); template -tmp > operator+ +tmp> operator+ ( const GeometricField&, - const tmp >& + const tmp>& ); template -tmp > operator+ +tmp> operator+ ( - const tmp >&, + const tmp>&, const faMatrix& ); template -tmp > operator+ +tmp> operator+ ( - const tmp >&, - const tmp >& + const tmp>&, + const tmp>& ); template -tmp > operator- +tmp> operator- ( const faMatrix&, const GeometricField& ); template -tmp > operator- +tmp> operator- ( - const tmp >&, + const tmp>&, const GeometricField& ); template -tmp > operator- +tmp> operator- ( const faMatrix&, - const tmp >& + const tmp>& ); template -tmp > operator- +tmp> operator- ( - const tmp >&, - const tmp >& + const tmp>&, + const tmp>& ); template -tmp > operator- +tmp> operator- ( const GeometricField&, const faMatrix& ); template -tmp > operator- +tmp> operator- ( const GeometricField&, - const tmp >& + const tmp>& ); template -tmp > operator- +tmp> operator- ( - const tmp >&, + const tmp>&, const faMatrix& ); template -tmp > operator- +tmp> operator- ( - const tmp >&, - const tmp >& + const tmp>&, + const tmp>& ); template -tmp > operator+ +tmp> operator+ ( - const tmp >&, + const faMatrix&, const dimensioned& ); template -tmp > operator+ +tmp> operator+ +( + const tmp>&, + const dimensioned& +); + +template +tmp> operator+ ( const dimensioned&, - const tmp >& + const faMatrix& ); template -tmp > operator- -( - const tmp >&, - const dimensioned& -); - -template -tmp > operator- +tmp> operator+ ( const dimensioned&, - const tmp >& + const tmp>& ); template -tmp > operator== -( - const faMatrix&, - const GeometricField& -); - -template -tmp > operator== -( - const tmp >&, - const GeometricField& -); - -template -tmp > operator== -( - const faMatrix&, - const tmp >& -); - -template -tmp > operator== -( - const tmp >&, - const tmp >& -); - -template -tmp > operator== +tmp> operator- ( const faMatrix&, const dimensioned& ); template -tmp > operator== +tmp> operator- ( - const tmp >&, + const tmp>&, + const dimensioned& +); + +template +tmp> operator- +( + const dimensioned&, + const faMatrix& +); + +template +tmp> operator- +( + const dimensioned&, + const tmp>& +); + +template +tmp> operator== +( + const faMatrix&, + const GeometricField& +); + +template +tmp> operator== +( + const tmp>&, + const GeometricField& +); + +template +tmp> operator== +( + const faMatrix&, + const tmp>& +); + +template +tmp> operator== +( + const tmp>&, + const tmp>& +); + +template +tmp> operator== +( + const faMatrix&, + const dimensioned& +); + +template +tmp> operator== +( + const tmp>&, const dimensioned& ); template -tmp > operator* +tmp> operator* ( const areaScalarField&, const faMatrix& ); template -tmp > operator* +tmp> operator* ( const areaScalarField&, - const tmp >& + const tmp>& ); template -tmp > operator* +tmp> operator* ( const tmp&, const faMatrix& ); template -tmp > operator* +tmp> operator* ( const tmp&, - const tmp >& + const tmp>& ); - template -tmp > operator* +tmp> operator* ( const dimensioned&, const faMatrix& ); template -tmp > operator* +tmp> operator* ( const dimensioned&, - const tmp >& + const tmp>& ); @@ -746,7 +773,7 @@ tmp > operator* // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "faMatrix.C" + #include "faMatrix.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C b/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C index c5f6780a63..726f9c1500 100644 --- a/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C +++ b/src/finiteArea/faMatrices/faMatrix/faMatrixSolve.C @@ -28,15 +28,8 @@ Description \*---------------------------------------------------------------------------*/ -namespace Foam -{ - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -// Set reference level for a component of the solution -// on a given patch face template -void faMatrix::setComponentReference +void Foam::faMatrix::setComponentReference ( const label patchi, const label facei, @@ -53,14 +46,14 @@ void faMatrix::setComponentReference template -SolverPerformance faMatrix::solve(const dictionary& solverControls) +Foam::SolverPerformance Foam::faMatrix::solve +( + const dictionary& solverControls +) { - if (debug) - { - Info<< "faMatrix::solve(const dictionary&) : " - "solving faMatrix" - << endl; - } + DebugInFunction + << "solving faMatrix" + << endl; SolverPerformance solverPerfVec ( @@ -73,16 +66,15 @@ SolverPerformance faMatrix::solve(const dictionary& solverControls) Field source(source_); addBoundarySource(source); - // Make a copy of interfaces: no longer a reference - // HJ, 20/Nov/2007 + // Note: make a copy of interfaces: no longer a reference lduInterfaceFieldPtrsList interfaces = psi_.boundaryField().scalarInterfaces(); - // Cast into a non-const to solve. HJ, 6/May/2016 + // Cast into a non-const to solve GeometricField& psi = const_cast&>(psi_); - for (direction cmpt = 0; cmpt < Type::nComponents; cmpt++) + for (direction cmpt = 0; cmpt < Type::nComponents; ++cmpt) { // copy field and source @@ -156,7 +148,7 @@ SolverPerformance faMatrix::solve(const dictionary& solverControls) template -SolverPerformance faMatrix::faSolver::solve() +Foam::SolverPerformance Foam::faMatrix::faSolver::solve() { return solvei ( @@ -169,7 +161,7 @@ SolverPerformance faMatrix::faSolver::solve() template -SolverPerformance faMatrix::solve() +Foam::SolverPerformance Foam::faMatrix::solve() { return solve ( @@ -181,22 +173,19 @@ SolverPerformance faMatrix::solve() } -// Return the matrix residual template -tmp > faMatrix::residual() const +Foam::tmp> Foam::faMatrix::residual() const { - tmp > tres(source_); + tmp> tres(source_); Field& res = tres().ref(); addBoundarySource(res); - // Make a copy of interfaces: no longer a reference - // HJ, 20/Nov/2007 lduInterfaceFieldPtrsList interfaces = psi_.boundaryField().scalarInterfaces(); // Loop over field components - for (direction cmpt = 0; cmpt < Type::nComponents; cmpt++) + for (direction cmpt = 0; cmpt < Type::nComponents; ++cmpt) { scalarField psiCmpt(psi_.internalField().component(cmpt)); @@ -226,8 +215,4 @@ tmp > faMatrix::residual() const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C b/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C index f1cacedd58..b110f62e0c 100644 --- a/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C +++ b/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.C @@ -31,17 +31,10 @@ Description #include "faScalarMatrix.H" #include "zeroGradientFaPatchFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// Set reference level for a component of the solution -// on a given patch face template<> -void faMatrix::setComponentReference +void Foam::faMatrix::setComponentReference ( const label patchI, const label edgeI, @@ -58,17 +51,14 @@ void faMatrix::setComponentReference template<> -solverPerformance faMatrix::solve +Foam::solverPerformance Foam::faMatrix::solve ( const dictionary& solverControls ) { - if (debug) - { - Info<< "faMatrix::solve(const dictionary&) : " - "solving faMatrix" - << endl; - } + DebugInFunction + << "solving faMatrix" + << endl; GeometricField& psi = const_cast&>(psi_); @@ -100,9 +90,8 @@ solverPerformance faMatrix::solve } -// Return the matrix residual template<> -tmp faMatrix::residual() const +Foam::tmp Foam::faMatrix::residual() const { scalarField boundaryDiag(psi_.size(), 0.0); addBoundaryDiag(boundaryDiag, 0); @@ -125,9 +114,8 @@ tmp faMatrix::residual() const } -// H operator template<> -tmp faMatrix::H() const +Foam::tmp Foam::faMatrix::H() const { tmp tHphi ( @@ -158,8 +146,4 @@ tmp faMatrix::H() const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.H b/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.H index e865b9e930..4306ca0699 100644 --- a/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.H +++ b/src/finiteArea/faMatrices/faScalarMatrix/faScalarMatrix.H @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see . Class - faScalarMatrix + Foam::faScalarMatrix Description Template specialisation for scalar faMatrix diff --git a/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C b/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C index 3968894470..9be62fad52 100644 --- a/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C +++ b/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.C @@ -31,23 +31,17 @@ Description #include "faMesh.H" #include "primitiveMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(faBoundaryMesh, 0); - - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + defineTypeNameAndDebug(faBoundaryMesh, 0); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from dictionary -faBoundaryMesh::faBoundaryMesh +Foam::faBoundaryMesh::faBoundaryMesh ( const IOobject& io, const faMesh& mesh @@ -83,19 +77,14 @@ faBoundaryMesh::faBoundaryMesh } // Check state of IOstream - is.check - ( - "faBoundaryMesh::polyBoundaryMesh" - "(const IOobject&, const faMesh&)" - ); + is.check(FUNCTION_NAME); close(); } } -// Construct given size. Patches will be set later -faBoundaryMesh::faBoundaryMesh +Foam::faBoundaryMesh::faBoundaryMesh ( const IOobject& io, const faMesh& pm, @@ -110,8 +99,7 @@ faBoundaryMesh::faBoundaryMesh // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -// Calculate the geometry for the patches (transformation tensors etc.) -void faBoundaryMesh::calcGeometry() +void Foam::faBoundaryMesh::calcGeometry() { forAll(*this, patchi) { @@ -125,25 +113,24 @@ void faBoundaryMesh::calcGeometry() } -// Return the mesh reference -const faMesh& faBoundaryMesh::mesh() const +const Foam::faMesh& Foam::faBoundaryMesh::mesh() const { return mesh_; } -lduInterfacePtrsList faBoundaryMesh::interfaces() const +Foam::lduInterfacePtrsList Foam::faBoundaryMesh::interfaces() const { lduInterfacePtrsList interfaces(size()); - forAll (interfaces, patchi) + forAll(interfaces, patchi) { if (isA(this->operator[](patchi))) { interfaces.set ( patchi, - &refCast(this->operator[](patchi)) + &refCast(this->operator[](patchi)) ); } } @@ -152,14 +139,13 @@ lduInterfacePtrsList faBoundaryMesh::interfaces() const } -// Return a list of patch types -wordList faBoundaryMesh::types() const +Foam::wordList Foam::faBoundaryMesh::types() const { const faPatchList& patches = *this; wordList t(patches.size()); - forAll (patches, patchI) + forAll(patches, patchI) { t[patchI] = patches[patchI].type(); } @@ -168,14 +154,13 @@ wordList faBoundaryMesh::types() const } -// Return a list of patch names -wordList faBoundaryMesh::names() const +Foam::wordList Foam::faBoundaryMesh::names() const { const faPatchList& patches = *this; wordList t(patches.size()); - forAll (patches, patchI) + forAll(patches, patchI) { t[patchI] = patches[patchI].name(); } @@ -184,11 +169,11 @@ wordList faBoundaryMesh::names() const } -label faBoundaryMesh::findPatchID(const word& patchName) const +Foam::label Foam::faBoundaryMesh::findPatchID(const word& patchName) const { const faPatchList& patches = *this; - forAll (patches, patchI) + forAll(patches, patchI) { if (patches[patchI].name() == patchName) { @@ -236,8 +221,7 @@ Foam::labelList Foam::faBoundaryMesh::findIndices } -// Return patch index for a given edge label -label faBoundaryMesh::whichPatch(const label edgeIndex) const +Foam::label Foam::faBoundaryMesh::whichPatch(const label edgeIndex) const { // Find out which patch the current face belongs to by comparing label // with patch start labels. @@ -245,10 +229,8 @@ label faBoundaryMesh::whichPatch(const label edgeIndex) const // if it is off the end of the list, abort if (edgeIndex >= mesh().nEdges()) { - FatalErrorIn - ( - "faBoundaryMesh::whichPatch(const label edgeIndex) const" - ) << "given label greater than the number of edges" + FatalErrorInFunction + << "given label greater than the number of edges" << abort(FatalError); } @@ -257,7 +239,7 @@ label faBoundaryMesh::whichPatch(const label edgeIndex) const return -1; } - forAll (*this, patchI) + forAll(*this, patchI) { label start = mesh_.patchStarts()[patchI]; label size = operator[](patchI).faPatch::size(); @@ -273,32 +255,28 @@ label faBoundaryMesh::whichPatch(const label edgeIndex) const } // If not in any of above, it's trouble! - FatalErrorIn - ( - "label faBoundaryMesh::whichPatch(const label edgeIndex) const" - ) << "error in patch search algorithm" + FatalErrorInFunction + << "error in patch search algorithm" << abort(FatalError); return -1; } -bool faBoundaryMesh::checkDefinition(const bool report) const +bool Foam::faBoundaryMesh::checkDefinition(const bool report) const { label nextPatchStart = mesh().nInternalEdges(); const faBoundaryMesh& bm = *this; bool boundaryError = false; - forAll (bm, patchI) + forAll(bm, patchI) { if (bm[patchI].start() != nextPatchStart) { boundaryError = true; - Info - << "bool faBoundaryMesh::checkDefinition(" - << "const bool report) const : " + InfoInFunction << "Problem with boundary patch " << patchI << ".\nThe patch should start on face no " << nextPatchStart << " and the boundary file specifies " << bm[patchI].start() @@ -310,11 +288,8 @@ bool faBoundaryMesh::checkDefinition(const bool report) const if (boundaryError) { - SeriousErrorIn - ( - "bool faBoundaryMesh::checkDefinition(" - "const bool report) const" - ) << "This mesh is not valid: boundary definition is in error." + SeriousErrorInFunction + << "This mesh is not valid: boundary definition is in error." << endl; } else @@ -329,24 +304,23 @@ bool faBoundaryMesh::checkDefinition(const bool report) const } -// Correct faBoundaryMesh after moving points -void faBoundaryMesh::movePoints(const pointField& p) +void Foam::faBoundaryMesh::movePoints(const pointField& p) { faPatchList& patches = *this; - forAll (patches, patchI) + forAll(patches, patchI) { patches[patchI].initMovePoints(p); } - forAll (patches, patchI) + forAll(patches, patchI) { patches[patchI].movePoints(p); } } -void faBoundaryMesh::updateMesh() +void Foam::faBoundaryMesh::updateMesh() { faPatchList& patches = *this; @@ -362,8 +336,7 @@ void faBoundaryMesh::updateMesh() } -// writeData member function required by regIOobject -bool faBoundaryMesh::writeData(Ostream& os) const +bool Foam::faBoundaryMesh::writeData(Ostream& os) const { const faPatchList& patches = *this; @@ -380,21 +353,17 @@ bool faBoundaryMesh::writeData(Ostream& os) const os << decrIndent << token::END_LIST; // Check state of IOstream - os.check("polyBoundaryMesh::writeData(Ostream& os) const"); + os.check(FUNCTION_NAME); return os.good(); } -Ostream& operator<<(Ostream& os, const faBoundaryMesh& bm) +Foam::Ostream& Foam::operator<<(Ostream& os, const faBoundaryMesh& bm) { bm.writeData(os); return os; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.H b/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.H index 93355ead80..f0973e950e 100644 --- a/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.H +++ b/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.H @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see . Class - faBoundaryMesh + Foam::faBoundaryMesh Description Finite area boundary mesh @@ -142,6 +142,7 @@ public: //- Check boundary definition bool checkDefinition(const bool report = false) const; + // Edit //- Correct faBoundaryMesh after moving points diff --git a/src/finiteArea/faMesh/faGlobalMeshData/faGlobalMeshData.C b/src/finiteArea/faMesh/faGlobalMeshData/faGlobalMeshData.C index 00bbc4edf6..6904776a9d 100644 --- a/src/finiteArea/faMesh/faGlobalMeshData/faGlobalMeshData.C +++ b/src/finiteArea/faMesh/faGlobalMeshData/faGlobalMeshData.C @@ -63,11 +63,9 @@ const Foam::faMesh& Foam::faGlobalMeshData::mesh() const } -// Update all data after morph void Foam::faGlobalMeshData::updateMesh() { - label polyMeshNGlobalPoints = - mesh_().globalData().nGlobalPoints(); + label polyMeshNGlobalPoints = mesh_().globalData().nGlobalPoints(); const labelList& polyMeshSharedPointLabels = mesh_().globalData().sharedPointLabels(); @@ -81,10 +79,11 @@ void Foam::faGlobalMeshData::updateMesh() forAll(mesh_.boundary(), patchI) { - if(mesh_.boundary()[patchI].type() == processorFaPatch::typeName) + const faPatch& fap = mesh_.boundary()[patchI]; + + if (isA(fap)) { - const labelList& localPointLabels = - mesh_.boundary()[patchI].pointLabels(); + const labelList& localPointLabels = fap.pointLabels(); forAll(localPointLabels, pointI) { @@ -111,12 +110,12 @@ void Foam::faGlobalMeshData::updateMesh() sharedPointLabels_ = sharedPointLabels.toc(); - combineReduce(globalList, plusEqOp()); + combineReduce(globalList, plusEqOp()); nGlobalPoints_ = 0; - for (label i=0; i 0) + if (globalList[i] > 0) { globalList[i] = ++nGlobalPoints_; } @@ -137,4 +136,5 @@ void Foam::faGlobalMeshData::updateMesh() } } + // ************************************************************************* // diff --git a/src/finiteArea/faMesh/faGlobalMeshData/faGlobalMeshData.H b/src/finiteArea/faMesh/faGlobalMeshData/faGlobalMeshData.H index 87b7ba7eda..acfef27d3c 100644 --- a/src/finiteArea/faMesh/faGlobalMeshData/faGlobalMeshData.H +++ b/src/finiteArea/faMesh/faGlobalMeshData/faGlobalMeshData.H @@ -24,7 +24,7 @@ License along with OpenFOAM. If not, see . Class - faGlobalMeshData + Foam::faGlobalMeshData Description Various mesh related information for a parallel run @@ -87,16 +87,11 @@ public: //- Runtime type information ClassName("faGlobalMeshData"); + //- Construct from mesh + faGlobalMeshData(const faMesh& mesh); - // Constructors - - //- Construct from mesh - faGlobalMeshData(const faMesh& mesh); - - - // Destructor - - ~faGlobalMeshData(); + //- Destructor + ~faGlobalMeshData(); // Member Functions diff --git a/src/finiteArea/faMesh/faGlobalMeshData/faProcessorTopology.H b/src/finiteArea/faMesh/faGlobalMeshData/faProcessorTopology.H index cc72fc5299..36a4534874 100644 --- a/src/finiteArea/faMesh/faGlobalMeshData/faProcessorTopology.H +++ b/src/finiteArea/faMesh/faGlobalMeshData/faProcessorTopology.H @@ -23,8 +23,8 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Class - faProcessorTopology +Typedef + Foam::faProcessorTopology Description diff --git a/src/finiteArea/faMesh/faMesh.C b/src/finiteArea/faMesh/faMesh.C index a14fc8e417..d6706dbd2a 100644 --- a/src/finiteArea/faMesh/faMesh.C +++ b/src/finiteArea/faMesh/faMesh.C @@ -23,8 +23,6 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Description - \*---------------------------------------------------------------------------*/ #include "faMesh.H" @@ -57,11 +55,8 @@ const int Foam::faMesh::quadricsFit_ = 0; void Foam::faMesh::setPrimitiveMeshData() { - if (debug) - { - Info<< "void faMesh::setPrimitiveMeshData() const : " - << "Setting primitive data" << endl; - } + DebugInFunction + << "Setting primitive data" << endl; const indirectPrimitivePatch& bp = patch(); @@ -70,19 +65,18 @@ void Foam::faMesh::setPrimitiveMeshData() label edgeI = -1; - label nIntEdges = bp.nInternalEdges(); - for (label curEdge = 0; curEdge < nIntEdges; curEdge++) + for (label curEdge = 0; curEdge < nIntEdges; ++curEdge) { edges_[++edgeI] = bp.edges()[curEdge]; } - forAll (boundary(), patchI) + forAll(boundary(), patchI) { const labelList& curP = boundary()[patchI]; - forAll (curP, eI) + forAll(curP, eI) { edges_[++edgeI] = bp.edges()[curP[eI]]; } @@ -100,18 +94,18 @@ void Foam::faMesh::setPrimitiveMeshData() const labelListList& bpef = bp.edgeFaces(); - for (label curEdge = 0; curEdge < nIntEdges; curEdge++) + for (label curEdge = 0; curEdge < nIntEdges; ++curEdge) { edgeOwner_[++edgeI] = bpef[curEdge][0]; edgeNeighbour_[edgeI] = bpef[curEdge][1]; } - forAll (boundary(), patchI) + forAll(boundary(), patchI) { const labelList& curP = boundary()[patchI]; - forAll (curP, eI) + forAll(curP, eI) { edgeOwner_[++edgeI] = bpef[curP[eI]][0]; } @@ -216,24 +210,24 @@ Foam::faMesh::faMesh(const polyMesh& pMesh) *this ), comm_(Pstream::worldComm), - patchPtr_(NULL), - lduPtr_(NULL), + patchPtr_(nullptr), + lduPtr_(nullptr), curTimeIndex_(time().timeIndex()), - SPtr_(NULL), - S0Ptr_(NULL), - S00Ptr_(NULL), - patchStartsPtr_(NULL), - LePtr_(NULL), - magLePtr_(NULL), - centresPtr_(NULL), - edgeCentresPtr_(NULL), - faceAreaNormalsPtr_(NULL), - edgeAreaNormalsPtr_(NULL), - pointAreaNormalsPtr_(NULL), - faceCurvaturesPtr_(NULL), - edgeTransformTensorsPtr_(NULL), - correctPatchPointNormalsPtr_(NULL), - globalMeshDataPtr_(NULL) + SPtr_(nullptr), + S0Ptr_(nullptr), + S00Ptr_(nullptr), + patchStartsPtr_(nullptr), + LePtr_(nullptr), + magLePtr_(nullptr), + centresPtr_(nullptr), + edgeCentresPtr_(nullptr), + faceAreaNormalsPtr_(nullptr), + edgeAreaNormalsPtr_(nullptr), + pointAreaNormalsPtr_(nullptr), + faceCurvaturesPtr_(nullptr), + edgeTransformTensorsPtr_(nullptr), + correctPatchPointNormalsPtr_(nullptr), + globalMeshDataPtr_(nullptr) { if (debug) { @@ -274,7 +268,6 @@ Foam::faMesh::faMesh(const polyMesh& pMesh) } -// Construct from components without boundary. Foam::faMesh::faMesh ( const polyMesh& pMesh, @@ -312,24 +305,24 @@ Foam::faMesh::faMesh 0 ), comm_(Pstream::worldComm), - patchPtr_(NULL), - lduPtr_(NULL), + patchPtr_(nullptr), + lduPtr_(nullptr), curTimeIndex_(time().timeIndex()), - SPtr_(NULL), - S0Ptr_(NULL), - S00Ptr_(NULL), - patchStartsPtr_(NULL), - LePtr_(NULL), - magLePtr_(NULL), - centresPtr_(NULL), - edgeCentresPtr_(NULL), - faceAreaNormalsPtr_(NULL), - edgeAreaNormalsPtr_(NULL), - pointAreaNormalsPtr_(NULL), - faceCurvaturesPtr_(NULL), - edgeTransformTensorsPtr_(NULL), - correctPatchPointNormalsPtr_(NULL), - globalMeshDataPtr_(NULL) + SPtr_(nullptr), + S0Ptr_(nullptr), + S00Ptr_(nullptr), + patchStartsPtr_(nullptr), + LePtr_(nullptr), + magLePtr_(nullptr), + centresPtr_(nullptr), + edgeCentresPtr_(nullptr), + faceAreaNormalsPtr_(nullptr), + edgeAreaNormalsPtr_(nullptr), + pointAreaNormalsPtr_(nullptr), + faceCurvaturesPtr_(nullptr), + edgeTransformTensorsPtr_(nullptr), + correctPatchPointNormalsPtr_(nullptr), + globalMeshDataPtr_(nullptr) { if (debug) { @@ -339,7 +332,6 @@ Foam::faMesh::faMesh } -// Construct from definition field Foam::faMesh::faMesh ( const polyMesh& pMesh, @@ -377,30 +369,27 @@ Foam::faMesh::faMesh 0 ), comm_(Pstream::worldComm), - patchPtr_(NULL), - lduPtr_(NULL), + patchPtr_(nullptr), + lduPtr_(nullptr), curTimeIndex_(time().timeIndex()), - SPtr_(NULL), - S0Ptr_(NULL), - S00Ptr_(NULL), - patchStartsPtr_(NULL), - LePtr_(NULL), - magLePtr_(NULL), - centresPtr_(NULL), - edgeCentresPtr_(NULL), - faceAreaNormalsPtr_(NULL), - edgeAreaNormalsPtr_(NULL), - pointAreaNormalsPtr_(NULL), - faceCurvaturesPtr_(NULL), - edgeTransformTensorsPtr_(NULL), - correctPatchPointNormalsPtr_(NULL), - globalMeshDataPtr_(NULL) + SPtr_(nullptr), + S0Ptr_(nullptr), + S00Ptr_(nullptr), + patchStartsPtr_(nullptr), + LePtr_(nullptr), + magLePtr_(nullptr), + centresPtr_(nullptr), + edgeCentresPtr_(nullptr), + faceAreaNormalsPtr_(nullptr), + edgeAreaNormalsPtr_(nullptr), + pointAreaNormalsPtr_(nullptr), + faceCurvaturesPtr_(nullptr), + edgeTransformTensorsPtr_(nullptr), + correctPatchPointNormalsPtr_(nullptr), + globalMeshDataPtr_(nullptr) { - if (debug) - { - Info<< "faMesh::faMesh(...) : " - << "Creating faMesh from definition file" << endl; - } + DebugInFunction + << "Creating faMesh from definition file" << endl; // Reading faMeshDefinition dictionary IOdictionary faMeshDefinition @@ -416,38 +405,29 @@ Foam::faMesh::faMesh ) ); - wordList polyMeshPatches - ( - faMeshDefinition.lookup("polyMeshPatches") - ); + const wordList polyMeshPatches(faMeshDefinition.lookup("polyMeshPatches")); - dictionary bndDict = faMeshDefinition.subDict("boundary"); + const dictionary& bndDict = faMeshDefinition.subDict("boundary"); - wordList faPatchNames = bndDict.toc(); + const wordList faPatchNames(bndDict.toc()); List faPatches(faPatchNames.size() + 1); - forAll (faPatchNames, patchI) + const polyBoundaryMesh& pbm = pMesh.boundaryMesh(); + + forAll(faPatchNames, patchI) { - dictionary curPatchDict = - bndDict.subDict(faPatchNames[patchI]); + dictionary curPatchDict = bndDict.subDict(faPatchNames[patchI]); faPatches[patchI].name_ = faPatchNames[patchI]; - faPatches[patchI].type_ = - word(curPatchDict.lookup("type")); + faPatches[patchI].type_ = word(curPatchDict.lookup("type")); faPatches[patchI].ownPolyPatchID_ = - mesh().boundaryMesh().findPatchID - ( - word(curPatchDict.lookup("ownerPolyPatch")) - ); + pbm.findPatchID(word(curPatchDict.lookup("ownerPolyPatch"))); - faPatches[patchI].ngbPolyPatchID_ = - mesh().boundaryMesh().findPatchID - ( - word(curPatchDict.lookup("neighbourPolyPatch")) - ); + faPatches[patchI].ngbPolyPatchID_ = + pbm.findPatchID(word(curPatchDict.lookup("neighbourPolyPatch"))); } @@ -456,12 +436,11 @@ Foam::faMesh::faMesh labelList patchIDs(polyMeshPatches.size(), -1); - forAll (polyMeshPatches, patchI) + forAll(polyMeshPatches, patchI) { - patchIDs[patchI] = - mesh().boundaryMesh().findPatchID(polyMeshPatches[patchI]); + patchIDs[patchI] = pbm.findPatchID(polyMeshPatches[patchI]); - size += mesh().boundaryMesh()[patchIDs[patchI]].size(); + size += pbm[patchIDs[patchI]].size(); } faceLabels_ = labelList(size, -1); @@ -472,12 +451,12 @@ Foam::faMesh::faMesh sort(patchIDs); - forAll (polyMeshPatches, patchI) + forAll(polyMeshPatches, patchI) { - label start = mesh().boundaryMesh()[patchIDs[patchI]].start(); - label size = mesh().boundaryMesh()[patchIDs[patchI]].size(); + label start = pbm[patchIDs[patchI]].start(); + label size = pbm[patchIDs[patchI]].size(); - for (label i = 0; i < size; i++) + for (label i = 0; i < size; ++i) { faceLabels_[++faceI] = start + i; } @@ -488,7 +467,7 @@ Foam::faMesh::faMesh // Result is in the bndEdgeFaPatchIDs list labelList faceCells(faceLabels_.size(), -1); - forAll (faceCells, faceI) + forAll(faceCells, faceI) { label faceID = faceLabels_[faceI]; @@ -510,7 +489,7 @@ Foam::faMesh::faMesh labelList bndEdgeFaPatchIDs(nTotalEdges - nInternalEdges, -1); - for (label edgeI = nInternalEdges; edgeI < nTotalEdges; edgeI++) + for (label edgeI = nInternalEdges; edgeI < nTotalEdges; ++edgeI) { label curMeshEdge = meshEdges[edgeI]; @@ -518,11 +497,11 @@ Foam::faMesh::faMesh label patchI = -1; - forAll (edgeFaces[curMeshEdge], faceI) + forAll(edgeFaces[curMeshEdge], faceI) { label curFace = edgeFaces[curMeshEdge][faceI]; - label curPatchID = mesh().boundaryMesh().whichPatch(curFace); + label curPatchID = pbm.whichPatch(curFace); if (curPatchID != -1) { @@ -530,7 +509,7 @@ Foam::faMesh::faMesh } } - for (label pI = 0; pI < faPatches.size() - 1; pI++) + for (label pI = 0; pI < faPatches.size() - 1; ++pI) { if ( @@ -553,11 +532,11 @@ Foam::faMesh::faMesh // Set edgeLabels for each faPatch - for (label pI = 0; pI < (faPatches.size() - 1); pI++) + for (label pI = 0; pI < (faPatches.size() - 1); ++pI) { SLList