Go to the documentation of this file.
36 template<
class ParcelType>
39 sizeof(DSMCParcel<ParcelType>) -
sizeof(ParcelType)
45 template<
class ParcelType>
61 if (is.
format() == IOstream::ASCII)
63 is >> U_ >> Ei_ >> typeId_;
71 readRawScalar(is, U_.data(), vector::nComponents);
72 readRawScalar(is, &Ei_);
79 is.
read(
reinterpret_cast<char*
>(&U_), sizeofFields);
87 template<
class ParcelType>
90 bool valid =
c.size();
95 c.checkFieldIOobject(
c,
U);
98 c.checkFieldIOobject(
c, Ei);
102 c.fieldIOobject(
"typeId", IOobject::MUST_READ),
105 c.checkFieldIOobject(
c, typeId);
112 p.typeId_ = typeId[i];
118 template<
class ParcelType>
130 IOField<label> typeId(
c.fieldIOobject(
"typeId", IOobject::NO_READ), np);
137 typeId[i] =
p.typeId();
143 typeId.write(np > 0);
149 template<
class ParcelType>
156 if (
os.format() == IOstream::ASCII)
158 os << static_cast<const ParcelType& >(
p)
159 << token::SPACE <<
p.U()
160 << token::SPACE <<
p.Ei()
161 << token::SPACE <<
p.typeId();
165 os << static_cast<const ParcelType& >(
p);
168 reinterpret_cast<const char*
>(&
p.U_),
169 DSMCParcel<ParcelType>::sizeofFields
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.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
A primitive field of type <T> with automated input and output.
static constexpr const zero Zero
Global zero (0)
streamFormat format() const noexcept
Get the current stream format.
Mesh consisting of general polyhedral cells.
static void readFields(Cloud< DSMCParcel< ParcelType >> &c)
std::enable_if< std::is_integral< T >::value, bool >::type checkLabelSize() const noexcept
virtual bool endRawRead()=0
End of low-level raw binary read.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
std::enable_if< std::is_floating_point< T >::value, bool >::type checkScalarSize() const noexcept
virtual bool check(const char *operation) const
Check IOstream status for given operation.
OBJstream os(runTime.globalPath()/outputName)
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
virtual bool beginRawRead()=0
Start of low-level raw binary read.
static void writeFields(const Cloud< DSMCParcel< ParcelType >> &c)
Base cloud calls templated on particle type.
const dimensionedScalar c
Speed of light in a vacuum.
label readRawLabel(Istream &is)
Read raw label from binary stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void writeFields(const fvMesh &mesh, const wordHashSet &selectedFields, const bool writeFaceFields)
static const std::size_t sizeofFields
Size in bytes of the fields.
virtual Istream & read(token &)=0
Return next token from stream.