Commit c334892d authored by mattijs's avatar mattijs
Browse files

use point merge information

parent 2726b577
...@@ -586,8 +586,8 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::repatch ...@@ -586,8 +586,8 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::repatch
"fvMeshDistribute::repatch(const labelList&, labelListList&)" "fvMeshDistribute::repatch(const labelList&, labelListList&)"
) << "reverseFaceMap contains -1 at index:" ) << "reverseFaceMap contains -1 at index:"
<< index << endl << index << endl
<< "This means that the repatch operation was not just a shuffle?" << "This means that the repatch operation was not just"
<< abort(FatalError); << " a shuffle?" << abort(FatalError);
} }
} }
...@@ -622,9 +622,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints ...@@ -622,9 +622,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints
) )
); );
bool merged = pointToMaster.size() > 0; if (returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
if (!returnReduce(merged, orOp<bool>()))
{ {
return autoPtr<mapPolyMesh>(NULL); return autoPtr<mapPolyMesh>(NULL);
} }
...@@ -639,14 +637,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints ...@@ -639,14 +637,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints
// Update fields. No inflation, parallel sync. // Update fields. No inflation, parallel sync.
mesh_.updateMesh(map); mesh_.updateMesh(map);
// Move mesh (since morphing does not do this)
if (map().hasMotionPoints())
{
mesh_.movePoints(map().preMotionPoints());
}
// Adapt constructMaps for merged points. // Adapt constructMaps for merged points.
// 1.4.1: use reversePointMap < -1 feature.
forAll(constructPointMap, procI) forAll(constructPointMap, procI)
{ {
labelList& constructMap = constructPointMap[procI]; labelList& constructMap = constructPointMap[procI];
...@@ -655,16 +646,38 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints ...@@ -655,16 +646,38 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints
{ {
label oldPointI = constructMap[i]; label oldPointI = constructMap[i];
// See if merged into other point label newPointI = map().reversePointMap()[oldPointI];
Map<label>::const_iterator iter = pointToMaster.find(oldPointI);
if (iter != pointToMaster.end()) if (newPointI < -1)
{ {
oldPointI = iter(); constructMap[i] = -newPointI-2;
}
else if (newPointI >= 0)
{
constructMap[i] = newPointI;
}
else
{
FatalErrorIn("fvMeshDistribute::mergeSharedPoints()")
<< "Problem. oldPointI:" << oldPointI
<< " newPointI:" << newPointI << abort(FatalError);
} }
constructMap[i] = map().reversePointMap()[oldPointI];
} }
//- old: use pointToMaster map.
//forAll(constructMap, i)
//{
// label oldPointI = constructMap[i];
//
// // See if merged into other point
// Map<label>::const_iterator iter = pointToMaster.find(oldPointI);
//
// if (iter != pointToMaster.end())
// {
// oldPointI = iter();
// }
//
// constructMap[i] = map().reversePointMap()[oldPointI];
//}
} }
return map; return map;
} }
......
Supports Markdown
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