- Timestamp:
- Feb 3, 2011, 9:51:18 AM (14 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:
- ea430a
- Parents:
- d6f886
- git-author:
- Frederik Heber <heber@…> (01/15/11 15:04:18)
- git-committer:
- Frederik Heber <heber@…> (02/03/11 09:51:18)
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/atom.cpp
rd6f886 r9df680 49 49 ParticleInfo(pointer), 50 50 father(pointer), 51 sort(&nr) 51 sort(&nr), 52 mol(0) 52 53 { 53 54 setType(pointer->getType()); // copy element of atom … … 55 56 AtomicVelocity = pointer->AtomicVelocity; // copy velocity 56 57 FixedIon = pointer->FixedIon; 57 mol = 0;58 58 }; 59 59 60 60 atom *atom::clone(){ 61 61 atom *res = new atom(this); 62 res->father = this;63 res->sort = &res->nr;64 res->setType(getType());65 res->setPosition(this->getPosition());66 res->AtomicVelocity = this->AtomicVelocity;67 res->FixedIon = FixedIon;68 res->mol = 0;69 62 World::getInstance().registerAtom(res); 70 63 return res; -
src/boundary.cpp
rd6f886 r9df680 852 852 if (DoRandomRotation) 853 853 for (int i=0;i<NDIM;i++) 854 phi[i] = rand()/(RAND_MAX/(2.*M_PI));854 phi[i] = (rand()/RAND_MAX)*(2.*M_PI); 855 855 856 856 for(molecule::const_iterator iter = filler->begin(); iter !=filler->end();++iter){ … … 961 961 * @param Filling molecule whose atoms to check, removed if eventually left 962 962 * empty. 963 */ 964 void RemoveAtomsOutsideDomain(molecule *&Filling) 965 { 963 * @return true - atoms had to be removed, false - no atoms have been removed 964 */ 965 bool RemoveAtomsOutsideDomain(molecule *&Filling) 966 { 967 bool status = false; 966 968 Box &Domain = World::getInstance().getDomain(); 967 969 // check if all is still inside domain … … 969 971 // check whether each atom is inside box 970 972 if (!Domain.isInside((*miter)->getPosition())) { 973 status = true; 971 974 atom *Walker = *miter; 972 975 ++miter; … … 980 983 World::getInstance().destroyMolecule(Filling); 981 984 } 985 return status; 982 986 } 983 987 … … 1069 1073 } 1070 1074 1071 // Center filler at origin 1072 filler->CenterEdge(&Inserter); 1075 // Center filler at its center of gravity 1076 Vector *gravity = filler->DetermineCenterOfGravity(); 1077 filler->CenterAtVector(gravity); 1078 delete gravity; 1073 1079 //const int FillerCount = filler->getAtomCount(); 1074 1080 DoLog(2) && (Log() << Verbose(2) << "INFO: Filler molecule has the following bonds:" << endl); … … 1124 1130 DoLog(1) && (Log() << Verbose(1) << "INFO: Position at " << Inserter << " is void point." << endl); 1125 1131 // fill! 1126 if (firstInsertion) { // use filler as first molecule 1132 Filling = filler->CopyMolecule(); 1133 RandomizeMoleculePositions(Filling, RandomAtomDisplacement, Rotations); 1134 // translation 1135 Filling->Translate(&Inserter); 1136 // remove out-of-bounds atoms 1137 const bool status = RemoveAtomsOutsideDomain(Filling); 1138 if ((firstInsertion) && (!status)) { // no atom has been removed 1139 // remove copied atoms and molecule again 1140 Filling->removeAtomsinMolecule(); 1141 World::getInstance().destroyMolecule(Filling); 1142 // and mark is final filler position 1127 1143 Filling = filler; 1128 1144 firstInsertion = false; 1129 1145 firstInserter = Inserter; 1130 } else { // copy from filler molecule 1131 Filling = filler->CopyMolecule(); 1132 RandomizeMoleculePositions(Filling, RandomAtomDisplacement, Rotations); 1133 // translation 1134 Filling->Translate(&Inserter); 1135 // remove out-of-bounds atoms 1136 RemoveAtomsOutsideDomain(Filling); 1146 } else { 1137 1147 // TODO: Remove when World has no MoleculeListClass anymore 1138 1148 MolList->insert(Filling); 1139 1149 } 1140 1150 } else { 1141 1151 DoLog(1) && (Log() << Verbose(1) << "INFO: Position at " << Inserter << " is non-void point, within boundary or outside of MaxDistance." << endl); 1142 1152 continue; 1143 1153 } -
src/molecule.cpp
rd6f886 r9df680 678 678 679 679 680 /** Destroys all atoms inside this molecule. 681 */ 682 void molecule::removeAtomsinMolecule() 683 { 684 // remove each atom from world 685 for(molecule::const_iterator AtomRunner = begin(); !empty(); AtomRunner = begin()) 686 World::getInstance().destroyAtom(*AtomRunner); 687 }; 688 689 680 690 /** 681 691 * Copies all atoms of a molecule which are within the defined parallelepiped. -
src/molecule.hpp
rd6f886 r9df680 171 171 bool UnlinkAtom(atom *pointer); 172 172 bool CleanupMolecule(); 173 void removeAtomsinMolecule(); 173 174 174 175 /// Add/remove atoms to/from molecule.
Note:
See TracChangeset
for help on using the changeset viewer.