Ignore:
Timestamp:
May 27, 2010, 10:46:54 AM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
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:
1024cb
Parents:
8f215d (diff), 05a97c (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.
Message:

Merge branch 'MoleculeStartEndSwitch' into StructureRefactoring

Conflicts:

molecuilder/src/Helpers/Assert.cpp
molecuilder/src/Helpers/Assert.hpp
molecuilder/src/Legacy/oldmenu.cpp
molecuilder/src/Makefile.am
molecuilder/src/Patterns/Cacheable.hpp
molecuilder/src/Patterns/Observer.cpp
molecuilder/src/Patterns/Observer.hpp
molecuilder/src/analysis_correlation.cpp
molecuilder/src/boundary.cpp
molecuilder/src/builder.cpp
molecuilder/src/config.cpp
molecuilder/src/helpers.hpp
molecuilder/src/molecule.cpp
molecuilder/src/molecule.hpp
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/tesselation.cpp
molecuilder/src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
molecuilder/src/unittests/ObserverTest.cpp
molecuilder/src/unittests/ObserverTest.hpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/analysis_correlation.cpp

    r8f215d ra7b761b  
    4040  }
    4141  outmap = new PairCorrelationMap;
    42   for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
     42  for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++){
    4343    if ((*MolWalker)->ActiveFlag) {
    4444      DoeLog(2) && (eLog()<< Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
    45       atom *Walker = (*MolWalker)->start;
    46       while (Walker->next != (*MolWalker)->end) {
    47         Walker = Walker->next;
    48         DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl);
    49         if ((type1 == NULL) || (Walker->type == type1)) {
    50           for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++)
     45      eLog() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
     46      for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
     47        DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
     48        if ((type1 == NULL) || ((*iter)->type == type1)) {
     49          for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++){
    5150            if ((*MolOtherWalker)->ActiveFlag) {
    5251              DoLog(2) && (Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl);
    53               atom *OtherWalker = (*MolOtherWalker)->start;
    54               while (OtherWalker->next != (*MolOtherWalker)->end) { // only go up to Walker
    55                 OtherWalker = OtherWalker->next;
    56                 DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl);
    57                 if (Walker->nr < OtherWalker->nr)
    58                   if ((type2 == NULL) || (OtherWalker->type == type2)) {
    59                     distance = Walker->node->PeriodicDistance(*OtherWalker->node, World::getInstance().getDomain());
    60                     //Log() << Verbose(1) <<"Inserting " << *Walker << " and " << *OtherWalker << endl;
    61                     outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) );
     52              for (molecule::const_iterator runner = (*MolOtherWalker)->begin(); runner != (*MolOtherWalker)->end(); ++runner) {
     53                DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl);
     54                if ((*iter)->getId() < (*runner)->getId()){
     55                  if ((type2 == NULL) || ((*runner)->type == type2)) {
     56                    distance = (*iter)->node->PeriodicDistance(*(*runner)->node,  World::getInstance().getDomain());
     57                    //Log() << Verbose(1) <<"Inserting " << *(*iter) << " and " << *(*runner) << endl;
     58                    outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> ((*iter), (*runner)) ) );
    6259                  }
     60                }
    6361              }
     62            }
    6463          }
    6564        }
    6665      }
    6766    }
    68 
     67  }
    6968  return outmap;
    7069};
     
    101100      double * FullInverseMatrix = InverseMatrix(FullMatrix);
    102101      DoeLog(2) && (eLog()<< Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
    103       atom *Walker = (*MolWalker)->start;
    104       while (Walker->next != (*MolWalker)->end) {
    105         Walker = Walker->next;
    106         DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl);
    107         if ((type1 == NULL) || (Walker->type == type1)) {
    108           periodicX = *(Walker->node);
     102      for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
     103        DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
     104        if ((type1 == NULL) || ((*iter)->type == type1)) {
     105          periodicX = *(*iter)->node;
    109106          periodicX.MatrixMultiplication(FullInverseMatrix);  // x now in [0,1)^3
    110107          // go through every range in xyz and get distance
     
    117114                  if ((*MolOtherWalker)->ActiveFlag) {
    118115                    DoLog(2) && (Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl);
    119                     atom *OtherWalker = (*MolOtherWalker)->start;
    120                     while (OtherWalker->next != (*MolOtherWalker)->end) { // only go up to Walker
    121                       OtherWalker = OtherWalker->next;
    122                       DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl);
    123                       if (Walker->nr < OtherWalker->nr)
    124                         if ((type2 == NULL) || (OtherWalker->type == type2)) {
    125                           periodicOtherX = *(OtherWalker->node);
     116                    for (molecule::const_iterator runner = (*MolOtherWalker)->begin(); runner != (*MolOtherWalker)->end(); ++runner) {
     117                      DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl);
     118                      if ((*iter)->nr < (*runner)->nr)
     119                        if ((type2 == NULL) || ((*runner)->type == type2)) {
     120                          periodicOtherX = *(*runner)->node;
    126121                          periodicOtherX.MatrixMultiplication(FullInverseMatrix);  // x now in [0,1)^3
    127122                          // go through every range in xyz and get distance
     
    132127                                checkOtherX.MatrixMultiplication(FullMatrix);
    133128                                distance = checkX.distance(checkOtherX);
    134                                 //Log() << Verbose(1) <<"Inserting " << *Walker << " and " << *OtherWalker << endl;
    135                                 outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) );
     129                                //Log() << Verbose(1) <<"Inserting " << *(*iter) << " and " << *(*runner) << endl;
     130                                outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> ((*iter), (*runner)) ) );
    136131                              }
    137132                        }
     
    169164    if ((*MolWalker)->ActiveFlag) {
    170165      DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
    171       atom *Walker = (*MolWalker)->start;
    172       while (Walker->next != (*MolWalker)->end) {
    173         Walker = Walker->next;
    174         DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl);
    175         if ((type == NULL) || (Walker->type == type)) {
    176           distance = Walker->node->PeriodicDistance(*point, World::getInstance().getDomain());
     166      for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
     167        DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
     168        if ((type == NULL) || ((*iter)->type == type)) {
     169          distance = (*iter)->node->PeriodicDistance(*point, World::getInstance().getDomain());
    177170          DoLog(4) && (Log() << Verbose(4) << "Current distance is " << distance << "." << endl);
    178           outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) );
     171          outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> ((*iter), point) ) );
    179172        }
    180173      }
     
    211204      double * FullInverseMatrix = InverseMatrix(FullMatrix);
    212205      DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
    213       atom *Walker = (*MolWalker)->start;
    214       while (Walker->next != (*MolWalker)->end) {
    215         Walker = Walker->next;
    216         DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl);
    217         if ((type == NULL) || (Walker->type == type)) {
    218           periodicX = *(Walker->node);
     206      for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
     207        DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
     208        if ((type == NULL) || ((*iter)->type == type)) {
     209          periodicX = *(*iter)->node;
    219210          periodicX.MatrixMultiplication(FullInverseMatrix);  // x now in [0,1)^3
    220211          // go through every range in xyz and get distance
     
    226217                distance = checkX.distance(*point);
    227218                DoLog(4) && (Log() << Verbose(4) << "Current distance is " << distance << "." << endl);
    228                 outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) );
     219                outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (*iter, point) ) );
    229220              }
    230221        }
     
    261252    if ((*MolWalker)->ActiveFlag) {
    262253      DoLog(1) && (Log() << Verbose(1) << "Current molecule is " << (*MolWalker)->name << "." << endl);
    263       atom *Walker = (*MolWalker)->start;
    264       while (Walker->next != (*MolWalker)->end) {
    265         Walker = Walker->next;
    266         //Log() << Verbose(1) << "Current atom is " << *Walker << "." << endl;
    267         if ((type == NULL) || (Walker->type == type)) {
    268           TriangleIntersectionList Intersections(Walker->node,Surface,LC);
     254      for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
     255        //Log() << Verbose(3) << "Current atom is " << *(*iter) << "." << endl;
     256        if ((type == NULL) || ((*iter)->type == type)) {
     257          TriangleIntersectionList Intersections((*iter)->node,Surface,LC);
    269258          distance = Intersections.GetSmallestDistance();
    270259          triangle = Intersections.GetClosestTriangle();
    271           outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(distance, pair<atom *, BoundaryTriangleSet*> (Walker, triangle) ) );
     260          outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(distance, pair<atom *, BoundaryTriangleSet*> ((*iter), triangle) ) );
    272261        }
    273262      }
     
    314303      double * FullInverseMatrix = InverseMatrix(FullMatrix);
    315304      DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl);
    316       atom *Walker = (*MolWalker)->start;
    317       while (Walker->next != (*MolWalker)->end) {
    318         Walker = Walker->next;
    319         DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl);
    320         if ((type == NULL) || (Walker->type == type)) {
    321           periodicX = *(Walker->node);
     305      for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
     306        DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
     307        if ((type == NULL) || ((*iter)->type == type)) {
     308          periodicX = *(*iter)->node;
    322309          periodicX.MatrixMultiplication(FullInverseMatrix);  // x now in [0,1)^3
    323310          // go through every range in xyz and get distance
     
    337324              }
    338325          // insert
    339           outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(ShortestDistance, pair<atom *, BoundaryTriangleSet*> (Walker, ShortestTriangle) ) );
     326          outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(ShortestDistance, pair<atom *, BoundaryTriangleSet*> (*iter, ShortestTriangle) ) );
    340327          //Log() << Verbose(1) << "INFO: Inserting " << Walker << " with distance " << ShortestDistance << " to " << *ShortestTriangle << "." << endl;
    341328        }
Note: See TracChangeset for help on using the changeset viewer.