42 sizeof(injectedParticle) - offsetof(injectedParticle, tag_)
80 readRawScalar(is, &
soi_);
81 readRawScalar(is, &
d_);
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_),
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.
streamFormat format() const noexcept
Get the current stream format.
std::enable_if< std::is_integral< T >::value, bool >::type checkLabelSize() const noexcept
virtual bool check(const char *operation) const
Check IOstream status for given operation.
std::enable_if< std::is_floating_point< T >::value, bool >::type checkScalarSize() const noexcept
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
virtual bool endRawRead()=0
End of low-level raw binary read.
virtual bool beginRawRead()=0
Start of low-level raw binary read.
virtual Istream & read(token &)=0
Return next token from stream.
virtual Ostream & write(const char c)
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.
void writeFields() const
Write fields.
Reads fields from the time directories and adds them to the mesh database for further post-processing...
Allows specification of different writing frequency of objects registered to the database.
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.
static void readObjects(Cloud< injectedParticle > &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
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.
Registry of regIOobjects.
static constexpr direction nComponents
Number of components in bool is 1.
vector position() const
Return current particle position.
static string propertyList()
static void readObjects(CloudType &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
static bool writeLagrangianPositions
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly) const
Write individual particle properties to stream.
static string propertyList_
String representation of properties.
static bool writeLagrangianCoordinates
Mesh consisting of general polyhedral cells.
virtual bool write(const bool valid=true) const
Write using setting from DB.
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)
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
label readRawLabel(Istream &is)
Read raw label from binary stream.
Old particle positions content for OpenFOAM-1706 and earlier.