Go to the documentation of this file.
42 sizeof(injectedParticle) - offsetof(injectedParticle, tag_)
68 position_ = particle::position();
70 if (is.
format() == IOstream::ASCII)
72 is >> tag_ >> soi_ >> d_ >> U_;
80 readRawScalar(is, &soi_);
81 readRawScalar(is, &d_);
82 readRawScalar(is, U_.data(), vector::nComponents);
88 is.
read(
reinterpret_cast<char*
>(&tag_), sizeofFields);
108 c.checkFieldIOobject(
c,
tag);
111 c.checkFieldIOobject(
c,
soi);
114 c.checkFieldIOobject(
c,
d);
117 c.checkFieldIOobject(
c,
U);
186 #define writeProp(Name, Value) \
187 particle::writeProperty(os, Name, Value, namesOnly, delim, filters)
206 if (!
c.size())
return;
208 const auto& tag = cloud::lookupIOField<label>(
"tag", obr);
209 const auto& soi = cloud::lookupIOField<scalar>(
"soi", obr);
210 const auto& d = cloud::lookupIOField<scalar>(
"d", obr);
211 const auto&
U = cloud::lookupIOField<vector>(
"U", obr);
236 const label np =
c.size();
238 auto& tag = cloud::createIOField<label>(
"tag", np, obr);
239 auto& soi = cloud::createIOField<scalar>(
"soi", np, obr);
240 auto& d = cloud::createIOField<scalar>(
"d", np, obr);
241 auto&
U = cloud::createIOField<vector>(
"U", np, obr);
272 p.position = position_;
275 os.
write(
reinterpret_cast<const char*
>(&
p.position),
s);
295 os << static_cast<const particle&>(
p)
303 os << static_cast<const particle&>(
p);
306 reinterpret_cast<const char*
>(&
p.tag_),
scalar d() const
Return const access to diameter.
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.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
static void writeFields(const Cloud< injectedParticle > &c)
Write fields.
static constexpr const zero Zero
Global zero (0)
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.
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
static void writeFields(const TrackCloudType &c)
Write the fields associated with the owner cloud.
A class for handling character strings derived from std::string.
static void readObjects(Cloud< injectedParticle > &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
const vector & U() const
Return const access to velocity.
Mesh consisting of general polyhedral cells.
static bool writeLagrangianPositions
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly) const
Write individual particle properties to stream.
Registry of regIOobjects.
static void writeObjects(const CloudType &c, objectRegistry &obr)
Write particle fields as objects into the obr registry.
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 string propertyList()
std::enable_if< std::is_integral< T >::value, bool >::type checkLabelSize() const
label tag() const
Return const access to the tag.
Primarily stores particle properties so that it can be injected at a later time. Note that this store...
static void readFields(Cloud< injectedParticle > &c)
Read fields.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
#define writeProp(Name, Value)
static string propertyList_
String representation of properties.
injectedParticle(const polyMesh &mesh, const vector &position, const label celli=-1)
Construct from a position and a cell.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
static const std::size_t sizeofFields
Size in bytes of the fields.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
static bool writeLagrangianCoordinates
Old particle positions content for OpenFOAM-1706 and earlier.
scalar soi() const
Return const access to the start of injection.
virtual bool beginRawRead()=0
Start of low-level raw binary read.
std::enable_if< std::is_floating_point< T >::value, bool >::type checkScalarSize() const
A List of wordRe with additional matching capabilities.
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly) const
Write individual parcel properties to stream.
static void writeObjects(const Cloud< injectedParticle > &c, objectRegistry &obr)
Write particle fields as objects into the obr registry.
const dimensionedScalar c
Speed of light in a vacuum.
virtual void writePosition(Ostream &) const
Write the particle position and cell.
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,...
A cell is defined as a list of faces with extra functionality.
virtual Istream & read(token &)=0
Return next token from stream.