57 specialPosition_(
Zero),
58 potentialEnergy_(0.0),
92 readRawScalar(is, &potentialEnergy_);
104 is >> siteForces_ >> sitePositions_;
113 const bool readOnProc = mC.size();
118 mC.checkFieldIOobject(mC, Q);
121 mC.checkFieldIOobject(mC, v);
124 mC.checkFieldIOobject(mC, a);
127 mC.checkFieldIOobject(mC,
pi);
134 mC.checkFieldIOobject(mC, tau);
136 IOField<vector> specialPosition
141 mC.checkFieldIOobject(mC, specialPosition);
143 IOField<label> special
148 mC.checkFieldIOobject(mC, special);
151 mC.checkFieldIOobject(mC,
id);
154 for (molecule& mol : mC)
161 mol.specialPosition_ = specialPosition[i];
162 mol.special_ = special[i];
174 const label np = mC.size();
175 const bool writeOnProc = mC.size();
182 IOField<vector> specialPosition
192 IOField<vector> piGlobal
198 IOField<vector> tauGlobal
204 IOField<vector> orientation1
210 IOField<vector> orientation2
216 IOField<vector> orientation3
223 for (
const molecule& mol : mC)
230 specialPosition[i] = mol.specialPosition_;
231 special[i] = mol.special_;
234 piGlobal[i] = mol.Q_ & mol.pi_;
235 tauGlobal[i] = mol.Q_ & mol.tau_;
237 orientation1[i] = mol.Q_ &
vector(1,0,0);
238 orientation2[i] = mol.Q_ &
vector(0,1,0);
239 orientation3[i] = mol.Q_ &
vector(0,0,1);
244 Q.write(writeOnProc);
245 v.write(writeOnProc);
246 a.write(writeOnProc);
247 pi.write(writeOnProc);
248 tau.write(writeOnProc);
249 specialPosition.write(writeOnProc);
250 special.write(writeOnProc);
251 id.write(writeOnProc);
253 piGlobal.write(writeOnProc);
254 tauGlobal.write(writeOnProc);
256 orientation1.write(writeOnProc);
257 orientation2.write(writeOnProc);
258 orientation3.write(writeOnProc);
260 Info<<
"writeFields " << mC.name() <<
endl;
262 if (isA<moleculeCloud>(mC))
264 const moleculeCloud& m =
dynamic_cast<const moleculeCloud&
>(mC);
268 m.mesh().time().timePath()/
cloud::prefix/
"moleculeCloud.xmol" 280 os << token::SPACE << static_cast<const particle&>(mol)
296 os << static_cast<const particle&>(mol);
299 reinterpret_cast<const char*>(&mol.Q_),
302 os << mol.siteForces_ << mol.sitePositions_;
std::enable_if< std::is_floating_point< T >::value, bool >::type checkScalarSize() const noexcept
Check if the scalar byte-size associated with the stream is the same as the given type...
virtual Ostream & write(const char c) override
Write character.
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)...
static const std::size_t sizeofFields
Size in bytes of the fields.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool endRawRead()=0
End of low-level raw binary read.
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
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 readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
constexpr scalar pi(M_PI)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
label readRawLabel(Istream &is)
Read raw label from binary stream.
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
virtual bool beginRawRead()=0
Start of low-level raw binary read.
static void writeFields(const TrackCloudType &c)
Write the fields associated with the owner cloud.
messageStream Info
Information stream (stdout output on master, null elsewhere)
std::enable_if< std::is_integral< T >::value, bool >::type checkLabelSize() const noexcept
Check if the label byte-size associated with the stream is the same as the given type.
Mesh consisting of general polyhedral cells.
streamFormat format() const noexcept
Get the current stream format.
static constexpr const zero Zero
Global zero (0)
static const word prefix
The prefix to local: lagrangian.