Changeset 752dc7 for src


Ignore:
Timestamp:
Dec 19, 2012, 3:25:54 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:
f904d5
Parents:
990a62
git-author:
Frederik Heber <heber@…> (10/05/12 20:27:13)
git-committer:
Frederik Heber <heber@…> (12/19/12 15:25:54)
Message:

FIX: Made R and S also fixed parameters, this is in accordance with [Malshe].

Location:
src/Potentials/Specifics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Potentials/Specifics/ManyBodyPotential_Tersoff.cpp

    r990a62 r752dc7  
    5151    ) :
    5252    params(parameters_t(MAXPARAMS, 0.)),
     53    R(3.2),
     54    S(3.5),
    5355    lambda3(0.),
    5456    alpha(0.),
     
    7678    boost::function< std::vector<arguments_t>(const argument_t &, const double)> &_triplefunction) :
    7779  params(parameters_t(MAXPARAMS, 0.)),
     80  R(_R),
     81  S(_S),
    7882  lambda3(_lambda3),
    7983  alpha(_alpha),
     
    8387{
    8488//  Info info(__func__);
    85   params[R] = _R;
    86   params[S] = _S;
     89//  R = _R;
     90//  S = _S;
    8791  params[A] = _A;
    8892  params[B] = _B;
     
    151155  const argument_t &r_ij = arguments[0];
    152156  switch (index) {
    153     case R:
    154     {
    155       const double result = 0.;
    156       return results_t(1, result);
    157       break;
    158     }
    159     case S:
    160     {
    161       const double result = 0.;
    162       return results_t(1, result);
    163       break;
    164     }
     157//    case R:
     158//    {
     159//      const double result = 0.;
     160//      return results_t(1, result);
     161//      break;
     162//    }
     163//    case S:
     164//    {
     165//      const double result = 0.;
     166//      return results_t(1, result);
     167//      break;
     168//    }
    165169    case A:
    166170    {
     
    311315//  Info info(__func__);
    312316  double result = 0.;
    313   if (distance < params[R])
     317  if (distance < R)
    314318    result = 1.;
    315   else if (distance > params[S])
     319  else if (distance > S)
    316320    result = 0.;
    317321  else {
    318     result = (0.5 + 0.5 * cos( M_PI * (distance - params[R])/(params[S]-params[R])));
     322    result = (0.5 + 0.5 * cos( M_PI * (distance - R)/(S-R)));
    319323  }
    320324//  LOG(2, "DEBUG: function_cutoff(" << distance << ") = " << result);
     
    358362
    359363  // get all triples within the cutoff
    360   std::vector<arguments_t> triples = triplefunction(r_ij, params[S]);
     364  std::vector<arguments_t> triples = triplefunction(r_ij, S);
    361365  for (std::vector<arguments_t>::const_iterator iter = triples.begin();
    362366      iter != triples.end(); ++iter) {
     
    381385
    382386  // get all triples within the cutoff
    383   std::vector<arguments_t> triples = triplefunction(r_ij, params[S]);
     387  std::vector<arguments_t> triples = triplefunction(r_ij, S);
    384388  for (std::vector<arguments_t>::const_iterator iter = triples.begin();
    385389      iter != triples.end(); ++iter) {
  • src/Potentials/Specifics/ManyBodyPotential_Tersoff.hpp

    r990a62 r752dc7  
    180180private:
    181181  enum parameter_enum_t {
    182     R=0,
    183     S=1,
    184     A=2,
    185     B=3,
    186     lambda=4,
    187     mu=5,
    188     beta=6,
    189     n=7,
    190     c=8,
    191     d=9,
    192     h=10,
    193 //    lambda3=11,
    194 //    alpha=12,
    195 //    chi=13,
    196 //    omega=14,
     182    A,
     183    B,
     184    lambda,
     185    mu,
     186    beta,
     187    n,
     188    c,
     189    d,
     190    h,
     191//    R,
     192//    S,
     193//    lambda3,
     194//    alpha,
     195//    chi,
     196//    omega,
    197197    MAXPARAMS
    198198  };
     
    200200  parameters_t params;
    201201
     202public:
    202203  // some internal parameters which are fixed
     204  const double R;
     205  const double S;
    203206  const double lambda3;
    204207  const double alpha;
  • src/Potentials/Specifics/unittests/ManyBodyPotential_TersoffUnitTest.cpp

    r990a62 r752dc7  
    128128  // [Tersoff, '89]
    129129  params.resize(ManyBodyPotential_Tersoff::MAXPARAMS,0.);
    130   params[ManyBodyPotential_Tersoff::R] = 1.800000e+00;
    131   params[ManyBodyPotential_Tersoff::S] = 2.100000e+00;
     130//  params[ManyBodyPotential_Tersoff::R] = 1.800000e+00;
     131//  params[ManyBodyPotential_Tersoff::S] = 2.100000e+00;
    132132  params[ManyBodyPotential_Tersoff::A] = 1.393600e+03;
    133133  params[ManyBodyPotential_Tersoff::B] = 3.467000e+02;
     
    289289  ManyBodyPotential_Tersoff tersoff(fct);
    290290  tersoff.setParameters(params);
     291  const_cast<double &>(tersoff.R) = 1.8;
     292  const_cast<double &>(tersoff.S) = 2.1;
    291293  for (size_t index = 0; index < configurations.size(); ++index) {
    292294    CurrentConfiguration = &(configurations[index]);
     
    307309    // of the first and second position for the second configuration is easy to
    308310    // see as 1.119779. However, tremolo obtains 1.1197792 for unknown reasons.
    309     // Maybe, there is some float floating around in the code ...
     311    // Maybe, there is some float floating around in the code ... see strtod() bugs
     312//    LOG(2, "Comparing " << output[index] << " and " << .5*temp);
    310313    CPPUNIT_ASSERT(
    311314        Helpers::isEqual(
Note: See TracChangeset for help on using the changeset viewer.