Ignore:
Timestamp:
Aug 9, 2010, 6:33:29 PM (15 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, 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:
353e82
Parents:
458447 (diff), e588312 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'StructureRefactoring' into stable

Conflicts:

src/Actions/AtomAction/AddAction.cpp
src/Actions/AtomAction/ChangeElementAction.cpp
src/Parser/XyzParser.cpp
src/analysis_correlation.cpp
src/atom.cpp
src/config.cpp
src/molecule.cpp

  • AtomInfo::element were privatized in stable and element::symbol, ::name in StructureRefactoring (overlapped in various lines).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/analysis_correlation.cpp

    r458447 rb5c53d  
    3333 * \return Map of doubles with values the pair of the two atoms.
    3434 */
    35 PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<element *> &elements)
     35PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements)
    3636{
    3737  Info FunctionInfo(__func__);
     
    4848
    4949  // create all possible pairs of elements
    50   set <pair<element *, element *> > PairsOfElements;
     50  set <pair<const element *,const element *> > PairsOfElements;
    5151  if (elements.size() >= 2) {
    52     for (vector<element *>::const_iterator type1 = elements.begin(); type1 != elements.end(); ++type1)
    53       for (vector<element *>::const_iterator type2 = elements.begin(); type2 != elements.end(); ++type2)
     52    for (vector<const element *>::const_iterator type1 = elements.begin(); type1 != elements.end(); ++type1)
     53      for (vector<const element *>::const_iterator type2 = elements.begin(); type2 != elements.end(); ++type2)
    5454        if (type1 != type2) {
    55           PairsOfElements.insert( pair<element *, element*>(*type1,*type2) );
    56           DoLog(1) && (Log() << Verbose(1) << "Creating element pair " << (*type1)->symbol << " and " << (*type2)->symbol << "." << endl);
     55          PairsOfElements.insert( make_pair(*type1,*type2) );
     56          DoLog(1) && (Log() << Verbose(1) << "Creating element pair " << *(*type1) << " and " << *(*type2) << "." << endl);
    5757        }
    5858  } else if (elements.size() == 1) { // one to all are valid
    59     element *elemental = *elements.begin();
    60     PairsOfElements.insert( pair<element *, element*>(elemental,(element *)NULL) );
    61     PairsOfElements.insert( pair<element *, element*>((element *)NULL,elemental) );
     59    const element *elemental = *elements.begin();
     60    PairsOfElements.insert( pair<const element *,const element*>(elemental,0) );
     61    PairsOfElements.insert( pair<const element *,const element*>(0,elemental) );
    6262  } else { // all elements valid
    6363    PairsOfElements.insert( pair<element *, element*>((element *)NULL, (element *)NULL) );
     
    7474          DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl);
    7575          if ((*iter)->getId() < (*runner)->getId()){
    76             for (set <pair<element *, element *> >::iterator PairRunner = PairsOfElements.begin(); PairRunner != PairsOfElements.end(); ++PairRunner)
     76            for (set <pair<const element *, const element *> >::iterator PairRunner = PairsOfElements.begin(); PairRunner != PairsOfElements.end(); ++PairRunner)
    7777              if ((PairRunner->first == (**iter).getType()) && (PairRunner->second == (**runner).getType())) {
    7878                distance = domain.periodicDistance((*iter)->getPosition(),(*runner)->getPosition());
     
    9595 * \return Map of doubles with values the pair of the two atoms.
    9696 */
    97 PairCorrelationMap *PeriodicPairCorrelation(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const int ranges[NDIM] )
     97PairCorrelationMap *PeriodicPairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const int ranges[NDIM] )
    9898{
    9999  Info FunctionInfo(__func__);
     
    115115
    116116  // create all possible pairs of elements
    117   set <pair<element *, element *> > PairsOfElements;
     117  set <pair<const element *,const element *> > PairsOfElements;
    118118  if (elements.size() >= 2) {
    119     for (vector<element *>::const_iterator type1 = elements.begin(); type1 != elements.end(); ++type1)
    120       for (vector<element *>::const_iterator type2 = elements.begin(); type2 != elements.end(); ++type2)
     119    for (vector<const element *>::const_iterator type1 = elements.begin(); type1 != elements.end(); ++type1)
     120      for (vector<const element *>::const_iterator type2 = elements.begin(); type2 != elements.end(); ++type2)
    121121        if (type1 != type2) {
    122           PairsOfElements.insert( pair<element *, element*>(*type1,*type2) );
    123           DoLog(1) && (Log() << Verbose(1) << "Creating element pair " << (*type1)->symbol << " and " << (*type2)->symbol << "." << endl);
     122          PairsOfElements.insert( make_pair(*type1,*type2) );
     123          DoLog(1) && (Log() << Verbose(1) << "Creating element pair " << *(*type1) << " and " << *(*type2) << "." << endl);
    124124        }
    125125  } else if (elements.size() == 1) { // one to all are valid
    126     element *elemental = *elements.begin();
    127     PairsOfElements.insert( pair<element *, element*>(elemental,(element *)NULL) );
    128     PairsOfElements.insert( pair<element *, element*>((element *)NULL,elemental) );
     126    const element *elemental = *elements.begin();
     127    PairsOfElements.insert( pair<const element *,const element*>(elemental,0) );
     128    PairsOfElements.insert( pair<const element *,const element*>(0,elemental) );
    129129  } else { // all elements valid
    130130    PairsOfElements.insert( pair<element *, element*>((element *)NULL, (element *)NULL) );
     
    149149                  DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl);
    150150                  if ((*iter)->getId() < (*runner)->getId()){
    151                     for (set <pair<element *, element *> >::iterator PairRunner = PairsOfElements.begin(); PairRunner != PairsOfElements.end(); ++PairRunner)
     151                    for (set <pair<const element *,const element *> >::iterator PairRunner = PairsOfElements.begin(); PairRunner != PairsOfElements.end(); ++PairRunner)
    152152                      if ((PairRunner->first == (**iter).getType()) && (PairRunner->second == (**runner).getType())) {
    153153                        periodicOtherX = FullInverseMatrix * ((*runner)->getPosition()); // x now in [0,1)^3
     
    178178 * \return Map of dobules with values as pairs of atom and the vector
    179179 */
    180 CorrelationToPointMap *CorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Vector *point )
     180CorrelationToPointMap *CorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point )
    181181{
    182182  Info FunctionInfo(__func__);
     
    196196    for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
    197197      DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
    198       for (vector<element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
     198      for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
    199199        if ((*type == NULL) || ((*iter)->getType() == *type)) {
    200200          distance = domain.periodicDistance((*iter)->getPosition(),*point);
     
    215215 * \return Map of dobules with values as pairs of atom and the vector
    216216 */
    217 CorrelationToPointMap *PeriodicCorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Vector *point, const int ranges[NDIM] )
     217CorrelationToPointMap *PeriodicCorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point, const int ranges[NDIM] )
    218218{
    219219  Info FunctionInfo(__func__);
     
    237237    for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
    238238      DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
    239       for (vector<element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
     239      for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
    240240        if ((*type == NULL) || ((*iter)->getType() == *type)) {
    241241          periodicX = FullInverseMatrix * ((*iter)->getPosition()); // x now in [0,1)^3
     
    263263 * \return Map of doubles with values as pairs of atom and the BoundaryTriangleSet that's closest
    264264 */
    265 CorrelationToSurfaceMap *CorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Tesselation * const Surface, const LinkedCell *LC )
     265CorrelationToSurfaceMap *CorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Tesselation * const Surface, const LinkedCell *LC )
    266266{
    267267  Info FunctionInfo(__func__);
     
    284284    for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
    285285      DoLog(3) && (Log() << Verbose(3) << "\tCurrent atom is " << *(*iter) << "." << endl);
    286       for (vector<element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
     286      for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
    287287        if ((*type == NULL) || ((*iter)->getType() == *type)) {
    288288          TriangleIntersectionList Intersections((*iter)->getPosition(),Surface,LC);
     
    309309 * \return Map of doubles with values as pairs of atom and the BoundaryTriangleSet that's closest
    310310 */
    311 CorrelationToSurfaceMap *PeriodicCorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] )
     311CorrelationToSurfaceMap *PeriodicCorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] )
    312312{
    313313  Info FunctionInfo(__func__);
     
    335335    for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
    336336      DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
    337       for (vector<element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
     337      for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
    338338        if ((*type == NULL) || ((*iter)->getType() == *type)) {
    339339          periodicX = FullInverseMatrix * ((*iter)->getPosition()); // x now in [0,1)^3
Note: See TracChangeset for help on using the changeset viewer.