Changes in src/atom_trajectoryparticle.cpp [112b09:a3fded]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/atom_trajectoryparticle.cpp
r112b09 ra3fded 5 5 * Author: heber 6 6 */ 7 8 #include "Helpers/MemDebug.hpp"9 7 10 8 #include "atom.hpp" … … 15 13 #include "log.hpp" 16 14 #include "parser.hpp" 15 #include "ThermoStatContainer.hpp" 17 16 #include "verbose.hpp" 18 17 … … 197 196 void TrajectoryParticle::Thermostat_Langevin(int Step, gsl_rng * r, double *ekin, config *configuration) 198 197 { 199 double sigma = sqrt(configuration->T argetTemp/type->mass); // sigma = (k_b T)/m (Hartree/atomicmass = atomiclength/atomictime)198 double sigma = sqrt(configuration->Thermostats->TargetTemp/type->mass); // sigma = (k_b T)/m (Hartree/atomicmass = atomiclength/atomictime) 200 199 Vector &U = Trajectory.U.at(Step); 201 200 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces 202 201 // throw a dice to determine whether it gets hit by a heat bath particle 203 if (((((rand()/(double)RAND_MAX))*configuration->T empFrequency) < 1.)) {202 if (((((rand()/(double)RAND_MAX))*configuration->Thermostats->TempFrequency) < 1.)) { 204 203 DoLog(3) && (Log() << Verbose(3) << "Particle " << *this << " was hit (sigma " << sigma << "): " << sqrt(U[0]*U[0]+U[1]*U[1]+U[2]*U[2]) << " -> "); 205 204 // pick three random numbers from a Boltzmann distribution around the desired temperature T for each momenta axis … … 225 224 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces 226 225 for (int d=0; d<NDIM; d++) { 227 U[d] *= sqrt(1+(configuration->Deltat/configuration->T empFrequency)*(ScaleTempFactor-1));226 U[d] *= sqrt(1+(configuration->Deltat/configuration->Thermostats->TempFrequency)*(ScaleTempFactor-1)); 228 227 *ekin += 0.5*type->mass * U[d]*U[d]; 229 228 } … … 255 254 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces 256 255 for (int d=0; d<NDIM; d++) { 257 U[d] += configuration->Deltat/type->mass * (configuration-> alpha * (U[d] * type->mass));256 U[d] += configuration->Deltat/type->mass * (configuration->Thermostats->alpha * (U[d] * type->mass)); 258 257 *ekin += (0.5*type->mass) * U[d]*U[d]; 259 258 }
Note:
See TracChangeset
for help on using the changeset viewer.