57 specialPosition_(
Zero),
58 potentialEnergy_(0.0),
88 is >> siteForces_ >> sitePositions_;
97 const bool readOnProc = mC.size();
102 mC.checkFieldIOobject(mC, Q);
105 mC.checkFieldIOobject(mC, v);
108 mC.checkFieldIOobject(mC, a);
111 mC.checkFieldIOobject(mC,
pi);
118 mC.checkFieldIOobject(mC, tau);
120 IOField<vector> specialPosition
125 mC.checkFieldIOobject(mC, specialPosition);
127 IOField<label> special
132 mC.checkFieldIOobject(mC, special);
135 mC.checkFieldIOobject(mC,
id);
138 for (molecule& mol : mC)
145 mol.specialPosition_ = specialPosition[i];
146 mol.special_ = special[i];
158 const label np = mC.size();
159 const bool writeOnProc = mC.size();
166 IOField<vector> specialPosition
176 IOField<vector> piGlobal
182 IOField<vector> tauGlobal
188 IOField<vector> orientation1
194 IOField<vector> orientation2
200 IOField<vector> orientation3
207 for (
const molecule& mol : mC)
214 specialPosition[i] = mol.specialPosition_;
215 special[i] = mol.special_;
218 piGlobal[i] = mol.Q_ & mol.pi_;
219 tauGlobal[i] = mol.Q_ & mol.tau_;
221 orientation1[i] = mol.Q_ &
vector(1,0,0);
222 orientation2[i] = mol.Q_ &
vector(0,1,0);
223 orientation3[i] = mol.Q_ &
vector(0,0,1);
228 Q.write(writeOnProc);
229 v.write(writeOnProc);
230 a.write(writeOnProc);
231 pi.write(writeOnProc);
232 tau.write(writeOnProc);
233 specialPosition.write(writeOnProc);
234 special.write(writeOnProc);
235 id.write(writeOnProc);
237 piGlobal.write(writeOnProc);
238 tauGlobal.write(writeOnProc);
240 orientation1.write(writeOnProc);
241 orientation2.write(writeOnProc);
242 orientation3.write(writeOnProc);
244 Info<<
"writeFields " << mC.name() <<
endl;
252 m.mesh().time().timePath()/
cloud::prefix/
"moleculeCloud.xmol"
283 reinterpret_cast<const char*
>(&mol.Q_),
286 os << mol.siteForces_ << mol.sitePositions_;
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
constexpr scalar pi(M_PI)
Base cloud calls templated on particle type.
void checkFieldIOobject(const Cloud< ParticleType > &c, const IOField< DataType > &data) const
Check lagrangian data field.
label size() const noexcept
The number of elements in table.
A primitive field of type <T> with automated input and output.
@ NO_READ
Nothing to be read.
@ MUST_READ
Reading required.
const word & name() const noexcept
Return the object name.
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,...
fileName timePath() const
Return current time path = path/timeName.
static const word prefix
The prefix to local: lagrangian.
void writeXYZ(const fileName &fName) const
Write molecule sites in XYZ format.
const polyMesh & mesh() const noexcept
const vector & specialPosition() const
static const std::size_t sizeofFields
Size in bytes of the fields.
const vector & tau() const
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.
static void writeFields(const Cloud< molecule > &mC)
const vector & pi() const
static void readFields(Cloud< molecule > &mC)
const Time & time() const noexcept
Return time registry.
IOobject newIOobject(const word &name, IOobjectOption ioOpt) const
Create an IOobject at the current time instance (timeName) with the specified options.
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
const polyMesh & mesh() const noexcept
Return the mesh database.
particle(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from components.
static void writeFields(const TrackCloudType &c)
Write the fields associated with the owner cloud.
Mesh consisting of general polyhedral cells.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
OBJstream os(runTime.globalPath()/outputName)
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
static constexpr const zero Zero
Global zero (0).