Changeset 401f90 for src/molecule_geometry.cpp
- Timestamp:
- Dec 28, 2011, 3:27:15 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:
- 3e4fb6
- Parents:
- f9b967 (diff), adb5cda (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule_geometry.cpp
rf9b967 r401f90 55 55 56 56 // go through all atoms 57 BOOST_FOREACH(atom* iter, atoms){57 for (iterator iter = begin(); iter != end(); ++iter) { 58 58 if (DoLog(4) && (*Center != *CenterBox)) 59 LOG(4, "INFO: atom before is at " << * iter);60 * iter -= *Center;61 * iter += *CenterBox;59 LOG(4, "INFO: atom before is at " << **iter); 60 **iter -= *Center; 61 **iter += *CenterBox; 62 62 if (DoLog(4) && (*Center != *CenterBox)) 63 LOG(4, "INFO: atom after is at " << * iter);64 } 65 atoms.transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1));63 LOG(4, "INFO: atom after is at " << **iter); 64 } 65 getAtomSet().transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1)); 66 66 67 67 delete(Center); … … 80 80 81 81 // go through all atoms 82 atoms.transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1));82 getAtomSet().transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1)); 83 83 84 84 return status; … … 94 94 Vector *min = new Vector; 95 95 96 molecule::const_iterator iter = begin(); // start at first in list96 const_iterator iter = begin(); // start at first in list 97 97 if (iter != end()) { //list not empty? 98 98 for (int i=NDIM;i--;) { … … 122 122 { 123 123 int Num = 0; 124 molecule::const_iterator iter = begin(); // start at first in list124 const_iterator iter = begin(); // start at first in list 125 125 Vector Center; 126 126 … … 141 141 Vector * molecule::DetermineCenterOfAll() const 142 142 { 143 molecule::const_iterator iter = begin(); // start at first in list143 const_iterator iter = begin(); // start at first in list 144 144 Vector *a = new Vector(); 145 145 double Num = 0; … … 174 174 Vector * molecule::DetermineCenterOfGravity() const 175 175 { 176 molecule::const_iterator iter = begin(); // start at first in list176 const_iterator iter = begin(); // start at first in list 177 177 Vector *a = new Vector(); 178 178 Vector tmp; … … 202 202 DeterminePeriodicCenter(NewCenter); 203 203 // go through all atoms 204 BOOST_FOREACH(atom* iter, atoms){205 * iter -= NewCenter;204 for (iterator iter = begin(); iter != end(); ++iter) { 205 **iter -= NewCenter; 206 206 } 207 207 }; … … 215 215 { 216 216 // go through all atoms 217 BOOST_FOREACH(atom* iter, atoms){218 * iter -= *newcenter;217 for (iterator iter = begin(); iter != end(); ++iter) { 218 **iter -= *newcenter; 219 219 } 220 220 }; … … 233 233 234 234 // sum up inertia tensor 235 for ( molecule::const_iterator iter = begin(); iter != end(); ++iter) {235 for (const_iterator iter = begin(); iter != end(); ++iter) { 236 236 Vector x = (*iter)->getPosition(); 237 237 x -= *CenterOfGravity; … … 286 286 287 287 // and rotate 288 for ( molecule::iterator iter = begin(); iter != end(); ++iter) {288 for (iterator iter = begin(); iter != end(); ++iter) { 289 289 *(*iter) -= *CenterOfGravity; 290 290 (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), alpha)); … … 306 306 void molecule::Scale(const double ** const factor) 307 307 { 308 for ( molecule::const_iterator iter = begin(); iter != end(); ++iter) {308 for (iterator iter = begin(); iter != end(); ++iter) { 309 309 for (size_t j=0;j<(*iter)->getTrajectorySize();j++) { 310 310 Vector temp = (*iter)->getPositionAtStep(j); … … 320 320 void molecule::Translate(const Vector *trans) 321 321 { 322 for ( molecule::const_iterator iter = begin(); iter != end(); ++iter) {322 for (iterator iter = begin(); iter != end(); ++iter) { 323 323 for (size_t j=0;j<(*iter)->getTrajectorySize();j++) { 324 324 (*iter)->setPositionAtStep(j, (*iter)->getPositionAtStep(j) + (*trans)); … … 336 336 337 337 // go through all atoms 338 BOOST_FOREACH(atom* iter, atoms){339 * iter += *trans;340 } 341 atoms.transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1));338 for (iterator iter = begin(); iter != end(); ++iter) { 339 **iter += *trans; 340 } 341 getAtomSet().transformNodes(boost::bind(&Box::WrapPeriodically,domain,_1)); 342 342 343 343 }; … … 351 351 OBSERVE; 352 352 Plane p(*n,0); 353 atoms.transformNodes(boost::bind(&Plane::mirrorVector,p,_1));353 getAtomSet().transformNodes(boost::bind(&Plane::mirrorVector,p,_1)); 354 354 }; 355 355 … … 371 371 Center.Zero(); 372 372 flag = true; 373 for ( molecule::const_iterator iter = begin(); iter != end(); ++iter) {373 for (const_iterator iter = begin(); iter != end(); ++iter) { 374 374 if ((saturation == DontSaturate) || ((*iter)->getType()->getAtomicNumber() != 1)) { 375 375 Testvector = inversematrix * (*iter)->getPosition(); … … 435 435 alpha = atan(-n->at(0)/n->at(2)); 436 436 LOG(1, "INFO: Z-X-angle: " << alpha << " ... "); 437 for ( molecule::const_iterator iter = begin(); iter != end(); ++iter) {437 for (iterator iter = begin(); iter != end(); ++iter) { 438 438 tmp = (*iter)->at(0); 439 439 (*iter)->set(0, cos(alpha) * tmp + sin(alpha) * (*iter)->at(2)); … … 455 455 alpha = atan(-n->at(1)/n->at(2)); 456 456 LOG(1, "INFO: Z-Y-angle: " << alpha << " ... "); 457 for ( molecule::const_iterator iter = begin(); iter != end(); ++iter) {457 for (iterator iter = begin(); iter != end(); ++iter) { 458 458 tmp = (*iter)->at(1); 459 459 (*iter)->set(1, cos(alpha) * tmp + sin(alpha) * (*iter)->at(2));
Note:
See TracChangeset
for help on using the changeset viewer.