Ignore:
Timestamp:
Aug 7, 2010, 12:07:04 PM (15 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, Candidate_v1.7.0, 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:
2d292d
Parents:
8d6d31 (diff), d74077 (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 'AtomicPositionEncapsulation' into stable

Conflicts:

src/Actions/AtomAction/ChangeElementAction.cpp
src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp
src/Makefile.am
src/UIElements/TextUI/TextDialog.cpp
src/analysis_correlation.hpp
src/atom.cpp
src/atom_atominfo.hpp
src/bond.cpp
src/boundary.cpp
src/molecule_geometry.cpp
src/tesselation.cpp
src/tesselationhelpers.cpp
src/triangleintersectionlist.cpp
src/unittests/Makefile.am

  • fixed #includes due to moves to Helpers and LinearAlgebra
  • moved VectorInterface.* and vector_ops.* to LinearAlgebra
  • no more direct access of atom::node, remapped to set/getPosition()
  • no more direct access to atom::type, remapped to set/getType() (also in atom due to derivation and atominfo::AtomicElement is private not protected).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/atom_trajectoryparticle.cpp

    r8d6d31 r8f4df1  
    3838{
    3939  for (int i=NDIM;i--;)
    40     *temperature += type->mass * Trajectory.U.at(step)[i]* Trajectory.U.at(step)[i];
     40    *temperature += getType()->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 * type->mass * Trajectory.U.at(Step)[d] * Trajectory.U.at(Step)[d];
     67    *ActualTemp += 0.5 * getType()->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]/type->mass);     // F = m * a and s =
     115    Trajectory.R.at(NextStep)[d] += 0.5*configuration->Deltat*configuration->Deltat*(Trajectory.F.at(NextStep)[d]/getType()->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]/type->mass); // v = F/m * t
     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
    121121  }
    122122  // Update R (and F)
     
    137137void TrajectoryParticle::SumUpKineticEnergy( int Step, double *TotalMass, Vector *TotalVelocity ) const
    138138{
    139   *TotalMass += type->mass;  // sum up total mass
     139  *TotalMass += getType()->mass;  // sum up total mass
    140140  for(int d=0;d<NDIM;d++) {
    141     TotalVelocity->at(d) += Trajectory.U.at(Step)[d]*type->mass;
     141    TotalVelocity->at(d) += Trajectory.U.at(Step)[d]*getType()->mass;
    142142  }
    143143};
     
    154154    for (int d=0; d<NDIM; d++) {
    155155      U[d] *= ScaleTempFactor;
    156       *ekin += 0.5*type->mass * U[d]*U[d];
     156      *ekin += 0.5*getType()->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]*type->mass;
     172      *E += U[d]*U[d]*getType()->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/type->mass * ( (G_over_E) * (U[d]*type->mass) );
    188       *ekin += type->mass * U[d]*U[d];
     187      U[d] += configuration->Deltat/getType()->mass * ( (G_over_E) * (U[d]*getType()->mass) );
     188      *ekin += getType()->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/type->mass); // sigma = (k_b T)/m (Hartree/atomicmass = atomiclength/atomictime)
     200  double sigma  = sqrt(configuration->Thermostats->TargetTemp/getType()->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*type->mass * U[d]*U[d];
     213      *ekin += 0.5*getType()->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*type->mass * U[d]*U[d];
     229      *ekin += 0.5*getType()->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]*type->mass;
     243      *delta_alpha += U[d]*U[d]*getType()->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/type->mass * (configuration->Thermostats->alpha * (U[d] * type->mass));
    259         *ekin += (0.5*type->mass) * U[d]*U[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];
    260260      }
    261261  }
    262262};
     263
     264
     265std::ostream & TrajectoryParticle::operator << (std::ostream &ost) const
     266{
     267  ParticleInfo::operator<<(ost);
     268  ost << "," << getPosition();
     269  return ost;
     270}
     271
     272std::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.