dumping redistributed surfaces

This commit is contained in:
mattijs 2008-10-21 21:38:43 +01:00
parent 527d64a640
commit 805b45e88a
4 changed files with 45 additions and 5 deletions

View File

@ -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,

View File

@ -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

View File

@ -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;
}

View File

@ -1904,6 +1904,7 @@ void Foam::distributedTriSurfaceMesh::distribute
}
else
{
dict_.set("bounds", procBb_[Pstream::myProcNo()]);
procBb_.transfer(newProcBb);
}
}