Changeset a1c8fa
- Timestamp:
- Oct 20, 2016, 8:54:23 PM (9 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, 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_ChronosMutex, Fix_ForceAnnealing, Fix_ParseParticles, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids_IntegrationTest, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, RotateToPrincipalAxisSystem_UndoRedo, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, Ubuntu_1604_changes, stable
- Children:
- 72e40d0
- Parents:
- 064b34
- git-author:
- Frederik Heber <heber@…> (09/27/16 09:58:43)
- git-committer:
- Frederik Heber <heber@…> (10/20/16 20:54:23)
- Location:
- src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Atom/atom_bondedparticle.cpp
r064b34 ra1c8fa 71 71 void BondedParticle::OutputOrder(ofstream *file) const 72 72 { 73 *file << getNr() << "\t" << (int) AdaptiveOrder << "\t" << (int)MaxOrder<< endl;74 //LOG(2, "Storing: " << getNr() << "\t" << (int) AdaptiveOrder << "\t" << MaxOrder<< ".");73 *file << getNr() << "\t" << (int)getAdaptiveOrder() << "\t" << (int)getMaxOrder() << endl; 74 //LOG(2, "Storing: " << getNr() << "\t" << (int)getAdaptiveOrder() << "\t" << getMaxOrder() << "."); 75 75 }; 76 76 -
src/Atom/atom_bondedparticleinfo.cpp
r064b34 ra1c8fa 45 45 BondList BondedParticleInfo::emptyList; 46 46 47 /** Constructor of class BondedParticleInfo.48 */49 BondedParticleInfo::BondedParticleInfo() :50 AdaptiveOrder(0),51 MaxOrder(0)52 {}53 54 /** Destructor of class BondedParticleInfo.55 */56 BondedParticleInfo::~BondedParticleInfo()57 {}58 59 47 void BondedParticleInfo::AppendTrajectoryStep(const unsigned int _step) 60 48 { … … 74 62 } 75 63 64 template <class List_t> 65 void setEntryInList( 66 List_t &_list, 67 const typename List_t::key_type _step, 68 const typename List_t::mapped_type &_value) 69 { 70 typename List_t::iterator iter = 71 _list.find(_step); 72 if (iter != _list.end()) 73 iter->second = _value; 74 else 75 _list.insert( std::make_pair(_step, _value) ); 76 } 77 78 template <class List_t> 79 const typename List_t::mapped_type& getEntryInList( 80 const List_t &_list, 81 const typename List_t::key_type _step, 82 const typename List_t::mapped_type &_empty) 83 { 84 typename List_t::const_iterator iter = 85 _list.find(_step); 86 if (iter != _list.end()) 87 return iter->second; 88 return _empty; 89 } 90 76 91 const BondList& BondedParticleInfo::getListOfBondsAtStep(unsigned int _step) const 77 92 { 78 BondTrajectory_t::const_iterator iter = 79 ListOfBonds.find(_step); 80 if (iter != ListOfBonds.end()) 81 return iter->second; 82 return emptyList; 93 return getEntryInList<BondTrajectory_t>(ListOfBonds, _step, emptyList); 83 94 } 95 96 const unsigned char& BondedParticleInfo::getMaxOrder() const 97 { 98 return getMaxOrder(WorldTime::getTime()); 99 } 100 101 const unsigned char& BondedParticleInfo::getMaxOrder(unsigned int _step) const 102 { 103 static unsigned char emptyOrder=0; 104 return getEntryInList<OrderTrajectory_t>(MaxOrder, _step, emptyOrder); 105 } 106 107 void BondedParticleInfo::setMaxOrder(unsigned char _value) 108 { 109 setMaxOrder(WorldTime::getTime(), _value); 110 } 111 112 void BondedParticleInfo::setMaxOrder(unsigned int _step, const unsigned char _value) 113 { 114 setEntryInList<OrderTrajectory_t>(MaxOrder, _step, _value); 115 } 116 117 const unsigned char& BondedParticleInfo::getAdaptiveOrder() const 118 { 119 return getAdaptiveOrder(WorldTime::getTime()); 120 } 121 122 const unsigned char& BondedParticleInfo::getAdaptiveOrder(unsigned int _step) const 123 { 124 static unsigned char emptyOrder=0; 125 return getEntryInList<OrderTrajectory_t>(AdaptiveOrder, _step, emptyOrder); 126 } 127 128 void BondedParticleInfo::setAdaptiveOrder(unsigned char _value) 129 { 130 setAdaptiveOrder(WorldTime::getTime(), _value); 131 } 132 133 void BondedParticleInfo::setAdaptiveOrder(unsigned int _step, const unsigned char _value) 134 { 135 setEntryInList<OrderTrajectory_t>(AdaptiveOrder, _step, _value); 136 } 137 -
src/Atom/atom_bondedparticleinfo.hpp
r064b34 ra1c8fa 37 37 friend class BondedParticle; 38 38 public: 39 unsigned char AdaptiveOrder; //!< current present bond order at site (0 means "not set")40 unsigned char MaxOrder; //!< desired maximum order of this atom (0 means "not set")41 39 42 BondedParticleInfo(); 43 virtual ~BondedParticleInfo(); 40 virtual ~BondedParticleInfo() {} 44 41 45 42 /** Pushes back another step in all trajectory vectors. … … 65 62 const BondList& getListOfBonds() const; 66 63 67 /** Accessor to ListOfBonds of WorldTime::CurrentTime.68 *69 * Note, new empty BondList is returned if array entry at upper boundary is70 * accessed. Beyond std will issue exception due to out-of-range access.71 *72 * @return ListOfBonds[WorldTime::CurrentTime]73 */74 // BondList& getListOfBonds();75 76 64 /** Const Accessor ListOfBonds of any present time step. 77 65 * … … 81 69 const BondList& getListOfBondsAtStep(unsigned int _step) const; 82 70 83 /** Accessor ListOfBonds of any present time step.71 /** Const getter for the MaxOrder property at current time step. 84 72 * 85 * Note, new empty BondList is returned if array entry at upper boundary is 86 * accessed. Beyond std will issue exception due to out-of-range access. 73 * @return MaxOrder[Current world time step]. 74 */ 75 const unsigned char& getMaxOrder() const; 76 77 /** Const getter for the MaxOrder property at given \a _step. 87 78 * 88 79 * @param _step time step to access 89 * @return ListOfBonds[_step].80 * @return MaxOrder[_step]. 90 81 */ 91 // BondList& getListOfBondsAtStep(unsigned int _step); 82 const unsigned char& getMaxOrder(const unsigned int _step) const; 83 84 /** Setter for the MaxOrder property at current time step. 85 * 86 * @param _value value to set for MaxOrder at current time step 87 */ 88 void setMaxOrder(const unsigned char _value); 89 90 /**Setter for the MaxOrder property at given \a _step. 91 * 92 * @param _step time step to access 93 * @param _value value to set for MaxOrder at the desired time step 94 * @return MaxOrder[_step]. 95 */ 96 void setMaxOrder(const unsigned int _step, const unsigned char _value); 97 98 /** Const getter for the AdaptiveOrder property at current time step. 99 * 100 * @return AdaptiveOrder[Current world time step]. 101 */ 102 const unsigned char& getAdaptiveOrder() const; 103 104 /** Const getter for the AdaptiveOrder property at given \a _step. 105 * 106 * @param _step time step to access 107 * @return AdaptiveOrder[_step]. 108 */ 109 const unsigned char& getAdaptiveOrder(const unsigned int _step) const; 110 111 /** Setter for the AdaptiveOrder property at current time step. 112 * 113 * @param _value value to set for AdaptiveOrder at current time step 114 */ 115 void setAdaptiveOrder(const unsigned char _value); 116 117 /** Setter for the AdaptiveOrder property at given \a _step. 118 * 119 * @param _step time step to access 120 * @param _value value to set for AdaptiveOrder at the desired time step 121 * @return AdaptiveOrder[_step]. 122 */ 123 void setAdaptiveOrder(const unsigned int _step, const unsigned char _value); 92 124 93 125 protected: … … 105 137 BondTrajectory_t ListOfBonds; //!< list of all bonds 106 138 static BondList emptyList; //!< empty list to return when step is not present 139 140 typedef std::map<unsigned int, unsigned char> OrderTrajectory_t; 141 OrderTrajectory_t AdaptiveOrder; //!< current present bond order at site (0 means "not set") 142 OrderTrajectory_t MaxOrder; //!< desired maximum order of this atom (0 means "not set") 107 143 }; 108 144 -
src/Fragmentation/AdaptivityMap.cpp
r064b34 ra1c8fa 154 154 Walker = mol->FindAtom((*runner).first); 155 155 if (Walker != NULL) { 156 //if ((*runner).second.second >= Walker-> AdaptiveOrder) { // only insert if this is an "active" root site for the current order157 if (Walker-> MaxOrder > Walker->AdaptiveOrder) {156 //if ((*runner).second.second >= Walker->getAdaptiveOrder()) { // only insert if this is an "active" root site for the current order 157 if (Walker->getMaxOrder() > Walker->getAdaptiveOrder()) { 158 158 LOG(2, "(" << (*runner).first << ",[" << (*runner).second.first << "," << (*runner).second.second << "])"); 159 159 FinalRootCandidates->insert( make_pair( (*runner).second.first, pair<int,int>((*runner).first, (*runner).second.second) ) ); -
src/Fragmentation/Fragmentation.cpp
r064b34 ra1c8fa 286 286 atom *Walker = mol->FindAtom(RootKeyNr); 287 287 // check cyclic lengths 288 //if ((MinimumRingSize[Walker->GetTrueFather()->getNr()] != -1) && (Walker->GetTrueFather()-> AdaptiveOrder+1 > MinimumRingSize[Walker->GetTrueFather()->getNr()])) {289 // LOG(0, "Bond order " << Walker->GetTrueFather()-> AdaptiveOrder<< " of Root " << *Walker << " greater than or equal to Minimum Ring size of " << MinimumRingSize << " found is not allowed.");288 //if ((MinimumRingSize[Walker->GetTrueFather()->getNr()] != -1) && (Walker->GetTrueFather()->getAdaptiveOrder()+1 > MinimumRingSize[Walker->GetTrueFather()->getNr()])) { 289 // LOG(0, "Bond order " << Walker->GetTrueFather()->getAdaptiveOrder() << " of Root " << *Walker << " greater than or equal to Minimum Ring size of " << MinimumRingSize << " found is not allowed."); 290 290 //} else 291 291 { 292 292 // set adaptive order to desired max order 293 Walker->GetTrueFather()->AdaptiveOrder = Walker->GetTrueFather()->MaxOrder; 294 Order = Walker->AdaptiveOrder = Walker->GetTrueFather()->AdaptiveOrder; 293 Walker->GetTrueFather()->setAdaptiveOrder(Walker->GetTrueFather()->getMaxOrder()); 294 Order = Walker->GetTrueFather()->getAdaptiveOrder(); 295 Walker->setAdaptiveOrder(Order); 295 296 296 297 // allocate memory for all lower level orders … … 302 303 // initialise Order-dependent entries of UniqueFragments structure 303 304 UniqueFragments FragmentSearch(1., FragmentLowerOrdersList[RootNr], Walker); 304 PowerSetGenerator PSG(&FragmentSearch, Walker-> AdaptiveOrder);305 PowerSetGenerator PSG(&FragmentSearch, Walker->getAdaptiveOrder()); 305 306 306 307 // create top order where nothing is reduced … … 316 317 // NumMolecules = 0; 317 318 // } 318 // now, we have completely filled each cell of FragmentLowerOrdersList[] for the current Walker-> AdaptiveOrder319 //NumMoleculesOfOrder[Walker-> AdaptiveOrder-1] = NumMolecules;319 // now, we have completely filled each cell of FragmentLowerOrdersList[] for the current Walker->getAdaptiveOrder() 320 //NumMoleculesOfOrder[Walker->getAdaptiveOrder()-1] = NumMolecules; 320 321 TotalNumMolecules += NumMoleculesOfOrder[RootNr]; 321 // LOG(1, "Number of resulting molecules for Order " << (int)Walker->GetTrueFather()-> AdaptiveOrder<< " is: " << NumMoleculesOfOrder[RootNr] << ".");322 // LOG(1, "Number of resulting molecules for Order " << (int)Walker->GetTrueFather()->getAdaptiveOrder() << " is: " << NumMoleculesOfOrder[RootNr] << "."); 322 323 RootStack.push_back(RootKeyNr); // put back on stack 323 324 RootNr++; … … 407 408 atom * const Walker = *iter; 408 409 if (AtomMask.isTrue(Walker->getNr())) { // skip masked out 409 Walker-> MaxOrder = (Order != 0 ? Order : Walker->MaxOrder+1);410 Walker->setMaxOrder((Order != 0 ? Order : Walker->getMaxOrder()+1)); 410 411 // remove all that have reached desired order 411 if (Walker-> AdaptiveOrder >= Walker->MaxOrder) // && (Walker->AdaptiveOrder< MinimumRingSize[Walker->getNr()]))412 if (Walker->getAdaptiveOrder() >= Walker->getMaxOrder()) // && (Walker->getAdaptiveOrder() < MinimumRingSize[Walker->getNr()])) 412 413 AtomMask.setFalse(Walker->getNr()); 413 414 else … … 451 452 ++iter) { 452 453 file << (*iter)->getId() 453 << "\t" << (int)(*iter)-> AdaptiveOrder454 << "\t" << (int)(*iter)-> MaxOrder<< std::endl;454 << "\t" << (int)(*iter)->getAdaptiveOrder() 455 << "\t" << (int)(*iter)->getMaxOrder() << std::endl; 455 456 } 456 457 file.close(); … … 513 514 // set atom values 514 515 for(molecule::iterator iter=mol->begin();iter!=mol->end();++iter){ 515 (*iter)-> AdaptiveOrder = OrderArray[(*iter)->getNr()];516 (*iter)-> MaxOrder = OrderArray[(*iter)->getNr()]; //MaxArray.isTrue((*iter)->getNr());516 (*iter)->setAdaptiveOrder(OrderArray[(*iter)->getNr()]); 517 (*iter)->setMaxOrder(OrderArray[(*iter)->getNr()]); //MaxArray.isTrue((*iter)->getNr()); 517 518 } 518 519 //SetAtomValueToIndexedArray( OrderArray, &atom::getNr(), &atom::AdaptiveOrder ); -
src/Fragmentation/fragmentation_helpers.cpp
r064b34 ra1c8fa 45 45 46 46 #include "Atom/atom.hpp" 47 #include "Fragmentation/AdaptivityMap.hpp"48 47 #include "Fragmentation/AtomMask.hpp" 49 48 #include "Fragmentation/Graph.hpp" … … 103 102 RootStack.pop_front(); 104 103 Walker = mol->FindAtom(RootKeyNr); 105 NumLevels = Walker-> AdaptiveOrder;104 NumLevels = Walker->getAdaptiveOrder(); 106 105 ASSERT( NumLevels == FragmentLowerOrdersList[RootNr].size(), 107 106 "CombineAllOrderListIntoOne() - differing size and NumLevels."); … … 134 133 RootStack.pop_front(); 135 134 Walker = mol->FindAtom(RootKeyNr); 136 NumLevels = Walker-> AdaptiveOrder;135 NumLevels = Walker->getAdaptiveOrder(); 137 136 for(int i=0;i<NumLevels;i++) { 138 137 if (FragmentLowerOrdersList[RootNr][i] != NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.