Changes in src/atom_trajectoryparticle.cpp [1513a74:a3fded]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/atom_trajectoryparticle.cpp
r1513a74 ra3fded 10 10 #include "config.hpp" 11 11 #include "element.hpp" 12 #include "info.hpp" 12 13 #include "log.hpp" 13 14 #include "parser.hpp" 15 #include "ThermoStatContainer.hpp" 14 16 #include "verbose.hpp" 15 17 … … 71 73 void TrajectoryParticle::ResizeTrajectory(int MaxSteps) 72 74 { 75 Info FunctionInfo(__func__); 73 76 if (Trajectory.R.size() <= (unsigned int)(MaxSteps)) { 74 //Log() << Verbose(0) << "Increasing size for trajectory array of " << keyword << " to " << (MaxSteps+1) << "." << endl;77 DoLog(0) && (Log() << Verbose(0) << "Increasing size for trajectory array of " << nr << " from " << Trajectory.R.size() << " to " << (MaxSteps+1) << "." << endl); 75 78 Trajectory.R.resize(MaxSteps+1); 76 79 Trajectory.U.resize(MaxSteps+1); … … 193 196 void TrajectoryParticle::Thermostat_Langevin(int Step, gsl_rng * r, double *ekin, config *configuration) 194 197 { 195 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) 196 199 Vector &U = Trajectory.U.at(Step); 197 200 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces 198 201 // throw a dice to determine whether it gets hit by a heat bath particle 199 if (((((rand()/(double)RAND_MAX))*configuration->T empFrequency) < 1.)) {202 if (((((rand()/(double)RAND_MAX))*configuration->Thermostats->TempFrequency) < 1.)) { 200 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]) << " -> "); 201 204 // pick three random numbers from a Boltzmann distribution around the desired temperature T for each momenta axis … … 221 224 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces 222 225 for (int d=0; d<NDIM; d++) { 223 U[d] *= sqrt(1+(configuration->Deltat/configuration->T empFrequency)*(ScaleTempFactor-1));226 U[d] *= sqrt(1+(configuration->Deltat/configuration->Thermostats->TempFrequency)*(ScaleTempFactor-1)); 224 227 *ekin += 0.5*type->mass * U[d]*U[d]; 225 228 } … … 251 254 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces 252 255 for (int d=0; d<NDIM; d++) { 253 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)); 254 257 *ekin += (0.5*type->mass) * U[d]*U[d]; 255 258 }
Note:
See TracChangeset
for help on using the changeset viewer.