Changeset 9879f6 for src/Legacy/oldmenu.cpp
- Timestamp:
- Mar 5, 2010, 10:16:47 AM (15 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:
- d3347e
- Parents:
- e87acf
- git-author:
- Frederik Heber <heber@…> (03/05/10 10:08:44)
- git-committer:
- Frederik Heber <heber@…> (03/05/10 10:16:47)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Legacy/oldmenu.cpp
re87acf r9879f6 447 447 break; 448 448 case 'b': 449 second = mol->AskAtom("Enter number of atom as reference point: ");450 Log() << Verbose(0) << "Enter radius: ";451 cin >> tmp1;452 first = mol->start;453 second = first->next;454 while(second != mol->end) {455 first = second;456 second = first->next;457 if (first->x.DistanceSquared((const Vector *)&second->x) > tmp1*tmp1) // distance to first above radius ...458 mol->RemoveAtom(first);449 { 450 second = mol->AskAtom("Enter number of atom as reference point: "); 451 Log() << Verbose(0) << "Enter radius: "; 452 cin >> tmp1; 453 molecule::iterator runner; 454 for (molecule::iterator iter = mol->begin(); iter != mol->end(); ) { 455 runner = iter++; 456 if ((*runner)->x.DistanceSquared((const Vector *)&(*runner)->x) > tmp1*tmp1) // distance to first above radius ... 457 mol->RemoveAtom((*runner)); 458 } 459 459 } 460 460 break; … … 466 466 Log() << Verbose(0) << "Upper boundary: "; 467 467 cin >> tmp2; 468 first = mol->start; 469 second = first->next; 470 while(second != mol->end) { 471 first = second; 472 second = first->next; 473 if ((first->x.x[axis] < tmp1) || (first->x.x[axis] > tmp2)) {// out of boundary ... 474 //Log() << Verbose(0) << "Atom " << *first << " with " << first->x.x[axis] << " on axis " << axis << " is out of bounds [" << tmp1 << "," << tmp2 << "]." << endl; 475 mol->RemoveAtom(first); 468 molecule::iterator runner; 469 for (molecule::iterator iter = mol->begin(); iter != mol->end(); ) { 470 runner = iter++; 471 if (((*runner)->x.x[axis] < tmp1) || ((*runner)->x.x[axis] > tmp2)) {// out of boundary ... 472 //Log() << Verbose(0) << "Atom " << *(*runner) << " with " << (*runner)->x.x[axis] << " on axis " << axis << " is out of bounds [" << tmp1 << "," << tmp2 << "]." << endl; 473 mol->RemoveAtom((*runner)); 476 474 } 477 475 } … … 516 514 min[i] = 0.; 517 515 518 second = mol->start; 519 while ((second->next != mol->end)) { 520 second = second->next; // advance 521 Z = second->type->Z; 516 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 517 Z = (*iter)->type->Z; 522 518 tmp1 = 0.; 523 if (first != second) {519 if (first != (*iter)) { 524 520 x.CopyVector((const Vector *)&first->x); 525 x.SubtractVector((const Vector *)& second->x);521 x.SubtractVector((const Vector *)&(*iter)->x); 526 522 tmp1 = x.Norm(); 527 523 } 528 524 if ((tmp1 != 0.) && ((min[Z] == 0.) || (tmp1 < min[Z]))) min[Z] = tmp1; 529 //Log() << Verbose(0) << "Bond length between Atom " << first->nr << " and " << second->nr << ": " << tmp1 << " a.u." << endl;525 //Log() << Verbose(0) << "Bond length between Atom " << first->nr << " and " << ((*iter)->nr << ": " << tmp1 << " a.u." << endl; 530 526 } 531 527 for (int i=MAX_ELEMENTS;i--;) … … 767 763 vectors = new Vector *[count]; 768 764 j = 0; 769 first = mol->start; 770 while (first->next != mol->end) { // make a list of all atoms with coordinates and element 771 first = first->next; 772 Elements[j] = first->type; 773 vectors[j] = &first->x; 765 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 766 Elements[j] = (*iter)->type; 767 vectors[j] = &(*iter)->x; 774 768 j++; 775 769 } … … 1029 1023 return; 1030 1024 } 1031 atom *Walker = mol->start;1032 1025 1033 1026 // generate some KeySets … … 1035 1028 KeySet TestSets[mol->AtomCount+1]; 1036 1029 i=1; 1037 while (Walker->next != mol->end) { 1038 Walker = Walker->next; 1030 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 1039 1031 for (int j=0;j<i;j++) { 1040 TestSets[j].insert( Walker->nr);1032 TestSets[j].insert((*iter)->nr); 1041 1033 } 1042 1034 i++; … … 1044 1036 Log() << Verbose(0) << "Testing insertion of already present item in KeySets." << endl; 1045 1037 KeySetTestPair test; 1046 test = TestSets[mol->AtomCount-1].insert(Walker->nr); 1047 if (test.second) { 1048 Log() << Verbose(1) << "Insertion worked?!" << endl; 1038 molecule::const_iterator iter = mol->begin(); 1039 if (iter != mol->end()) { 1040 test = TestSets[mol->AtomCount-1].insert((*iter)->nr); 1041 if (test.second) { 1042 Log() << Verbose(1) << "Insertion worked?!" << endl; 1043 } else { 1044 Log() << Verbose(1) << "Insertion rejected: Present object is " << (*test.first) << "." << endl; 1045 } 1049 1046 } else { 1050 Log() << Verbose(1) << "Insertion rejected: Present object is " << (*test.first) << "." << endl; 1051 } 1052 TestSets[mol->AtomCount].insert(mol->end->previous->nr); 1053 TestSets[mol->AtomCount].insert(mol->end->previous->previous->previous->nr); 1047 eLog() << Verbose(1) << "No atoms to test double insertion." << endl; 1048 } 1054 1049 1055 1050 // constructing Graph structure
Note:
See TracChangeset
for help on using the changeset viewer.