34 template<
class ParcelType>
39 template<
class ParcelType>
48 template<
class ParcelType>
75 readRawScalar(is, &
mass0_);
93 template<
class ParcelType>
94 template<
class CloudType>
101 template<
class ParcelType>
102 template<
class CloudType,
class CompositionType>
106 const CompositionType& compModel
109 const bool readOnProc =
c.size();
118 c.checkFieldIOobject(
c, mass0);
129 const wordList& phaseTypes = compModel.phaseTypes();
130 const label nPhases = phaseTypes.
size();
132 if (compModel.nPhase() == 1)
134 stateLabels = compModel.stateLabels()[0];
139 for (ReactingParcel<ParcelType>&
p :
c)
151 "Y" + phaseTypes[j] + stateLabels[j],
158 for (ReactingParcel<ParcelType>&
p :
c)
168 template<
class ParcelType>
169 template<
class CloudType>
176 template<
class ParcelType>
177 template<
class CloudType,
class CompositionType>
181 const CompositionType& compModel
186 const label np =
c.size();
187 const bool writeOnProc =
c.size();
199 mass0.
write(writeOnProc);
202 const wordList& phaseTypes = compModel.phaseTypes();
203 wordList stateLabels(phaseTypes.size(),
"");
204 if (compModel.nPhase() == 1)
206 stateLabels = compModel.stateLabels()[0];
215 "Y" + phaseTypes[j] + stateLabels[j],
222 for (
const ReactingParcel<ParcelType>&
p :
c)
229 Y.write(writeOnProc);
235 template<
class ParcelType>
239 const wordRes& filters,
244 ParcelType::writeProperties(
os, filters, delim, namesOnly);
247 #define writeProp(Name, Value) \ 248 ParcelType::writeProperty(os, Name, Value, namesOnly, delim, filters) 257 template<
class ParcelType>
258 template<
class CloudType>
265 ParcelType::readObjects(
c, obr);
269 template<
class ParcelType>
270 template<
class CloudType>
277 ParcelType::writeObjects(
c, obr);
281 template<
class ParcelType>
282 template<
class CloudType,
class CompositionType>
286 const CompositionType& compModel,
290 ParcelType::readObjects(
c, obr);
292 if (!
c.size())
return;
295 auto& mass0 = cloud::lookupIOField<scalar>(
"mass0", obr);
306 const wordList& phaseTypes = compModel.phaseTypes();
307 wordList stateLabels(phaseTypes.size(),
"");
308 if (compModel.nPhase() == 1)
310 stateLabels = compModel.stateLabels()[0];
315 const word fieldName =
"Y" + phaseTypes[j] + stateLabels[j];
316 auto&
Y = cloud::lookupIOField<scalar>(fieldName, obr);
319 for (ReactingParcel<ParcelType>&
p :
c)
329 template<
class ParcelType>
330 template<
class CloudType,
class CompositionType>
334 const CompositionType& compModel,
338 ParcelType::writeObjects(
c, obr);
340 const label np =
c.size();
341 const bool writeOnProc =
c.size();
345 auto& mass0 = cloud::createIOField<scalar>(
"mass0", np, obr);
348 for (
const ReactingParcel<ParcelType>&
p :
c)
356 const wordList& phaseTypes = compModel.phaseTypes();
357 wordList stateLabels(phaseTypes.size(),
"");
358 if (compModel.nPhase() == 1)
360 stateLabels = compModel.stateLabels()[0];
365 const word fieldName =
"Y" + phaseTypes[j] + stateLabels[j];
366 auto&
Y = cloud::createIOField<scalar>(fieldName, np, obr);
369 for (
const ReactingParcel<ParcelType>&
p :
c)
382 template<
class ParcelType>
386 const ReactingParcel<ParcelType>&
p 391 os << static_cast<const ParcelType&>(
p)
397 os << static_cast<const ParcelType&>(
p);
400 reinterpret_cast<const char*>(&
p.mass0_),
void size(const label n)
Older name for setAddressableSize.
static void writeObjects(const CloudType &c, objectRegistry &obr)
Write particle fields as objects into the obr registry.
DSMCCloud< dsmcParcel > CloudType
std::enable_if< std::is_floating_point< T >::value, bool >::type checkScalarSize() const noexcept
Check if the scalar byte-size associated with the stream is the same as the given type...
virtual Ostream & write(const char c) override
Write character.
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
scalarField Y_
Mass fractions of mixture [].
ReactingParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from mesh, coordinates and topology.
virtual bool endRawRead()=0
End of low-level raw binary read.
static void writeFields(const CloudType &c, const CompositionType &compModel)
Write - composition supplied.
#define forAll(list, i)
Loop across all elements in list.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
static void readFields(CloudType &c, const CompositionType &compModel)
Read - composition supplied.
void setSize(const label n)
Alias for resize()
virtual Istream & read(token &)=0
Return next token from stream.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly=false) const
Write individual parcel properties to stream.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
void writeFields(const fvMesh &mesh, const wordHashSet &selectedFields, const bool writeFaceFields)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
static const std::size_t sizeofFields
Size in bytes of the fields.
List< word > wordList
List of word.
virtual bool beginRawRead()=0
Start of low-level raw binary read.
PtrList< volScalarField > & Y
const dimensionedScalar c
Speed of light in a vacuum.
std::enable_if< std::is_integral< T >::value, bool >::type checkLabelSize() const noexcept
Check if the label byte-size associated with the stream is the same as the given type.
#define writeProp(Name, Value)
Mesh consisting of general polyhedral cells.
Reacting parcel class with one/two-way coupling with the continuous phase.
Registry of regIOobjects.
scalar mass0_
Initial mass [kg].
A class for handling character strings derived from std::string.
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.
static void readObjects(CloudType &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.