createFields.H
Go to the documentation of this file.
1 IOdictionary pdfDictionary
2 (
3 IOobject
4 (
5 "pdfDict",
6 runTime.constant(),
8 IOobject::MUST_READ_IF_MODIFIED,
9 IOobject::NO_WRITE
10 )
11 );
12
13 const label nIntervals(pdfDictionary.get<label>("nIntervals"));
14
15 const label nSamples(pdfDictionary.get<label>("nSamples"));
16
17 const bool writeData(pdfDictionary.get<bool>("writeData"));
18
19
20 const fileName pdfPath = runTime.path()/"pdf";
22
23 Random rndGen;
24
25 autoPtr<distributionModel> p
26 (
27 distributionModel::New
28 (
30 rndGen
31 )
32 );
33
34 const scalar xMin = p->minValue();
35 const scalar xMax = p->maxValue();
36
37 autoPtr<OFstream> filePtr;
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
47 scalarField samples(nIntervals, Zero);
volScalarField & p
engineTime & runTime
const label nIntervals(pdfDictionary.get< label >("nIntervals"))
const label nSamples(pdfDictionary.get< label >("nSamples"))
const scalar xMin
Definition: createFields.H:34
const fileName pdfPath
Definition: createFields.H:20
scalarField samples(nIntervals, Zero)
mkDir(pdfPath)
IOdictionary pdfDictionary(IOobject("pdfDict", runTime.constant(), runTime, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE))
Random rndGen
Definition: createFields.H:23
const scalar xMax
Definition: createFields.H:35
const bool writeData(pdfDictionary.get< bool >("writeData"))
autoPtr< OFstream > filePtr
Definition: createFields.H:37