Commit 805b45e8 authored by mattijs's avatar mattijs
Browse files

dumping redistributed surfaces

parent 527d64a6
......@@ -230,7 +230,7 @@ Foam::autoHexMeshDriver::autoHexMeshDriver
IOobject
(
"abc", // dummy name
mesh_.time().constant(), // directory
mesh_.time().timeName(), // directory
"triSurface", // instance
mesh_.time(), // registry
IOobject::MUST_READ,
......
......@@ -242,6 +242,8 @@ Foam::label Foam::autoRefineDriver::surfaceOnlyRefine
// Only look at surface intersections (minLevel and surface curvature),
// do not do internal refinement (refinementShells)
const PtrList<featureEdgeMesh> dummyFeatures;
labelList candidateCells
(
meshRefiner_.refineCandidates
......@@ -249,8 +251,8 @@ Foam::label Foam::autoRefineDriver::surfaceOnlyRefine
refineParams.keepPoints()[0],
refineParams.curvature(),
PtrList<featureEdgeMesh>(), // dummy featureMeshes;
labelList(0), // dummy featureLevels;
dummyFeatures, // dummy featureMeshes;
labelList(0), // dummy featureLevels;
false, // featureRefinement
false, // internalRefinement
......@@ -383,6 +385,8 @@ Foam::label Foam::autoRefineDriver::shellRefine
<< "----------------------------" << nl
<< endl;
const PtrList<featureEdgeMesh> dummyFeatures;
labelList candidateCells
(
meshRefiner_.refineCandidates
......@@ -390,8 +394,8 @@ Foam::label Foam::autoRefineDriver::shellRefine
refineParams.keepPoints()[0],
refineParams.curvature(),
PtrList<featureEdgeMesh>(), // dummy featureMeshes;
labelList(0), // dummy featureLevels;
dummyFeatures, // dummy featureMeshes;
labelList(0), // dummy featureLevels;
false, // featureRefinement
true, // internalRefinement
......
......@@ -1776,6 +1776,13 @@ void Foam::meshRefinement::distribute(const mapDistributePolyMesh& map)
faceMap,
pointMap
);
if (faceMap.valid())
{
// (ab)use the instance() to signal current modification time
geometry[i].instance() = geometry[i].time().timeName();
}
faceMap.clear();
pointMap.clear();
}
......@@ -1914,6 +1921,34 @@ bool Foam::meshRefinement::write() const
&& meshCutter_.write()
&& surfaceIndex_.write();
// Make sure that any distributed surfaces (so ones which probably have
// been changed) get written as well.
// Note: should ideally have some 'modified' flag to say whether it
// has been changed or not.
searchableSurfaces& geometry =
const_cast<searchableSurfaces&>(surfaces_.geometry());
forAll(geometry, i)
{
searchableSurface& s = geometry[i];
// Check if instance() of surface is not constant or system.
// Is good hint that surface is distributed.
if
(
s.instance() != s.time().system()
&& s.instance() != s.time().caseSystem()
&& s.instance() != s.time().constant()
&& s.instance() != s.time().caseConstant()
)
{
// Make sure it gets written to current time, not constant.
s.instance() = s.time().timeName();
writeOk = writeOk && s.write();
}
}
return writeOk;
}
......
......@@ -1904,6 +1904,7 @@ void Foam::distributedTriSurfaceMesh::distribute
}
else
{
dict_.set("bounds", procBb_[Pstream::myProcNo()]);
procBb_.transfer(newProcBb);
}
}
......
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