Changeset 713888


Ignore:
Timestamp:
Jul 8, 2013, 2:22:03 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:
a82d33
Parents:
acc9b1
git-author:
Frederik Heber <heber@…> (05/09/13 18:27:17)
git-committer:
Frederik Heber <heber@…> (07/08/13 14:22:03)
Message:

Made PotentialFactory friend of all specific potentials and added default cstor.

Location:
src/Potentials
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • src/Potentials/EmpiricalPotential.hpp

    racc9b1 r713888  
    7272   */
    7373  virtual derivative_components_t derivative(const arguments_t &arguments) const=0;
     74
     75protected:
     76  /** Default constructor for class EmpiricalPotential.
     77   *
     78   * Callable only by derived functions.
     79   *
     80   */
     81  EmpiricalPotential()
     82  {}
     83
     84
    7485};
    7586
  • src/Potentials/SerializablePotential.cpp

    racc9b1 r713888  
    4949
    5050#include "Potentials/Exceptions.hpp"
     51
     52SerializablePotential::SerializablePotential() :
     53  ParticleTypes()
     54{}
    5155
    5256std::ostream& operator<<(std::ostream &ost, const SerializablePotential &potential)
  • src/Potentials/SerializablePotential.hpp

    racc9b1 r713888  
    146146  }
    147147
     148protected:
     149  /** Default constructor for class EmpiricalPotential.
     150   *
     151   * Callable only by derived functions.
     152   *
     153   */
     154  SerializablePotential();
     155
    148156private:
    149157
  • src/Potentials/Specifics/ConstantPotential.hpp

    racc9b1 r713888  
    1919#include "Potentials/EmpiricalPotential.hpp"
    2020
     21class PotentialFactory;
    2122class TrainingData;
    2223
     
    3233  //!> grant unit test access to internal parts
    3334  friend class ConstantPotentialTest;
     35  //!> grant PotentialFactory access to default cstor
     36  friend class PotentialFactory;
    3437  // some repeated typedefs to avoid ambiguities
    3538  typedef FunctionModel::arguments_t arguments_t;
     
    3841  typedef EmpiricalPotential::derivative_components_t derivative_components_t;
    3942  typedef FunctionModel::parameters_t parameters_t;
     43private:
     44  /** Private default constructor.
     45   *
     46   * This prevents creation of potential without set ParticleTypes_t.
     47   *
     48   */
     49  ConstantPotential() {}
     50
    4051public:
    4152  ConstantPotential(const ParticleTypes_t &_ParticleTypes);
  • src/Potentials/Specifics/ManyBodyPotential_Tersoff.cpp

    racc9b1 r713888  
    7777    ;
    7878const std::string ManyBodyPotential_Tersoff::potential_token("tersoff");
     79
     80ManyBodyPotential_Tersoff::ManyBodyPotential_Tersoff() :
     81    EmpiricalPotential(),
     82    R(3.2),
     83    S(3.5),
     84    lambda3(0.),
     85    alpha(0.),
     86    chi(1.),
     87    omega(1.),
     88    triplefunction(&Helpers::NoOp_Triplefunction)
     89{}
    7990
    8091ManyBodyPotential_Tersoff::ManyBodyPotential_Tersoff(
  • src/Potentials/Specifics/ManyBodyPotential_Tersoff.hpp

    racc9b1 r713888  
    2020#include "Potentials/EmpiricalPotential.hpp"
    2121
     22class PotentialFactory;
    2223class TrainingData;
    2324
     
    3435  //!> grant unit test access to internal parts
    3536  friend class ManyBodyPotential_TersoffTest;
     37  //!> grant PotentialFactory access to default cstor
     38  friend class PotentialFactory;
    3639  // some repeated typedefs to avoid ambiguities
    3740  typedef FunctionModel::arguments_t arguments_t;
     
    4043  typedef EmpiricalPotential::derivative_components_t derivative_components_t;
    4144  typedef FunctionModel::parameters_t parameters_t;
     45private:
     46  /** Private default constructor.
     47   *
     48   * This prevents creation of potential without set ParticleTypes_t.
     49   *
     50   */
     51  ManyBodyPotential_Tersoff();
     52
    4253public:
    4354  /** Constructor for class ManyBodyPotential_Tersoff.
     
    185196  void setTriplefunction(triplefunction_t &_triplefunction)
    186197  { triplefunction = _triplefunction;  }
    187 
    188 private:
    189   /** Prohibit private default constructor.
    190    *
    191    * We essentially need the triplefunction, hence without this function cannot
    192    * be.
    193    */
    194   ManyBodyPotential_Tersoff();
    195198
    196199private:
  • src/Potentials/Specifics/PairPotential_Angle.hpp

    racc9b1 r713888  
    1919#include "Potentials/EmpiricalPotential.hpp"
    2020
     21class PotentialFactory;
    2122class TrainingData;
    2223
     
    3132  //!> grant unit test access to internal parts
    3233  friend class PairPotential_AngleTest;
     34  //!> grant PotentialFactory access to default cstor
     35  friend class PotentialFactory;
    3336  // some repeated typedefs to avoid ambiguities
    3437  typedef FunctionModel::arguments_t arguments_t;
     
    3740  typedef EmpiricalPotential::derivative_components_t derivative_components_t;
    3841  typedef FunctionModel::parameters_t parameters_t;
     42private:
     43  /** Private default constructor.
     44   *
     45   * This prevents creation of potential without set ParticleTypes_t.
     46   *
     47   */
     48  PairPotential_Angle() {}
     49
    3950public:
    4051  PairPotential_Angle(const ParticleTypes_t &_ParticleTypes);
  • src/Potentials/Specifics/PairPotential_Harmonic.hpp

    racc9b1 r713888  
    1919#include "Potentials/EmpiricalPotential.hpp"
    2020
     21class PotentialFactory;
    2122class TrainingData;
    2223
     
    3132  //!> grant unit test access to internal parts
    3233  friend class PairPotential_HarmonicTest;
     34  //!> grant PotentialFactory access to default cstor
     35  friend class PotentialFactory;
    3336  // some repeated typedefs to avoid ambiguities
    3437  typedef FunctionModel::arguments_t arguments_t;
     
    3740  typedef EmpiricalPotential::derivative_components_t derivative_components_t;
    3841  typedef FunctionModel::parameters_t parameters_t;
     42private:
     43  /** Private default constructor.
     44   *
     45   * This prevents creation of potential without set ParticleTypes_t.
     46   *
     47   */
     48  PairPotential_Harmonic() {}
     49
    3950public:
    4051  PairPotential_Harmonic(const ParticleTypes_t &_ParticleTypes);
  • src/Potentials/Specifics/PairPotential_Morse.hpp

    racc9b1 r713888  
    1919#include "Potentials/EmpiricalPotential.hpp"
    2020
     21class PotentialFactory;
    2122class TrainingData;
    2223
     
    3132  //!> grant unit test access to internal parts
    3233  friend class PairPotential_MorseTest;
     34  //!> grant PotentialFactory access to default cstor
     35  friend class PotentialFactory;
    3336  // some repeated typedefs to avoid ambiguities
    3437  typedef FunctionModel::arguments_t arguments_t;
     
    3740  typedef EmpiricalPotential::derivative_components_t derivative_components_t;
    3841  typedef FunctionModel::parameters_t parameters_t;
     42private:
     43  /** Private default constructor.
     44   *
     45   * This prevents creation of potential without set ParticleTypes_t.
     46   *
     47   */
     48  PairPotential_Morse() {}
     49
    3950public:
    4051  PairPotential_Morse(const ParticleTypes_t &_ParticleTypes);
Note: See TracChangeset for help on using the changeset viewer.