diff --git a/src/OpenFOAM/containers/Lists/ListListOps/ListListOps.C b/src/OpenFOAM/containers/Lists/ListListOps/ListListOps.C index 443e188ed1..d83b4a9f3a 100644 --- a/src/OpenFOAM/containers/Lists/ListListOps/ListListOps.C +++ b/src/OpenFOAM/containers/Lists/ListListOps/ListListOps.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -106,6 +106,7 @@ AccessType ListListOps::combineOffset return result; } + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/containers/Lists/ListListOps/ListListOps.H b/src/OpenFOAM/containers/Lists/ListListOps/ListListOps.H index c35fc714c6..05cef4a723 100644 --- a/src/OpenFOAM/containers/Lists/ListListOps/ListListOps.H +++ b/src/OpenFOAM/containers/Lists/ListListOps/ListListOps.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,10 +92,8 @@ SourceFiles namespace Foam { -// -//template class accessOp; -//template class offsetOp; -// Dummy access operator for combine() + +// Dummy access operator for ListListOps::combine() template class accessOp { @@ -108,7 +106,7 @@ public: }; -// Offset operator for combineOffset() +// Offset operator for ListListOps::combineOffset() template class offsetOp { diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.H b/src/OpenFOAM/meshes/meshShapes/face/face.H index 3b2ffcc757..c9cd3724dc 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.H +++ b/src/OpenFOAM/meshes/meshShapes/face/face.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,6 +50,7 @@ SourceFiles #include "faceListFwd.H" #include "intersection.H" #include "pointHit.H" +#include "ListListOps.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -386,6 +387,30 @@ public: }; +//- Hash specialization to offset faces in ListListOps::combineOffset +template<> +class offsetOp +{ + +public: + + inline face operator() + ( + const face& x, + const label offset + ) const + { + face result(x.size()); + + forAll(x, xI) + { + result[xI] = x[xI] + offset; + } + return result; + } +}; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H b/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H index 8e5103ac2c..24ad5d3d1c 100644 --- a/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H +++ b/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,6 +46,7 @@ SourceFiles #include "intersection.H" #include "pointField.H" #include "triPointRef.H" +#include "ListListOps.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -249,6 +250,30 @@ template<> inline bool contiguous() {return true;} +//- Hash specialization to offset faces in ListListOps::combineOffset +template<> +class offsetOp +{ + +public: + + inline triFace operator() + ( + const triFace& x, + const label offset + ) const + { + triFace result(x); + + forAll(x, xI) + { + result[xI] = x[xI] + offset; + } + return result; + } +}; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsGatherAndMerge.C b/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsGatherAndMerge.C index 1d759d3783..89ffdec2ae 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsGatherAndMerge.C +++ b/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsGatherAndMerge.C @@ -28,58 +28,7 @@ License #include "mergePoints.H" #include "face.H" #include "triFace.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - //- Used to offset faces in Pstream::combineOffset - template<> - class offsetOp - { - - public: - - face operator() - ( - const face& x, - const label offset - ) const - { - face result(x.size()); - - forAll(x, xI) - { - result[xI] = x[xI] + offset; - } - return result; - } - }; - - //- Used to offset faces in Pstream::combineOffset - template<> - class offsetOp - { - - public: - - triFace operator() - ( - const triFace& x, - const label offset - ) const - { - triFace result(x); - - forAll(x, xI) - { - result[xI] = x[xI] + offset; - } - return result; - } - }; -} - +#include "ListListOps.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/triSurface/tools/labelledTri/labelledTri.H b/src/triSurface/tools/labelledTri/labelledTri.H index a4bd26f825..6f0c13065d 100644 --- a/src/triSurface/tools/labelledTri/labelledTri.H +++ b/src/triSurface/tools/labelledTri/labelledTri.H @@ -36,6 +36,7 @@ SourceFiles #define labelledTri_H #include "triFace.H" +#include "ListListOps.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -114,14 +115,15 @@ public: template<> inline bool contiguous() {return true;} -//- Used to offset faces in ListListOps::combineOffset + +//- Hash specialization to offset faces in ListListOps::combineOffset template<> class offsetOp { public: - labelledTri operator() + inline labelledTri operator() ( const labelledTri& x, const label offset