80 readRawScalar(is, &
soi_);
81 readRawScalar(is, &
d_);
82 readRawScalar(is,
U_.data(), vector::nComponents);
108 c.checkFieldIOobject(
c, tag);
111 c.checkFieldIOobject(
c, soi);
114 c.checkFieldIOobject(
c, d);
117 c.checkFieldIOobject(
c,
U);
120 for (injectedParticle&
p :
c)
154 for (
const injectedParticle&
p :
c)
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);
229 const Cloud<injectedParticle>&
c,
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);
245 for (
const injectedParticle&
p :
c)
265 positionsCompat1706
p;
269 offsetof(positionsCompat1706, facei)
270 - offsetof(positionsCompat1706, position));
272 p.position = position_;
275 os.
write(reinterpret_cast<const char*>(&
p.position),
s);
288 const injectedParticle&
p 295 os << static_cast<const particle&>(
p)
303 os << static_cast<const particle&>(
p);
306 reinterpret_cast<const char*>(&
p.tag_),
virtual Ostream & write(const char c)
Write character.
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...
static string propertyList_
String representation of properties.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
injectedParticle(const polyMesh &mesh, const vector &position, const label celli=-1)
Construct from a position and a cell.
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly) const
Write individual parcel properties to stream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
#define writeProp(Name, Value)
Primarily stores particle properties so that it can be injected at a later time. Note that this store...
static bool writeLagrangianCoordinates
Write particle coordinates file (v1712 and later) Default is true.
virtual bool endRawRead()=0
End of low-level raw binary read.
static const std::size_t sizeofFields
Size in bytes of the fields.
virtual void writePosition(Ostream &) const
Write the particle position and cell.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
virtual Istream & read(token &)=0
Return next token from stream.
static void writeObjects(const Cloud< injectedParticle > &c, objectRegistry &obr)
Write particle fields as objects into the obr registry.
A class for handling words, derived from Foam::string.
A List of wordRe with additional matching capabilities.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
label readRawLabel(Istream &is)
Read raw label from binary stream.
static bool writeLagrangianPositions
Write particle positions file (v1706 format and earlier) Default is true (disable in etc/controlDict)...
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
virtual bool beginRawRead()=0
Start of low-level raw binary read.
static void readObjects(CloudType &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
const dimensionedScalar c
Speed of light in a vacuum.
static void writeFields(const TrackCloudType &c)
Write the fields associated with the owner cloud.
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.
static void readObjects(Cloud< injectedParticle > &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
Mesh consisting of general polyhedral cells.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type.
Registry of regIOobjects.
virtual bool write(const bool valid=true) const
Write using setting from DB.
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 writeObjects(const CloudType &c, objectRegistry &obr)
Write particle fields as objects into the obr registry.
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly) const
Write individual particle properties to stream.
A class for handling character strings derived from std::string.
streamFormat format() const noexcept
Get the current stream format.
vector position() const
Return current particle position.
static void writeFields(const Cloud< injectedParticle > &c)
Write fields.
static string propertyList()
scalar soi_
Start of injection [s].
static constexpr const zero Zero
Global zero (0)
static void readFields(Cloud< injectedParticle > &c)
Read fields.