36template<
class ParcelType>
45template<
class ParcelType>
78template<
class ParcelType>
81 const bool readOnProc = c.size();
83 ParcelType::readFields(c);
86 c.checkFieldIOobject(c,
U);
89 c.checkFieldIOobject(c, Ei);
96 c.checkFieldIOobject(c, typeId);
99 for (DSMCParcel<ParcelType>&
p : c)
109template<
class ParcelType>
112 const Cloud<DSMCParcel<ParcelType>>& c
115 ParcelType::writeFields(c);
117 const label np = c.size();
118 const bool writeOnProc = c.size();
125 for (
const DSMCParcel<ParcelType>&
p : c)
129 typeId[i] =
p.typeId();
133 U.write(writeOnProc);
134 Ei.write(writeOnProc);
135 typeId.write(writeOnProc);
141template<
class ParcelType>
142Foam::Ostream& Foam::operator<<
160 reinterpret_cast<const char*
>(&
p.U_),
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Base cloud calls templated on particle type.
label typeId_
Parcel type id.
label typeId() const
Return type id.
const vector & U() const
Return const access to velocity.
static const std::size_t sizeofFields
Size in bytes of the fields.
scalar Ei() const
Return const access to internal energy.
static void readFields(Cloud< DSMCParcel< ParcelType > > &c)
static void writeFields(const Cloud< DSMCParcel< ParcelType > > &c)
DSMCParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti, const vector &U, const scalar Ei, const label typeId)
Construct from components.
vector U_
Velocity of Parcel [m/s].
scalar Ei_
Internal energy of the Parcel, covering all non-translational.
A primitive field of type <T> with automated input and output.
@ NO_READ
Nothing to be read.
@ MUST_READ
Reading required.
streamFormat format() const noexcept
Get the current stream format.
@ ASCII
"ascii" (normal default)
virtual bool check(const char *operation) const
Check IOstream status for given operation.
bool fatalCheckNativeSizes(const char *operation) const
Assert that the label/scalar byte-size associated with the stream are the native label/scalar sizes.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
virtual Istream & read(token &)=0
Return next token from stream.
virtual Ostream & write(const char c) override
Write character.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Mesh consisting of general polyhedral cells.
OBJstream os(runTime.globalPath()/outputName)
static constexpr const zero Zero
Global zero (0).