36 const std::size_t Foam::particle::sizeofPosition
38 offsetof(particle, facei_) - offsetof(particle, coordinates_)
41 const std::size_t Foam::particle::sizeofFields
88 is >> coordinates_ >> celli_ >> tetFacei_ >> tetPti_;
91 is >> facei_ >> stepFraction_ >> origProc_ >> origId_;
108 readRawScalar(is, &stepFraction_);
119 is.
read(reinterpret_cast<char*>(&coordinates_), sizeofFields);
123 is.
read(reinterpret_cast<char*>(&coordinates_), sizeofPosition);
129 positionsCompat1706
p;
133 is >>
p.position >>
p.celli;
157 readRawScalar(is, &
p.stepFraction);
173 sizeof(positionsCompat1706)
174 - offsetof(positionsCompat1706, position)
176 is.
read(reinterpret_cast<char*>(&
p.position),
s);
183 offsetof(positionsCompat1706, facei)
184 - offsetof(positionsCompat1706, position)
186 is.
read(reinterpret_cast<char*>(&
p.position),
s);
193 stepFraction_ =
p.stepFraction;
194 origProc_ =
p.origProc;
199 position =
p.position;
209 "Particle initialised with a location outside of the mesh." 228 #define writeProp(Name, Value) \ 229 particle::writeProperty(os, Name, Value, namesOnly, delim, filters) 237 writeProp(
"stepFraction", stepFraction_);
256 os.
write(reinterpret_cast<const char*>(&coordinates_), sizeofPosition);
272 positionsCompat1706
p;
276 offsetof(positionsCompat1706, facei)
277 - offsetof(positionsCompat1706, position)
280 p.position = position();
283 os.
write(reinterpret_cast<const char*>(&
p.position),
s);
308 reinterpret_cast<const char*>(&
p.coordinates_),
309 particle::sizeofFields
virtual void writePosition(Ostream &os) const
Write the particle position and cell id.
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.
static string propertyList_
String representation of properties.
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)...
T * data() noexcept
Return pointer to the underlying array serving as data storage.
virtual bool endRawRead()=0
End of low-level raw binary read.
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
void readData(Istream &is, point &position, const bool readFields, const bool newFormat, const bool doLocate)
Read particle from stream. Optionally (for old format) return.
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.
A class for handling words, derived from Foam::string.
particle(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from components.
Inter-processor communications stream.
void writeCoordinates(Ostream &os) const
Write the particle barycentric coordinates and cell info.
A List of wordRe with additional matching capabilities.
static constexpr direction nComponents
Number of components in this vector space.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
label readRawLabel(Istream &is)
Read raw label from binary stream.
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
virtual bool beginRawRead()=0
Start of low-level raw binary read.
#define writeProp(Name, Value)
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.
Mesh consisting of general polyhedral cells.
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))
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 string propertyList()