38namespace functionObjects
62 cloudName_(
"unknown-cloudName"),
63 tagFieldName_(
"none"),
78 dict.readEntry(
"cloud", cloudName_);
79 dict.readIfPresent(
"tagField", tagFieldName_);
80 dict.readEntry(
"nameVsBinWidth", nameVsBinWidth_);
86 dict.subOrEmptyDict(
"formatOptions").optionalSubDict(
setFormat)
90 <<
" Processing cloud : " << cloudName_ <<
nl
110 if (!mesh_.foundObject<
cloud>(cloudName_))
113 <<
"Unable to find cloud " << cloudName_
114 <<
" in the mesh database. Available clouds include:"
120 const cloud& c = mesh_.lookupObject<
cloud>(cloudName_);
126 scopedName(
"CloudRegistry"),
127 mesh_.time().timeName(),
135 c.writeObjects(cloudObr);
140 tagFieldName_ !=
"none"
148 const label tagMax = tagMap.
size();
153 label newTag = tagMap[tag[i]];
154 tagAddr[newTag].
append(i);
159 forAll(nameVsBinWidth_, i)
163 processField<scalar>(cloudObr, i, tagAddr)
164 || processField<vector>(cloudObr, i, tagAddr)
165 || processField<tensor>(cloudObr, i, tagAddr)
166 || processField<sphericalTensor>(cloudObr, i, tagAddr)
167 || processField<symmTensor>(cloudObr, i, tagAddr)
168 || processField<tensor>(cloudObr, i, tagAddr)
174 <<
"Unable to find field " << nameVsBinWidth_[i].first()
175 <<
" in the " << cloudName_ <<
" cloud database" <<
endl;
185 const word& fieldName,
187 const scalar binWidth,
196 word fldName(fieldName);
215 const coordSet coords(fldName,
"x", std::move(xBin), std::move(distX));
217 writerPtr_->open(coords, baseTimeDir() / fldName);
218 fileName outFile = writerPtr_->write(fldName, distY);
219 writerPtr_->close(
true);
221 Log <<
" Wrote distribution of " << fieldName
222 <<
" to " << time_.relativePath(outFile) <<
endl;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
A primitive field of type <T> with automated input and output.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void append(const T &val)
Append an element at the end of the list.
virtual bool read()
Re-read model coefficients if they have changed.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
void size(const label n)
Older name for setAddressableSize.
A cloud is a registry collection of lagrangian particles.
static const word prefix
The prefix to local: lagrangian.
Holds list of sampling positions.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Particle-size distribution model wherein random samples are drawn from a given arbitrary probability ...
Accumulating histogram of values. Specified bin resolution automatic generation of bins.
A class for handling file names.
Abstract base-class for Time/database function objects.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Computes the natural logarithm of an input volScalarField.
Generates a particle distribution for lagrangian data at a given time.
void generateDistribution(const word &fieldName, const scalarField &field, const scalar binWidth, const label tag=-1)
Generate the distribution.
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Write the particleDistribution.
virtual bool read(const dictionary &)
Read the particleDistribution data.
Base class for writing single files from the function objects.
Registry of regIOobjects.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define WarningInFunction
Report a warning using Foam::Warning.
messageStream Info
Information stream (stdout output on master, null elsewhere)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
static constexpr const zero Zero
Global zero (0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
word setFormat(propsDict.getOrDefault< word >("setFormat", "vtk"))