38 namespace functionObjects
62 cloudName_(
"unknown-cloudName"),
63 tagFieldName_(
"none"),
86 dict.subOrEmptyDict(
"formatOptions").optionalSubDict(
setFormat)
115 <<
"Unable to find cloud " << cloudName_
116 <<
" in the mesh database. Available clouds include:" 122 const cloud&
c = *cloudPtr;
128 scopedName(
"CloudRegistry"),
129 mesh_.time().timeName(),
137 c.writeObjects(cloudObr);
142 tagFieldName_ !=
"none" 150 const label tagMax = tagMap.size();
155 label newTag = tagMap[tag[i]];
156 tagAddr[newTag].
append(i);
161 forAll(nameVsBinWidth_, i)
165 processField<scalar>(cloudObr, i, tagAddr)
166 || processField<vector>(cloudObr, i, tagAddr)
167 || processField<tensor>(cloudObr, i, tagAddr)
168 || processField<sphericalTensor>(cloudObr, i, tagAddr)
169 || processField<symmTensor>(cloudObr, i, tagAddr)
170 || processField<tensor>(cloudObr, i, tagAddr)
176 <<
"Unable to find field " << nameVsBinWidth_[i].first()
177 <<
" in the " << cloudName_ <<
" cloud database" <<
endl;
187 const word& fieldName,
189 const scalar binWidth,
198 word fldName(fieldName);
204 distributionModels::general distribution
211 Field<scalar> distX(distribution.x());
212 Field<scalar> distY(distribution.y());
215 xBin.
replace(vector::X, distX);
217 const coordSet coords(fldName,
"x", std::move(xBin), std::move(distX));
219 writerPtr_->open(coords, baseTimeDir() / fldName);
220 fileName outFile = writerPtr_->write(fldName, distY);
221 writerPtr_->close(
true);
223 Log <<
" Wrote distribution of " << fieldName
224 <<
" to " << time_.relativePath(outFile) <<
endl;
virtual bool execute()
Execute, currently does nothing.
defineTypeNameAndDebug(ObukhovLength, 0)
dimensionedScalar log(const dimensionedScalar &ds)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
void append(const T &val)
Append an element at the end of the list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void generateDistribution(const word &fieldName, const scalarField &field, const scalar binWidth, const label tag=-1)
Generate the distribution.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ignore writing from objectRegistry::writeObject()
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
particleDistribution(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
virtual bool read(const dictionary &)
Read the particleDistribution data.
const word & name() const noexcept
Return the name of this functionObject.
virtual bool write()
Write the particleDistribution.
#define forAll(list, i)
Loop across all elements in list.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
static autoPtr< coordSetWriter > New(const word &writeFormat)
Return a reference to the selected writer.
vectorField pointField
pointField is a vectorField.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
A cloud is a registry collection of lagrangian particles.
virtual const word & type() const =0
Runtime type information.
word tagFieldName_
Tag field name - used to filter the particles into groups.
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
virtual bool read(const dictionary &dict)
Read.
List< Tuple2< word, scalar > > nameVsBinWidth_
List of field name vs. bin width.
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionedScalar c
Speed of light in a vacuum.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual bool read(const dictionary &dict)
Read optional controls.
autoPtr< coordSetWriter > writerPtr_
Writer.
word setFormat(propsDict.getOrDefault< word >("setFormat", "vtk"))
Registry of regIOobjects.
Defines the attributes of an object for which implicit objectRegistry management is supported...
A primitive field of type <T> with automated input and output.
word cloudName_
Cloud name.
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)
static const word prefix
The prefix to local: lagrangian.