Added time options

This commit is contained in:
Hrvoje Jasak 2015-12-15 18:47:51 +00:00
parent 07efd81cb2
commit 16e7d5a961
2 changed files with 25 additions and 22 deletions

View file

@ -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",

View file

@ -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<Times.size(); i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;
polyMesh::readUpdateState state = mesh.readUpdate();
IOobject Uheader
(
"U",