- Timestamp:
- May 8, 2008, 3:52:11 PM (17 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:
- a529de
- Parents:
- 87f6c9
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/moleculelist.cpp
r87f6c9 rbf46da 503 503 if (FragmentList == NULL) { 504 504 KeySetCounter = Count(); 505 FragmentList = (Graph **) Malloc(sizeof(Graph *)*KeySetCounter, " molecule::FragmentMolecule - **BondFragments");505 FragmentList = (Graph **) Malloc(sizeof(Graph *)*KeySetCounter, "MoleculeLeafClass::AssignKeySetsToFragment - **FragmentList"); 506 506 for(int i=0;i<KeySetCounter;i++) 507 507 FragmentList[i] = NULL; -
src/molecules.cpp
r87f6c9 rbf46da 2161 2161 }; 2162 2162 2163 /** Create a SortIndex to map from BFS labels to the sequence in which the atoms are given in the config file. 2164 * \param *out output stream for debugging 2165 * \param *&SortIndex Mapping array of size molecule::AtomCount 2166 * \return true - success, false - failure of SortIndex alloc 2167 */ 2168 bool molecule::CreateMappingLabelsToConfigSequence(ofstream *out, int *&SortIndex) 2169 { 2170 element *runner = elemente->start; 2171 int AtomNo = 0; 2172 atom *Walker = NULL; 2173 2174 if (SortIndex != NULL) { 2175 *out << Verbose(1) << "SortIndex is " << SortIndex << " and not NULL as expected." << endl; 2176 return false; 2177 } 2178 SortIndex = (int *) Malloc(sizeof(int)*AtomCount, "molecule::FragmentMolecule: *SortIndex"); 2179 for(int i=0;i<AtomCount;i++) 2180 SortIndex[i] = -1; 2181 while (runner->next != elemente->end) { // go through every element 2182 runner = runner->next; 2183 if (ElementsInMolecule[runner->Z]) { // if this element got atoms 2184 Walker = start; 2185 while (Walker->next != end) { // go through every atom of this element 2186 Walker = Walker->next; 2187 if (Walker->type->Z == runner->Z) // if this atom fits to element 2188 SortIndex[Walker->nr] = AtomNo++; 2189 } 2190 } 2191 } 2192 return true; 2193 }; 2194 2163 2195 /** Performs a many-body bond order analysis for a given bond order. 2164 2196 * -# parses adjacency, keysets and orderatsite files … … 2181 2213 { 2182 2214 MoleculeListClass *BondFragments = NULL; 2183 atom *Walker = NULL;2184 2215 int *SortIndex = NULL; 2185 element *runner = NULL;2186 int AtomNo;2187 2216 int MinimumRingSize; 2188 2217 int FragmentCounter; … … 2302 2331 // ===== 9. Save fragments' configuration and keyset files et al to disk === 2303 2332 if (BondFragments->NumberOfMolecules != 0) { 2304 // create a SortIndex to map from BFS labels to the sequence in which the atoms are given in the config file 2305 SortIndex = (int *) Malloc(sizeof(int)*AtomCount, "molecule::FragmentMolecule: *SortIndex"); 2306 for(int i=0;i<AtomCount;i++) 2307 SortIndex[i] = -1; 2308 runner = elemente->start; 2309 AtomNo = 0; 2310 while (runner->next != elemente->end) { // go through every element 2311 runner = runner->next; 2312 if (ElementsInMolecule[runner->Z]) { // if this element got atoms 2313 Walker = start; 2314 while (Walker->next != end) { // go through every atom of this element 2315 Walker = Walker->next; 2316 if (Walker->type->Z == runner->Z) // if this atom fits to element 2317 SortIndex[Walker->nr] = AtomNo++; 2318 } 2319 } 2320 } 2333 // create the SortIndex from BFS labels to order in the config file 2334 CreateMappingLabelsToConfigSequence(out, SortIndex); 2335 2321 2336 *out << Verbose(1) << "Writing " << BondFragments->NumberOfMolecules << " possible bond fragmentation configs" << endl; 2322 2337 if (BondFragments->OutputConfigForListOfFragments(out, configuration, SortIndex)) … … 2343 2358 *out << Verbose(1) << "Freeing bond memory" << endl; 2344 2359 delete(FragmentList); // remove bond molecule from memory 2345 FragmentList = NULL;2346 2360 Free((void **)&SortIndex, "molecule::FragmentMolecule: *SortIndex"); 2347 2361 } else -
src/molecules.hpp
r87f6c9 rbf46da 348 348 bool StoreKeySetFile(ofstream *out, Graph &KeySetList, char *path); 349 349 bool StoreForcesFile(ofstream *out, MoleculeListClass *BondFragments, char *path, int *SortIndex); 350 bool CreateMappingLabelsToConfigSequence(ofstream *out, int *&SortIndex); 350 351 bool ScanBufferIntoKeySet(ofstream *out, char *buffer, KeySet &CurrentSet); 351 352 void BreadthFirstSearchAdd(ofstream *out, molecule *Mol, atom **&AddedAtomList, bond **&AddedBondList, atom *Root, bond *Bond, int BondOrder, bool IsAngstroem);
Note:
See TracChangeset
for help on using the changeset viewer.