99 c.checkFieldIOobject(c, tag);
102 c.checkFieldIOobject(c, soi);
105 c.checkFieldIOobject(c, d);
108 c.checkFieldIOobject(c,
U);
136 const label np = c.size();
145 for (
const injectedParticle&
p : c)
177 #define writeProp(Name, Value) \
178 particle::writeProperty(os, Name, Value, namesOnly, delim, filters)
197 if (!c.size())
return;
220 const Cloud<injectedParticle>& c,
227 const label np = c.size();
236 for (
const injectedParticle&
p : c)
256 positionsCompat1706
p;
260 offsetof(positionsCompat1706, facei)
261 - offsetof(positionsCompat1706, position));
263 p.position = position_;
266 os.
write(
reinterpret_cast<const char*
>(&
p.position),
s);
279 const injectedParticle&
p
297 reinterpret_cast<const char*
>(&
p.tag_),
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Base cloud calls templated on particle type.
A primitive field of type <T> with automated input and output.
@ NO_READ
Nothing to be read.
@ MUST_READ
Reading required.
streamFormat format() const noexcept
Get the current stream format.
@ ASCII
"ascii" (normal default)
virtual bool check(const char *operation) const
Check IOstream status for given operation.
bool fatalCheckNativeSizes(const char *operation) const
Assert that the label/scalar byte-size associated with the stream are the native label/scalar sizes.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
virtual Istream & read(token &)=0
Return next token from stream.
virtual Ostream & write(const char c) override
Write character.
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.
static const IOField< Type > & lookupIOField(const word &fieldName, const objectRegistry &obr)
Lookup an IOField within object registry.
static IOField< Type > & createIOField(const word &fieldName, const label nParticle, objectRegistry &obr)
Helper to construct IOField on a supplied object registry.
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.
static const std::size_t sizeofFields
Size in bytes of the fields.
const vector & U() const noexcept
Return const access to velocity.
static void writeObjects(const Cloud< injectedParticle > &c, objectRegistry &obr)
Write particle fields as objects into the obr registry.
static void readObjects(Cloud< injectedParticle > &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
scalar d() const noexcept
Return const access to diameter.
static void writeFields(const Cloud< injectedParticle > &c)
Write fields.
label tag() const noexcept
Return const access to the tag.
scalar soi() const noexcept
Return const access to the start of injection.
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly) const
Write individual parcel properties to stream.
scalar soi_
Start of injection [s].
virtual void writePosition(Ostream &) const
Write the particle position and cell.
injectedParticle(const polyMesh &mesh, const vector &position, const label celli=-1)
Construct from a position and a cell.
Registry of regIOobjects.
vector position() const
Return current particle position.
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
static void writeObjects(const CloudType &c, objectRegistry &obr)
Write particle fields as objects into the obr registry.
const polyMesh & mesh() const noexcept
Return the mesh database.
static string propertyList()
static void readObjects(CloudType &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
static bool writeLagrangianPositions
Write particle positions file (v1706 format and earlier) Default is true (disable in etc/controlDict)...
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly) const
Write individual particle properties to stream.
label cell() const noexcept
Return current cell particle is in.
particle(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from components.
static string propertyList_
String representation of properties.
static bool writeLagrangianCoordinates
Write particle coordinates file (v1712 and later) Default is true.
static void writeFields(const TrackCloudType &c)
Write the fields associated with the owner cloud.
Mesh consisting of general polyhedral cells.
A class for handling character strings derived from std::string.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
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))
#define writeProp(Name, Value)
const dimensionedScalar c
Speed of light in a vacuum.
static constexpr const zero Zero
Global zero (0).
Old particle positions content for OpenFOAM-1706 and earlier.