Changeset b4f72c for src/Fragmentation/Exporters/ExportGraph_ToFiles.cpp
- Timestamp:
- Dec 3, 2012, 9:50:01 AM (12 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Exporters/ExportGraph_ToFiles.cpp
rdcbb5d rb4f72c 54 54 * 55 55 * @param _graph instance of Graph containing keyset of each fragment 56 * @param _mol molecule as reference57 */ 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 */ 58 ExportGraph_ToFiles::ExportGraph_ToFiles(const Graph &_graph, const enum HydrogenSaturation _saturation) : 59 59 ExportGraph(_graph), 60 mol(_mol),61 60 BondFragments(World::getPointer()), 62 61 saturation(_saturation) … … 107 106 // store force index reference file 108 107 { 109 SortIndex_t SortIndex (mol);108 SortIndex_t SortIndex; 110 109 BondFragments.StoreForcesFile(prefix, SortIndex); 111 110 } … … 113 112 // store keysets file 114 113 TotalGraph.StoreKeySetFile(prefix); 115 116 {117 // store Adjacency file118 std::string filename = prefix + ADJACENCYFILE;119 mol->StoreAdjacencyToFile(filename);120 }121 114 122 115 // store Hydrogen saturation correction file … … 137 130 LOG(2, "DEBUG: Fragment No." << (*runner).second.first << " with TEFactor " 138 131 << (*runner).second.second << "."); 139 BondFragments.insert(StoreFragmentFromKeySet( mol,test, World::getInstance().getConfig()));132 BondFragments.insert(StoreFragmentFromKeySet(test, World::getInstance().getConfig())); 140 133 ++count; 141 134 } … … 147 140 * First creates the minimal set of atoms from the KeySet, then creates the bond structure from the complete 148 141 * molecule and adds missing hydrogen where bonds were cut. 149 * \param *mol reference molecule150 142 * \param &Leaflet pointer to KeySet structure 151 143 * \param IsAngstroem whether we have Ansgtroem or bohrradius 152 144 * \return pointer to constructed molecule 153 145 */ 154 molecule * ExportGraph_ToFiles::StoreFragmentFromKeySet( molecule *mol,KeySet &Leaflet, bool IsAngstroem)146 molecule * ExportGraph_ToFiles::StoreFragmentFromKeySet(KeySet &Leaflet, bool IsAngstroem) 155 147 { 156 148 Info info(__func__); … … 158 150 molecule *Leaf = World::getInstance().createMolecule(); 159 151 160 StoreFragmentFromKeySet_Init( mol,Leaf, Leaflet, SonList);152 StoreFragmentFromKeySet_Init(Leaf, Leaflet, SonList); 161 153 // create the bonds between all: Make it an induced subgraph and add hydrogen 162 154 // LOG(2, "Creating bonds from father graph (i.e. induced subgraph creation)."); 163 CreateInducedSubgraphOfFragment( mol,Leaf, SonList, IsAngstroem);155 CreateInducedSubgraphOfFragment(Leaf, SonList, IsAngstroem); 164 156 165 157 //Leaflet->Leaf->ScanForPeriodicCorrection(out); … … 168 160 169 161 /** Initializes some value for putting fragment of \a *mol into \a *Leaf. 170 * \param *mol total molecule171 162 * \param *Leaf fragment molecule 172 163 * \param &Leaflet pointer to KeySet structure … … 174 165 * \return number of atoms in fragment 175 166 */ 176 int ExportGraph_ToFiles::StoreFragmentFromKeySet_Init(molecule * mol, molecule *Leaf, KeySet &Leaflet, ListOfLocalAtoms_t &SonList)167 int ExportGraph_ToFiles::StoreFragmentFromKeySet_Init(molecule *Leaf, KeySet &Leaflet, ListOfLocalAtoms_t &SonList) 177 168 { 178 169 atom *FatherOfRunner = NULL; 179 170 180 171 // first create the minimal set of atoms from the KeySet 172 World &world = World::getInstance(); 181 173 int size = 0; 182 174 for(KeySet::const_iterator runner = Leaflet.begin(); runner != Leaflet.end(); runner++) { 183 FatherOfRunner = mol->FindAtom((*runner)); // find the id175 FatherOfRunner = world.getAtom(AtomById(*runner)); // find the id 184 176 SonList.insert( std::make_pair(FatherOfRunner->getNr(), Leaf->AddCopyAtom(FatherOfRunner) ) ); 185 177 size++; … … 189 181 190 182 /** Creates an induced subgraph out of a fragmental key set, adding bonds and hydrogens (if treated specially). 191 * \param *out output stream for debugging messages192 * \param *mol total molecule193 183 * \param *Leaf fragment molecule 194 184 * \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 *mol196 */ 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 */ 187 void ExportGraph_ToFiles::CreateInducedSubgraphOfFragment(molecule *Leaf, ListOfLocalAtoms_t &SonList, bool IsAngstroem) 198 188 { 199 189 bool LonelyFlag = false;
Note:
See TracChangeset
for help on using the changeset viewer.