Changeset 7ace68


Ignore:
Timestamp:
Dec 14, 2012, 2:29:34 PM (12 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:
0cfc27
Parents:
14de8e1
git-author:
Frederik Heber <heber@…> (02/06/12 15:04:48)
git-committer:
Frederik Heber <heber@…> (12/14/12 14:29:34)
Message:

Added multiplicity guesser for Psi3Parser's UHF.

  • TESTFIX: changed multp in testuhf.psi and testtwocon.psi of regression tests Parser/Psi3 due to multiplicity guesser.
  • TESTFIX: changed multp in the same way in ParserPsi3UnitTest.
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/Psi3Parser.cpp

    r14de8e1 r7ace68  
    4444
    4545#include "Atom/atom.hpp"
     46#include "Bond/bond.hpp"
    4647#include "CodePatterns/Log.hpp"
    4748#include "CodePatterns/toString.hpp"
     
    216217    if ((reference == getParams().getReferenceName(Psi3Parser_Parameters::UHF))
    217218        || (reference == getParams().getReferenceName(Psi3Parser_Parameters::TWOCON))) {
     219      const unsigned int multiplicity = calculateMultiplicity(atoms);
    218220      *file << "\t" << getParams().getParameterName(Psi3Parser_Parameters::multiplicityParam)
    219                     << " = " << getParams().getParameter(Psi3Parser_Parameters::multiplicityParam) << std::endl;
     221                    << " = " << multiplicity << std::endl;
     222//                    << " = " << getParams().getParameter(Psi3Parser_Parameters::multiplicityParam) << std::endl;
    220223      *file << "\t" << getParams().getParameterName(Psi3Parser_Parameters::chargeParam)
    221224                    << " = " << getParams().getParameter(Psi3Parser_Parameters::chargeParam) << std::endl;
     
    254257}
    255258
    256 
     259unsigned int FormatParser< psi3 >::calculateMultiplicity(const std::vector<atom *> &atoms) const
     260{
     261  // add up the number of electrons
     262  double valencies = 0.;
     263  BOOST_FOREACH(atom *_atom, atoms) {
     264    valencies += _atom->getType()->getAtomicNumber();
     265  }
     266
     267  // add doubly up all bond degrees (two electrons per bond)
     268  unsigned int degrees = 0;
     269  BOOST_FOREACH(atom *_atom, atoms) {
     270    BOOST_FOREACH(bond *_bond, _atom->getListOfBonds()) {
     271      degrees += 2*_bond->BondDegree;
     272    }
     273  }
     274
     275  // return difference+1 as multiplicity
     276  return (int)fabs(valencies-degrees)+1;
     277}
  • src/Parser/Psi3Parser.hpp

    r14de8e1 r7ace68  
    6161
    6262private:
     63  /** Prints the config line for the given \a _atom in PSI3 style.
     64   *
     65   * \param out output stream
     66   * \param _atom atom to print
     67   * \param center correct atom position by this vector
     68   */
    6369  void OutputPsi3Line(ostream * const out, const atom &_atom, const Vector *center) const;
     70
     71  /** Calculates multiplicites for a given set of \a atoms.
     72   *
     73   * \param atoms set of atoms
     74   * \return mulitplicity
     75   */
     76  unsigned int calculateMultiplicity(const std::vector<atom *> &atoms) const;
    6477
    6578  static ConvertTo<bool> Converter;
  • src/Parser/unittests/ParserPsi3UnitTest.cpp

    r14de8e1 r7ace68  
    102102\treference = uhf\n\
    103103\tbasis = \"cc-pVTZ\"\n\
    104 \tmultp = 2\n\
     104\tmultp = 3\n\
    105105\tcharge = 2\n\
    106106\tfreeze_core = no\n\
     
    121121\treference = twocon\n\
    122122\tbasis = \"cc-pVTZ\"\n\
    123 \tmultp = 1\n\
     123\tmultp = 3\n\
    124124\tcharge = 2\n\
    125125\tsocc = ( 1 1 0 0 0 0 0 0 )\n\
  • tests/regression/Parser/Psi3/pre/testtwocon.psi

    r14de8e1 r7ace68  
    66reference = twocon
    77basis = "cc-pVTZ"
    8 multp = 1
     8multp = 3
    99charge = 2
    1010socc = ( 1 0 1 0 0 0 0 0)
  • tests/regression/Parser/Psi3/pre/testuhf.psi

    r14de8e1 r7ace68  
    66reference = uhf
    77basis = "cc-pVTZ"
    8 multp = 1
     8multp = 3
    99charge = 2
    1010freeze_core = no
Note: See TracChangeset for help on using the changeset viewer.