Go to the documentation of this file.
38 namespace functionObjects
62 cloudName_(
"unknown-cloudName"),
63 tagFieldName_(
"none"),
105 if (!mesh_.foundObject<
cloud>(cloudName_))
110 <<
"Unable to find cloud " << cloudName_
111 <<
" in the mesh database. Available clouds include:"
117 const cloud&
c = mesh_.lookupObject<
cloud>(cloudName_);
123 name() &
"CloudRegistry",
124 mesh_.time().timeName(),
132 c.writeObjects(cloudObr);
137 tagFieldName_ !=
"none"
145 const label tagMax = tagMap.size();
150 label newTag = tagMap[tag[i]];
151 tagAddr[newTag].
append(i);
157 forAll(nameVsBinWidth_, i)
160 ok = ok || processField<scalar>(cloudObr, i, tagAddr);
161 ok = ok || processField<vector>(cloudObr, i, tagAddr);
162 ok = ok || processField<tensor>(cloudObr, i, tagAddr);
163 ok = ok || processField<sphericalTensor>(cloudObr, i, tagAddr);
164 ok = ok || processField<symmTensor>(cloudObr, i, tagAddr);
165 ok = ok || processField<tensor>(cloudObr, i, tagAddr);
170 <<
"Unable to find field " << nameVsBinWidth_[i].first()
171 <<
" in the " << cloudName_ <<
" cloud database" <<
endl;
181 const word& fieldName,
183 const scalar binWidth,
192 word fName(fieldName);
218 const wordList fieldNames(1, fName);
222 OFstream graphFile(outputPath/writerPtr_->getFileName(coords, fieldNames));
224 Log <<
" Writing distribution of " << fieldName
225 <<
" to " << graphFile.name() <<
endl;
229 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 (0)
word cloudName_
Cloud name.
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.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
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.
autoPtr< writer< scalar > > writerPtr_
Writer.
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
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,...
particleDistribution(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual bool read(const dictionary &dict)
Read optional controls.
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.
A cloud is a registry collection of lagrangian particles.
const word & name() const
Return the name of this functionObject.
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
virtual const word & type() const =0
Runtime type information.
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.
word tagFieldName_
Tag field name - used to filter the particles into groups.
defineTypeNameAndDebug(ObukhovLength, 0)
const dimensionedScalar c
Speed of light in a vacuum.
Computes the natural logarithm of an input volScalarField.
Base class for writing single files from the function objects.
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.
List< Tuple2< word, scalar > > nameVsBinWidth_
List of field name vs. bin width.
static autoPtr< writer > New(const word &writeFormat)
Return a reference to the selected writer.