Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/atom_trajectoryparticle.cpp

    r1513a74 ra3fded  
    1010#include "config.hpp"
    1111#include "element.hpp"
     12#include "info.hpp"
    1213#include "log.hpp"
    1314#include "parser.hpp"
     15#include "ThermoStatContainer.hpp"
    1416#include "verbose.hpp"
    1517
     
    7173void TrajectoryParticle::ResizeTrajectory(int MaxSteps)
    7274{
     75  Info FunctionInfo(__func__);
    7376  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);
    7578    Trajectory.R.resize(MaxSteps+1);
    7679    Trajectory.U.resize(MaxSteps+1);
     
    193196void TrajectoryParticle::Thermostat_Langevin(int Step, gsl_rng * r, double *ekin, config *configuration)
    194197{
    195   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)
    196199  Vector &U = Trajectory.U.at(Step);
    197200  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    198201    // throw a dice to determine whether it gets hit by a heat bath particle
    199     if (((((rand()/(double)RAND_MAX))*configuration->TempFrequency) < 1.)) {
     202    if (((((rand()/(double)RAND_MAX))*configuration->Thermostats->TempFrequency) < 1.)) {
    200203      DoLog(3) && (Log() << Verbose(3) << "Particle " << *this << " was hit (sigma " << sigma << "): " << sqrt(U[0]*U[0]+U[1]*U[1]+U[2]*U[2]) << " -> ");
    201204      // pick three random numbers from a Boltzmann distribution around the desired temperature T for each momenta axis
     
    221224  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    222225    for (int d=0; d<NDIM; d++) {
    223       U[d] *= sqrt(1+(configuration->Deltat/configuration->TempFrequency)*(ScaleTempFactor-1));
     226      U[d] *= sqrt(1+(configuration->Deltat/configuration->Thermostats->TempFrequency)*(ScaleTempFactor-1));
    224227      *ekin += 0.5*type->mass * U[d]*U[d];
    225228    }
     
    251254  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    252255    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));
    254257        *ekin += (0.5*type->mass) * U[d]*U[d];
    255258      }
Note: See TracChangeset for help on using the changeset viewer.