Changeset 04488a for src/molecule.cpp
- Timestamp:
- Jun 25, 2010, 9:57:15 AM (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:
- 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. - File:
-
- 1 edited
-
src/molecule.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/molecule.cpp
rce4487 r04488a 79 79 void molecule::setName(const std::string _name){ 80 80 OBSERVE; 81 cout << "Set name of molecule " << getId() << " to " << _name << endl; 81 82 strncpy(name,_name.c_str(),MAXSTRINGSIZE); 82 83 } … … 154 155 molecule::const_iterator molecule::erase( atom * key ) 155 156 { 156 cout << "trying to erase atom" << endl;157 157 molecule::const_iterator iter = find(key); 158 158 if (iter != end()){ … … 740 740 else 741 741 length = strlen(molname) - strlen(endname); 742 cout << "Set name of molecule " << getId() << " to " << molname << endl; 742 743 strncpy(name, molname, length); 743 744 name[length]='\0'; … … 881 882 ElementNo[i] = current++; 882 883 } 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 ); 884 885 return true; 885 886 } … … 1004 1005 for(int i=MAX_ELEMENTS;i--;) 1005 1006 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 everything1011 */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 }1040 1007 }; 1041 1008
Note:
See TracChangeset
for help on using the changeset viewer.
