Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/atom_trajectoryparticle.cpp

    rd74077 r952f38  
    1212#include "config.hpp"
    1313#include "element.hpp"
    14 #include "info.hpp"
    15 #include "log.hpp"
     14#include "Helpers/Info.hpp"
     15#include "Helpers/Log.hpp"
    1616#include "parser.hpp"
    1717#include "ThermoStatContainer.hpp"
    18 #include "verbose.hpp"
     18#include "Helpers/Verbose.hpp"
    1919
    2020/** Constructor of class TrajectoryParticle.
     
    3838{
    3939  for (int i=NDIM;i--;)
    40     *temperature += getType()->mass * Trajectory.U.at(step)[i]* Trajectory.U.at(step)[i];
     40    *temperature += type->mass * Trajectory.U.at(step)[i]* Trajectory.U.at(step)[i];
    4141};
    4242
     
    6565  for(int d=0;d<NDIM;d++) {
    6666    Trajectory.U.at(Step)[d] -= CoGVelocity->at(d);
    67     *ActualTemp += 0.5 * getType()->mass * Trajectory.U.at(Step)[d] * Trajectory.U.at(Step)[d];
     67    *ActualTemp += 0.5 * type->mass * Trajectory.U.at(Step)[d] * Trajectory.U.at(Step)[d];
    6868  }
    6969};
     
    113113    Trajectory.R.at(NextStep)[d] = Trajectory.R.at(NextStep-1)[d];
    114114    Trajectory.R.at(NextStep)[d] += configuration->Deltat*(Trajectory.U.at(NextStep-1)[d]);     // s(t) = s(0) + v * deltat + 1/2 a * deltat^2
    115     Trajectory.R.at(NextStep)[d] += 0.5*configuration->Deltat*configuration->Deltat*(Trajectory.F.at(NextStep)[d]/getType()->mass);     // F = m * a and s =
     115    Trajectory.R.at(NextStep)[d] += 0.5*configuration->Deltat*configuration->Deltat*(Trajectory.F.at(NextStep)[d]/type->mass);     // F = m * a and s =
    116116  }
    117117  // Update U
    118118  for (int d=0; d<NDIM; d++) {
    119119    Trajectory.U.at(NextStep)[d] = Trajectory.U.at(NextStep-1)[d];
    120     Trajectory.U.at(NextStep)[d] += configuration->Deltat * (Trajectory.F.at(NextStep)[d]+Trajectory.F.at(NextStep-1)[d]/getType()->mass); // v = F/m * t
     120    Trajectory.U.at(NextStep)[d] += configuration->Deltat * (Trajectory.F.at(NextStep)[d]+Trajectory.F.at(NextStep-1)[d]/type->mass); // v = F/m * t
    121121  }
    122122  // Update R (and F)
     
    137137void TrajectoryParticle::SumUpKineticEnergy( int Step, double *TotalMass, Vector *TotalVelocity ) const
    138138{
    139   *TotalMass += getType()->mass;  // sum up total mass
     139  *TotalMass += type->mass;  // sum up total mass
    140140  for(int d=0;d<NDIM;d++) {
    141     TotalVelocity->at(d) += Trajectory.U.at(Step)[d]*getType()->mass;
     141    TotalVelocity->at(d) += Trajectory.U.at(Step)[d]*type->mass;
    142142  }
    143143};
     
    154154    for (int d=0; d<NDIM; d++) {
    155155      U[d] *= ScaleTempFactor;
    156       *ekin += 0.5*getType()->mass * U[d]*U[d];
     156      *ekin += 0.5*type->mass * U[d]*U[d];
    157157    }
    158158};
     
    170170    for (int d=0; d<NDIM; d++) {
    171171      *G += U[d] * F[d];
    172       *E += U[d]*U[d]*getType()->mass;
     172      *E += U[d]*U[d]*type->mass;
    173173    }
    174174};
     
    185185  if (FixedIon == 0) // even FixedIon moves, only not by other's forces
    186186    for (int d=0; d<NDIM; d++) {
    187       U[d] += configuration->Deltat/getType()->mass * ( (G_over_E) * (U[d]*getType()->mass) );
    188       *ekin += getType()->mass * U[d]*U[d];
     187      U[d] += configuration->Deltat/type->mass * ( (G_over_E) * (U[d]*type->mass) );
     188      *ekin += type->mass * U[d]*U[d];
    189189    }
    190190};
     
    198198void TrajectoryParticle::Thermostat_Langevin(int Step, gsl_rng * r, double *ekin, config *configuration)
    199199{
    200   double sigma  = sqrt(configuration->Thermostats->TargetTemp/getType()->mass); // sigma = (k_b T)/m (Hartree/atomicmass = atomiclength/atomictime)
     200  double sigma  = sqrt(configuration->Thermostats->TargetTemp/type->mass); // sigma = (k_b T)/m (Hartree/atomicmass = atomiclength/atomictime)
    201201  Vector &U = Trajectory.U.at(Step);
    202202  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
     
    211211    }
    212212    for (int d=0; d<NDIM; d++)
    213       *ekin += 0.5*getType()->mass * U[d]*U[d];
     213      *ekin += 0.5*type->mass * U[d]*U[d];
    214214  }
    215215};
     
    227227    for (int d=0; d<NDIM; d++) {
    228228      U[d] *= sqrt(1+(configuration->Deltat/configuration->Thermostats->TempFrequency)*(ScaleTempFactor-1));
    229       *ekin += 0.5*getType()->mass * U[d]*U[d];
     229      *ekin += 0.5*type->mass * U[d]*U[d];
    230230    }
    231231  }
     
    241241  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    242242    for (int d=0; d<NDIM; d++) {
    243       *delta_alpha += U[d]*U[d]*getType()->mass;
     243      *delta_alpha += U[d]*U[d]*type->mass;
    244244    }
    245245  }
     
    256256  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    257257    for (int d=0; d<NDIM; d++) {
    258         U[d] += configuration->Deltat/getType()->mass * (configuration->Thermostats->alpha * (U[d] * getType()->mass));
    259         *ekin += (0.5*getType()->mass) * U[d]*U[d];
     258        U[d] += configuration->Deltat/type->mass * (configuration->Thermostats->alpha * (U[d] * type->mass));
     259        *ekin += (0.5*type->mass) * U[d]*U[d];
    260260      }
    261261  }
    262262};
    263 
    264 
    265 std::ostream & TrajectoryParticle::operator << (std::ostream &ost) const
    266 {
    267   ParticleInfo::operator<<(ost);
    268   ost << "," << getPosition();
    269   return ost;
    270 }
    271 
    272 std::ostream & operator << (std::ostream &ost, const TrajectoryParticle &a)
    273 {
    274   a.ParticleInfo::operator<<(ost);
    275   ost << "," << a.getPosition();
    276   return ost;
    277 }
    278 
Note: See TracChangeset for help on using the changeset viewer.