36const std::size_t Foam::particle::sizeofPosition
38 offsetof(particle, facei_) - offsetof(particle, coordinates_)
41const std::size_t Foam::particle::sizeofFields
43 sizeof(particle) - offsetof(particle, coordinates_)
53 const bool readFields,
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);
133 is >>
p.position >>
p.celli;
157 readRawScalar(is, &
p.stepFraction);
176 is.
read(
reinterpret_cast<char*
>(&
p.position),
s);
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);
280 p.position = position();
283 os.
write(
reinterpret_cast<const char*
>(&
p.position),
s);
308 reinterpret_cast<const char*
>(&
p.coordinates_),
309 particle::sizeofFields
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
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,...
Inter-processor communications stream.
T * data() noexcept
Return pointer to the underlying array serving as data storage.
static constexpr direction nComponents
Number of components in bool is 1.
vector position() const
Return current particle position.
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
void readData(Istream &is, point &position, const bool readFields, const bool newFormat, const bool doLocate)
Read particle from stream. Optionally (for old format) return.
static string propertyList()
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.
virtual void writePosition(Ostream &os) const
Write the particle position and cell id.
void writeCoordinates(Ostream &os) const
Write the particle barycentric coordinates and cell info.
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)
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
label readRawLabel(Istream &is)
Read raw label from binary stream.
Old particle positions content for OpenFOAM-1706 and earlier.