49bool Foam::functionObjects::dataCloud::writeCloud
63 const auto& currCloud = *cloudPtr;
78 currCloud.writeObjects(obrTmp);
95 applyFilter_ ?
parcelAddr_.count() : pointsPtr->size()
99 const label nTotParcels =
returnReduce(nParcels, sumOp<label>());
104 Log <<
"After filtering using " << nTotParcels <<
'/'
130Foam::functionObjects::dataCloud::dataCloud
139 precision_(
IOstream::defaultPrecision()),
155 const int padWidth =
dict.getOrDefault<
int>(
"width", 8);
158 if (padWidth < 1 || padWidth > 31)
164 printf_ =
"%0" + std::to_string(padWidth) +
"d";
171 selectClouds_.clear();
172 dict.readIfPresent(
"clouds", selectClouds_);
173 selectClouds_.uniq();
175 if (selectClouds_.empty())
180 selectClouds_.push_back(std::move(
cloudName));
184 dict.readEntry(
"field", fieldName_);
187 parcelSelect_ =
dict.subOrEmptyDict(
"selection");
192 dict.readIfPresent(
"directory", directory_);
194 if (directory_.size())
198 if (!directory_.isAbsolute())
200 directory_ = time_.globalPath()/directory_;
224 selectClouds_.empty()
225 ? mesh_.sortedNames<
cloud>()
229 if (cloudNames.empty())
234 const word timeDesc =
"_" +
241 Log <<
name() <<
" output Time: " << time_.timeName() <<
nl;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
const word cloudName(propsDict.get< word >("cloud"))
bitSet parcelAddr_
The filtered parcel addressing. Eg, for the current cloud.
bool calculateFilter(const objectRegistry &obrTmp, const bool log=true)
Calculate parcel selection filter.
dictionary parcelSelect_
The filtered parcel addressing. Eg, for the current cloud.
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
An IOstream is an abstract base class for all input/output systems; be they streams,...
static unsigned int defaultPrecision() noexcept
Return the default precision.
const word & constant() const noexcept
Return constant name.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
bool empty() const noexcept
True if List is empty (ie, size() is zero).
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
static void reduceOr(bool &value, const int communicator=worldComm)
Logical (or) reduction (MPI_AllReduce).
A cloud is a registry collection of lagrangian particles.
static const IOField< point > * findIOPosition(const objectRegistry &obr)
Locate the "position" IOField within object registry.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
Abstract base-class for Time/database function objects.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
static word outputPrefix
Directory prefix.
bool log
Flag to write log into Info.
This functionObject writes cloud positions in ASCII.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
virtual bool execute()
Execute the function-object operations, currently does nothing.
virtual bool write()
Write the function-object results.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const fvMesh & mesh_
Reference to the fvMesh.
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
const Time & time_
Reference to the time database.
const Time & time() const
Return the top-level database.
wordList sortedNames() const
The sorted names of all objects.
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
A class for handling words, derived from Foam::string.
static word printf(const char *fmt, const PrimitiveType &val)
Use a printf-style formatter for a primitive.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
word outputName("finiteArea-edges.obj")
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
List< word > wordList
List of word.
bool read(const char *buf, int32_t &val)
Same as readInt32.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
constexpr char nl
The newline '\n' character (0x0a).