- Timestamp:
- Feb 17, 2012, 3:24:18 PM (13 years ago)
- 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:
- b97a60
- Parents:
- 9f8b01
- git-author:
- Frederik Heber <heber@…> (01/06/12 15:38:26)
- git-committer:
- Frederik Heber <heber@…> (02/17/12 15:24:18)
- Location:
- src/Atom
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Atom/AtomicInfo.cpp
r9f8b01 r3867a7 22 22 #include "atom.hpp" 23 23 #include "AtomicInfo.hpp" 24 #include "Descriptors/AtomIdDescriptor.hpp" 25 #include "Descriptors/MoleculeIdDescriptor.hpp" 24 26 #include "Element/element.hpp" 25 27 #include "LinearAlgebra/Vector.hpp" 28 #include "molecule.hpp" 29 #include "World.hpp" 26 30 27 31 /********************************** Functions for class AtomicInfo **********************************/ … … 29 33 AtomicInfo::AtomicInfo() : 30 34 Type(NULL), 31 Father(NULL), 32 Id(-1) 35 FatherId(0), 36 MolId(0), 37 Id(0) 33 38 {} 34 39 AtomicInfo::AtomicInfo(const atom &_atom) : … … 36 41 Type(_atom.getType()), 37 42 Velocity(_atom.getAtomicVelocity()), 38 Father (_atom.father),39 Mol (_atom.getMolecule()),43 FatherId(_atom.father->getId()), 44 MolId(_atom.getMolecule()->getId()), 40 45 Id(_atom.getId()) 41 46 {} … … 49 54 _atom.setPosition(Position); 50 55 _atom.setType(Type); 51 _atom.father = const_cast<atom *>(Father); // TODO: Actually, atom::father should be const atom *!52 _atom.setMolecule(const_cast<molecule *>(Mol)); // this is ok, mol is const within AtomicInfo, but not outside (atoms need to register)53 56 _atom.setAtomicVelocity(Velocity); 54 if (_atom.getId() == Id) 55 return true; 57 58 // set old id 59 bool status = true; 60 if (_atom.getId() != Id) 61 status = _atom.changeId(Id); 62 63 // set its father 64 atom * const _father = World::getInstance().getAtom(AtomById(FatherId)); 65 if (_father == NULL) 66 _atom.father = &_atom; 56 67 else 57 return (_atom.changeId(Id)); 68 _atom.father = _father; 69 70 // setting molecule 71 molecule * const _mol = World::getInstance().getMolecule(MoleculeById(MolId)); 72 if (_mol != NULL) 73 _atom.setMolecule(_mol); // this is ok, mol is const within AtomicInfo, but not outside (atoms need to register) 74 75 return status; 58 76 } 59 77 … … 68 86 Position = AI.Position; 69 87 Type = AI.Type; 70 Father = AI.Father;71 Mol = AI.Mol;88 FatherId = AI.FatherId; 89 MolId = AI.MolId; 72 90 Velocity = AI.Velocity; 73 91 Id = AI.Id; -
src/Atom/AtomicInfo.hpp
r9f8b01 r3867a7 38 38 const element * Type; 39 39 Vector Velocity; 40 const atom * Father;41 const molecule * Mol;40 atomId_t FatherId; 41 moleculeId_t MolId; 42 42 atomId_t Id; 43 43 }; -
src/Atom/atom.cpp
r9f8b01 r3867a7 297 297 removeFromMolecule(); 298 298 mol = _mol; 299 if (!mol->containsAtom(this)){299 if ((mol) && (!mol->containsAtom(this))) 300 300 mol->insert(this); 301 }302 301 } 303 302
Note:
See TracChangeset
for help on using the changeset viewer.