Ignore:
Timestamp:
Apr 29, 2010, 1:55:21 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
070651, 5d1a94
Parents:
90c4460 (diff), 32842d8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'VectorRefactoring' into StructureRefactoring

Conflicts:

molecuilder/src/Legacy/oldmenu.cpp
molecuilder/src/Makefile.am
molecuilder/src/analysis_correlation.cpp
molecuilder/src/boundary.cpp
molecuilder/src/builder.cpp
molecuilder/src/config.cpp
molecuilder/src/ellipsoid.cpp
molecuilder/src/linkedcell.cpp
molecuilder/src/molecule.cpp
molecuilder/src/molecule_fragmentation.cpp
molecuilder/src/molecule_geometry.cpp
molecuilder/src/molecule_graph.cpp
molecuilder/src/moleculelist.cpp
molecuilder/src/tesselation.cpp
molecuilder/src/tesselationhelpers.cpp
molecuilder/src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
molecuilder/src/unittests/bondgraphunittest.cpp
molecuilder/src/vector.cpp
molecuilder/src/vector.hpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/atom_trajectoryparticle.cpp

    r90c4460 r0d111b  
    3434{
    3535  for (int i=NDIM;i--;)
    36     *temperature += type->mass * Trajectory.U.at(step).x[i]* Trajectory.U.at(step).x[i];
     36    *temperature += type->mass * Trajectory.U.at(step)[i]* Trajectory.U.at(step)[i];
    3737};
    3838
     
    4949  // set forces
    5050  for (int i=NDIM;i++;)
    51     Force->Matrix[0][nr][5+i] += 2.*constant*sqrt(Trajectory.R.at(startstep).Distance(&Sprinter->Trajectory.R.at(endstep)));
     51    Force->Matrix[0][nr][5+i] += 2.*constant*sqrt(Trajectory.R.at(startstep).Distance(Sprinter->Trajectory.R.at(endstep)));
    5252};
    5353
     
    6060{
    6161  for(int d=0;d<NDIM;d++) {
    62     Trajectory.U.at(Step).x[d] -= CoGVelocity->x[d];
    63     *ActualTemp += 0.5 * type->mass * Trajectory.U.at(Step).x[d] * Trajectory.U.at(Step).x[d];
     62    Trajectory.U.at(Step)[d] -= CoGVelocity->at(d);
     63    *ActualTemp += 0.5 * type->mass * Trajectory.U.at(Step)[d] * Trajectory.U.at(Step)[d];
    6464  }
    6565};
     
    8989
    9090  for (int n=NDIM;n--;) {
    91     Trajectory.R.at(dest).x[n] = Trajectory.R.at(src).x[n];
    92     Trajectory.U.at(dest).x[n] = Trajectory.U.at(src).x[n];
    93     Trajectory.F.at(dest).x[n] = Trajectory.F.at(src).x[n];
     91    Trajectory.R.at(dest)[n] = Trajectory.R.at(src)[n];
     92    Trajectory.U.at(dest)[n] = Trajectory.U.at(src)[n];
     93    Trajectory.F.at(dest)[n] = Trajectory.F.at(src)[n];
    9494  }
    9595};
     
    105105  //a = configuration.Deltat*0.5/walker->type->mass;        // (F+F_old)/2m = a and thus: v = (F+F_old)/2m * t = (F + F_old) * a
    106106  for (int d=0; d<NDIM; d++) {
    107     Trajectory.F.at(NextStep).x[d] = -Force->Matrix[0][nr][d+5]*(configuration->GetIsAngstroem() ? AtomicLengthToAngstroem : 1.);
    108     Trajectory.R.at(NextStep).x[d] = Trajectory.R.at(NextStep-1).x[d];
    109     Trajectory.R.at(NextStep).x[d] += configuration->Deltat*(Trajectory.U.at(NextStep-1).x[d]);     // s(t) = s(0) + v * deltat + 1/2 a * deltat^2
    110     Trajectory.R.at(NextStep).x[d] += 0.5*configuration->Deltat*configuration->Deltat*(Trajectory.F.at(NextStep).x[d]/type->mass);     // F = m * a and s =
     107    Trajectory.F.at(NextStep)[d] = -Force->Matrix[0][nr][d+5]*(configuration->GetIsAngstroem() ? AtomicLengthToAngstroem : 1.);
     108    Trajectory.R.at(NextStep)[d] = Trajectory.R.at(NextStep-1)[d];
     109    Trajectory.R.at(NextStep)[d] += configuration->Deltat*(Trajectory.U.at(NextStep-1)[d]);     // s(t) = s(0) + v * deltat + 1/2 a * deltat^2
     110    Trajectory.R.at(NextStep)[d] += 0.5*configuration->Deltat*configuration->Deltat*(Trajectory.F.at(NextStep)[d]/type->mass);     // F = m * a and s =
    111111  }
    112112  // Update U
    113113  for (int d=0; d<NDIM; d++) {
    114     Trajectory.U.at(NextStep).x[d] = Trajectory.U.at(NextStep-1).x[d];
    115     Trajectory.U.at(NextStep).x[d] += configuration->Deltat * (Trajectory.F.at(NextStep).x[d]+Trajectory.F.at(NextStep-1).x[d]/type->mass); // v = F/m * t
     114    Trajectory.U.at(NextStep)[d] = Trajectory.U.at(NextStep-1)[d];
     115    Trajectory.U.at(NextStep)[d] += configuration->Deltat * (Trajectory.F.at(NextStep)[d]+Trajectory.F.at(NextStep-1)[d]/type->mass); // v = F/m * t
    116116  }
    117117  // Update R (and F)
     
    134134  *TotalMass += type->mass;  // sum up total mass
    135135  for(int d=0;d<NDIM;d++) {
    136     TotalVelocity->x[d] += Trajectory.U.at(Step).x[d]*type->mass;
     136    TotalVelocity->at(d) += Trajectory.U.at(Step)[d]*type->mass;
    137137  }
    138138};
     
    145145void TrajectoryParticle::Thermostat_Woodcock(double ScaleTempFactor, int Step, double *ekin)
    146146{
    147   double *U = Trajectory.U.at(Step).x;
     147  Vector &U = Trajectory.U.at(Step);
    148148  if (FixedIon == 0) // even FixedIon moves, only not by other's forces
    149149    for (int d=0; d<NDIM; d++) {
     
    160160void TrajectoryParticle::Thermostat_Gaussian_init(int Step, double *G, double *E)
    161161{
    162   double *U = Trajectory.U.at(Step).x;
    163   double *F = Trajectory.F.at(Step).x;
     162  Vector &U = Trajectory.U.at(Step);
     163  Vector &F = Trajectory.F.at(Step);
    164164  if (FixedIon == 0) // even FixedIon moves, only not by other's forces
    165165    for (int d=0; d<NDIM; d++) {
     
    177177void TrajectoryParticle::Thermostat_Gaussian_least_constraint(int Step, double G_over_E, double *ekin, config *configuration)
    178178{
    179   double *U = Trajectory.U.at(Step).x;
     179  Vector &U = Trajectory.U.at(Step);
    180180  if (FixedIon == 0) // even FixedIon moves, only not by other's forces
    181181    for (int d=0; d<NDIM; d++) {
     
    194194{
    195195  double sigma  = sqrt(configuration->TargetTemp/type->mass); // sigma = (k_b T)/m (Hartree/atomicmass = atomiclength/atomictime)
    196   double *U = Trajectory.U.at(Step).x;
     196  Vector &U = Trajectory.U.at(Step);
    197197  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    198198    // throw a dice to determine whether it gets hit by a heat bath particle
     
    218218void TrajectoryParticle::Thermostat_Berendsen(int Step, double ScaleTempFactor, double *ekin, config *configuration)
    219219{
    220   double *U = Trajectory.U.at(Step).x;
     220  Vector &U = Trajectory.U.at(Step);
    221221  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    222222    for (int d=0; d<NDIM; d++) {
     
    233233void TrajectoryParticle::Thermostat_NoseHoover_init(int Step, double *delta_alpha)
    234234{
    235   double *U = Trajectory.U.at(Step).x;
     235  Vector &U = Trajectory.U.at(Step);
    236236  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    237237    for (int d=0; d<NDIM; d++) {
     
    248248void TrajectoryParticle::Thermostat_NoseHoover_scale(int Step, double *ekin, config *configuration)
    249249{
    250   double *U = Trajectory.U.at(Step).x;
     250  Vector &U = Trajectory.U.at(Step);
    251251  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    252252    for (int d=0; d<NDIM; d++) {
Note: See TracChangeset for help on using the changeset viewer.