Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/atom_trajectoryparticle.cpp

    r112b09 ra3fded  
    55 *      Author: heber
    66 */
    7 
    8 #include "Helpers/MemDebug.hpp"
    97
    108#include "atom.hpp"
     
    1513#include "log.hpp"
    1614#include "parser.hpp"
     15#include "ThermoStatContainer.hpp"
    1716#include "verbose.hpp"
    1817
     
    197196void TrajectoryParticle::Thermostat_Langevin(int Step, gsl_rng * r, double *ekin, config *configuration)
    198197{
    199   double sigma  = sqrt(configuration->TargetTemp/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)
    200199  Vector &U = Trajectory.U.at(Step);
    201200  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    202201    // throw a dice to determine whether it gets hit by a heat bath particle
    203     if (((((rand()/(double)RAND_MAX))*configuration->TempFrequency) < 1.)) {
     202    if (((((rand()/(double)RAND_MAX))*configuration->Thermostats->TempFrequency) < 1.)) {
    204203      DoLog(3) && (Log() << Verbose(3) << "Particle " << *this << " was hit (sigma " << sigma << "): " << sqrt(U[0]*U[0]+U[1]*U[1]+U[2]*U[2]) << " -> ");
    205204      // pick three random numbers from a Boltzmann distribution around the desired temperature T for each momenta axis
     
    225224  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    226225    for (int d=0; d<NDIM; d++) {
    227       U[d] *= sqrt(1+(configuration->Deltat/configuration->TempFrequency)*(ScaleTempFactor-1));
     226      U[d] *= sqrt(1+(configuration->Deltat/configuration->Thermostats->TempFrequency)*(ScaleTempFactor-1));
    228227      *ekin += 0.5*type->mass * U[d]*U[d];
    229228    }
     
    255254  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    256255    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));
    258257        *ekin += (0.5*type->mass) * U[d]*U[d];
    259258      }
Note: See TracChangeset for help on using the changeset viewer.