Ignore:
Timestamp:
Dec 3, 2012, 9:50:01 AM (12 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:
2ab6b6
Parents:
dcbb5d
git-author:
Frederik Heber <heber@…> (09/20/12 13:44:17)
git-committer:
Frederik Heber <heber@…> (12/03/12 09:50:01)
Message:

ExportGraph_ToFiles now does not require molecule reference anymore.

  • SortIndex is now just a dummy (identity) map.
  • FragmentationAction combines all graphs from each Fragmentationm call and exports these in one go.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Exporters/ExportGraph_ToFiles.cpp

    rdcbb5d rb4f72c  
    5454 *
    5555 * @param _graph instance of Graph containing keyset of each fragment
    56  * @param _mol molecule as reference
    57  */
    58 ExportGraph_ToFiles::ExportGraph_ToFiles(const Graph &_graph, molecule *&_mol, const enum HydrogenSaturation _saturation) :
     56 * @param saturation whether to saturate dangling bonds with hydrogen or not
     57 */
     58ExportGraph_ToFiles::ExportGraph_ToFiles(const Graph &_graph, const enum HydrogenSaturation _saturation) :
    5959                ExportGraph(_graph),
    60                 mol(_mol),
    6160                BondFragments(World::getPointer()),
    6261                saturation(_saturation)
     
    107106  // store force index reference file
    108107  {
    109     SortIndex_t SortIndex(mol);
     108    SortIndex_t SortIndex;
    110109    BondFragments.StoreForcesFile(prefix, SortIndex);
    111110  }
     
    113112  // store keysets file
    114113  TotalGraph.StoreKeySetFile(prefix);
    115 
    116   {
    117     // store Adjacency file
    118     std::string filename = prefix + ADJACENCYFILE;
    119     mol->StoreAdjacencyToFile(filename);
    120   }
    121114
    122115  // store Hydrogen saturation correction file
     
    137130    LOG(2, "DEBUG: Fragment No." << (*runner).second.first << " with TEFactor "
    138131                << (*runner).second.second << ".");
    139     BondFragments.insert(StoreFragmentFromKeySet(mol, test, World::getInstance().getConfig()));
     132    BondFragments.insert(StoreFragmentFromKeySet(test, World::getInstance().getConfig()));
    140133    ++count;
    141134  }
     
    147140 * First creates the minimal set of atoms from the KeySet, then creates the bond structure from the complete
    148141 * molecule and adds missing hydrogen where bonds were cut.
    149  * \param *mol reference molecule
    150142 * \param &Leaflet pointer to KeySet structure
    151143 * \param IsAngstroem whether we have Ansgtroem or bohrradius
    152144 * \return pointer to constructed molecule
    153145 */
    154 molecule * ExportGraph_ToFiles::StoreFragmentFromKeySet(molecule *mol, KeySet &Leaflet, bool IsAngstroem)
     146molecule * ExportGraph_ToFiles::StoreFragmentFromKeySet(KeySet &Leaflet, bool IsAngstroem)
    155147{
    156148  Info info(__func__);
     
    158150  molecule *Leaf = World::getInstance().createMolecule();
    159151
    160   StoreFragmentFromKeySet_Init(mol, Leaf, Leaflet, SonList);
     152  StoreFragmentFromKeySet_Init(Leaf, Leaflet, SonList);
    161153  // create the bonds between all: Make it an induced subgraph and add hydrogen
    162154//  LOG(2, "Creating bonds from father graph (i.e. induced subgraph creation).");
    163   CreateInducedSubgraphOfFragment(mol, Leaf, SonList, IsAngstroem);
     155  CreateInducedSubgraphOfFragment(Leaf, SonList, IsAngstroem);
    164156
    165157  //Leaflet->Leaf->ScanForPeriodicCorrection(out);
     
    168160
    169161/** Initializes some value for putting fragment of \a *mol into \a *Leaf.
    170  * \param *mol total molecule
    171162 * \param *Leaf fragment molecule
    172163 * \param &Leaflet pointer to KeySet structure
     
    174165 * \return number of atoms in fragment
    175166 */
    176 int ExportGraph_ToFiles::StoreFragmentFromKeySet_Init(molecule *mol, molecule *Leaf, KeySet &Leaflet, ListOfLocalAtoms_t &SonList)
     167int ExportGraph_ToFiles::StoreFragmentFromKeySet_Init(molecule *Leaf, KeySet &Leaflet, ListOfLocalAtoms_t &SonList)
    177168{
    178169  atom *FatherOfRunner = NULL;
    179170
    180171  // first create the minimal set of atoms from the KeySet
     172  World &world = World::getInstance();
    181173  int size = 0;
    182174  for(KeySet::const_iterator runner = Leaflet.begin(); runner != Leaflet.end(); runner++) {
    183     FatherOfRunner = mol->FindAtom((*runner));  // find the id
     175    FatherOfRunner = world.getAtom(AtomById(*runner));  // find the id
    184176    SonList.insert( std::make_pair(FatherOfRunner->getNr(), Leaf->AddCopyAtom(FatherOfRunner) ) );
    185177    size++;
     
    189181
    190182/** Creates an induced subgraph out of a fragmental key set, adding bonds and hydrogens (if treated specially).
    191  * \param *out output stream for debugging messages
    192  * \param *mol total molecule
    193183 * \param *Leaf fragment molecule
    194184 * \param IsAngstroem whether we have Ansgtroem or bohrradius
    195  * \param SonList list which atom of \a *Leaf is a son of which atom in \a *mol
    196  */
    197 void ExportGraph_ToFiles::CreateInducedSubgraphOfFragment(molecule *mol, molecule *Leaf, ListOfLocalAtoms_t &SonList, bool IsAngstroem)
     185 * \param SonList list which atom of \a *Leaf is another atom's son
     186 */
     187void ExportGraph_ToFiles::CreateInducedSubgraphOfFragment(molecule *Leaf, ListOfLocalAtoms_t &SonList, bool IsAngstroem)
    198188{
    199189  bool LonelyFlag = false;
Note: See TracChangeset for help on using the changeset viewer.