diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C index e310cc758f0809cc6ae1e49fe95add7c5614bae3..d3b9bd049249ba3211935864d8438eb32a204517 100644 --- a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C +++ b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C @@ -34,6 +34,7 @@ License #include "Map.H" #include "globalMeshData.H" #include "DynamicList.H" +#include "fvFieldDecomposer.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -306,12 +307,29 @@ bool domainDecomposition::writeDecomposition() forAll (curPatchSizes, patchi) { + // Get the face labels consistent with the field mapping + // (reuse the patch field mappers) + const polyPatch& meshPatch = + meshPatches[curBoundaryAddressing[patchi]]; + + fvFieldDecomposer::patchFieldDecomposer patchMapper + ( + SubList<label> + ( + curFaceLabels, + curPatchSizes[patchi], + curPatchStarts[patchi] + ), + meshPatch.start() + ); + + // Map existing patches procPatches[nPatches] = meshPatches[curBoundaryAddressing[patchi]].clone ( procMesh.boundaryMesh(), nPatches, - curPatchSizes[patchi], + patchMapper.directAddressing(), curPatchStarts[patchi] ).ptr(); diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C index f471fe1b6e83f0989aba4f211f6e09e53e4cd207..ee2d966836c27c04e1e2edf97d0e6d13c329076d 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C @@ -445,6 +445,19 @@ Foam::coupledPolyPatch::coupledPolyPatch {} +Foam::coupledPolyPatch::coupledPolyPatch +( + const coupledPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart +) +: + polyPatch(pp, bm, index, mapAddressing, newStart) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::coupledPolyPatch::~coupledPolyPatch() diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H index de1d9cc9f98c4fe60502606c3842c1057e7c8c9c..f823148d3a48b020a9d98a57e22fa3f5a4d5c853 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H @@ -221,6 +221,16 @@ public: const label newStart ); + //- Construct given the original patch and a map + coupledPolyPatch + ( + const coupledPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ); + // Destructor diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.C index 47730b06deb4c0e6880bfd26f80d114f4d581721..fc15b4ebed8a2f61c4042da0b27bf68937d96092 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.C @@ -94,6 +94,21 @@ Foam::genericPolyPatch::genericPolyPatch {} +Foam::genericPolyPatch::genericPolyPatch +( + const genericPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart +) +: + polyPatch(pp, bm, index, mapAddressing, newStart), + actualTypeName_(pp.actualTypeName_), + dict_(pp.dict_) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::genericPolyPatch::~genericPolyPatch() diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.H index 53bde568734f2f4b877b89c32f431b7d9f02e9ca..ae8f7cbedb08f8f0eba9c1f09480ed1e5981b552 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/generic/genericPolyPatch.H @@ -106,6 +106,16 @@ public: const label newStart ); + //- Construct given the original patch and a map + genericPolyPatch + ( + const genericPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ); + //- Construct and return a clone, resetting the boundary mesh virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const { @@ -128,6 +138,22 @@ public: ); } + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr<polyPatch> clone + ( + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ) const + { + return autoPtr<polyPatch> + ( + new genericPolyPatch(*this, bm, index, mapAddressing, newStart) + ); + } + // Destructor diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C index 265b61cc4bdf461bd691281c3c62bc12deb08dd6..8c6b20207913c5eac723b45455257560e4c62b92 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C @@ -826,6 +826,26 @@ Foam::cyclicPolyPatch::cyclicPolyPatch {} +Foam::cyclicPolyPatch::cyclicPolyPatch +( + const cyclicPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart +) +: + coupledPolyPatch(pp, bm, index, mapAddressing, newStart), + coupledPointsPtr_(NULL), + coupledEdgesPtr_(NULL), + featureCos_(pp.featureCos_), + transform_(pp.transform_), + rotationAxis_(pp.rotationAxis_), + rotationCentre_(pp.rotationCentre_), + separationVector_(pp.separationVector_) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::cyclicPolyPatch::~cyclicPolyPatch() diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H index 8bd2bff42f27ae16de9ff025a1cc1342468f4122..ea67348891994a77bc356d3621e4d28a4216efeb 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H @@ -234,6 +234,16 @@ public: const label newStart ); + //- Construct given the original patch and a map + cyclicPolyPatch + ( + const cyclicPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ); + //- Construct and return a clone, resetting the boundary mesh virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const { @@ -256,6 +266,22 @@ public: ); } + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr<polyPatch> clone + ( + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ) const + { + return autoPtr<polyPatch> + ( + new cyclicPolyPatch(*this, bm, index, mapAddressing, newStart) + ); + } + // Destructor diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/empty/emptyPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/empty/emptyPolyPatch.C index 01288857583dd0c1a07574b121e1d24403a8411b..a4cf9749e4554886d53856c23d52ce1143751a55 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/empty/emptyPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/empty/emptyPolyPatch.C @@ -87,4 +87,17 @@ Foam::emptyPolyPatch::emptyPolyPatch {} +Foam::emptyPolyPatch::emptyPolyPatch +( + const emptyPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart +) +: + polyPatch(pp, bm, index, mapAddressing, newStart) +{} + + // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/empty/emptyPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/empty/emptyPolyPatch.H index 0525e14f89a49e288e31fcc84759d615e1c5f211..286e9eeb492b623cedfe5f45144f69522cffedf8 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/empty/emptyPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/empty/emptyPolyPatch.H @@ -92,6 +92,16 @@ public: const label newStart ); + //- Construct given the original patch and a map + emptyPolyPatch + ( + const emptyPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ); + //- Construct and return a clone, resetting the boundary mesh virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const { @@ -113,6 +123,22 @@ public: new emptyPolyPatch(*this, bm, index, newSize, newStart) ); } + + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr<polyPatch> clone + ( + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ) const + { + return autoPtr<polyPatch> + ( + new emptyPolyPatch(*this, bm, index, mapAddressing, newStart) + ); + } }; diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C index 70eafc70a88d8c4ed96982789ae03e8f916fc193..6e4df9f4e5cb5b6f63c780aa83d209e2986e7ad1 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C @@ -124,6 +124,26 @@ Foam::processorPolyPatch::processorPolyPatch {} +Foam::processorPolyPatch::processorPolyPatch +( + const processorPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart +) +: + coupledPolyPatch(pp, bm, index, mapAddressing, newStart), + myProcNo_(pp.myProcNo_), + neighbProcNo_(pp.neighbProcNo_), + neighbFaceCentres_(), + neighbFaceAreas_(), + neighbFaceCellCentres_(), + neighbPointsPtr_(NULL), + neighbEdgesPtr_(NULL) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::processorPolyPatch::~processorPolyPatch() diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H index 246f0e466ab4763a900d0ead37fce14da1d84dd7..a8948fee4376804ce4322973d00499160b94c6d1 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.H @@ -158,6 +158,16 @@ public: const label newStart ); + //- Construct given the original patch and a map + processorPolyPatch + ( + const processorPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ); + //- Construct and return a clone, resetting the boundary mesh virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const { @@ -178,7 +188,7 @@ public: ( new processorPolyPatch ( - refCast<const processorPolyPatch>(*this), + *this, bm, index, newSize, @@ -187,6 +197,29 @@ public: ); } + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr<polyPatch> clone + ( + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ) const + { + return autoPtr<polyPatch> + ( + new processorPolyPatch + ( + *this, + bm, + index, + mapAddressing, + newStart + ) + ); + } + // Destructor diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetry/symmetryPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetry/symmetryPolyPatch.C index 99468ea477672d9fbac6170de8381e8871cfb606..ebcd04f113afd4d6ba7860396c902133c5389269 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetry/symmetryPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetry/symmetryPolyPatch.C @@ -87,4 +87,17 @@ Foam::symmetryPolyPatch::symmetryPolyPatch {} +Foam::symmetryPolyPatch::symmetryPolyPatch +( + const symmetryPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart +) +: + polyPatch(pp, bm, index, mapAddressing, newStart) +{} + + // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetry/symmetryPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetry/symmetryPolyPatch.H index b078076bb979fa30a625fb60e77ac64fb4c226a9..bb826d8647642f6ed3bbc46095deb7a37b0aca84 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetry/symmetryPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetry/symmetryPolyPatch.H @@ -92,6 +92,16 @@ public: const label newStart ); + //- Construct given the original patch and a map + symmetryPolyPatch + ( + const symmetryPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ); + //- Construct and return a clone, resetting the boundary mesh virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const { @@ -113,6 +123,22 @@ public: new symmetryPolyPatch(*this, bm, index, newSize, newStart) ); } + + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr<polyPatch> clone + ( + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ) const + { + return autoPtr<polyPatch> + ( + new symmetryPolyPatch(*this, bm, index, mapAddressing, newStart) + ); + } }; diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C index 9795b3d33289889ebb6899270b94d9347b711bf0..78a784906700817f4f0fa47a7f7461c12138d330 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C @@ -157,4 +157,19 @@ Foam::wedgePolyPatch::wedgePolyPatch } +Foam::wedgePolyPatch::wedgePolyPatch +( + const wedgePolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart +) +: + polyPatch(pp, bm, index, mapAddressing, newStart) +{ + initTransforms(); +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.H index f513037ec7ec52e025f91b6a3beff0795032b158..c4ca6add0deec239e53bf67f6e61dd799a570c99 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.H @@ -113,6 +113,16 @@ public: const label newStart ); + //- Construct given the original patch and a map + wedgePolyPatch + ( + const wedgePolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ); + //- Construct and return a clone, resetting the boundary mesh virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const { @@ -135,6 +145,22 @@ public: ); } + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr<polyPatch> clone + ( + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ) const + { + return autoPtr<polyPatch> + ( + new wedgePolyPatch(*this, bm, index, mapAddressing, newStart) + ); + } + // Member functions diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/derived/wall/wallPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/derived/wall/wallPolyPatch.C index 13197c86dde79d18893f7a39dde1fa6ff4131371..930759df7e64d6d3a8c5fcc21e5bad70fe29e091 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/derived/wall/wallPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/derived/wall/wallPolyPatch.C @@ -87,4 +87,17 @@ Foam::wallPolyPatch::wallPolyPatch {} +Foam::wallPolyPatch::wallPolyPatch +( + const wallPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart +) +: + polyPatch(pp, bm, index, mapAddressing, newStart) +{} + + // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/derived/wall/wallPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/derived/wall/wallPolyPatch.H index 7950eee150d202c39169b4682dcc446230abee51..d5af8724418bf38f140aa3670513b9a4a0aa1e66 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/derived/wall/wallPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/derived/wall/wallPolyPatch.H @@ -92,6 +92,16 @@ public: const label newStart ); + //- Construct given the original patch and a map + wallPolyPatch + ( + const wallPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ); + //- Construct and return a clone, resetting the boundary mesh virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const { @@ -113,6 +123,22 @@ public: new wallPolyPatch(*this, bm, index, newSize, newStart) ); } + + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr<polyPatch> clone + ( + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ) const + { + return autoPtr<polyPatch> + ( + new wallPolyPatch(*this, bm, index, mapAddressing, newStart) + ); + } }; diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C index 7c3d206db46746dcd55c6e7eec2ef2da74e98807..be0aa378a67e00fffba1b354cd2e65b885d072a1 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C @@ -167,6 +167,33 @@ Foam::polyPatch::polyPatch {} +Foam::polyPatch::polyPatch +( + const polyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart +) +: + patchIdentifier(pp, index), + primitivePatch + ( + faceSubList + ( + bm.mesh().faces(), + mapAddressing.size(), + newStart + ), + bm.mesh().points() + ), + start_(newStart), + boundaryMesh_(bm), + faceCellsPtr_(NULL), + mePtr_(NULL) +{} + + Foam::polyPatch::polyPatch(const polyPatch& p) : patchIdentifier(p), diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H index b43e4db9ff5f355672432d03e04a391aee18ac8c..f8c8fa72e72f511f4cdd29d0ead265c3ba66905b 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H @@ -199,6 +199,16 @@ public: const label newStart ); + //- Construct given the original patch and a map + polyPatch + ( + const polyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ); + //- Construct as copy polyPatch(const polyPatch&); @@ -224,6 +234,22 @@ public: ); } + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr<polyPatch> clone + ( + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ) const + { + return autoPtr<polyPatch> + ( + new polyPatch(*this, bm, index, mapAddressing, newStart) + ); + } + // Selectors diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C index c54e6bd693be7842c582d6d701c365d2890307bc..899203b54055f35dfe3bd9305f44df82cd0ae453 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C @@ -676,6 +676,25 @@ Foam::directMappedPatchBase::directMappedPatchBase {} +Foam::directMappedPatchBase::directMappedPatchBase +( + const polyPatch& pp, + const directMappedPatchBase& dmp, + const unallocLabelList& mapAddressing +) +: + patch_(pp), + sampleRegion_(dmp.sampleRegion_), + mode_(dmp.mode_), + samplePatch_(dmp.samplePatch_), + uniformOffset_(dmp.uniformOffset_), + offset_(dmp.offset_), + offsets_(dmp.offsets_, mapAddressing), + sameRegion_(dmp.sameRegion_), + mapPtr_(NULL) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::directMappedPatchBase::~directMappedPatchBase() diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H index 99761bd4debf025d3af910335cadf18a8e3b369f..3d6c0724290180d58ffca64d5fc8552ac2b6e727 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H @@ -163,6 +163,14 @@ public: //- Construct as copy, resetting patch directMappedPatchBase(const polyPatch&, const directMappedPatchBase&); + //- Construct as copy, resetting patch, map original data + directMappedPatchBase + ( + const polyPatch&, + const directMappedPatchBase&, + const unallocLabelList& mapAddressing + ); + //- Destructor virtual ~directMappedPatchBase(); diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.C b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.C index 814ff7a25dbb3f01018bbf25120b0612efab16cb..e16b8204f7c4ac72211ed3783173bb4c9312e385 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.C +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.C @@ -120,6 +120,20 @@ Foam::directMappedPolyPatch::directMappedPolyPatch {} +Foam::directMappedPolyPatch::directMappedPolyPatch +( + const directMappedPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart +) +: + polyPatch(pp, bm, index, mapAddressing, newStart), + directMappedPatchBase(*this, pp, mapAddressing) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::directMappedPolyPatch::~directMappedPolyPatch() diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.H b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.H index bfdbae7257164d16e896c89430f5e5b913bbfea5..8cb5907c9514da934a6e05e6409bf31e9fece070 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.H +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.H @@ -142,6 +142,16 @@ public: const label newStart ); + //- Construct given the original patch and a map + directMappedPolyPatch + ( + const directMappedPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ); + //- Construct and return a clone, resetting the boundary mesh virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const { @@ -164,6 +174,29 @@ public: ); } + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr<polyPatch> clone + ( + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ) const + { + return autoPtr<polyPatch> + ( + new directMappedPolyPatch + ( + *this, + bm, + index, + mapAddressing, + newStart + ) + ); + } + //- Destructor virtual ~directMappedPolyPatch(); diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.C b/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.C index 30558f61c1dd47c7d9afe4e4a4c7d1b987833eea..6d6038430d21ad7189b8b901e1dd4309ef37f735 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.C +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.C @@ -125,6 +125,20 @@ Foam::directMappedWallPolyPatch::directMappedWallPolyPatch {} +Foam::directMappedWallPolyPatch::directMappedWallPolyPatch +( + const directMappedWallPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart +) +: + wallPolyPatch(pp, bm, index, mapAddressing, newStart), + directMappedPatchBase(*this, pp, mapAddressing) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::directMappedWallPolyPatch::~directMappedWallPolyPatch() diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.H b/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.H index b7de43c0ada8741ff89dd42e05eb5abeb57cdec6..0a2f5bdfd37f2536ed6feae5161df29d8d755614 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.H +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.H @@ -142,6 +142,16 @@ public: const label newStart ); + //- Construct given the original patch and a map + directMappedWallPolyPatch + ( + const directMappedWallPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ); + //- Construct and return a clone, resetting the boundary mesh virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const { @@ -171,6 +181,29 @@ public: ); } + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr<polyPatch> clone + ( + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ) const + { + return autoPtr<polyPatch> + ( + new directMappedWallPolyPatch + ( + *this, + bm, + index, + mapAddressing, + newStart + ) + ); + } + //- Destructor virtual ~directMappedWallPolyPatch();