Changeset 555063


Ignore:
Timestamp:
Apr 28, 2008, 1:53:54 PM (17 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:
5b15ab
Parents:
c67e16
Message:

Atoms in the fragments in the configs are again ordered as first labeled during Bond structure recognition

Due to the move to disconnected subgraph recognition an additional "layer" of molecules is inserted. The Atoms are AddCopyAtom()ed into new molecules representing each subgraph and receiving new labels thereby (even if there is just one subgraph in the end). As these labels were used in the sorted "KeySet" sets for adding atoms on the one hand, the KeySet file on the other hand however was created from the molecules directly now with labels from the topmost molecule structure ... : lines in BondFragment configs were swapped with respect to freshly fragmented and parsed from KeySet files.
Do ameloriate this, the StoreFragmentFromKeySet procedure was taken out of FragmentBOSSANOVA() and up into FragmentMolecule(), where the uppermost molecular structure is accessible. At the same time, the topmost labels (via GetTrueFather) are used in the KeySets. Thus, we receive again ordered list of atoms in each fragment config and they match perfectly with those re-created from parsed keyset files (check with diff over all BondFragment*.conf*).

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/molecules.cpp

    rc67e16 r555063  
    18711871    } // else it's "-1" or else and thus must not be added
    18721872  }
     1873  *out << Verbose(1) << "The scanned KeySet is ";
     1874  for(KeySet::iterator runner = CurrentSet.begin(); runner != CurrentSet.end(); runner++) {
     1875    *out << (*runner) << "\t";
     1876  }
     1877  *out << endl;
    18731878  return (status != 0);
    18741879};
     
    21512156          BondFragments[FragmentCounter] = NULL;
    21522157          if (Scheme == ANOVA) {
    2153             BondFragments[FragmentCounter] = MolecularWalker->Leaf->FragmentBOSSANOVA(out,BottomUpOrder,configuration);
     2158            Graph *FragmentList = MolecularWalker->Leaf->FragmentBOSSANOVA(out,BottomUpOrder,configuration);
     2159
     2160            // allocate memory for the pointer array and transmorph graphs into full molecular fragments
     2161            int TotalNumberOfMolecules = 0;
     2162            for(Graph::iterator runner = FragmentList->begin(); runner != FragmentList->end(); runner++)
     2163              TotalNumberOfMolecules++;
     2164            BondFragments[FragmentCounter] = new MoleculeListClass(TotalNumberOfMolecules, AtomCount);
     2165            int k=0;
     2166            for(Graph::iterator runner = FragmentList->begin(); runner != FragmentList->end(); runner++) {
     2167              KeySet test = (*runner).first;
     2168              BondFragments[FragmentCounter]->ListOfMolecules[k] = StoreFragmentFromKeySet(out, test, configuration);
     2169              BondFragments[FragmentCounter]->TEList[k] = ((*runner).second).second;
     2170              k++;
     2171            }
    21542172          } 
    21552173          if ((Scheme == BottomUp) || (Scheme == Combined)) { // get overlapping subgraphs
     
    28022820  // first create the minimal set of atoms from the KeySet
    28032821  for(KeySet::iterator runner = Leaflet.begin(); runner != Leaflet.end(); runner++) {
    2804     FatherOfRunner =  FindAtom((*runner));  // find the id
     2822    FatherOfRunner = FindAtom((*runner));  // find the id
    28052823    SonList[FatherOfRunner->nr] = Leaf->AddCopyAtom(FatherOfRunner);
    28062824  }
     
    31353153          //if ((!FragmentSearch->UsedList[OtherWalker->nr][i]) && (FragmentSearch->Labels[OtherWalker->nr] > FragmentSearch->Labels[FragmentSearch->Root->nr])) {
    31363154            //*out << Verbose(2+verbosity) << "Not used so far, label " << FragmentSearch->Labels[OtherWalker->nr] << " is bigger than Root's " << FragmentSearch->Labels[FragmentSearch->Root->nr] << "." << endl;
    3137           *out << Verbose(2+verbosity) << "Adding " << *OtherWalker << "." << endl;
     3155          *out << Verbose(2+verbosity) << "Adding " << *OtherWalker << " with nr " << OtherWalker->nr << "." << endl;
    31383156          TouchedList[TouchedIndex++] = OtherWalker->nr;  // note as added
    3139           FragmentSearch->FragmentSet->insert( FragmentSearch->FragmentSet->end(), OtherWalker->nr);
     3157          FragmentSearch->FragmentSet->insert(OtherWalker->GetTrueFather()->nr);
    31403158            //FragmentSearch->UsedList[OtherWalker->nr][i] = true;
    31413159          //}
     
    33143332      }
    33153333      Walker = FindAtom(AtomKeyNr);
    3316       *out << Verbose(0) << "Current Walker is: " << *Walker << " with label " << FragmentSearch.Labels[AtomKeyNr] << " and SP of " << SP << "." << endl;
     3334      *out << Verbose(0) << "Current Walker is: " << *Walker << " with nr " << Walker->nr << " and label " << FragmentSearch.Labels[AtomKeyNr] << " and SP of " << SP << "." << endl;
    33173335      // check for new sp level
    33183336      // go through all its bonds
     
    33263344#endif
    33273345                                                              ) {  // skip hydrogens and restrict to fragment
    3328           *out << Verbose(2) << "Current partner is " << *OtherWalker << " in bond " << *Binder << "." << endl;
     3346          *out << Verbose(2) << "Current partner is " << *OtherWalker << " with nr " << OtherWalker->nr << " in bond " << *Binder << "." << endl;
    33293347          // set the label if not set (and push on root stack as well)
    33303348          if (FragmentSearch.Labels[OtherWalker->nr] == -1) {
     
    34083426      *out << Verbose(0) << "Starting fragment generation with " << *FragmentSearch.Root << "." << endl;
    34093427      FragmentSearch.FragmentSet->clear(); 
    3410       FragmentSearch.FragmentSet->insert(FragmentSearch.Root->nr);
     3428      FragmentSearch.FragmentSet->insert(FragmentSearch.Root->GetTrueFather()->nr);
    34113429     
    34123430      if (FragmentSearch.FragmentSet->size() == (unsigned int) Order) {
     
    36813699 * \param ANOVAOrder ANOVA expansion is truncated above this order
    36823700 * \param *configuration configuration for writing config files for each fragment
    3683  * \return pointer to MoleculeListClass with all the fragments or NULL if something went wrong.
    3684  */
    3685 MoleculeListClass * molecule::FragmentBOSSANOVA(ofstream *out, int ANOVAOrder, config *configuration)
     3701 * \return pointer to Graph list
     3702 */
     3703Graph * molecule::FragmentBOSSANOVA(ofstream *out, int ANOVAOrder, config *configuration)
    36863704{
    36873705  Graph *FragmentList = NULL, ***FragmentLowerOrdersList = NULL;
    3688   MoleculeListClass *FragmentMoleculeList = NULL;
     3706  //MoleculeListClass *FragmentMoleculeList = NULL;
    36893707  int Order, NumLevels, NumMolecules, TotalNumMolecules = 0, *NumMoleculesOfOrder = NULL;
    36903708  int counter = 0;
     
    37023720  while (Walker->next != end) {
    37033721    Walker = Walker->next;
    3704     CompleteMolecule.insert(Walker->nr);
     3722    CompleteMolecule.insert(Walker->GetTrueFather()->nr);
    37053723  }
    37063724
     
    37753793  Free((void **)&FragmentLowerOrdersList, "molecule::FragmentBOSSANOVA: ***FragmentLowerOrdersList");
    37763794  Free((void **)&NumMoleculesOfOrder, "molecule::FragmentBOSSANOVA: *NumMoleculesOfOrder");
    3777   // allocate memory for the pointer array and transmorph graphs into full molecular fragments
    3778   FragmentMoleculeList = new MoleculeListClass(TotalNumMolecules, AtomCount);
    3779   int k=0;
    3780   for(Graph::iterator runner = FragmentList->begin(); runner != FragmentList->end(); runner++) {
    3781     KeySet test = (*runner).first;
    3782     FragmentMoleculeList->ListOfMolecules[k] = StoreFragmentFromKeySet(out, test, configuration);
    3783     FragmentMoleculeList->TEList[k] = ((*runner).second).second;
    3784     k++;
    3785   }
    37863795 
    37873796  *out << Verbose(0) << "End of FragmentBOSSANOVA." << endl;
    3788   delete(FragmentList);
    3789   return FragmentMoleculeList;
     3797  return FragmentList;
    37903798};
    37913799
  • src/molecules.hpp

    rc67e16 r555063  
    532532  void FragmentMoleculeByBond(ofstream *out, bond *Bond, molecule **LeftFragment, molecule **RightFragment, bool IsAngstroem, enum CutCyclicBond CutCyclic);
    533533  /// -# BOSSANOVA
    534         MoleculeListClass * FragmentBOSSANOVA(ofstream *out, int ANOVAOrder, config *configuration);
     534  Graph * FragmentBOSSANOVA(ofstream *out, int ANOVAOrder, config *configuration);
    535535        int CreateListOfUniqueFragmentsOfOrder(ofstream *out, int Order, Graph *ListOfGraph, KeySet Fragment, double TEFactor, config *configuration);
    536536  bool BuildInducedSubgraph(ofstream *out, const molecule *Father);
Note: See TracChangeset for help on using the changeset viewer.