32 const std::size_t Foam::molecule::sizeofFields_
34 offsetof(molecule, siteForces_) - offsetof(molecule, Q_)
53 specialPosition_(
Zero),
54 potentialEnergy_(0.0),
63 if (is.
format() == IOstream::ASCII)
70 is >> specialPosition_;
80 is.
read(reinterpret_cast<char*>(&Q_), sizeofFields_);
81 is >> siteForces_ >> sitePositions_;
88 "Foam::molecule::molecule" 89 "(const Cloud<molecule>& cloud, Foam::Istream&), bool" 215 piGlobal[i] = mol.Q_ & mol.pi_;
216 tauGlobal[i] = mol.Q_ & mol.tau_;
218 orientation1[i] = mol.Q_ &
vector(1,0,0);
219 orientation2[i] = mol.Q_ &
vector(0,1,0);
220 orientation3[i] = mol.Q_ &
vector(0,0,1);
225 const bool write = np > 0;
236 piGlobal.write(write);
237 tauGlobal.write(write);
239 orientation1.write(write);
240 orientation2.write(write);
241 orientation3.write(write);
245 if (isA<moleculeCloud>(mC))
263 os << token::SPACE << static_cast<const particle&>(mol)
279 os << static_cast<const particle&>(mol);
282 reinterpret_cast<const char*>(&mol.Q_),
283 molecule::sizeofFields_
285 os << mol.siteForces_ << mol.sitePositions_;
291 "Foam::Ostream& Foam::operator<<" 292 "(Foam::Ostream&, const Foam::molecule&)"
void writeXYZ(const fileName &fName) const
Write molecule sites in XYZ format.
virtual Ostream & write(const char)=0
Write character.
const word & name() const
Return name.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
fileName timePath() const
Return current time path.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Ostream & endl(Ostream &os)
Add newline and flush stream.
const vector & pi() const
label size() const
Return the number of particles in the cloud.
Vector< scalar > vector
A scalar version of the templated Vector.
static void writeFields(const Cloud< molecule > &mC)
static void readFields(Cloud< molecule > &mC)
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
virtual Istream & read(token &)=0
Return next token from stream.
molecule(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti, const tensor &Q, const vector &v, const vector &a, const vector &pi, const vector &tau, const vector &specialPosition, const constantProperties &constProps, const label special, const label id)
Construct from components.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
streamFormat format() const
Return current stream format.
label readLabel(Istream &is)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const Time & time() const
Return time.
static const word prefix
The prefix to local: lagrangian.
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
static void writeFields(const TrackCloudType &c)
Write the fields associated with the owner cloud.
Ostream & operator<<(Ostream &, const ensightPart &)
void checkFieldIOobject(const Cloud< ParticleType > &c, const IOField< DataType > &data) const
Check lagrangian data field.
Mesh consisting of general polyhedral cells.
const polyMesh & mesh() const
IOobject fieldIOobject(const word &fieldName, const IOobject::readOption r) const
Helper to construct IOobject for field and current time.
A primitive field of type <T> with automated input and output.
const vector & tau() const
const vector & specialPosition() const