ENH: additional feedback about controlled mesh motion update type

- ensure that the updateControl is "non-sticky" on re-read,
  even if we do not support runtime-modifiable here

STYLE: add syntax example (wingMotion), but with updateInterval 1
This commit is contained in:
Mark Olesen
2019-12-13 10:02:46 +01:00
parent e90de78cac
commit 373ad6df0e
2 changed files with 31 additions and 12 deletions

View File

@ -41,20 +41,33 @@ namespace Foam
void Foam::dynamicFvMesh::readDict() void Foam::dynamicFvMesh::readDict()
{ {
IOdictionary dict IOobject dictHeader
( (
IOobject "dynamicMeshDict",
( thisDb().time().constant(),
"dynamicMeshDict", thisDb(),
thisDb().time().constant(), IOobject::MUST_READ_IF_MODIFIED,
thisDb(), IOobject::NO_WRITE,
IOobject::MUST_READ_IF_MODIFIED, false // Do not register
IOobject::NO_WRITE,
false // Do not register
)
); );
timeControl_.read(dict); if (dictHeader.typeHeaderOk<IOdictionary>(false, false))
{
IOdictionary dict(dictHeader);
timeControl_.read(dict);
if (!timeControl_.always())
{
// Feedback about the trigger mechanism
Info<< "Controlled mesh update triggered on "
<< timeControl_.type() << nl;
}
}
else
{
// Ensure it is pass-through
timeControl_.clear();
}
} }
@ -138,7 +151,8 @@ bool Foam::dynamicFvMesh::controlledUpdate()
if (!timeControl_.always()) if (!timeControl_.always())
{ {
// Feedback that update has been triggered // Feedback that update has been triggered
Info<< "Mesh update triggered based on " << timeControl_.name() << nl; Info<< "Mesh update triggered based on "
<< timeControl_.type() << nl;
} }
return this->update(); return this->update();

View File

@ -20,6 +20,11 @@ motionSolverLibs (sixDoFRigidBodyMotion);
motionSolver sixDoFRigidBodyMotion; motionSolver sixDoFRigidBodyMotion;
// Not necessarily useful here, but can have different motion updates types
updateControl timeStep;
updateInterval 1;
patches (wing); patches (wing);
innerDistance 0.3; innerDistance 0.3;
outerDistance 1; outerDistance 1;