Changeset ea7176 for src/molecule_fragmentation.cpp
- Timestamp:
- Mar 19, 2010, 1:29:01 PM (16 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, Candidate_v1.7.0, 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:
- e0b6fd
- Parents:
- 80c63d
- File:
-
- 1 edited
-
src/molecule_fragmentation.cpp (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/molecule_fragmentation.cpp
r80c63d rea7176 435 435 436 436 // initialize mask list 437 for(int i= AtomCount;i--;)437 for(int i=getAtomCount();i--;) 438 438 AtomMask[i] = false; 439 439 440 440 if (Order < 0) { // adaptive increase of BondOrder per site 441 if (AtomMask[ AtomCount] == true) // break after one step441 if (AtomMask[getAtomCount()] == true) // break after one step 442 442 return false; 443 443 … … 483 483 } 484 484 } 485 if (( Order == 0) && (AtomMask[AtomCount] == false)) // single stepping, just check485 if ((!Order) && (!AtomMask[getAtomCount()])) // single stepping, just check 486 486 status = true; 487 487 … … 494 494 } 495 495 496 PrintAtomMask(AtomMask, AtomCount); // for debugging496 PrintAtomMask(AtomMask, getAtomCount()); // for debugging 497 497 498 498 return status; … … 510 510 return false; 511 511 } 512 SortIndex = Malloc<int>( AtomCount, "molecule::CreateMappingLabelsToConfigSequence: *SortIndex");513 for(int i= AtomCount;i--;)512 SortIndex = Malloc<int>(getAtomCount(), "molecule::CreateMappingLabelsToConfigSequence: *SortIndex"); 513 for(int i=getAtomCount();i--;) 514 514 SortIndex[i] = -1; 515 515 … … 595 595 MoleculeListClass *BondFragments = NULL; 596 596 int *SortIndex = NULL; 597 int *MinimumRingSize = new int[ AtomCount];597 int *MinimumRingSize = new int[getAtomCount()]; 598 598 int FragmentCounter; 599 599 MoleculeLeafClass *MolecularWalker = NULL; … … 623 623 624 624 // create lookup table for Atom::nr 625 FragmentationToDo = FragmentationToDo && CreateFatherLookupTable(ListOfAtoms, AtomCount);625 FragmentationToDo = FragmentationToDo && CreateFatherLookupTable(ListOfAtoms, getAtomCount()); 626 626 627 627 // === compare it with adjacency file === … … 633 633 634 634 // analysis of the cycles (print rings, get minimum cycle length) for each subgraph 635 for(int i= AtomCount;i--;)636 MinimumRingSize[i] = AtomCount;635 for(int i=getAtomCount();i--;) 636 MinimumRingSize[i] = getAtomCount(); 637 637 MolecularWalker = Subgraphs; 638 638 FragmentCounter = 0; … … 671 671 // ===== 6b. prepare and go into the adaptive (Order<0), single-step (Order==0) or incremental (Order>0) cycle 672 672 KeyStack *RootStack = new KeyStack[Subgraphs->next->Count()]; 673 AtomMask = new bool[ AtomCount+1];674 AtomMask[ AtomCount] = false;673 AtomMask = new bool[getAtomCount()+1]; 674 AtomMask[getAtomCount()] = false; 675 675 FragmentationToDo = false; // if CheckOrderAtSite just ones recommends fragmentation, we will save fragments afterwards 676 676 while ((CheckOrder = CheckOrderAtSite(AtomMask, ParsedFragmentList, Order, MinimumRingSize, configuration->configpath))) { 677 677 FragmentationToDo = FragmentationToDo || CheckOrder; 678 AtomMask[ AtomCount] = true; // last plus one entry is used as marker that we have been through this loop once already in CheckOrderAtSite()678 AtomMask[getAtomCount()] = true; // last plus one entry is used as marker that we have been through this loop once already in CheckOrderAtSite() 679 679 // ===== 6b. fill RootStack for each subgraph (second adaptivity check) ===== 680 680 Subgraphs->next->FillRootStackForSubgraphs(RootStack, AtomMask, (FragmentCounter = 0)); … … 811 811 bool molecule::ParseOrderAtSiteFromFile(char *path) 812 812 { 813 unsigned char *OrderArray = Calloc<unsigned char>( AtomCount, "molecule::ParseOrderAtSiteFromFile - *OrderArray");814 bool *MaxArray = Calloc<bool>( AtomCount, "molecule::ParseOrderAtSiteFromFile - *MaxArray");813 unsigned char *OrderArray = Calloc<unsigned char>(getAtomCount(), "molecule::ParseOrderAtSiteFromFile - *OrderArray"); 814 bool *MaxArray = Calloc<bool>(getAtomCount(), "molecule::ParseOrderAtSiteFromFile - *MaxArray"); 815 815 bool status; 816 816 int AtomNr, value; … … 917 917 atom *OtherFather = NULL; 918 918 atom *FatherOfRunner = NULL; 919 Leaf->CountAtoms();920 919 921 920 #ifdef ADDHYDROGEN … … 955 954 eLog() << Verbose(1) << "Son " << (*iter)->Name << " has father " << FatherOfRunner->Name << " but its entry in SonList is " << SonList[FatherOfRunner->nr] << "!" << endl; 956 955 } 957 if ((LonelyFlag) && (Leaf-> AtomCount> 1)) {956 if ((LonelyFlag) && (Leaf->getAtomCount() > 1)) { 958 957 Log() << Verbose(0) << *(*iter) << "has got bonds only to hydrogens!" << endl; 959 958 } … … 975 974 molecule * molecule::StoreFragmentFromKeySet(KeySet &Leaflet, bool IsAngstroem) 976 975 { 977 atom **SonList = Calloc<atom*>( AtomCount, "molecule::StoreFragmentFromStack: **SonList");976 atom **SonList = Calloc<atom*>(getAtomCount(), "molecule::StoreFragmentFromStack: **SonList"); 978 977 molecule *Leaf = World::get()->createMolecule(); 979 978 … … 1602 1601 FragmentSearch.FragmentSet = new KeySet; 1603 1602 FragmentSearch.Root = FindAtom(RootKeyNr); 1604 FragmentSearch.ShortestPathList = Malloc<int>( AtomCount, "molecule::PowerSetGenerator: *ShortestPathList");1605 for (int i= AtomCount;i--;) {1603 FragmentSearch.ShortestPathList = Malloc<int>(getAtomCount(), "molecule::PowerSetGenerator: *ShortestPathList"); 1604 for (int i=getAtomCount();i--;) { 1606 1605 FragmentSearch.ShortestPathList[i] = -1; 1607 1606 } … … 1707 1706 Vector Translationvector; 1708 1707 //class StackClass<atom *> *CompStack = NULL; 1709 class StackClass<atom *> *AtomStack = new StackClass<atom *>( AtomCount);1708 class StackClass<atom *> *AtomStack = new StackClass<atom *>(getAtomCount()); 1710 1709 bool flag = true; 1711 1710 1712 1711 Log() << Verbose(2) << "Begin of ScanForPeriodicCorrection." << endl; 1713 1712 1714 ColorList = Calloc<enum Shading>( AtomCount, "molecule::ScanForPeriodicCorrection: *ColorList");1713 ColorList = Calloc<enum Shading>(getAtomCount(), "molecule::ScanForPeriodicCorrection: *ColorList"); 1715 1714 while (flag) { 1716 1715 // remove bonds that are beyond bonddistance … … 1746 1745 Log() << Verbose(0) << endl; 1747 1746 // apply to all atoms of first component via BFS 1748 for (int i= AtomCount;i--;)1747 for (int i=getAtomCount();i--;) 1749 1748 ColorList[i] = white; 1750 1749 AtomStack->Push(Binder->leftatom);
Note:
See TracChangeset
for help on using the changeset viewer.
