From 14da496a0e740bfe5063ec5c78dad2d156caa8b8 Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Tue, 13 Nov 2012 13:57:14 +0000 Subject: [PATCH] ENH: setsToZones: allow -time options --- .../mesh/manipulation/setsToZones/Make/options | 3 ++- .../mesh/manipulation/setsToZones/setsToZones.C | 14 ++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/applications/utilities/mesh/manipulation/setsToZones/Make/options b/applications/utilities/mesh/manipulation/setsToZones/Make/options index 54c035b8f55..ec38e1cbdb1 100644 --- a/applications/utilities/mesh/manipulation/setsToZones/Make/options +++ b/applications/utilities/mesh/manipulation/setsToZones/Make/options @@ -2,4 +2,5 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ - -lmeshTools + -lmeshTools \ + -lsampling diff --git a/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C b/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C index 2f56bb56930..c3d3d6297af 100644 --- a/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C +++ b/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,6 +48,7 @@ Description #include "IFstream.H" #include "IOobjectList.H" #include "SortableList.H" +#include "timeSelector.H" using namespace Foam; @@ -57,6 +58,7 @@ using namespace Foam; int main(int argc, char *argv[]) { + timeSelector::addOptions(true, false); argList::addNote ( "add point/face/cell Zones from similar named point/face/cell Sets" @@ -76,15 +78,7 @@ int main(int argc, char *argv[]) const bool noFlipMap = args.optionFound("noFlipMap"); // Get times list - instantList Times = runTime.times(); - - label startTime = Times.size()-1; - label endTime = Times.size(); - - // check -time and -latestTime options - #include "checkTimeOption.H" - - runTime.setTime(Times[startTime], startTime); + (void)timeSelector::selectIfPresent(runTime, args); #include "createNamedPolyMesh.H" -- GitLab