Start/restart handling in dynamicPolyRefinementFvMesh

If the constant/polyMesh/meshModifiers file is present, we simply neglect it and
use the controls from dynamicMeshDict to avoid confusion.
This commit is contained in:
Vuko Vukcevic 2019-05-31 10:39:45 +02:00
parent 44cef61dbe
commit d5948f3fb7

View file

@ -117,10 +117,28 @@ Foam::dynamicPolyRefinementFvMesh::dynamicPolyRefinementFvMesh
// protectedInitialRefinement)
refinementSelectionPtr_()
{
// Only create topo modifiers if they haven't been read in
// HJ, 16/Oct/2018
if (topoChanger_.empty())
// Check whether we read polyMeshModifiers from
// constant/polyMesh/meshModifiers file in the base class
if (!topoChanger_.empty())
{
// Already initialized, warn the user that we'll neglect it
WarningIn
(
"dynamicPolyRefinementFvMesh::dynamicPolyRefinementFvMesh"
"\n("
"\n const IOobject& io"
"\n const word subDictName"
"\n)"
) << "Using controls from constant/dynamicMeshDict instead of"
<< " constant/polyMesh/meshModifiers."
<< nl
<< "To supress this warning, delete meshModifiers file."
<< endl;
// Clear the list
topoChanger_.clear();
}
// Only one topo changer engine
topoChanger_.setSize(1);
@ -189,7 +207,6 @@ Foam::dynamicPolyRefinementFvMesh::dynamicPolyRefinementFvMesh
) << "Invalid number of geometric meshes detected: "
<< nGeometricDirs
<< nl << "It appears that this mesh is neither 1D, 2D or 3D."
<< nl << " the mesh."
<< abort(FatalError);
}
@ -198,7 +215,6 @@ Foam::dynamicPolyRefinementFvMesh::dynamicPolyRefinementFvMesh
topoChanger_.writeOpt() = IOobject::AUTO_WRITE;
topoChanger_.write();
write();
}
// Initialize refinement selection algorithm after modifiers
refinementSelectionPtr_ = refinementSelection::New(*this, refinementDict_);