From cd8aee2d76a2223b19c53fa42042e7aa0d8d731b Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Mon, 21 Jan 2019 08:52:52 +0000 Subject: [PATCH] PrimitivePatch: Simplified templating --- .../test/primitivePatch/Test-PrimitivePatch.C | 6 +- .../extrudeMesh/extrudedMesh/extrudedMesh.H | 18 +- .../extrudedMesh/extrudedMeshTemplates.C | 28 +- .../backgroundMeshDecomposition.H | 4 +- .../automatic/automatic.C | 7 +- .../nonUniformField/nonUniformField.H | 7 +- .../primitivePatchInterpolation.H | 7 +- .../primitiveMesh/PatchTools/PatchTools.H | 149 +++------ .../PatchTools/PatchToolsCheck.C | 24 +- .../PatchTools/PatchToolsEdgeOwner.C | 24 +- .../PatchTools/PatchToolsGatherAndMerge.C | 32 +- .../PatchTools/PatchToolsMatch.C | 34 +- .../PatchTools/PatchToolsNormals.C | 30 +- .../PatchTools/PatchToolsSearch.C | 63 +--- .../PatchTools/PatchToolsSortEdges.C | 25 +- .../PatchTools/PatchToolsSortPoints.C | 16 +- .../PrimitivePatch/PrimitivePatch.C | 307 +++++------------- .../PrimitivePatch/PrimitivePatch.H | 36 +- .../PrimitivePatch/PrimitivePatchAddressing.C | 26 +- .../PrimitivePatch/PrimitivePatchBdryPoints.C | 14 +- .../PrimitivePatch/PrimitivePatchCheck.C | 46 +-- .../PrimitivePatch/PrimitivePatchClear.C | 50 +-- .../PrimitivePatch/PrimitivePatchEdgeLoops.C | 25 +- .../PrimitivePatchLocalPointOrder.C | 20 +- .../PrimitivePatch/PrimitivePatchMeshData.C | 120 ++----- .../PrimitivePatch/PrimitivePatchMeshEdges.C | 50 +-- .../PrimitivePatchPointAddressing.C | 30 +- .../PrimitivePatchProjectPoints.C | 27 +- .../primitivePatch/indirectPrimitivePatch.H | 4 +- .../primitivePatch/primitiveFacePatch.H | 5 +- .../primitivePatch/primitivePatch.H | 5 +- .../primitivePatch/uindirectPrimitivePatch.H | 4 +- src/dynamicMesh/boundaryMesh/bMesh.H | 7 +- src/dynamicMesh/boundaryMesh/boundaryMesh.C | 4 +- .../pairPatchAgglomeration.H | 4 +- .../extendedEdgeMesh/extendedEdgeMesh.C | 4 +- .../extendedEdgeMesh/extendedEdgeMesh.H | 4 +- .../extendedFeatureEdgeMesh.C | 4 +- .../extendedFeatureEdgeMesh.H | 4 +- .../triSurfaceMesh/triSurfaceMesh.C | 4 +- .../triSurfaceSearch/triSurfaceRegionSearch.H | 10 +- .../sampledSurface/isoSurface/isoSurface.H | 4 +- src/surfMesh/MeshedSurface/MeshedSurface.H | 13 +- src/surfMesh/surfMesh/surfMesh.H | 14 +- .../surfaceFormats/ac3d/AC3DsurfaceFormat.C | 4 +- src/triSurface/triSurface/triSurface.H | 14 +- 46 files changed, 381 insertions(+), 956 deletions(-) diff --git a/applications/test/primitivePatch/Test-PrimitivePatch.C b/applications/test/primitivePatch/Test-PrimitivePatch.C index b5299497bb..51d09148f1 100644 --- a/applications/test/primitivePatch/Test-PrimitivePatch.C +++ b/applications/test/primitivePatch/Test-PrimitivePatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,7 @@ using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -typedef PrimitivePatch myPrimitivePatch; +typedef PrimitivePatch myPrimitivePatch; void writeObj(Ostream& os,const pointField& points) @@ -252,7 +252,7 @@ int main(int argc, char *argv[]) faceList patchFaces = patch; pointField allPoints = patch.points(); - PrimitivePatch storedPatch + PrimitivePatch storedPatch ( patchFaces.xfer(), allPoints.xfer() diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.H b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.H index 827dd8ef70..b780f5801c 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.H +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMesh.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -62,26 +62,26 @@ class extrudedMesh static bool sameOrder(const face&, const edge&); //- Construct and return the extruded mesh points - template class FaceList, class PointField> + template Xfer extrudedPoints ( - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& ); //- Construct and return the extruded mesh faces - template class FaceList, class PointField> + template Xfer extrudedFaces ( - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& ); //- Construct and return the extruded mesh cells - template class FaceList, class PointField> + template Xfer extrudedCells ( - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& ); @@ -98,11 +98,11 @@ public: // Constructors //- Construct from the primitivePatch to extrude - template class FaceList, class PointField> + template extrudedMesh ( const IOobject&, - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& ); }; diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMeshTemplates.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMeshTemplates.C index d60641ecba..cc8af81150 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMeshTemplates.C +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudedMesh/extrudedMeshTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,15 +28,10 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -template -< - class Face, - template class FaceList, - class PointField -> +template Foam::Xfer Foam::extrudedMesh::extrudedPoints ( - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& model ) { @@ -67,10 +62,10 @@ Foam::Xfer Foam::extrudedMesh::extrudedPoints } -template class FaceList, class PointField> +template Foam::Xfer Foam::extrudedMesh::extrudedFaces ( - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& model ) { @@ -193,10 +188,10 @@ Foam::Xfer Foam::extrudedMesh::extrudedFaces } -template class FaceList, class PointField> +template Foam::Xfer Foam::extrudedMesh::extrudedCells ( - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& model ) { @@ -302,16 +297,11 @@ Foam::Xfer Foam::extrudedMesh::extrudedCells // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -< - class Face, - template class FaceList, - class PointField -> +template Foam::extrudedMesh::extrudedMesh ( const IOobject& io, - const PrimitivePatch& extrudePatch, + const PrimitivePatch& extrudePatch, const extrudeModel& model ) : diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H index 47f36573a5..e3f0de5dbd 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -79,7 +79,7 @@ SourceFiles namespace Foam { -typedef PrimitivePatch bPatch; +typedef PrimitivePatch bPatch; typedef treeDataPrimitivePatch treeDataBPatch; class Time; diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C index 59b1edbdcf..bd11a02a4d 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -197,8 +197,9 @@ Foam::tmp Foam::automatic::load() PrimitivePatchInterpolation < - PrimitivePatch - > patchInterpolate(surface_); + PrimitivePatch<::Foam::List, pointField> + > + patchInterpolate(surface_); const Map