41#ifndef Foam_passivePositionParticle_H
42#define Foam_passivePositionParticle_H
105 const bool newFormat =
true
134 location_(
p.location_)
181 positionsCompat1706
p;
185 offsetof(positionsCompat1706, facei)
186 - offsetof(positionsCompat1706,
position)
192 os.write(
reinterpret_cast<const char*
>(&
p.position),
s);
@ ASCII
"ascii" (normal default)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
vector position() const
Return current particle position.
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
static autoPtr< particle > Clone(const Derived &p)
Clone a particle.
const polyMesh & mesh() const noexcept
Return the mesh database.
const barycentric & coordinates() const noexcept
Return current particle coordinates.
void readData(Istream &is, point &position, const bool readFields, const bool newFormat, const bool doLocate)
Read particle from stream. Optionally (for old format) return.
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.
iNew(const polyMesh &mesh)
autoPtr< passivePositionParticle > operator()(Istream &is) const
Copy of base particle but without particle locating and preserving read location.
passivePositionParticle(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from components (known location).
const point & location() const noexcept
The cached particle position.
passivePositionParticle(const polyMesh &mesh, Istream &is, const bool readFields=true, const bool newFormat=true)
Construct from Istream.
virtual autoPtr< particle > clone() const
Return a clone.
passivePositionParticle(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti, const vector &position)
Construct from components (supplied location).
passivePositionParticle(const passivePositionParticle &p)
Construct as copy.
virtual void writePosition(Ostream &os) const
Write the particle position and cell id.
Mesh consisting of general polyhedral cells.
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))
vector point
Point is a vector.
static constexpr const zero Zero
Global zero (0).
Barycentric< scalar > barycentric
A scalar version of the templated Barycentric.
Old particle positions content for OpenFOAM-1706 and earlier.