Changeset 04488a for src/molecule.cpp


Ignore:
Timestamp:
Jun 25, 2010, 9:57:15 AM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
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:
b6dbff
Parents:
ce4487 (diff), 0d1ad0 (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 QT4Refactoring

Conflicts:

molecuilder/src/Makefile.am
molecuilder/src/builder.cpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule.cpp

    rce4487 r04488a  
    7979void molecule::setName(const std::string _name){
    8080  OBSERVE;
     81  cout << "Set name of molecule " << getId() << " to " << _name << endl;
    8182  strncpy(name,_name.c_str(),MAXSTRINGSIZE);
    8283}
     
    154155molecule::const_iterator molecule::erase( atom * key )
    155156{
    156   cout << "trying to erase atom" << endl;
    157157  molecule::const_iterator iter = find(key);
    158158  if (iter != end()){
     
    740740  else
    741741    length = strlen(molname) - strlen(endname);
     742  cout << "Set name of molecule " << getId() << " to " << molname << endl;
    742743  strncpy(name, molname, length);
    743744  name[length]='\0';
     
    881882        ElementNo[i] = current++;
    882883    }
    883     ActOnAllAtoms( &atom::OutputArrayIndexed, output, (const int *)ElementNo, (int *)AtomNo, (const char *) NULL );
     884    ActOnAllAtoms( &atom::OutputArrayIndexed, (ostream * const) output, (const int *)ElementNo, (int *)AtomNo, (const char *) NULL );
    884885    return true;
    885886  }
     
    10041005  for(int i=MAX_ELEMENTS;i--;)
    10051006    ElementCount += (ElementsInMolecule[i] != 0 ? 1 : 0);
    1006 };
    1007 
    1008 
    1009 /** Counts necessary number of valence electrons and returns number and SpinType.
    1010  * \param configuration containing everything
    1011  */
    1012 void molecule::CalculateOrbitals(class config &configuration)
    1013 {
    1014   configuration.MaxPsiDouble = configuration.PsiMaxNoDown = configuration.PsiMaxNoUp = configuration.PsiType = 0;
    1015   for(int i=MAX_ELEMENTS;i--;) {
    1016     if (ElementsInMolecule[i] != 0) {
    1017       //Log() << Verbose(0) << "CalculateOrbitals: " << elemente->FindElement(i)->name << " has a valence of " << (int)elemente->FindElement(i)->Valence << " and there are " << ElementsInMolecule[i] << " of it." << endl;
    1018       configuration.MaxPsiDouble += ElementsInMolecule[i]*((int)elemente->FindElement(i)->Valence);
    1019     }
    1020   }
    1021   configuration.PsiMaxNoDown = configuration.MaxPsiDouble/2 + (configuration.MaxPsiDouble % 2);
    1022   configuration.PsiMaxNoUp = configuration.MaxPsiDouble/2;
    1023   configuration.MaxPsiDouble /= 2;
    1024   configuration.PsiType = (configuration.PsiMaxNoDown == configuration.PsiMaxNoUp) ? 0 : 1;
    1025   if ((configuration.PsiType == 1) && (configuration.ProcPEPsi < 2) && ((configuration.PsiMaxNoDown != 1) || (configuration.PsiMaxNoUp != 0))) {
    1026     configuration.ProcPEGamma /= 2;
    1027     configuration.ProcPEPsi *= 2;
    1028   } else {
    1029     configuration.ProcPEGamma *= configuration.ProcPEPsi;
    1030     configuration.ProcPEPsi = 1;
    1031   }
    1032   cout << configuration.PsiMaxNoDown << ">" << configuration.PsiMaxNoUp << endl;
    1033   if (configuration.PsiMaxNoDown > configuration.PsiMaxNoUp) {
    1034     configuration.InitMaxMinStopStep = configuration.MaxMinStopStep = configuration.PsiMaxNoDown;
    1035     cout << configuration.PsiMaxNoDown << " " << configuration.InitMaxMinStopStep << endl;
    1036   } else {
    1037     configuration.InitMaxMinStopStep = configuration.MaxMinStopStep = configuration.PsiMaxNoUp;
    1038     cout << configuration.PsiMaxNoUp << " " << configuration.InitMaxMinStopStep << endl;
    1039   }
    10401007};
    10411008
Note: See TracChangeset for help on using the changeset viewer.