Skip to content
Snippets Groups Projects
Commit 66ba2dd6 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: check case tool - updated command line arguments:

-dry-run : perform check only and no writing
-dry-run-write: perform check and write to the next time step.  This
also triggers function objects that fire on the call to write()
parent b50bbc7e
Branches
Tags
No related merge requests found
Foam::argList::addBoolOption Foam::argList::addBoolOption
( (
"check", "dry-run",
"Check set-up only using a single time step" "Check case set-up only using a single time step"
);
Foam::argList::addBoolOption
(
"dry-run-write",
"Check case set-up and write only using a single time step"
); );
Foam::autoPtr<Foam::fvMesh> meshPtr(nullptr); Foam::autoPtr<Foam::fvMesh> meshPtr(nullptr);
if (args.optionFound("check")) if (args.optionFound("dry-run") || args.optionFound("dry-run-write"))
{ {
Info<< "Operating in 'check' mode: case will run for 1 time step. " Foam::Info
<< "All checks assumed OK on a clean exit" << endl; << "Operating in 'dry-run' mode: case will run for 1 time step. "
<< "All checks assumed OK on a clean exit" << Foam::endl;
Field<label>::allowConstructFromLargerSize = true; Foam::FieldBase::allowConstructFromLargerSize = true;
Field<scalar>::allowConstructFromLargerSize = true;
Field<vector>::allowConstructFromLargerSize = true;
Field<sphericalTensor>::allowConstructFromLargerSize = true;
Field<symmTensor>::allowConstructFromLargerSize = true;
Field<tensor>::allowConstructFromLargerSize = true;
// Create a simplified 1D mesh and attempt to re-create boundary conditions // Create a simplified 1D mesh and attempt to re-create boundary conditions
meshPtr = dummyFvMesh::equivalent1DMesh(runTime); meshPtr.reset(Foam::dummyFvMesh::equivalent1DMesh(runTime));
// Stopping after 1 iteration of the simplified mesh // Stopping after 1 iteration of the simplified mesh
// Note: using saWriteNow to trigger writing/execution of function objects // Note: using saNoWriteNow will only trigger the function object execute
// - saNoWriteNow will only trigger the function object execute function // function and not the write function
runTime.stopAt(Foam::Time::saNoWriteNow); runTime.stopAt(Foam::Time::saNoWriteNow);
// runTime.stopAt(Foam::Time::saWriteNow);
if (args.optionFound("dry-run-write"))
{
// Stopping after 1 iteration of the simplified mesh
// Note: using saWriteNow to trigger writing/execution of function
// objects
runTime.stopAt(Foam::Time::saWriteNow);
}
Foam::functionObject::outputPrefix = "postProcessing-dry-run";
} }
else else
{ {
......
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