Ignore:
Timestamp:
Aug 19, 2010, 3:23:37 PM (14 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
2a7457
Parents:
1ee380f
git-author:
Frederik Heber <heber@…> (08/17/10 17:21:25)
git-committer:
Frederik Heber <heber@…> (08/19/10 15:23:37)
Message:

Made all member variables of class element private, added accessor functions and periodentafel is friend.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/atom_trajectoryparticle.cpp

    r1ee380f r83f176  
    5050{
    5151  for (int i=NDIM;i--;)
    52     *temperature += getType()->mass * Trajectory.U.at(step)[i]* Trajectory.U.at(step)[i];
     52    *temperature += getType()->getMass() * Trajectory.U.at(step)[i]* Trajectory.U.at(step)[i];
    5353};
    5454
     
    7777  for(int d=0;d<NDIM;d++) {
    7878    Trajectory.U.at(Step)[d] -= CoGVelocity->at(d);
    79     *ActualTemp += 0.5 * getType()->mass * Trajectory.U.at(Step)[d] * Trajectory.U.at(Step)[d];
     79    *ActualTemp += 0.5 * getType()->getMass() * Trajectory.U.at(Step)[d] * Trajectory.U.at(Step)[d];
    8080  }
    8181};
     
    125125    Trajectory.R.at(NextStep)[d] = Trajectory.R.at(NextStep-1)[d];
    126126    Trajectory.R.at(NextStep)[d] += configuration->Deltat*(Trajectory.U.at(NextStep-1)[d]);     // s(t) = s(0) + v * deltat + 1/2 a * deltat^2
    127     Trajectory.R.at(NextStep)[d] += 0.5*configuration->Deltat*configuration->Deltat*(Trajectory.F.at(NextStep)[d]/getType()->mass);     // F = m * a and s =
     127    Trajectory.R.at(NextStep)[d] += 0.5*configuration->Deltat*configuration->Deltat*(Trajectory.F.at(NextStep)[d]/getType()->getMass());     // F = m * a and s =
    128128  }
    129129  // Update U
    130130  for (int d=0; d<NDIM; d++) {
    131131    Trajectory.U.at(NextStep)[d] = Trajectory.U.at(NextStep-1)[d];
    132     Trajectory.U.at(NextStep)[d] += configuration->Deltat * (Trajectory.F.at(NextStep)[d]+Trajectory.F.at(NextStep-1)[d]/getType()->mass); // v = F/m * t
     132    Trajectory.U.at(NextStep)[d] += configuration->Deltat * (Trajectory.F.at(NextStep)[d]+Trajectory.F.at(NextStep-1)[d]/getType()->getMass()); // v = F/m * t
    133133  }
    134134  // Update R (and F)
     
    149149void TrajectoryParticle::SumUpKineticEnergy( int Step, double *TotalMass, Vector *TotalVelocity ) const
    150150{
    151   *TotalMass += getType()->mass;  // sum up total mass
     151  *TotalMass += getType()->getMass();  // sum up total mass
    152152  for(int d=0;d<NDIM;d++) {
    153     TotalVelocity->at(d) += Trajectory.U.at(Step)[d]*getType()->mass;
     153    TotalVelocity->at(d) += Trajectory.U.at(Step)[d]*getType()->getMass();
    154154  }
    155155};
     
    166166    for (int d=0; d<NDIM; d++) {
    167167      U[d] *= ScaleTempFactor;
    168       *ekin += 0.5*getType()->mass * U[d]*U[d];
     168      *ekin += 0.5*getType()->getMass() * U[d]*U[d];
    169169    }
    170170};
     
    182182    for (int d=0; d<NDIM; d++) {
    183183      *G += U[d] * F[d];
    184       *E += U[d]*U[d]*getType()->mass;
     184      *E += U[d]*U[d]*getType()->getMass();
    185185    }
    186186};
     
    197197  if (FixedIon == 0) // even FixedIon moves, only not by other's forces
    198198    for (int d=0; d<NDIM; d++) {
    199       U[d] += configuration->Deltat/getType()->mass * ( (G_over_E) * (U[d]*getType()->mass) );
    200       *ekin += getType()->mass * U[d]*U[d];
     199      U[d] += configuration->Deltat/getType()->getMass() * ( (G_over_E) * (U[d]*getType()->getMass()) );
     200      *ekin += getType()->getMass() * U[d]*U[d];
    201201    }
    202202};
     
    210210void TrajectoryParticle::Thermostat_Langevin(int Step, gsl_rng * r, double *ekin, config *configuration)
    211211{
    212   double sigma  = sqrt(configuration->Thermostats->TargetTemp/getType()->mass); // sigma = (k_b T)/m (Hartree/atomicmass = atomiclength/atomictime)
     212  double sigma  = sqrt(configuration->Thermostats->TargetTemp/getType()->getMass()); // sigma = (k_b T)/m (Hartree/atomicmass = atomiclength/atomictime)
    213213  Vector &U = Trajectory.U.at(Step);
    214214  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
     
    223223    }
    224224    for (int d=0; d<NDIM; d++)
    225       *ekin += 0.5*getType()->mass * U[d]*U[d];
     225      *ekin += 0.5*getType()->getMass() * U[d]*U[d];
    226226  }
    227227};
     
    239239    for (int d=0; d<NDIM; d++) {
    240240      U[d] *= sqrt(1+(configuration->Deltat/configuration->Thermostats->TempFrequency)*(ScaleTempFactor-1));
    241       *ekin += 0.5*getType()->mass * U[d]*U[d];
     241      *ekin += 0.5*getType()->getMass() * U[d]*U[d];
    242242    }
    243243  }
     
    253253  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    254254    for (int d=0; d<NDIM; d++) {
    255       *delta_alpha += U[d]*U[d]*getType()->mass;
     255      *delta_alpha += U[d]*U[d]*getType()->getMass();
    256256    }
    257257  }
     
    268268  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    269269    for (int d=0; d<NDIM; d++) {
    270         U[d] += configuration->Deltat/getType()->mass * (configuration->Thermostats->alpha * (U[d] * getType()->mass));
    271         *ekin += (0.5*getType()->mass) * U[d]*U[d];
     270        U[d] += configuration->Deltat/getType()->getMass() * (configuration->Thermostats->alpha * (U[d] * getType()->getMass()));
     271        *ekin += (0.5*getType()->getMass()) * U[d]*U[d];
    272272      }
    273273  }
Note: See TracChangeset for help on using the changeset viewer.