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);
passivePositionParticle(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from components (known location)
const barycentric & coordinates() const noexcept
Return current particle coordinates.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
autoPtr< passivePositionParticle > operator()(Istream &is) const
void readData(Istream &is, point &position, const bool readFields, const bool newFormat, const bool doLocate)
Read particle from stream. Optionally (for old format) return.
const point & location() const noexcept
The cached particle position.
static autoPtr< particle > Clone(const Derived &p)
Clone a particle.
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)
virtual autoPtr< particle > clone() const
Return a clone.
label cell() const noexcept
Return current cell particle is in.
const polyMesh & mesh() const noexcept
Return the mesh database.
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
iNew(const polyMesh &mesh)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Mesh consisting of general polyhedral cells.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
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 position() const
Return current particle position.
Copy of base particle but without particle locating and preserving read location. ...
virtual void writePosition(Ostream &os) const
Write the particle position and cell id.
static constexpr const zero Zero
Global zero (0)