BUG: polyMesh: update patchGroups when polyMesh::readUpdate

This commit is contained in:
mattijs
2015-11-11 13:28:41 +00:00
parent cc3ef7b876
commit 1afb36a476
4 changed files with 77 additions and 12 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -227,7 +227,8 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
newBoundary[patchI].start(), newBoundary[patchI].start(),
patchI, patchI,
boundary_, boundary_,
newBoundary[patchI].type() newBoundary[patchI].physicalType(),
newBoundary[patchI].inGroups()
); );
} }
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -78,15 +78,43 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
newMotionPoints.setSize(points_.size()); newMotionPoints.setSize(points_.size());
// Map the list // Map the list
newMotionPoints.map(oldMotionPoints, mpm.pointMap()); if (mpm.hasMotionPoints())
// 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.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)
{ {
newMotionPoints[newPointI] = points_[newPointI]; if (mpm.pointMap()[newPointI] == -1)
{
newMotionPoints[newPointI] = points_[newPointI];
}
}
}
else
{
const labelList& pointMap = mpm.pointMap();
const labelList& revPointMap = mpm.reversePointMap();
forAll(pointMap, 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];
}
} }
} }
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. 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 Foam::polyPatch::polyPatch
( (
const word& name, const word& name,

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -179,6 +179,18 @@ public:
const word& patchType 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 //- Construct from dictionary
polyPatch polyPatch
( (