36 template<
class ParcelType>
41 template<
class ParcelType>
44 sizeof(KinematicParcel<ParcelType>)
45 - offsetof(KinematicParcel<ParcelType>, active_)
51 template<
class ParcelType>
89 else if (!is.checkLabelSize<>() || !is.checkScalarSize<>())
98 readRawScalar(is, &
d_);
101 readRawScalar(is, &
rho_);
102 readRawScalar(is, &
age_);
103 readRawScalar(is, &
tTurb_);
119 template<
class ParcelType>
120 template<
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];
225 template<
class ParcelType>
226 template<
class CloudType>
231 const label np =
c.size();
232 const bool valid = np;
236 IOField<scalar> nParticle
252 for (
const KinematicParcel<ParcelType>&
p :
c)
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);
283 template<
class ParcelType>
292 ParcelType::writeProperties(
os, filters, delim, namesOnly);
295 #define writeProp(Name, Value) \
296 ParcelType::writeProperty(os, Name, Value, namesOnly, delim, filters)
314 template<
class ParcelType>
315 template<
class CloudType>
322 ParcelType::readObjects(
c, obr);
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];
359 template<
class ParcelType>
360 template<
class CloudType>
367 ParcelType::writeObjects(
c, obr);
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);
385 for (
const KinematicParcel<ParcelType>&
p :
c)
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();
406 template<
class ParcelType>
410 const KinematicParcel<ParcelType>&
p
415 os << static_cast<const ParcelType&>(
p)
430 os << static_cast<const ParcelType&>(
p);
433 reinterpret_cast<const char*
>(&
p.active_),