Changeset 7fd416 for src


Ignore:
Timestamp:
Jun 2, 2010, 12:22:47 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:
accebe
Parents:
6ef0a4
Message:

FIX: CorrelationToSurface() was broken.

  • DOCU: CorrelationToSurface() is more verbose on empty molecules, molecule::doCountAtoms() is verbose on naming atoms only for high verbosity levels
  • MEMFIX: ParseCommandLineOptions() - case 'CP' did not set counter to zero for re-setting active flag.
  • BUGFIX: molecule::DeterminePeriodicCenter() - InverseMatrix() was called with cell_size instead of full matrix.
  • rewritten MoleculeListClass::DissectMoleculeIntoConnectedSubgraphs() a bit:
    • molname and contained atoms are given
    • no more stupid map, atoms are directly transfered from Leaf to molecules[]
    • mol that contained all was not destroyed after use
Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/analysis_correlation.cpp

    r6ef0a4 r7fd416  
    262262    if ((*MolWalker)->ActiveFlag) {
    263263      DoLog(1) && (Log() << Verbose(1) << "Current molecule is " << (*MolWalker)->name << "." << endl);
    264       for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
    265         //Log() << Verbose(3) << "Current atom is " << *(*iter) << "." << endl;
     264      if ((*MolWalker)->empty())
     265        DoLog(1) && (1) && (Log() << Verbose(1) << "\t is empty." << endl);
     266      for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
     267        DoLog(1) && (Log() << Verbose(1) << "\tCurrent atom is " << *(*iter) << "." << endl);
    266268        if ((type == NULL) || ((*iter)->type == type)) {
    267269          TriangleIntersectionList Intersections((*iter)->node,Surface,LC);
     
    271273        }
    272274      }
    273     } else
     275    } else {
    274276      DoLog(1) && (Log() << Verbose(1) << "molecule " << (*MolWalker)->name << " is not active." << endl);
     277    }
    275278
    276279  return outmap;
  • src/builder.cpp

    r6ef0a4 r7fd416  
    19111911                          output.close();
    19121912                          binoutput.close();
     1913                          counter = 0;
    19131914                          for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++)
    19141915                            (*BigFinder)->ActiveFlag = Actives[counter++];
  • src/molecule.cpp

    r6ef0a4 r7fd416  
    963963    sstr << (*iter)->type->symbol << (*iter)->nr+1;
    964964    (*iter)->setName(sstr.str());
    965     Log() << Verbose(3) << "Naming atom nr. " << (*iter)->nr << " " << (*iter)->getName() << "." << endl;
     965    DoLog(3) && (Log() << Verbose(3) << "Naming atom nr. " << (*iter)->nr << " " << (*iter)->getName() << "." << endl);
    966966    i++;
    967967  }
  • src/molecule_geometry.cpp

    r6ef0a4 r7fd416  
    266266  double * const cell_size = World::getInstance().getDomain();
    267267  double *matrix = ReturnFullMatrixforSymmetric(cell_size);
    268   double *inversematrix = InverseMatrix(cell_size);
     268  double *inversematrix = InverseMatrix(matrix);
    269269  double tmp;
    270270  bool flag;
  • src/moleculelist.cpp

    r6ef0a4 r7fd416  
    754754    World::getInstance().destroyMolecule(*MolRunner);
    755755  }
    756   // 0b. remove all bonds
     756  // 0b. remove all bonds and construct a molecule with all atoms
    757757  molecule *mol = World::getInstance().createMolecule();
    758758  vector <atom *> allatoms = World::getInstance().getAllAtoms();
     
    789789  char number[MAXSTRINGSIZE];
    790790  molecule **molecules = new molecule *[MolCount];
     791  MoleculeLeafClass *MolecularWalker = Subgraphs;
    791792  for (int i=0;i<MolCount;i++) {
     793    MolecularWalker = MolecularWalker->next;
    792794    molecules[i] = World::getInstance().createMolecule();
    793795    molecules[i]->ActiveFlag = true;
     
    798800    }
    799801    DoLog(1) && (Log() << Verbose(1) << "MolName is " << molecules[i]->name << endl);
     802    for (molecule::iterator iter = MolecularWalker->Leaf->begin(); iter != MolecularWalker->Leaf->end(); ++iter) {
     803      DoLog(1) && (Log() << Verbose(1) << **iter << endl);
     804    }
    800805    insert(molecules[i]);
    801806  }
     
    803808  // 4b. create and fill map of which atom is associated to which connected molecule (note, counting starts at 1)
    804809  int FragmentCounter = 0;
    805   int *MolMap = new int[mol->getAtomCount()];
    806   for (int i=0;i<mol->getAtomCount();i++)
    807     MolMap[i] = 0;
    808   MoleculeLeafClass *MolecularWalker = Subgraphs;
     810  map<int, atom *> AtomToFragmentMap;
     811  MolecularWalker = Subgraphs;
    809812  while (MolecularWalker->next != NULL) {
    810813    MolecularWalker = MolecularWalker->next;
    811     for (molecule::const_iterator iter = MolecularWalker->Leaf->begin(); iter != MolecularWalker->Leaf->end(); ++iter) {
    812       MolMap[(*iter)->GetTrueFather()->nr] = FragmentCounter+1;
     814    for (molecule::iterator iter = MolecularWalker->Leaf->begin(); !MolecularWalker->Leaf->empty(); iter = MolecularWalker->Leaf->begin()) {
     815      atom * Walker = *iter;
     816      DoLog(1) && (Log() << Verbose(1) << "Re-linking " << Walker << "..." << endl);
     817      MolecularWalker->Leaf->erase(iter);
     818      molecules[FragmentCounter]->AddAtom(Walker);    // counting starts at 1
    813819    }
    814820    FragmentCounter++;
    815821  }
    816 
    817   // 4c. relocate atoms to new molecules and remove from Leafs
    818   for (molecule::iterator iter = mol->begin(); !mol->empty(); iter = mol->begin()) {
    819     const int count = mol->getAtomCount();
    820     if (((*iter)->nr <0) || ((*iter)->nr >= count)) {
    821       DoeLog(0) && (eLog()<< Verbose(0) << "Index " << (*iter)->nr << " of atom " << **iter << " in molecule of " << count << " atoms is invalid!" << endl);
    822       performCriticalExit();
    823     }
    824     const int Index = MolMap[(*iter)->nr];
    825     if (Index != 0) {
    826       DoLog(3) && (Log() << Verbose(3) << "Re-linking " << **iter << "..." << endl);
    827       molecules[Index-1]->AddAtom((*iter));    // counting starts at 1
    828       mol->erase(iter);
    829     } else {
    830       DoeLog(0) && (eLog()<< Verbose(0) << "Atom " << **iter << " not associated to molecule!" << endl);
    831       performCriticalExit();
    832     }
    833   }
     822  World::getInstance().destroyMolecule(mol);
     823
    834824  // 4d. we don't need to redo bonds, as they are connected subgraphs and still maintain their ListOfBonds, but we have to remove them from first..last list
    835825  // TODO: check whether this is really not needed anymore
     
    841831  }
    842832  delete(MolecularWalker);
    843   delete[](MolMap);
    844833  delete[](molecules);
    845834  DoLog(1) && (Log() << Verbose(1) << "I scanned " << FragmentCounter << " molecules." << endl);
Note: See TracChangeset for help on using the changeset viewer.