createFields.H
Go to the documentation of this file.
1  IOdictionary pdfDictionary
2  (
3  IOobject
4  (
5  "pdfDict",
6  runTime.constant(),
7  runTime,
8  IOobject::MUST_READ_IF_MODIFIED,
9  IOobject::NO_WRITE
10  )
11  );
12 
13  const label nIntervals(readLabel(pdfDictionary.lookup("nIntervals")));
14 
15  const label nSamples(readLabel(pdfDictionary.lookup("nSamples")));
16 
17  const bool writeData(readBool(pdfDictionary.lookup("writeData")));
18 
19 
20  const fileName pdfPath = runTime.path()/"pdf";
21  mkDir(pdfPath);
22 
23  cachedRandom rndGen(label(0), -1);
24 
25  autoPtr<distributionModels::distributionModel> p
26  (
28  (
30  rndGen
31  )
32  );
33 
34  const scalar xMin = p->minValue();
35  const scalar xMax = p->maxValue();
36 
37  autoPtr<OFstream> filePtr(NULL);
38  if (writeData)
39  {
40  fileName fName = pdfPath/(p->type() + ".data");
41  Info<< "Writing " << p->type() << " data samples to file:" << nl
42  << fName << nl << endl;
43 
44  filePtr.reset(new OFstream(fName));
45  }
46 
48 
mkDir
mkDir(pdfPath)
Foam::compressible::New
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
Definition: turbulentFluidThermoModel.C:36
nSamples
const label nSamples(readLabel(pdfDictionary.lookup("nSamples")))
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
pdfPath
const fileName pdfPath
Definition: createFields.H:20
samples
scalarField samples(nIntervals, 0)
xMin
const scalar xMin
Definition: createFields.H:34
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
writeData
const bool writeData(readBool(pdfDictionary.lookup("writeData")))
p
volScalarField & p
Definition: createFields.H:51
nIntervals
const label nIntervals(readLabel(pdfDictionary.lookup("nIntervals")))
xMax
const scalar xMax
Definition: createFields.H:35
scalarField
volScalarField scalarField(fieldObject, mesh)
Foam::readLabel
label readLabel(Istream &is)
Definition: label.H:64
filePtr
autoPtr< OFstream > filePtr(NULL)
Foam::readBool
bool readBool(Istream &)
Definition: boolIO.C:60
pdfDictionary
IOdictionary pdfDictionary(IOobject("pdfDict", runTime.constant(), runTime, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE))
rndGen
cachedRandom rndGen(label(0), -1)