40 namespace functionObjects
49 bool Foam::functionObjects::dataCloud::writeCloud
51 const fileName& outputName,
63 const auto& currCloud = *cloudPtr;
78 currCloud.writeObjects(obrTmp);
99 const label nTotParcels =
returnReduce(nParcels, sumOp<label>());
104 Log <<
"After filtering using " << nTotParcels <<
'/' 121 writeField<label>(outputName, obrTmp)
122 || writeField<scalar>(outputName, obrTmp)
123 || writeField<vector>(outputName, obrTmp)
130 Foam::functionObjects::dataCloud::dataCloud
139 precision_(
IOstream::defaultPrecision()),
152 const int padWidth =
dict.getOrDefault<
int>(
"width", 8);
155 if (padWidth < 1 || padWidth > 31)
161 printf_ =
"%0" + std::to_string(padWidth) +
"d";
168 selectClouds_.clear();
169 dict.readIfPresent(
"clouds", selectClouds_);
170 selectClouds_.uniq();
172 if (selectClouds_.empty())
177 selectClouds_.push_back(std::move(
cloudName));
181 dict.readEntry(
"field", fieldName_);
184 parcelSelect_ =
dict.subOrEmptyDict(
"selection");
187 if (fileName dir;
dict.readIfPresent(
"directory", dir) && !dir.empty())
191 if (dir.isAbsolute())
193 outputDir_ = std::move(dir);
197 outputDir_ = time_.globalPath()/dir;
224 selectClouds_.empty()
225 ? mesh_.sortedNames<
cloud>()
229 if (cloudNames.empty())
234 const word timeDesc =
"_" +
241 Log <<
name() <<
" output Time: " << time_.timeName() <<
nl;
258 << time_.relativePath(outputName) <<
endl;
static const IOField< point > * findIOPosition(const objectRegistry &obr)
Locate the "position" IOField within object registry.
defineTypeNameAndDebug(ObukhovLength, 0)
unsigned int count(const bool on=true) const
Count number of bits set.
A class for handling file names.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static unsigned int defaultPrecision() noexcept
Return the default precision.
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
Ignore writing from objectRegistry::writeObject()
const Time & time() const
Return the top-level database.
bitSet parcelAddr_
The filtered parcel addressing. Eg, for the current cloud.
static void reduceOr(bool &value, const int communicator=UPstream::worldComm)
Logical (or) reduction (MPI_AllReduce)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
bool read(const char *buf, int32_t &val)
Same as readInt32.
virtual bool execute()
Execute the function-object operations, currently does nothing.
virtual bool write()
Write the function-object results.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
const word cloudName(propsDict.get< word >("cloud"))
A class for handling words, derived from Foam::string.
A cloud is a registry collection of lagrangian particles.
wordList sortedNames() const
The sorted names of all objects.
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
bool log
Flag to write log into Info.
bool calculateFilter(const objectRegistry &obrTmp, const bool log=true)
Calculate parcel selection filter.
static word printf(const char *fmt, const PrimitiveType &val)
Use a printf-style formatter for a primitive.
const word & constant() const noexcept
Return constant name.
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
An IOstream is an abstract base class for all input/output systems; be they streams, files, token lists etc.
decomposeUsingBbs false
Use bounding boxes (default) or unique decomposition of triangles (i.e. do not duplicate triangles) ...
static word outputPrefix
Directory prefix.
static bool master(label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
virtual bool read(const dictionary &dict)
Read optional controls.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
const fvMesh & mesh_
Reference to the fvMesh.
Do not request registration (bool: false)