32 const std::size_t Foam::molecule::sizeofFields_
34 offsetof(molecule, siteForces_) - offsetof(molecule, Q_)
48 specialPosition_(
Zero),
49 potentialEnergy_(0.0),
65 is >> specialPosition_;
75 is.
read(
reinterpret_cast<char*
>(&Q_), sizeofFields_);
76 is >> siteForces_ >> sitePositions_;
83 "Foam::molecule::molecule"
84 "(const Cloud<molecule>& cloud, Foam::Istream&), bool"
137 mol.specialPosition_ = specialPosition[i];
138 mol.special_ = special[i];
206 specialPosition[i] = mol.specialPosition_;
207 special[i] = mol.special_;
210 piGlobal[i] = mol.Q_ & mol.pi_;
211 tauGlobal[i] = mol.Q_ & mol.tau_;
213 orientation1[i] = mol.Q_ &
vector(1,0,0);
214 orientation2[i] = mol.Q_ &
vector(0,1,0);
215 orientation3[i] = mol.Q_ &
vector(0,0,1);
220 const bool write = np > 0;
240 if (isA<moleculeCloud>(mC))
248 /
"moleculeCloud.xmol"
260 os << token::SPACE << static_cast<const particle&>(mol)
276 os << static_cast<const particle&>(mol);
279 reinterpret_cast<const char*
>(&mol.Q_),
280 molecule::sizeofFields_
282 os << mol.siteForces_ << mol.sitePositions_;
288 "Foam::Ostream& Foam::operator<<"
289 "(Foam::Ostream&, const Foam::molecule&)"
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
A primitive field of type <Type> with automated input and output.
const word & name() const
Return name.
streamFormat format() const
Return current stream format.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
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.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & write(const char)=0
Write character.
fileName timePath() const
Return current time path.
void checkFieldIOobject(const Cloud< ParticleType > &c, const IOField< DataType > &data) const
Check lagrangian data field.
IOobject fieldIOobject(const word &fieldName, const IOobject::readOption r) const
Helper to construct IOobject for field and current time.
label size() const
Return the number of particles in the cloud.
static const word prefix
The prefix to local: lagrangian.
const polyMesh & mesh() const
void writeXYZ(const fileName &fName) const
Write molecule sites in XYZ format.
molecule(const polyMesh &mesh, const vector &position, const label celli, label &nLocateBoundaryHits, 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 a position and a cell, searching for the rest of the.
static void readFields(lagrangian::Cloud< molecule > &mC)
static void writeFields(const lagrangian::Cloud< molecule > &mC)
const Time & time() const
Return time.
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.
virtual bool write(const bool write=true) const
Write using setting from DB.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const HashSet< word > &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the specified type.
Vector< scalar > vector
A scalar version of the templated Vector.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
label readLabel(Istream &is)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)