Ignore:
Timestamp:
May 31, 2010, 5:32:27 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, 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:
e08c46
Parents:
42af9e (diff), a7b761b (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.
git-author:
Frederik Heber <heber@…> (05/31/10 17:29:30)
git-committer:
Frederik Heber <heber@…> (05/31/10 17:32:27)
Message:

Merge commit 'jupiter/MoleculeStartEndSwitch' into CommandLineActionMapping

Conflicts:

molecuilder/src/Makefile.am
molecuilder/src/builder.cpp
molecuilder/src/config.cpp
molecuilder/src/helpers.hpp
molecuilder/src/molecule.cpp
molecuilder/src/molecule_dynamics.cpp
molecuilder/src/molecule_fragmentation.cpp
molecuilder/src/molecule_geometry.cpp
molecuilder/src/molecule_graph.cpp
molecuilder/src/moleculelist.cpp
molecuilder/src/unittests/AnalysisCorrelationToPointUnitTest.cpp
molecuilder/src/unittests/listofbondsunittest.cpp

Integration of MoleculeStartEndSwitch had the following consequences:

  • no more AtomCount -> getAtomCount()
  • no more start/end -> begin(), end() and iterator
  • no more decent ordering in atomic ids (hence, Simple_configuration/8 and Domain/5, Domain/6 now check by comparing sorted xyz, not confs)

There is still a huge problem with bonds. One test runs into an endless loop.

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Legacy/oldmenu.cpp

    r42af9e r1024cb  
    424424void oldmenu::RemoveAtoms(molecule *mol)
    425425{
    426   atom *first, *second;
     426  atom *second;
    427427  int axis;
    428428  double tmp1, tmp2;
     
    447447      break;
    448448    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(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((*runner)->x) > tmp1*tmp1) // distance to first above radius ...
     457            mol->RemoveAtom((*runner));
     458        }
    459459      }
    460460      break;
     
    466466      Log() << Verbose(0) << "Upper boundary: ";
    467467      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[axis] < tmp1) || (first->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[axis] < tmp1) || ((*runner)->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));
    476474        }
    477475      }
     
    516514        min[i] = 0.;
    517515
    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;
    522518        tmp1 = 0.;
    523         if (first != second) {
    524           x = first->x - second->x;
     519        if (first != (*iter)) {
     520          x = first->x - (*iter)->x;
    525521          tmp1 = x.Norm();
    526522        }
    527523        if ((tmp1 != 0.) && ((min[Z] == 0.) || (tmp1 < min[Z]))) min[Z] = tmp1;
    528         //Log() << Verbose(0) << "Bond length between Atom " << first->nr << " and " << second->nr << ": " << tmp1 << " a.u." << endl;
     524        //Log() << Verbose(0) << "Bond length between Atom " << first->nr << " and " << ((*iter)->nr << ": " << tmp1 << " a.u." << endl;
    529525      }
    530526      for (int i=MAX_ELEMENTS;i--;)
     
    755751    Log() << Verbose(0) << "State the factor: ";
    756752    cin >> faktor;
    757 
    758     mol->CountAtoms(); // recount atoms
    759     if (mol->AtomCount != 0) {  // if there is more than none
    760       count = mol->AtomCount;  // is changed becausing of adding, thus has to be stored away beforehand
     753    if (mol->getAtomCount() != 0) {  // if there is more than none
     754      count = mol->getAtomCount();  // is changed becausing of adding, thus has to be stored away beforehand
    761755      Elements = new const element *[count];
    762756      vectors = new Vector *[count];
    763757      j = 0;
    764       first = mol->start;
    765       while (first->next != mol->end) { // make a list of all atoms with coordinates and element
    766         first = first->next;
    767         Elements[j] = first->type;
    768         vectors[j] = &first->x;
     758      for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
     759        Elements[j] = (*iter)->type;
     760        vectors[j] = &(*iter)->x;
    769761        j++;
    770762      }
     
    10251017    return;
    10261018  }
    1027   atom *Walker = mol->start;
    10281019
    10291020  // generate some KeySets
    10301021  Log() << Verbose(0) << "Generating KeySets." << endl;
    1031   KeySet TestSets[mol->AtomCount+1];
     1022  KeySet TestSets[mol->getAtomCount()+1];
    10321023  i=1;
    1033   while (Walker->next != mol->end) {
    1034     Walker = Walker->next;
     1024  for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
    10351025    for (int j=0;j<i;j++) {
    1036       TestSets[j].insert(Walker->nr);
     1026      TestSets[j].insert((*iter)->nr);
    10371027    }
    10381028    i++;
     
    10401030  Log() << Verbose(0) << "Testing insertion of already present item in KeySets." << endl;
    10411031  KeySetTestPair test;
    1042   test = TestSets[mol->AtomCount-1].insert(Walker->nr);
    1043   if (test.second) {
    1044     Log() << Verbose(1) << "Insertion worked?!" << endl;
     1032  molecule::const_iterator iter = mol->begin();
     1033  if (iter != mol->end()) {
     1034    test = TestSets[mol->getAtomCount()-1].insert((*iter)->nr);
     1035    if (test.second) {
     1036      Log() << Verbose(1) << "Insertion worked?!" << endl;
     1037    } else {
     1038      Log() << Verbose(1) << "Insertion rejected: Present object is " << (*test.first) << "." << endl;
     1039    }
    10451040  } else {
    1046     Log() << Verbose(1) << "Insertion rejected: Present object is " << (*test.first) << "." << endl;
    1047   }
    1048   TestSets[mol->AtomCount].insert(mol->end->previous->nr);
    1049   TestSets[mol->AtomCount].insert(mol->end->previous->previous->previous->nr);
     1041    eLog() << Verbose(1) << "No atoms to test double insertion." << endl;
     1042  }
    10501043
    10511044  // constructing Graph structure
     
    10551048  // insert KeySets into Subgraphs
    10561049  Log() << Verbose(0) << "Inserting KeySets into Subgraph class." << endl;
    1057   for (int j=0;j<mol->AtomCount;j++) {
     1050  for (int j=0;j<mol->getAtomCount();j++) {
    10581051    Subgraphs.insert(GraphPair (TestSets[j],pair<int, double>(counter++, 1.)));
    10591052  }
    10601053  Log() << Verbose(0) << "Testing insertion of already present item in Subgraph." << endl;
    10611054  GraphTestPair test2;
    1062   test2 = Subgraphs.insert(GraphPair (TestSets[mol->AtomCount],pair<int, double>(counter++, 1.)));
     1055  test2 = Subgraphs.insert(GraphPair (TestSets[mol->getAtomCount()],pair<int, double>(counter++, 1.)));
    10631056  if (test2.second) {
    10641057    Log() << Verbose(1) << "Insertion worked?!" << endl;
Note: See TracChangeset for help on using the changeset viewer.