diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C index 6015f1167ddfed9f450c2d0ef5f6911123294165..7b36d92c5875f37db8a065afc56043339e8fd0f2 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -227,7 +227,8 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate() newBoundary[patchI].start(), patchI, boundary_, - newBoundary[patchI].type() + newBoundary[patchI].physicalType(), + newBoundary[patchI].inGroups() ); } } diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C b/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C index 4a8b5dd7d73802016d71614d439423c05d35a3ec..f26f77cad30b27fcd26c4311bb23a25f1412cccb 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -78,15 +78,43 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm) newMotionPoints.setSize(points_.size()); // Map the list - newMotionPoints.map(oldMotionPoints, mpm.pointMap()); + if (mpm.hasMotionPoints()) + { + newMotionPoints.map(oldMotionPoints, mpm.pointMap()); - // Any points created out-of-nothing get set to the current coordinate - // for lack of anything better. - forAll(mpm.pointMap(), newPointI) + // Any points created out-of-nothing get set to the current + // coordinate for lack of anything better. + forAll(mpm.pointMap(), newPointI) + { + if (mpm.pointMap()[newPointI] == -1) + { + newMotionPoints[newPointI] = points_[newPointI]; + } + } + } + else { - if (mpm.pointMap()[newPointI] == -1) + const labelList& pointMap = mpm.pointMap(); + const labelList& revPointMap = mpm.reversePointMap(); + + forAll(pointMap, newPointI) { - newMotionPoints[newPointI] = points_[newPointI]; + label oldPointI = pointMap[newPointI]; + if (oldPointI >= 0) + { + if (revPointMap[oldPointI] == newPointI) // master point + { + newMotionPoints[newPointI] = oldMotionPoints[oldPointI]; + } + else + { + newMotionPoints[newPointI] = points_[newPointI]; + } + } + else + { + newMotionPoints[newPointI] = points_[newPointI]; + } } } } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C index d7508c3d94a5b214f6ef45991488380d2b0cde29..dd1583577ffac12499a8f453ff8be82335d5b648 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -107,6 +107,30 @@ Foam::polyPatch::polyPatch } +Foam::polyPatch::polyPatch +( + const word& name, + const label size, + const label start, + const label index, + const polyBoundaryMesh& bm, + const word& physicalType, + const wordList& inGroups +) +: + patchIdentifier(name, index, physicalType, inGroups), + primitivePatch + ( + faceSubList(bm.mesh().faces(), size, start), + bm.mesh().points() + ), + start_(start), + boundaryMesh_(bm), + faceCellsPtr_(NULL), + mePtr_(NULL) +{} + + Foam::polyPatch::polyPatch ( const word& name, diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H index b13faf0968f96576e3f96cf29cb17488215e71c3..2e12697a1843124b1be69017053c5c7208d48c76 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -179,6 +179,18 @@ public: const word& patchType ); + //- Construct from components + polyPatch + ( + const word& name, + const label size, + const label start, + const label index, + const polyBoundaryMesh& bm, + const word& physicalType, + const wordList& inGroups + ); + //- Construct from dictionary polyPatch (