Go to the documentation of this file.
35 template<
class ParcelType>
40 template<
class ParcelType>
43 sizeof(MPPICParcel<ParcelType>) -
sizeof(ParcelType)
49 template<
class ParcelType>
63 if (is.
format() == IOstream::ASCII)
73 readRawScalar(is, UCorrect_.data(), vector::nComponents);
79 is.
read(
reinterpret_cast<char*
>(&UCorrect_), sizeofFields);
87 template<
class ParcelType>
88 template<
class CloudType>
91 bool valid =
c.size();
97 c.fieldIOobject(
"UCorrect", IOobject::MUST_READ),
100 c.checkFieldIOobject(
c, UCorrect);
105 p.UCorrect_ = UCorrect[i];
112 template<
class ParcelType>
113 template<
class CloudType>
118 const label np =
c.size();
121 UCorrect(
c.fieldIOobject(
"UCorrect", IOobject::NO_READ), np);
127 UCorrect[i] =
p.UCorrect();
132 UCorrect.write(np > 0);
136 template<
class ParcelType>
145 ParcelType::writeProperties(
os, filters, delim, namesOnly);
148 #define writeProp(Name, Value) \
149 ParcelType::writeProperty(os, Name, Value, namesOnly, delim, filters)
157 template<
class ParcelType>
158 template<
class CloudType>
165 ParcelType::readObjects(
c, obr);
167 if (!
c.size())
return;
169 const auto& UCorrect = cloud::lookupIOField<vector>(
"UCorrect", obr);
174 p.UCorrect() = UCorrect[i];
181 template<
class ParcelType>
182 template<
class CloudType>
189 ParcelType::writeObjects(
c, obr);
191 const label np =
c.size();
193 auto& UCorrect = cloud::createIOField<vector>(
"UCorrect", np, obr);
198 UCorrect[i] =
p.UCorrect();
207 template<
class ParcelType>
214 if (
os.format() == IOstream::ASCII)
216 os << static_cast<const ParcelType&>(
p)
217 << token::SPACE <<
p.UCorrect();
221 os << static_cast<const ParcelType&>(
p);
224 reinterpret_cast<const char*
>(&
p.UCorrect_),
225 MPPICParcel<ParcelType>::sizeofFields
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
A class for handling words, derived from Foam::string.
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.
A class for handling character strings derived from std::string.
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly=false) const
Write individual parcel properties to stream.
Mesh consisting of general polyhedral cells.
#define writeProp(Name, Value)
Registry of regIOobjects.
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)....
static void readFields(CloudType &c)
Read.
Wrapper around kinematic parcel types to add MPPIC modelling.
static void writeFields(const CloudType &c)
Write.
static const std::size_t sizeofFields
Size in bytes of the fields.
static void writeObjects(const CloudType &c, objectRegistry &obr)
Write particle fields as objects into the obr registry.
Templated base class for dsmc cloud.
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.
A List of wordRe with additional matching capabilities.
const dimensionedScalar c
Speed of light in a vacuum.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static void readObjects(CloudType &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
MPPICParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from mesh, coordinates and topology.
void writeFields(const fvMesh &mesh, const wordHashSet &selectedFields, const bool writeFaceFields)
virtual Istream & read(token &)=0
Return next token from stream.