Go to the documentation of this file.
38 namespace functionObjects
63 cloudName_(
"unknown-cloudName"),
65 tagFieldName_(
"none"),
85 dict.readEntry(
"cloud", cloudName_);
86 dict.readEntry(
"nameVsBinWidth", nameVsBinWidth_);
87 dict.readIfPresent(
"tagField", tagFieldName_);
92 <<
" Processing cloud : " << cloudName_ <<
nl
112 if (!mesh_.foundObject<
cloud>(cloudName_))
117 <<
"Unable to find cloud " << cloudName_
118 <<
" in the mesh database. Available clouds include:"
124 const cloud&
c = mesh_.lookupObject<
cloud>(cloudName_);
130 name() &
"CloudRegistry",
131 mesh_.time().timeName(),
139 c.writeObjects(cloudObr);
144 tagFieldName_ !=
"none"
152 const label tagMax = tagMap.size();
157 label newTag = tagMap[tag[i]];
158 tagAddr[newTag].
append(i);
164 forAll(nameVsBinWidth_, i)
167 ok = ok || processField<scalar>(cloudObr, i, tagAddr);
168 ok = ok || processField<vector>(cloudObr, i, tagAddr);
169 ok = ok || processField<tensor>(cloudObr, i, tagAddr);
170 ok = ok || processField<sphericalTensor>(cloudObr, i, tagAddr);
171 ok = ok || processField<symmTensor>(cloudObr, i, tagAddr);
172 ok = ok || processField<tensor>(cloudObr, i, tagAddr);
177 <<
"Unable to find field " << nameVsBinWidth_[i].first()
178 <<
" in the " << cloudName_ <<
" cloud database" <<
endl;
188 const word& fieldName,
190 const scalar binWidth,
199 word fName(fieldName);
225 const wordList fieldNames(1, fName);
229 OFstream graphFile(outputPath/writerPtr_->getFileName(coords, fieldNames));
231 Log <<
" Writing distribution of " << fieldName
232 <<
" to " << graphFile.name() <<
endl;
236 writerPtr_->write(coords, fieldNames, yPtrs, graphFile);
static const word prefix
The prefix to local: lagrangian.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Accumulating histogram of values. Specified bin resolution automatic generation of bins.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual bool read(const dictionary &)
Read the particleDistribution data.
A class for handling words, derived from Foam::string.
A class for handling file names.
A primitive field of type <T> with automated input and output.
static constexpr const zero Zero
Global zero.
virtual bool write()
Write the particleDistribution.
void append(const T &val)
Append an element at the end of the list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
particleDistribution(const particleDistribution &)=delete
No copy construct.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
addToRunTimeSelectionTable(functionObject, add, dictionary)
general distribution model
#define forAll(list, i)
Loop across all elements in list.
Registry of regIOobjects.
word format(conversionProperties.get< word >("format"))
virtual bool read(const dictionary &dict)
Read.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
virtual ~particleDistribution()
Destructor.
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool read(const dictionary &dict)
Read optional controls.
dimensionedScalar log(const dimensionedScalar &ds)
Macros for easy insertion into run-time selection tables.
Holds list of sampling positions.
const wordList cloudNames(cloudFields.sortedToc())
Output to file stream, using an OSstream.
defineTypeNameAndDebug(fvMeshFunctionObject, 0)
A cloud is a registry collection of lagrangian particles.
virtual bool execute()
Execute, currently does nothing.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const dimensionedScalar c
Speed of light in a vacuum.
functionObject base class for writing single files
void generateDistribution(const word &fieldName, const scalarField &field, const scalar binWidth, const label tag=-1)
Generate the distribution.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
#define WarningInFunction
Report a warning using Foam::Warning.
#define Log
Report write to Foam::Info if the local log switch is true.
static autoPtr< writer > New(const word &writeFormat)
Return a reference to the selected writer.