mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: sampleDict: missing type
This commit is contained in:
@ -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
|
||||
@ -49,12 +49,7 @@ int main(int argc, char *argv[])
|
||||
"noWrite",
|
||||
"suppress writing results"
|
||||
);
|
||||
Foam::argList::addOption
|
||||
(
|
||||
"dict",
|
||||
"name",
|
||||
"dictionary to use"
|
||||
);
|
||||
# include "addDictOption.H"
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
|
||||
@ -1,16 +1,9 @@
|
||||
word dictName(args.optionLookupOrDefault<word>("dict", "particleTrackDict"));
|
||||
const word dictName("particleTrackDict");
|
||||
|
||||
IOdictionary propsDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
dictName,
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED
|
||||
)
|
||||
);
|
||||
#include "setConstantMeshDictionaryIO.H"
|
||||
|
||||
IOdictionary propsDict(dictIO);
|
||||
|
||||
word cloudName(propsDict.lookup("cloudName"));
|
||||
|
||||
List<word> userFields(propsDict.lookup("fields"));
|
||||
List<word> userFields(propsDict.lookup("fields"));
|
||||
|
||||
@ -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
|
||||
@ -113,7 +113,7 @@ int main(int argc, char *argv[])
|
||||
argList::noParallel();
|
||||
timeSelector::addOptions();
|
||||
#include "addRegionOption.H"
|
||||
argList::validOptions.insert("dict", "");
|
||||
#include "addDictOption.H"
|
||||
|
||||
#include "setRootCase.H"
|
||||
|
||||
|
||||
@ -65,7 +65,6 @@ namespace Foam
|
||||
IOobject
|
||||
(
|
||||
args["dict"],
|
||||
runTime.system(),
|
||||
runTime,
|
||||
IOobject::MUST_READ_IF_MODIFIED
|
||||
)
|
||||
|
||||
@ -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
|
||||
@ -97,37 +97,82 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
timeSelector::addOptions();
|
||||
#include "addRegionOption.H"
|
||||
argList::addOption
|
||||
(
|
||||
"dict",
|
||||
"word",
|
||||
"name of dictionary to provide sample information"
|
||||
);
|
||||
|
||||
#include "addDictOption.H"
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
#include "createNamedMesh.H"
|
||||
|
||||
word sampleDict(args.optionLookupOrDefault<word>("dict", "sampleDict"));
|
||||
const word dictName("sampleDict");
|
||||
|
||||
IOsampledSets sSets
|
||||
(
|
||||
sampledSets::typeName,
|
||||
mesh,
|
||||
sampleDict,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
true
|
||||
);
|
||||
autoPtr<IOsampledSets> sSetsPtr;
|
||||
autoPtr<IOsampledSurfaces> sSurfsPtr;
|
||||
|
||||
IOsampledSurfaces sSurfs
|
||||
(
|
||||
sampledSurfaces::typeName,
|
||||
mesh,
|
||||
sampleDict,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
true
|
||||
);
|
||||
if (args.optionFound("dict"))
|
||||
{
|
||||
// Construct from fileName
|
||||
|
||||
fileName dictPath = args["dict"];
|
||||
if (isDir(dictPath))
|
||||
{
|
||||
dictPath = dictPath / dictName;
|
||||
}
|
||||
|
||||
sSetsPtr.reset
|
||||
(
|
||||
new IOsampledSets
|
||||
(
|
||||
sampledSets::typeName,
|
||||
mesh,
|
||||
dictPath,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
sSurfsPtr.reset
|
||||
(
|
||||
new IOsampledSurfaces
|
||||
(
|
||||
sampledSurfaces::typeName,
|
||||
mesh,
|
||||
dictPath,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
true
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Construct from name in system() directory
|
||||
|
||||
sSetsPtr.reset
|
||||
(
|
||||
new IOsampledSets
|
||||
(
|
||||
sampledSets::typeName,
|
||||
mesh,
|
||||
dictName,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
sSurfsPtr.reset
|
||||
(
|
||||
new IOsampledSurfaces
|
||||
(
|
||||
sampledSurfaces::typeName,
|
||||
mesh,
|
||||
dictName,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
true
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
IOsampledSets& sSets = sSetsPtr();
|
||||
IOsampledSurfaces& sSurfs = sSurfsPtr();
|
||||
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
|
||||
@ -140,6 +140,7 @@ sets
|
||||
|
||||
patchSeed
|
||||
{
|
||||
type patchSeed;
|
||||
patches (".*Wall.*");
|
||||
// Number of points to seed. Divided amongst all processors according
|
||||
// to fraction of patches they hold.
|
||||
|
||||
Reference in New Issue
Block a user