Ignore:
Timestamp:
Feb 24, 2013, 12:59:18 PM (13 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, 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:
c91572
Parents:
b6b5b8
git-author:
Frederik Heber <heber@…> (02/19/13 12:42:38)
git-committer:
Frederik Heber <heber@…> (02/24/13 12:59:18)
Message:

REFACTOR: PowerSetGenerator now creates all orders in one go, not limited to one by one increments.

  • atom_bondedparticle's MaxOrder is not a bool but an int containing the desired final order set by CheckOrderAtSite and compared to AdaptiveOrder to obtain its old meaning.
  • UniqueFragments now contains a vector of n Graphs to place n-body fragments in that are later combined. Also, cleaned up a lot of old functions and merged stuff into cstor. FreeAllOrdersList() and CombineAllOrderListIntoOne() have been adapted accordingly.
  • Fragmentation::FragmentBOSSANOVA now uses fully again FragmentLowerOrdersList which now has the above n slots to place n-body fragments in and which is passed by ref to UniqueFragments.
  • SPFragmentGenerator now always stores the current fragment, only in a specific slot in UniqueFragment's Graphs, and it recurses if there are enough SP levels and plces left.
  • FIX: BondsPerShortestPath properly prints and informs about resetting the path list.
  • We checked extra that BondFragments come out exactly as before (same order because of the Graph being a map naturally). The only difference is the OrderAtSite file which now has more than 0/1 values in the second entry.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/UniqueFragments.cpp

    rb6b5b8 rd760bb  
    3737#include "UniqueFragments.hpp"
    3838
     39#include "CodePatterns/Assert.hpp"
    3940#include "CodePatterns/Log.hpp"
    4041
     
    4849/** Constructor of class UniqueFragments.
    4950 *
     51 * @param _TEFactor total energy factor
     52 * @param _Leaflet current graph to work on
     53 * @param _Root root atom
    5054 */
    51 UniqueFragments::UniqueFragments()
    52 {}
     55UniqueFragments::UniqueFragments(double _TEFactor, std::vector<Graph*> &_Leaflets, atom *_Root) :
     56    FragmentCounter(0),
     57    Root(_Root),
     58    TEFactor(_TEFactor),
     59    Leaflets(_Leaflets)
     60{
     61  FragmentSet = new KeySet;
     62}
    5363
    5464/** Destructor of class UniqueFragments.
     
    5666 */
    5767UniqueFragments::~UniqueFragments()
    58 {}
     68{
     69  Cleanup();
     70}
    5971
    6072/** Checking whether KeySet is not already present in Graph, if so just adds factor.
     73 *
     74 * \param order order at which to insert
    6175 */
    62 void UniqueFragments::InsertFragmentIntoGraph()
     76void UniqueFragments::InsertFragmentIntoGraph(const size_t order)
    6377{
    6478  GraphTestPair testGraphInsert;
    6579
    66   testGraphInsert = Leaflet->insert(GraphPair (*FragmentSet,std::pair<int,double>(FragmentCounter,TEFactor)));  // store fragment number and current factor
     80  ASSERT( Leaflets.size() > order,
     81      "UniqueFragments::InsertFragmentIntoGraph() - Leaflets has only "
     82      +toString(Leaflets.size())+" entries, not enough for "+toString(order));
     83  testGraphInsert = Leaflets[order]->insert(GraphPair (*FragmentSet,std::pair<int,double>(FragmentCounter,TEFactor)));  // store fragment number and current factor
    6784  if (testGraphInsert.second) {
    6885    LOG(2, "KeySet " << FragmentCounter << " successfully inserted.");
     
    7592};
    7693
    77 /** Initialization for UniqueFragments.
    78  *
    79  * \param _Root ref to atom to start from (with graph algorithms, hence root node)
    80  * \param AtomCount number of nodes/atoms
    81  */
    82 void UniqueFragments::Init(atom *_Root)
    83 {
    84   // initialise the fragments structure
    85   FragmentCounter = 0;
    86   FragmentSet = new KeySet;
    87   Root = _Root;
    88 }
    89 
    9094/** Removes some allocated memory.
    9195 *
     
    9397void UniqueFragments::Cleanup()
    9498{
    95   delete(FragmentSet);
     99  delete FragmentSet;
    96100}
    97101
     
    113117  Root=_root;
    114118}
    115 
    116 /** Sets initial values before PowerSetGenerator uses this class.
    117  *
    118  * @param _TEFactor total energy factor
    119  * @param _Leaflet current graph to work on
    120  * @param _Root root atom
    121  */
    122 void UniqueFragments::PrepareForPowersetGeneration(double _TEFactor, Graph *_Leaflet, atom *_Root)
    123 {
    124   TEFactor = _TEFactor;
    125   Leaflet = _Leaflet;
    126   Root = _Root;
    127 }
Note: See TracChangeset for help on using the changeset viewer.