143 |
|
|
144 |
|
RealType temperature = ( 2.0 * this->getKinetic() ) / (info_->getNdf()* PhysicalConstants::kb ); |
145 |
|
return temperature; |
146 |
+ |
} |
147 |
+ |
|
148 |
+ |
RealType Thermo::getElectronicTemperature() { |
149 |
+ |
SimInfo::MoleculeIterator miter; |
150 |
+ |
std::vector<Atom*>::iterator iiter; |
151 |
+ |
Molecule* mol; |
152 |
+ |
Atom* atom; |
153 |
+ |
RealType cvel; |
154 |
+ |
RealType cmass; |
155 |
+ |
RealType kinetic = 0.0; |
156 |
+ |
RealType kinetic_global = 0.0; |
157 |
+ |
|
158 |
+ |
for (mol = info_->beginMolecule(miter); mol != NULL; mol = info_->nextMolecule(miter)) { |
159 |
+ |
for (atom = mol->beginFluctuatingCharge(iiter); atom != NULL; |
160 |
+ |
atom = mol->nextFluctuatingCharge(iiter)) { |
161 |
+ |
cmass = atom->getChargeMass(); |
162 |
+ |
cvel = atom->getFlucQVel(); |
163 |
+ |
|
164 |
+ |
kinetic += cmass * cvel * cvel; |
165 |
+ |
|
166 |
+ |
} |
167 |
+ |
} |
168 |
+ |
|
169 |
+ |
#ifdef IS_MPI |
170 |
+ |
|
171 |
+ |
MPI_Allreduce(&kinetic, &kinetic_global, 1, MPI_REALTYPE, MPI_SUM, |
172 |
+ |
MPI_COMM_WORLD); |
173 |
+ |
kinetic = kinetic_global; |
174 |
+ |
|
175 |
+ |
#endif //is_mpi |
176 |
+ |
|
177 |
+ |
kinetic = kinetic * 0.5 / PhysicalConstants::energyConvert; |
178 |
+ |
return ( 2.0 * kinetic) / (info_->getNFluctuatingCharges()* PhysicalConstants::kb ); |
179 |
|
} |
180 |
|
|
181 |
+ |
|
182 |
+ |
|
183 |
+ |
|
184 |
|
RealType Thermo::getVolume() { |
185 |
|
Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); |
186 |
|
return curSnapshot->getVolume(); |