36const std::size_t Foam::particle::sizeofPosition
38 offsetof(particle, facei_) - offsetof(particle, coordinates_)
41const std::size_t Foam::particle::sizeofFields
88 is >> coordinates_ >> celli_ >> tetFacei_ >> tetPti_;
91 is >> facei_ >> stepFraction_ >> origProc_ >> origId_;
101 is.
read(
reinterpret_cast<char*
>(&coordinates_), sizeofFields);
105 is.
read(
reinterpret_cast<char*
>(&coordinates_), sizeofPosition);
111 positionsCompat1706
p;
115 is >>
p.position >>
p.celli;
137 sizeof(positionsCompat1706)
138 - offsetof(positionsCompat1706, position)
140 is.
read(
reinterpret_cast<char*
>(&
p.position),
s);
147 offsetof(positionsCompat1706, facei)
148 - offsetof(positionsCompat1706, position)
150 is.
read(
reinterpret_cast<char*
>(&
p.position),
s);
157 stepFraction_ =
p.stepFraction;
158 origProc_ =
p.origProc;
163 position =
p.position;
173 "Particle initialised with a location outside of the mesh."
186 const wordRes& filters,
192 #define writeProp(Name, Value) \
193 particle::writeProperty(os, Name, Value, namesOnly, delim, filters)
201 writeProp(
"stepFraction", stepFraction_);
220 os.write(
reinterpret_cast<const char*
>(&coordinates_), sizeofPosition);
236 positionsCompat1706
p;
240 offsetof(positionsCompat1706, facei)
241 - offsetof(positionsCompat1706, position)
244 p.position = position();
247 os.
write(
reinterpret_cast<const char*
>(&
p.position),
s);
272 reinterpret_cast<const char*
>(&
p.coordinates_),
273 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.
@ 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,...
Inter-processor communications stream.
vector position() const
Return current particle position.
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
const polyMesh & mesh() const noexcept
Return the mesh database.
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.
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.
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 NameMatchPredicate &selectedFields, DynamicList< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
vector point
Point is a vector.
Old particle positions content for OpenFOAM-1706 and earlier.