From 298d24a872d0850bad81ae08cc8bdeae919d4e90 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 15 Dec 2015 18:47:51 +0000 Subject: [PATCH] Added time options --- .../manipulation/deformedGeom/deformedGeom.C | 24 +++++++++---------- .../deformedTetFemGeom/deformedTetFemGeom.C | 23 ++++++++++-------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/applications/utilities/mesh/manipulation/deformedGeom/deformedGeom.C b/applications/utilities/mesh/manipulation/deformedGeom/deformedGeom.C index 3afa72f0d..7f5c1dab8 100644 --- a/applications/utilities/mesh/manipulation/deformedGeom/deformedGeom.C +++ b/applications/utilities/mesh/manipulation/deformedGeom/deformedGeom.C @@ -30,41 +30,41 @@ Description \*---------------------------------------------------------------------------*/ -#include "argList.H" -#include "fvMesh.H" +#include "fvCFD.H" #include "pointFields.H" #include "IStringStream.H" #include "volPointInterpolation.H" -using namespace Foam; - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { + timeSelector::addOptions(); + +# include "addRegionOption.H" + argList::validArgs.append("scaling factor"); # include "setRootCase.H" +# include "createTime.H" +# include "createNamedMesh.H" scalar scaleFactor(readScalar(IStringStream(args.additionalArgs()[0])())); -# include "createTime.H" -# include "createMesh.H" + instantList timeDirs = timeSelector::select0(runTime, args); volPointInterpolation pInterp(mesh); - // Get times list - instantList Times = runTime.times(); - pointField zeroPoints(mesh.points()); - // skip "constant" time - for (label timeI = 1; timeI < Times.size(); ++timeI) + forAll(timeDirs, timeI) { - runTime.setTime(Times[timeI], timeI); + runTime.setTime(timeDirs[timeI], timeI); Info<< "Time = " << runTime.timeName() << endl; + fvMesh::readUpdateState state = mesh.readUpdate(); + IOobject Uheader ( "U", diff --git a/applications/utilities/mesh/manipulation/deformedTetFemGeom/deformedTetFemGeom.C b/applications/utilities/mesh/manipulation/deformedTetFemGeom/deformedTetFemGeom.C index 3e61e70b5..ea3ca3b1f 100644 --- a/applications/utilities/mesh/manipulation/deformedTetFemGeom/deformedTetFemGeom.C +++ b/applications/utilities/mesh/manipulation/deformedTetFemGeom/deformedTetFemGeom.C @@ -32,6 +32,7 @@ Description #include "argList.H" #include "polyMesh.H" +#include "timeSelector.H" #include "pointFields.H" #include "tetFemMatrix.H" #include "tetPointFields.H" @@ -43,30 +44,32 @@ using namespace Foam; int main(int argc, char *argv[]) { + timeSelector::addOptions(); + +# include "addRegionOption.H" + argList::validArgs.append("scaling factor"); # include "setRootCase.H" - - scalar scaleFactor(readScalar(IStringStream(args.additionalArgs()[0])())); - # include "createTime.H" # include "createPolyMesh.H" - tetPolyMesh tetMesh(mesh); + scalar scaleFactor(readScalar(IStringStream(args.additionalArgs()[0])())); - // Get times list - instantList Times = runTime.times(); + instantList timeDirs = timeSelector::select0(runTime, args); + + tetPolyMesh tetMesh(mesh); pointField zeroPoints(mesh.points()); - runTime.setTime(Times[0], 0); - - for (int i = 1; i