Commit 1afb36a4 authored by mattijs's avatar mattijs
Browse files

BUG: polyMesh: update patchGroups when polyMesh::readUpdate

parent cc3ef7b8
......@@ -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()
);
}
}
......
......@@ -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];
}
}
}
}
......
......@@ -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,
......
......@@ -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
(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment