36template<
class ParcelType>
41template<
class ParcelType>
44 sizeof(KinematicParcel<ParcelType>)
45 - offsetof(KinematicParcel<ParcelType>, active_)
51template<
class ParcelType>
98 readRawScalar(is, &
d_);
101 readRawScalar(is, &
rho_);
102 readRawScalar(is, &
age_);
103 readRawScalar(is, &
tTurb_);
119template<
class ParcelType>
120template<
class CloudType>
123 const bool valid = c.size();
132 c.checkFieldIOobject(c, active);
139 c.checkFieldIOobject(c, typeId);
146 c.checkFieldIOobject(c, nParticle);
153 c.checkFieldIOobject(c, d);
160 c.checkFieldIOobject(c, dTarget);
167 c.checkFieldIOobject(c,
U);
174 c.checkFieldIOobject(c,
rho);
181 c.checkFieldIOobject(c, age);
188 c.checkFieldIOobject(c, tTurb);
195 c.checkFieldIOobject(c, UTurb);
202 c.checkFieldIOobject(c, UCorrect);
208 p.active_ = active[i];
209 p.typeId_ = typeId[i];
210 p.nParticle_ = nParticle[i];
212 p.dTarget_ = dTarget[i];
218 p.UCorrect_ = UCorrect[i];
225template<
class ParcelType>
226template<
class CloudType>
231 const label np = c.size();
232 const bool valid = np;
254 active[i] =
p.active();
255 typeId[i] =
p.typeId();
256 nParticle[i] =
p.nParticle();
258 dTarget[i] =
p.dTarget();
262 tTurb[i] =
p.tTurb();
263 UTurb[i] =
p.UTurb();
264 UCorrect[i] =
p.UCorrect();
271 nParticle.
write(valid);
273 dTarget.
write(valid);
279 UCorrect.
write(valid);
283template<
class ParcelType>
295 #define writeProp(Name, Value) \
296 ParcelType::writeProperty(os, Name, Value, namesOnly, delim, filters)
314template<
class ParcelType>
315template<
class CloudType>
324 if (!c.size())
return;
326 const auto& active = cloud::lookupIOField<label>(
"active", obr);
327 const auto& typeId = cloud::lookupIOField<label>(
"typeId", obr);
328 const auto& nParticle = cloud::lookupIOField<scalar>(
"nParticle", obr);
329 const auto& d = cloud::lookupIOField<scalar>(
"d", obr);
330 const auto& dTarget = cloud::lookupIOField<scalar>(
"dTarget", obr);
331 const auto&
U = cloud::lookupIOField<vector>(
"U", obr);
332 const auto&
rho = cloud::lookupIOField<scalar>(
"rho", obr);
333 const auto& age = cloud::lookupIOField<scalar>(
"age", obr);
334 const auto& tTurb = cloud::lookupIOField<scalar>(
"tTurb", obr);
335 const auto& UTurb = cloud::lookupIOField<vector>(
"UTurb", obr);
336 const auto& UCorrect = cloud::lookupIOField<vector>(
"UCorrect", obr);
342 p.active_ = active[i];
343 p.typeId_ = typeId[i];
344 p.nParticle_ = nParticle[i];
346 p.dTarget_ = dTarget[i];
352 p.UCorrect_ = UCorrect[i];
359template<
class ParcelType>
360template<
class CloudType>
369 const label np = c.size();
371 auto& active = cloud::createIOField<label>(
"active", np, obr);
372 auto& typeId = cloud::createIOField<label>(
"typeId", np, obr);
373 auto& nParticle = cloud::createIOField<scalar>(
"nParticle", np, obr);
374 auto& d = cloud::createIOField<scalar>(
"d", np, obr);
375 auto& dTarget = cloud::createIOField<scalar>(
"dTarget", np, obr);
376 auto&
U = cloud::createIOField<vector>(
"U", np, obr);
377 auto&
rho = cloud::createIOField<scalar>(
"rho", np, obr);
378 auto& age = cloud::createIOField<scalar>(
"age", np, obr);
379 auto& tTurb = cloud::createIOField<scalar>(
"tTurb", np, obr);
380 auto&& UTurb = cloud::createIOField<vector>(
"UTurb", np, obr);
381 auto&& UCorrect = cloud::createIOField<vector>(
"UCorrect", np, obr);
387 active[i] =
p.active();
388 typeId[i] =
p.typeId();
389 nParticle[i] =
p.nParticle();
391 dTarget[i] =
p.dTarget();
395 tTurb[i] =
p.tTurb();
396 UTurb[i] =
p.UTurb();
397 UCorrect[i] =
p.UCorrect();
406template<
class ParcelType>
415 os << static_cast<const ParcelType&>(
p)
430 os << static_cast<const ParcelType&>(
p);
433 reinterpret_cast<const char*
>(&
p.active_),
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Templated base class for dsmc cloud.
A primitive field of type <T> with automated input and output.
streamFormat format() const noexcept
Get the current stream format.
std::enable_if< std::is_integral< T >::value, bool >::type checkLabelSize() const noexcept
virtual bool check(const char *operation) const
Check IOstream status for given operation.
std::enable_if< std::is_floating_point< T >::value, bool >::type checkScalarSize() const noexcept
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
virtual bool endRawRead()=0
End of low-level raw binary read.
virtual bool beginRawRead()=0
Start of low-level raw binary read.
virtual Istream & read(token &)=0
Return next token from stream.
Kinematic parcel class with rotational motion (as spherical particles only) and one/two-way coupling ...
label typeId_
Parcel type id.
vector UTurb_
Turbulent velocity fluctuation [m/s].
scalar rho_
Density [kg/m3].
label active_
Active flag - tracking inactive when active = false.
static void readFields(TrackCloudType &c)
Read.
scalar tTurb_
Time spent in turbulent eddy [s].
scalar dTarget_
Target diameter [m].
static const std::size_t sizeofFields
Size in bytes of the fields.
static void readObjects(CloudType &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
vector UCorrect_
Velocity correction due to collisions MPPIC [m/s].
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly=false) const
Write individual parcel properties to stream.
vector U_
Velocity of Parcel [m/s].
scalar nParticle_
Number of particles in Parcel.
virtual Ostream & write(const char c)
Write character.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Cmpt * data() noexcept
Return pointer to the first data element.
void writeFields() const
Write fields.
Reads fields from the time directories and adds them to the mesh database for further post-processing...
Allows specification of different writing frequency of objects registered to the database.
static void readObjects(Cloud< injectedParticle > &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly) const
Write individual parcel properties to stream.
Registry of regIOobjects.
static constexpr direction nComponents
Number of components in bool is 1.
static string propertyList()
Mesh consisting of general polyhedral cells.
virtual bool write(const bool valid=true) const
Write using setting from DB.
A class for handling character strings derived from std::string.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
#define writeProp(Name, Value)
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
label readRawLabel(Istream &is)
Read raw label from binary stream.