Index: src/Potentials/Specifics/PairPotential_Angle.cpp
===================================================================
--- src/Potentials/Specifics/PairPotential_Angle.cpp	(revision 1413f4555b944ca972d0d485541e58d325f62feb)
+++ 	(revision )
@@ -1,242 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Copyright (C)  2013 Frederik Heber. All rights reserved.
- * Please see the COPYING file or "Copyright notice" in builder.cpp for details.
- * 
- *
- *   This file is part of MoleCuilder.
- *
- *    MoleCuilder is free software: you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation, either version 2 of the License, or
- *    (at your option) any later version.
- *
- *    MoleCuilder is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>. 
- */
-
-/*
- * PairPotential_Angle.cpp
- *
- *  Created on: Oct 11, 2012
- *      Author: heber
- */
-
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include "PairPotential_Angle.hpp"
-
-#include <boost/assign/list_of.hpp> // for 'map_list_of()'
-#include <boost/bind.hpp>
-#include <boost/lambda/lambda.hpp>
-#include <string>
-
-#include "CodePatterns/Assert.hpp"
-
-#include "FunctionApproximation/Extractors.hpp"
-#include "FunctionApproximation/TrainingData.hpp"
-#include "Potentials/helpers.hpp"
-#include "Potentials/ParticleTypeCheckers.hpp"
-
-class Fragment;
-
-// static definitions
-const PairPotential_Angle::ParameterNames_t
-PairPotential_Angle::ParameterNames =
-      boost::assign::list_of<std::string>
-      ("spring_constant")
-      ("equilibrium_distance")
-    ;
-const std::string PairPotential_Angle::potential_token("harmonic_angle");
-
-PairPotential_Angle::PairPotential_Angle() :
-  EmpiricalPotential(),
-  params(parameters_t(MAXPARAMS, 0.))
-{
-  // have some decent defaults for parameter_derivative checking
-  params[spring_constant] = 1.;
-  params[equilibrium_distance] = 0.1;
-}
-
-PairPotential_Angle::PairPotential_Angle(
-    const ParticleTypes_t &_ParticleTypes
-    ) :
-  EmpiricalPotential(_ParticleTypes),
-  params(parameters_t(MAXPARAMS, 0.))
-{
-  // have some decent defaults for parameter_derivative checking
-  params[spring_constant] = 1.;
-  params[equilibrium_distance] = 0.1;
-}
-
-PairPotential_Angle::PairPotential_Angle(
-    const ParticleTypes_t &_ParticleTypes,
-    const double _spring_constant,
-    const double _equilibrium_distance) :
-  EmpiricalPotential(_ParticleTypes),
-  params(parameters_t(MAXPARAMS, 0.))
-{
-  params[spring_constant] = _spring_constant;
-  params[equilibrium_distance] = _equilibrium_distance;
-}
-
-void PairPotential_Angle::setParameters(const parameters_t &_params)
-{
-  const size_t paramsDim = _params.size();
-  ASSERT( paramsDim <= getParameterDimension(),
-      "PairPotential_Angle::setParameters() - we need not more than "
-      +toString(getParameterDimension())+" parameters.");
-  for(size_t i=0;i<paramsDim;++i)
-    params[i] = _params[i];
-
-#ifndef NDEBUG
-  parameters_t check_params(getParameters());
-  check_params.resize(paramsDim); // truncate to same size
-  ASSERT( check_params == _params,
-      "PairPotential_Angle::setParameters() - failed, mismatch in to be set "
-      +toString(_params)+" and set "+toString(check_params)+" params.");
-#endif
-}
-
-PairPotential_Angle::result_t
-PairPotential_Angle::function_theta(
-    const double &r_ij,
-    const double &r_jk,
-    const double &r_ik
-  ) const
-{
-//  Info info(__func__);
-  const double angle = Helpers::pow(r_ij,2) + Helpers::pow(r_jk,2) - Helpers::pow(r_ik,2);
-  const double divisor = 2.* r_ij * r_jk;
-
-//  LOG(2, "DEBUG: cos(theta)= " << angle/divisor);
-  if (divisor == 0.)
-    return 0.;
-  else
-    return angle/divisor;
-}
-
-PairPotential_Angle::results_t
-PairPotential_Angle::operator()(
-    const arguments_t &arguments
-    ) const
-{
-  ASSERT( arguments.size() == 3,
-      "PairPotential_Angle::operator() - requires exactly three arguments.");
-  ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes(
-      arguments, getParticleTypes()),
-      "PairPotential_Angle::operator() - types don't match with ones in arguments.");
-  const argument_t &r_ij = arguments[0]; // 01
-  const argument_t &r_jk = arguments[2]; // 12
-  const argument_t &r_ik = arguments[1]; // 02
-  const result_t result =
-      params[spring_constant]
-             * Helpers::pow( function_theta(r_ij.distance, r_jk.distance, r_ik.distance) - params[equilibrium_distance], 2 );
-  return std::vector<result_t>(1, result);
-}
-
-PairPotential_Angle::derivative_components_t
-PairPotential_Angle::derivative(
-    const arguments_t &arguments
-    ) const
-{
-  ASSERT( arguments.size() == 3,
-      "PairPotential_Angle::operator() - requires exactly three arguments.");
-  ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes(
-      arguments, getParticleTypes()),
-      "PairPotential_Angle::operator() - types don't match with ones in arguments.");
-  derivative_components_t result;
-  const argument_t &r_ij = arguments[0]; //01
-  const argument_t &r_jk = arguments[2]; //12
-  const argument_t &r_ik = arguments[1]; //02
-  result.push_back( 2. * params[spring_constant] * ( function_theta(r_ij.distance, r_jk.distance, r_ik.distance) - params[equilibrium_distance]) );
-  ASSERT( result.size() == 1,
-      "PairPotential_Angle::operator() - we did not create exactly one component.");
-  return result;
-}
-
-PairPotential_Angle::results_t
-PairPotential_Angle::parameter_derivative(
-    const arguments_t &arguments,
-    const size_t index
-    ) const
-{
-  ASSERT( arguments.size() == 3,
-      "PairPotential_Angle::parameter_derivative() - requires exactly three arguments.");
-  ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes(
-      arguments, getParticleTypes()),
-      "PairPotential_Angle::operator() - types don't match with ones in arguments.");
-  const argument_t &r_ij = arguments[0]; //01
-  const argument_t &r_jk = arguments[2]; //12
-  const argument_t &r_ik = arguments[1]; //02
-  switch (index) {
-    case spring_constant:
-    {
-      const result_t result =
-                 Helpers::pow( function_theta(r_ij.distance, r_jk.distance, r_ik.distance) - params[equilibrium_distance], 2 );
-      return std::vector<result_t>(1, result);
-      break;
-    }
-    case equilibrium_distance:
-    {
-      const result_t result =
-          -2. * params[spring_constant]
-                 * ( function_theta(r_ij.distance, r_jk.distance, r_ik.distance) - params[equilibrium_distance]);
-      return std::vector<result_t>(1, result);
-      break;
-    }
-    default:
-      ASSERT(0, "PairPotential_Angle::parameter_derivative() - derivative to unknown parameter desired.");
-      break;
-  }
-}
-
-FunctionModel::extractor_t
-PairPotential_Angle::getSpecificExtractor() const
-{
-  Fragment::charges_t charges;
-  charges.resize(getParticleTypes().size());
-  std::transform(getParticleTypes().begin(), getParticleTypes().end(),
-      charges.begin(), boost::lambda::_1);
-  FunctionModel::extractor_t returnfunction =
-      boost::bind(&Extractors::gatherDistancesFromFragment,
-          boost::bind(&Fragment::getPositions, _1),
-          boost::bind(&Fragment::getCharges, _1),
-          charges,
-          _2);
-  return returnfunction;
-}
-
-FunctionModel::filter_t PairPotential_Angle::getSpecificFilter() const
-{
-  FunctionModel::filter_t returnfunction =
-      boost::bind(&Extractors::reorderArgumentsByParticleTypes,
-        boost::bind(&Extractors::filterArgumentsByParticleTypes,
-            _1,
-            getParticleTypes()),
-        getParticleTypes()
-      );
-  return returnfunction;
-}
-
-void
-PairPotential_Angle::setParametersToRandomInitialValues(
-    const TrainingData &data)
-{
-  params[PairPotential_Angle::spring_constant] = 1e+0*rand()/(double)RAND_MAX;// 0.2;
-  params[PairPotential_Angle::equilibrium_distance] = -0.3;//2e+0*rand()/(double)RAND_MAX - 1.;// 1.;
-}
-
Index: src/Potentials/Specifics/PairPotential_Angle.hpp
===================================================================
--- src/Potentials/Specifics/PairPotential_Angle.hpp	(revision 1413f4555b944ca972d0d485541e58d325f62feb)
+++ 	(revision )
@@ -1,206 +1,0 @@
-/*
- * PairPotential_Angle.hpp
- *
- *  Created on: Oct 11, 2012
- *      Author: heber
- */
-
-#ifndef PAIRPOTENTIAL_ANGLE_HPP_
-#define PAIRPOTENTIAL_ANGLE_HPP_
-
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <limits>
-
-#include "Potentials/EmpiricalPotential.hpp"
-
-class PotentialFactory;
-class TrainingData;
-
-/** This is the implementation of a harmonic angle potential.
- *
- * This evaluates \f$ k \cdot (\theta -\theta_0)^2 \f$.
- *
- */
-class PairPotential_Angle :
-  public EmpiricalPotential
-{
-  //!> grant unit test access to internal parts
-  friend class PairPotential_AngleTest;
-  //!> grant PotentialFactory access to default cstor
-  friend class PotentialFactory;
-  // some repeated typedefs to avoid ambiguities
-  typedef FunctionModel::arguments_t arguments_t;
-  typedef FunctionModel::result_t result_t;
-  typedef FunctionModel::results_t results_t;
-  typedef EmpiricalPotential::derivative_components_t derivative_components_t;
-  typedef FunctionModel::parameters_t parameters_t;
-private:
-  /** Private default constructor.
-   *
-   * This prevents creation of potential without set ParticleTypes_t.
-   *
-   * \note PotentialFactory may use this default cstor
-   *
-   */
-  PairPotential_Angle();
-
-public:
-  PairPotential_Angle(const ParticleTypes_t &_ParticleTypes);
-  PairPotential_Angle(
-      const ParticleTypes_t &_ParticleTypes,
-      const double _spring_constant,
-      const double _equilibrium_distance);
-  virtual ~PairPotential_Angle() {}
-
-  /** Setter for parameters as required by FunctionModel interface.
-   *
-   * \param _params given set of parameters
-   */
-  void setParameters(const parameters_t &_params);
-
-  /** Getter for parameters as required by FunctionModel interface.
-   *
-   * \return set of parameters
-   */
-  parameters_t getParameters() const
-  {
-    return params;
-  }
-
-  /** Sets the parameter randomly within the sensible range of each parameter.
-   *
-   * \param data container with training data for guesstimating range
-   */
-  void setParametersToRandomInitialValues(const TrainingData &data);
-
-  /** Getter for the number of parameters of this model function.
-   *
-   * \return number of parameters
-   */
-  size_t getParameterDimension() const
-  {
-    return MAXPARAMS;
-  }
-
-  /** Evaluates the harmonic potential function for the given arguments.
-   *
-   * @param arguments single distance
-   * @return value of the potential function
-   */
-  results_t operator()(const arguments_t &arguments) const;
-
-  /** Evaluates the derivative of the potential function.
-   *
-   * @param arguments single distance
-   * @return vector with derivative with respect to the input degrees of freedom
-   */
-  derivative_components_t derivative(const arguments_t &arguments) const;
-
-  /** Evaluates the derivative of the function with the given \a arguments
-   * with respect to a specific parameter indicated by \a index.
-   *
-   * \param arguments set of arguments as input variables to the function
-   * \param index derivative of which parameter
-   * \return result vector containing the derivative with respect to the given
-   *         input
-   */
-  results_t parameter_derivative(const arguments_t &arguments, const size_t index) const;
-
-  /** Return the token name of this specific potential.
-   *
-   * \return token name of the potential
-   */
-  const std::string& getToken() const
-  { return potential_token; }
-
-  /** Returns a vector of parameter names.
-   *
-   * This is required from the specific implementation
-   *
-   * \return vector of strings containing parameter names
-   */
-  const ParameterNames_t& getParameterNames() const
-  { return ParameterNames; }
-
-  /** States whether lower and upper boundaries should be used to constraint
-   * the parameter search for this function model.
-   *
-   * \return true - constraints should be used, false - else
-   */
-  bool isBoxConstraint() const {
-    return true;
-  }
-
-  /** Returns a vector which are the lower boundaries for each parameter_t
-   * of this FunctionModel.
-   *
-   * \return vector of parameter_t resembling lowest allowed values
-   */
-  parameters_t getLowerBoxConstraints() const {
-    parameters_t lowerbounds(getParameterDimension(), -std::numeric_limits<double>::max());
-    lowerbounds[equilibrium_distance] = -1.;
-    return lowerbounds;
-  }
-
-  /** Returns a vector which are the upper boundaries for each parameter_t
-   * of this FunctionModel.
-   *
-   * \return vector of parameter_t resembling highest allowed values
-   */
-  parameters_t getUpperBoxConstraints() const {
-    parameters_t upperbounds(getParameterDimension(), std::numeric_limits<double>::max());
-    upperbounds[equilibrium_distance] = 1.;
-    return upperbounds;
-  }
-
-  /** Returns a bound function to be used with TrainingData, extracting distances
-   * from a Fragment.
-   *
-   * \return bound function extracting distances from a fragment
-   */
-  FunctionModel::extractor_t getSpecificExtractor() const;
-
-  /** Returns a bound function to be used with TrainingData, extracting distances
-   * from a Fragment.
-   *
-   * \return bound function extracting distances from a fragment
-   */
-  FunctionModel::filter_t getSpecificFilter() const;
-
-  /** Returns the number of arguments the underlying function requires.
-   *
-   * \return number of arguments of the function
-   */
-  size_t getSpecificArgumentCount() const
-  { return 3; }
-
-  enum parameter_enum_t {
-    spring_constant=0,
-    equilibrium_distance=1,
-    MAXPARAMS
-  };
-
-private:
-  result_t
-  function_theta(
-      const double &r_ij,
-      const double &r_ik,
-      const double &r_jk
-    ) const;
-private:
-  //!> parameter vector with parameters as in enum parameter_enum_t
-  parameters_t params;
-
-  //!> static definitions of the parameter name for this potential
-  static const ParameterNames_t ParameterNames;
-
-  //!> static token of this potential type
-  static const std::string potential_token;
-};
-
-#endif /* PAIRPOTENTIAL_ANGLE_HPP_ */
Index: src/Potentials/Specifics/ThreeBodyPotential_Angle.cpp
===================================================================
--- src/Potentials/Specifics/ThreeBodyPotential_Angle.cpp	(revision 484e2ac103bbd121925bede487af209b526f8d12)
+++ src/Potentials/Specifics/ThreeBodyPotential_Angle.cpp	(revision 484e2ac103bbd121925bede487af209b526f8d12)
@@ -0,0 +1,242 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * Copyright (C)  2013 Frederik Heber. All rights reserved.
+ * Please see the COPYING file or "Copyright notice" in builder.cpp for details.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>. 
+ */
+
+/*
+ * ThreeBodyPotential_Angle.cpp
+ *
+ *  Created on: Oct 11, 2012
+ *      Author: heber
+ */
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "ThreeBodyPotential_Angle.hpp"
+
+#include <boost/assign/list_of.hpp> // for 'map_list_of()'
+#include <boost/bind.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <string>
+
+#include "CodePatterns/Assert.hpp"
+
+#include "FunctionApproximation/Extractors.hpp"
+#include "FunctionApproximation/TrainingData.hpp"
+#include "Potentials/helpers.hpp"
+#include "Potentials/ParticleTypeCheckers.hpp"
+
+class Fragment;
+
+// static definitions
+const ThreeBodyPotential_Angle::ParameterNames_t
+ThreeBodyPotential_Angle::ParameterNames =
+      boost::assign::list_of<std::string>
+      ("spring_constant")
+      ("equilibrium_distance")
+    ;
+const std::string ThreeBodyPotential_Angle::potential_token("harmonic_angle");
+
+ThreeBodyPotential_Angle::ThreeBodyPotential_Angle() :
+  EmpiricalPotential(),
+  params(parameters_t(MAXPARAMS, 0.))
+{
+  // have some decent defaults for parameter_derivative checking
+  params[spring_constant] = 1.;
+  params[equilibrium_distance] = 0.1;
+}
+
+ThreeBodyPotential_Angle::ThreeBodyPotential_Angle(
+    const ParticleTypes_t &_ParticleTypes
+    ) :
+  EmpiricalPotential(_ParticleTypes),
+  params(parameters_t(MAXPARAMS, 0.))
+{
+  // have some decent defaults for parameter_derivative checking
+  params[spring_constant] = 1.;
+  params[equilibrium_distance] = 0.1;
+}
+
+ThreeBodyPotential_Angle::ThreeBodyPotential_Angle(
+    const ParticleTypes_t &_ParticleTypes,
+    const double _spring_constant,
+    const double _equilibrium_distance) :
+  EmpiricalPotential(_ParticleTypes),
+  params(parameters_t(MAXPARAMS, 0.))
+{
+  params[spring_constant] = _spring_constant;
+  params[equilibrium_distance] = _equilibrium_distance;
+}
+
+void ThreeBodyPotential_Angle::setParameters(const parameters_t &_params)
+{
+  const size_t paramsDim = _params.size();
+  ASSERT( paramsDim <= getParameterDimension(),
+      "ThreeBodyPotential_Angle::setParameters() - we need not more than "
+      +toString(getParameterDimension())+" parameters.");
+  for(size_t i=0;i<paramsDim;++i)
+    params[i] = _params[i];
+
+#ifndef NDEBUG
+  parameters_t check_params(getParameters());
+  check_params.resize(paramsDim); // truncate to same size
+  ASSERT( check_params == _params,
+      "ThreeBodyPotential_Angle::setParameters() - failed, mismatch in to be set "
+      +toString(_params)+" and set "+toString(check_params)+" params.");
+#endif
+}
+
+ThreeBodyPotential_Angle::result_t
+ThreeBodyPotential_Angle::function_theta(
+    const double &r_ij,
+    const double &r_jk,
+    const double &r_ik
+  ) const
+{
+//  Info info(__func__);
+  const double angle = Helpers::pow(r_ij,2) + Helpers::pow(r_jk,2) - Helpers::pow(r_ik,2);
+  const double divisor = 2.* r_ij * r_jk;
+
+//  LOG(2, "DEBUG: cos(theta)= " << angle/divisor);
+  if (divisor == 0.)
+    return 0.;
+  else
+    return angle/divisor;
+}
+
+ThreeBodyPotential_Angle::results_t
+ThreeBodyPotential_Angle::operator()(
+    const arguments_t &arguments
+    ) const
+{
+  ASSERT( arguments.size() == 3,
+      "ThreeBodyPotential_Angle::operator() - requires exactly three arguments.");
+  ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes(
+      arguments, getParticleTypes()),
+      "ThreeBodyPotential_Angle::operator() - types don't match with ones in arguments.");
+  const argument_t &r_ij = arguments[0]; // 01
+  const argument_t &r_jk = arguments[2]; // 12
+  const argument_t &r_ik = arguments[1]; // 02
+  const result_t result =
+      params[spring_constant]
+             * Helpers::pow( function_theta(r_ij.distance, r_jk.distance, r_ik.distance) - params[equilibrium_distance], 2 );
+  return std::vector<result_t>(1, result);
+}
+
+ThreeBodyPotential_Angle::derivative_components_t
+ThreeBodyPotential_Angle::derivative(
+    const arguments_t &arguments
+    ) const
+{
+  ASSERT( arguments.size() == 3,
+      "ThreeBodyPotential_Angle::operator() - requires exactly three arguments.");
+  ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes(
+      arguments, getParticleTypes()),
+      "ThreeBodyPotential_Angle::operator() - types don't match with ones in arguments.");
+  derivative_components_t result;
+  const argument_t &r_ij = arguments[0]; //01
+  const argument_t &r_jk = arguments[2]; //12
+  const argument_t &r_ik = arguments[1]; //02
+  result.push_back( 2. * params[spring_constant] * ( function_theta(r_ij.distance, r_jk.distance, r_ik.distance) - params[equilibrium_distance]) );
+  ASSERT( result.size() == 1,
+      "ThreeBodyPotential_Angle::operator() - we did not create exactly one component.");
+  return result;
+}
+
+ThreeBodyPotential_Angle::results_t
+ThreeBodyPotential_Angle::parameter_derivative(
+    const arguments_t &arguments,
+    const size_t index
+    ) const
+{
+  ASSERT( arguments.size() == 3,
+      "ThreeBodyPotential_Angle::parameter_derivative() - requires exactly three arguments.");
+  ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes(
+      arguments, getParticleTypes()),
+      "ThreeBodyPotential_Angle::operator() - types don't match with ones in arguments.");
+  const argument_t &r_ij = arguments[0]; //01
+  const argument_t &r_jk = arguments[2]; //12
+  const argument_t &r_ik = arguments[1]; //02
+  switch (index) {
+    case spring_constant:
+    {
+      const result_t result =
+                 Helpers::pow( function_theta(r_ij.distance, r_jk.distance, r_ik.distance) - params[equilibrium_distance], 2 );
+      return std::vector<result_t>(1, result);
+      break;
+    }
+    case equilibrium_distance:
+    {
+      const result_t result =
+          -2. * params[spring_constant]
+                 * ( function_theta(r_ij.distance, r_jk.distance, r_ik.distance) - params[equilibrium_distance]);
+      return std::vector<result_t>(1, result);
+      break;
+    }
+    default:
+      ASSERT(0, "ThreeBodyPotential_Angle::parameter_derivative() - derivative to unknown parameter desired.");
+      break;
+  }
+}
+
+FunctionModel::extractor_t
+ThreeBodyPotential_Angle::getSpecificExtractor() const
+{
+  Fragment::charges_t charges;
+  charges.resize(getParticleTypes().size());
+  std::transform(getParticleTypes().begin(), getParticleTypes().end(),
+      charges.begin(), boost::lambda::_1);
+  FunctionModel::extractor_t returnfunction =
+      boost::bind(&Extractors::gatherDistancesFromFragment,
+          boost::bind(&Fragment::getPositions, _1),
+          boost::bind(&Fragment::getCharges, _1),
+          charges,
+          _2);
+  return returnfunction;
+}
+
+FunctionModel::filter_t ThreeBodyPotential_Angle::getSpecificFilter() const
+{
+  FunctionModel::filter_t returnfunction =
+      boost::bind(&Extractors::reorderArgumentsByParticleTypes,
+        boost::bind(&Extractors::filterArgumentsByParticleTypes,
+            _1,
+            getParticleTypes()),
+        getParticleTypes()
+      );
+  return returnfunction;
+}
+
+void
+ThreeBodyPotential_Angle::setParametersToRandomInitialValues(
+    const TrainingData &data)
+{
+  params[ThreeBodyPotential_Angle::spring_constant] = 1e+0*rand()/(double)RAND_MAX;// 0.2;
+  params[ThreeBodyPotential_Angle::equilibrium_distance] = -0.3;//2e+0*rand()/(double)RAND_MAX - 1.;// 1.;
+}
+
Index: src/Potentials/Specifics/ThreeBodyPotential_Angle.hpp
===================================================================
--- src/Potentials/Specifics/ThreeBodyPotential_Angle.hpp	(revision 484e2ac103bbd121925bede487af209b526f8d12)
+++ src/Potentials/Specifics/ThreeBodyPotential_Angle.hpp	(revision 484e2ac103bbd121925bede487af209b526f8d12)
@@ -0,0 +1,206 @@
+/*
+ * ThreeBodyPotential_Angle.hpp
+ *
+ *  Created on: Oct 11, 2012
+ *      Author: heber
+ */
+
+#ifndef THREEBODYPOTENTIAL_ANGLE_HPP_
+#define THREEBODYPOTENTIAL_ANGLE_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <limits>
+
+#include "Potentials/EmpiricalPotential.hpp"
+
+class PotentialFactory;
+class TrainingData;
+
+/** This is the implementation of a harmonic angle potential.
+ *
+ * This evaluates \f$ k \cdot (\theta -\theta_0)^2 \f$.
+ *
+ */
+class ThreeBodyPotential_Angle :
+  public EmpiricalPotential
+{
+  //!> grant unit test access to internal parts
+  friend class ThreeBodyPotential_AngleTest;
+  //!> grant PotentialFactory access to default cstor
+  friend class PotentialFactory;
+  // some repeated typedefs to avoid ambiguities
+  typedef FunctionModel::arguments_t arguments_t;
+  typedef FunctionModel::result_t result_t;
+  typedef FunctionModel::results_t results_t;
+  typedef EmpiricalPotential::derivative_components_t derivative_components_t;
+  typedef FunctionModel::parameters_t parameters_t;
+private:
+  /** Private default constructor.
+   *
+   * This prevents creation of potential without set ParticleTypes_t.
+   *
+   * \note PotentialFactory may use this default cstor
+   *
+   */
+  ThreeBodyPotential_Angle();
+
+public:
+  ThreeBodyPotential_Angle(const ParticleTypes_t &_ParticleTypes);
+  ThreeBodyPotential_Angle(
+      const ParticleTypes_t &_ParticleTypes,
+      const double _spring_constant,
+      const double _equilibrium_distance);
+  virtual ~ThreeBodyPotential_Angle() {}
+
+  /** Setter for parameters as required by FunctionModel interface.
+   *
+   * \param _params given set of parameters
+   */
+  void setParameters(const parameters_t &_params);
+
+  /** Getter for parameters as required by FunctionModel interface.
+   *
+   * \return set of parameters
+   */
+  parameters_t getParameters() const
+  {
+    return params;
+  }
+
+  /** Sets the parameter randomly within the sensible range of each parameter.
+   *
+   * \param data container with training data for guesstimating range
+   */
+  void setParametersToRandomInitialValues(const TrainingData &data);
+
+  /** Getter for the number of parameters of this model function.
+   *
+   * \return number of parameters
+   */
+  size_t getParameterDimension() const
+  {
+    return MAXPARAMS;
+  }
+
+  /** Evaluates the harmonic potential function for the given arguments.
+   *
+   * @param arguments single distance
+   * @return value of the potential function
+   */
+  results_t operator()(const arguments_t &arguments) const;
+
+  /** Evaluates the derivative of the potential function.
+   *
+   * @param arguments single distance
+   * @return vector with derivative with respect to the input degrees of freedom
+   */
+  derivative_components_t derivative(const arguments_t &arguments) const;
+
+  /** Evaluates the derivative of the function with the given \a arguments
+   * with respect to a specific parameter indicated by \a index.
+   *
+   * \param arguments set of arguments as input variables to the function
+   * \param index derivative of which parameter
+   * \return result vector containing the derivative with respect to the given
+   *         input
+   */
+  results_t parameter_derivative(const arguments_t &arguments, const size_t index) const;
+
+  /** Return the token name of this specific potential.
+   *
+   * \return token name of the potential
+   */
+  const std::string& getToken() const
+  { return potential_token; }
+
+  /** Returns a vector of parameter names.
+   *
+   * This is required from the specific implementation
+   *
+   * \return vector of strings containing parameter names
+   */
+  const ParameterNames_t& getParameterNames() const
+  { return ParameterNames; }
+
+  /** States whether lower and upper boundaries should be used to constraint
+   * the parameter search for this function model.
+   *
+   * \return true - constraints should be used, false - else
+   */
+  bool isBoxConstraint() const {
+    return true;
+  }
+
+  /** Returns a vector which are the lower boundaries for each parameter_t
+   * of this FunctionModel.
+   *
+   * \return vector of parameter_t resembling lowest allowed values
+   */
+  parameters_t getLowerBoxConstraints() const {
+    parameters_t lowerbounds(getParameterDimension(), -std::numeric_limits<double>::max());
+    lowerbounds[equilibrium_distance] = -1.;
+    return lowerbounds;
+  }
+
+  /** Returns a vector which are the upper boundaries for each parameter_t
+   * of this FunctionModel.
+   *
+   * \return vector of parameter_t resembling highest allowed values
+   */
+  parameters_t getUpperBoxConstraints() const {
+    parameters_t upperbounds(getParameterDimension(), std::numeric_limits<double>::max());
+    upperbounds[equilibrium_distance] = 1.;
+    return upperbounds;
+  }
+
+  /** Returns a bound function to be used with TrainingData, extracting distances
+   * from a Fragment.
+   *
+   * \return bound function extracting distances from a fragment
+   */
+  FunctionModel::extractor_t getSpecificExtractor() const;
+
+  /** Returns a bound function to be used with TrainingData, extracting distances
+   * from a Fragment.
+   *
+   * \return bound function extracting distances from a fragment
+   */
+  FunctionModel::filter_t getSpecificFilter() const;
+
+  /** Returns the number of arguments the underlying function requires.
+   *
+   * \return number of arguments of the function
+   */
+  size_t getSpecificArgumentCount() const
+  { return 3; }
+
+  enum parameter_enum_t {
+    spring_constant=0,
+    equilibrium_distance=1,
+    MAXPARAMS
+  };
+
+private:
+  result_t
+  function_theta(
+      const double &r_ij,
+      const double &r_ik,
+      const double &r_jk
+    ) const;
+private:
+  //!> parameter vector with parameters as in enum parameter_enum_t
+  parameters_t params;
+
+  //!> static definitions of the parameter name for this potential
+  static const ParameterNames_t ParameterNames;
+
+  //!> static token of this potential type
+  static const std::string potential_token;
+};
+
+#endif /* THREEBODYPOTENTIAL_ANGLE_HPP_ */
Index: src/Potentials/Specifics/unittests/Makefile.am
===================================================================
--- src/Potentials/Specifics/unittests/Makefile.am	(revision 1413f4555b944ca972d0d485541e58d325f62feb)
+++ src/Potentials/Specifics/unittests/Makefile.am	(revision 484e2ac103bbd121925bede487af209b526f8d12)
@@ -5,24 +5,24 @@
 	../Potentials/Specifics/unittests/ConstantPotentialUnitTest.cpp \
 	../Potentials/Specifics/unittests/ManyBodyPotential_TersoffUnitTest.cpp \
-	../Potentials/Specifics/unittests/PairPotential_AngleUnitTest.cpp \
 	../Potentials/Specifics/unittests/PairPotential_HarmonicUnitTest.cpp \
 	../Potentials/Specifics/unittests/PairPotential_LennardJonesUnitTest.cpp \
-	../Potentials/Specifics/unittests/PairPotential_MorseUnitTest.cpp
+	../Potentials/Specifics/unittests/PairPotential_MorseUnitTest.cpp \
+	../Potentials/Specifics/unittests/ThreeBodyPotential_AngleUnitTest.cpp
 
 POTENTIALSSPECIFICSTESTSHEADERS = \
 	../Potentials/Specifics/unittests/ConstantPotentialUnitTest.hpp \
 	../Potentials/Specifics/unittests/ManyBodyPotential_TersoffUnitTest.hpp \
-	../Potentials/Specifics/unittests/PairPotential_AngleUnitTest.hpp \
 	../Potentials/Specifics/unittests/PairPotential_HarmonicUnitTest.hpp \
 	../Potentials/Specifics/unittests/PairPotential_LennardJonesUnitTest.hpp \
-	../Potentials/Specifics/unittests/PairPotential_MorseUnitTest.hpp
+	../Potentials/Specifics/unittests/PairPotential_MorseUnitTest.hpp \
+	../Potentials/Specifics/unittests/ThreeBodyPotential_AngleUnitTest.hpp
 
 POTENTIALSSPECIFICSTESTS = \
 	ConstantPotentialUnitTest \
 	ManyBodyPotential_TersoffUnitTest \
-	PairPotential_AngleUnitTest \
 	PairPotential_HarmonicUnitTest \
 	PairPotential_LennardJonesUnitTest \
-	PairPotential_MorseUnitTest
+	PairPotential_MorseUnitTest \
+	ThreeBodyPotential_AngleUnitTest
 
 TESTS += $(POTENTIALSSPECIFICSTESTS)
@@ -50,9 +50,4 @@
 ManyBodyPotential_TersoffUnitTest_LDADD = ${POTENTIALSSPECIFICSLIBS}
 
-PairPotential_AngleUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
-	../Potentials/Specifics/unittests/PairPotential_AngleUnitTest.cpp \
-	../Potentials/Specifics/unittests/PairPotential_AngleUnitTest.hpp
-PairPotential_AngleUnitTest_LDADD = ${POTENTIALSSPECIFICSLIBS}
-
 PairPotential_HarmonicUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
 	../Potentials/Specifics/unittests/PairPotential_HarmonicUnitTest.cpp \
@@ -70,4 +65,9 @@
 PairPotential_MorseUnitTest_LDADD = ${POTENTIALSSPECIFICSLIBS}
 
+ThreeBodyPotential_AngleUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	../Potentials/Specifics/unittests/ThreeBodyPotential_AngleUnitTest.cpp \
+	../Potentials/Specifics/unittests/ThreeBodyPotential_AngleUnitTest.hpp
+ThreeBodyPotential_AngleUnitTest_LDADD = ${POTENTIALSSPECIFICSLIBS}
+
 
 #AUTOMAKE_OPTIONS = parallel-tests
Index: src/Potentials/Specifics/unittests/PairPotential_AngleUnitTest.cpp
===================================================================
--- src/Potentials/Specifics/unittests/PairPotential_AngleUnitTest.cpp	(revision 1413f4555b944ca972d0d485541e58d325f62feb)
+++ 	(revision )
@@ -1,174 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Copyright (C)  2013 Frederik Heber. All rights reserved.
- * 
- *
- *   This file is part of MoleCuilder.
- *
- *    MoleCuilder is free software: you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation, either version 2 of the License, or
- *    (at your option) any later version.
- *
- *    MoleCuilder is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * PairPotential_AngleUnitTest.cpp
- *
- *  Created on: Oct 16, 2012
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-using namespace std;
-
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/ui/text/TestRunner.h>
-
-#include "PairPotential_AngleUnitTest.hpp"
-
-#include <boost/assign.hpp>
-
-#include "CodePatterns/Assert.hpp"
-
-#include "FunctionApproximation/FunctionArgument.hpp"
-#include "Potentials/Specifics/PairPotential_Angle.hpp"
-#include "Potentials/helpers.hpp"
-
-using namespace boost::assign;
-
-#ifdef HAVE_TESTRUNNER
-#include "UnitTestMain.hpp"
-#endif /*HAVE_TESTRUNNER*/
-
-/********************************************** Test classes **************************************/
-
-// Registers the fixture into the 'registry'
-CPPUNIT_TEST_SUITE_REGISTRATION( PairPotential_AngleTest );
-
-const double spring_constant = .5;
-
-void PairPotential_AngleTest::setUp()
-{
-  // failing asserts should be thrown
-  ASSERT_DO(Assert::Throw);
-
-  // create three distances to have the desired angle
-  typedef std::vector<double> angles_t;
-  angles_t angles;
-  angles += -0.5, -.4, -.3, -.2, -.1, 0., .1, .2, .3, .4, .5;
-  FunctionModel::arguments_t tempvector(3);
-  tempvector[0] = argument_t( std::make_pair(0,1), std::make_pair(0,1), 1.);
-  tempvector[1] = argument_t( std::make_pair(1,2), std::make_pair(1,1), 0.);
-  tempvector[2] = argument_t( std::make_pair(0,2), std::make_pair(0,1), 1.);
-  for (angles_t::const_iterator iter = angles.begin(); iter != angles.end(); ++iter) {
-    tempvector[1].distance = sqrt(-(2.*(*iter)-2.));//1.+1.-x/(2.*1.*1.)
-    input += tempvector;
-  }
-  output +=
-      spring_constant*0.25,
-      spring_constant*0.16,
-      spring_constant*0.09,
-      spring_constant*0.04,
-      spring_constant*0.01,
-      spring_constant*0.,
-      spring_constant*0.01,
-      spring_constant*0.04,
-      spring_constant*0.09,
-      spring_constant*0.16,
-      spring_constant*0.25;
-
-  CPPUNIT_ASSERT_EQUAL( input.size(), output.size() );
-}
-
-
-void PairPotential_AngleTest::tearDown()
-{
-}
-
-/** UnitTest for operator()
- */
-void PairPotential_AngleTest::operatorTest()
-{
-  PairPotential_Angle::ParticleTypes_t types =
-      boost::assign::list_of<PairPotential_Angle::ParticleType_t>
-        (0)(1)(1)
-      ;
-  PairPotential_Angle angle(types, spring_constant,0.);
-  for (size_t index = 0; index < input.size(); ++index) {
-    const PairPotential_Angle::results_t result =
-        angle( input[index] );
-    CPPUNIT_ASSERT(
-        Helpers::isEqual(
-            output[index],
-            result[0]
-        )
-    );
-  }
-}
-
-/** UnitTest for derivative()
- */
-void PairPotential_AngleTest::derivativeTest()
-{
-  PairPotential_Angle::ParticleTypes_t types =
-      boost::assign::list_of<PairPotential_Angle::ParticleType_t>
-        (0)(1)(1)
-      ;
-  PairPotential_Angle angle(types, spring_constant,0.);
-  CPPUNIT_ASSERT(
-      Helpers::isEqual(
-          0.,
-          angle.derivative(
-              input[5]
-          )[0],
-          10.
-      )
-  );
-}
-
-
-/** UnitTest for parameter_derivative()
- */
-void PairPotential_AngleTest::parameter_derivativeTest()
-{
-  PairPotential_Angle::ParticleTypes_t types =
-      boost::assign::list_of<PairPotential_Angle::ParticleType_t>
-        (0)(1)(1)
-      ;
-  PairPotential_Angle angle(types, spring_constant,0.);
-  CPPUNIT_ASSERT(
-      Helpers::isEqual(
-          0.,
-          angle.parameter_derivative(
-              input[5],
-              0
-          )[0],
-          10.
-      )
-  );
-  CPPUNIT_ASSERT(
-      Helpers::isEqual(
-          0.,
-          angle.parameter_derivative(
-              input[5],
-              1
-          )[0],
-          10.
-      )
-  );
-}
Index: src/Potentials/Specifics/unittests/PairPotential_AngleUnitTest.hpp
===================================================================
--- src/Potentials/Specifics/unittests/PairPotential_AngleUnitTest.hpp	(revision 1413f4555b944ca972d0d485541e58d325f62feb)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * PairPotential_AngleUnitTest.hpp
- *
- *  Created on: Oct 16, 2012
- *      Author: heber
- */
-
-#ifndef PAIRPOTENTIAL_ANGLEUNITTEST_HPP_
-#define PAIRPOTENTIAL_ANGLEUNITTEST_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-#include <cppunit/extensions/HelperMacros.h>
-
-#include "FunctionApproximation/FunctionModel.hpp"
-
-class PairPotential_Angle;
-
-/********************************************** Test classes **************************************/
-
-class PairPotential_AngleTest : public CppUnit::TestFixture
-{
-    CPPUNIT_TEST_SUITE( PairPotential_AngleTest) ;
-    CPPUNIT_TEST ( operatorTest );
-    CPPUNIT_TEST ( derivativeTest );
-    CPPUNIT_TEST ( parameter_derivativeTest );
-    CPPUNIT_TEST_SUITE_END();
-
-public:
-      void setUp();
-      void tearDown();
-      void operatorTest();
-      void derivativeTest();
-      void parameter_derivativeTest();
-
-private:
-      typedef std::vector<double> data_t;
-      std::vector<FunctionModel::arguments_t> input;
-      data_t output;
-};
-
-#endif /* PAIRPOTENTIAL_ANGLEUNITTEST_HPP_ */
Index: src/Potentials/Specifics/unittests/ThreeBodyPotential_AngleUnitTest.cpp
===================================================================
--- src/Potentials/Specifics/unittests/ThreeBodyPotential_AngleUnitTest.cpp	(revision 484e2ac103bbd121925bede487af209b526f8d12)
+++ src/Potentials/Specifics/unittests/ThreeBodyPotential_AngleUnitTest.cpp	(revision 484e2ac103bbd121925bede487af209b526f8d12)
@@ -0,0 +1,174 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * Copyright (C)  2013 Frederik Heber. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * ThreeBodyPotential_AngleUnitTest.cpp
+ *
+ *  Created on: Oct 16, 2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+using namespace std;
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include "ThreeBodyPotential_AngleUnitTest.hpp"
+
+#include <boost/assign.hpp>
+
+#include "CodePatterns/Assert.hpp"
+
+#include "FunctionApproximation/FunctionArgument.hpp"
+#include "Potentials/Specifics/ThreeBodyPotential_Angle.hpp"
+#include "Potentials/helpers.hpp"
+
+using namespace boost::assign;
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( ThreeBodyPotential_AngleTest );
+
+const double spring_constant = .5;
+
+void ThreeBodyPotential_AngleTest::setUp()
+{
+  // failing asserts should be thrown
+  ASSERT_DO(Assert::Throw);
+
+  // create three distances to have the desired angle
+  typedef std::vector<double> angles_t;
+  angles_t angles;
+  angles += -0.5, -.4, -.3, -.2, -.1, 0., .1, .2, .3, .4, .5;
+  FunctionModel::arguments_t tempvector(3);
+  tempvector[0] = argument_t( std::make_pair(0,1), std::make_pair(0,1), 1.);
+  tempvector[1] = argument_t( std::make_pair(1,2), std::make_pair(1,1), 0.);
+  tempvector[2] = argument_t( std::make_pair(0,2), std::make_pair(0,1), 1.);
+  for (angles_t::const_iterator iter = angles.begin(); iter != angles.end(); ++iter) {
+    tempvector[1].distance = sqrt(-(2.*(*iter)-2.));//1.+1.-x/(2.*1.*1.)
+    input += tempvector;
+  }
+  output +=
+      spring_constant*0.25,
+      spring_constant*0.16,
+      spring_constant*0.09,
+      spring_constant*0.04,
+      spring_constant*0.01,
+      spring_constant*0.,
+      spring_constant*0.01,
+      spring_constant*0.04,
+      spring_constant*0.09,
+      spring_constant*0.16,
+      spring_constant*0.25;
+
+  CPPUNIT_ASSERT_EQUAL( input.size(), output.size() );
+}
+
+
+void ThreeBodyPotential_AngleTest::tearDown()
+{
+}
+
+/** UnitTest for operator()
+ */
+void ThreeBodyPotential_AngleTest::operatorTest()
+{
+  ThreeBodyPotential_Angle::ParticleTypes_t types =
+      boost::assign::list_of<ThreeBodyPotential_Angle::ParticleType_t>
+        (0)(1)(1)
+      ;
+  ThreeBodyPotential_Angle angle(types, spring_constant,0.);
+  for (size_t index = 0; index < input.size(); ++index) {
+    const ThreeBodyPotential_Angle::results_t result =
+        angle( input[index] );
+    CPPUNIT_ASSERT(
+        Helpers::isEqual(
+            output[index],
+            result[0]
+        )
+    );
+  }
+}
+
+/** UnitTest for derivative()
+ */
+void ThreeBodyPotential_AngleTest::derivativeTest()
+{
+  ThreeBodyPotential_Angle::ParticleTypes_t types =
+      boost::assign::list_of<ThreeBodyPotential_Angle::ParticleType_t>
+        (0)(1)(1)
+      ;
+  ThreeBodyPotential_Angle angle(types, spring_constant,0.);
+  CPPUNIT_ASSERT(
+      Helpers::isEqual(
+          0.,
+          angle.derivative(
+              input[5]
+          )[0],
+          10.
+      )
+  );
+}
+
+
+/** UnitTest for parameter_derivative()
+ */
+void ThreeBodyPotential_AngleTest::parameter_derivativeTest()
+{
+  ThreeBodyPotential_Angle::ParticleTypes_t types =
+      boost::assign::list_of<ThreeBodyPotential_Angle::ParticleType_t>
+        (0)(1)(1)
+      ;
+  ThreeBodyPotential_Angle angle(types, spring_constant,0.);
+  CPPUNIT_ASSERT(
+      Helpers::isEqual(
+          0.,
+          angle.parameter_derivative(
+              input[5],
+              0
+          )[0],
+          10.
+      )
+  );
+  CPPUNIT_ASSERT(
+      Helpers::isEqual(
+          0.,
+          angle.parameter_derivative(
+              input[5],
+              1
+          )[0],
+          10.
+      )
+  );
+}
Index: src/Potentials/Specifics/unittests/ThreeBodyPotential_AngleUnitTest.hpp
===================================================================
--- src/Potentials/Specifics/unittests/ThreeBodyPotential_AngleUnitTest.hpp	(revision 484e2ac103bbd121925bede487af209b526f8d12)
+++ src/Potentials/Specifics/unittests/ThreeBodyPotential_AngleUnitTest.hpp	(revision 484e2ac103bbd121925bede487af209b526f8d12)
@@ -0,0 +1,46 @@
+/*
+ * ThreeBodyPotential_AngleUnitTest.hpp
+ *
+ *  Created on: Oct 16, 2012
+ *      Author: heber
+ */
+
+#ifndef THREEBODYPOTENTIAL_ANGLEUNITTEST_HPP_
+#define THREEBODYPOTENTIAL_ANGLEUNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "FunctionApproximation/FunctionModel.hpp"
+
+class ThreeBodyPotential_Angle;
+
+/********************************************** Test classes **************************************/
+
+class ThreeBodyPotential_AngleTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( ThreeBodyPotential_AngleTest) ;
+    CPPUNIT_TEST ( operatorTest );
+    CPPUNIT_TEST ( derivativeTest );
+    CPPUNIT_TEST ( parameter_derivativeTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void operatorTest();
+      void derivativeTest();
+      void parameter_derivativeTest();
+
+private:
+      typedef std::vector<double> data_t;
+      std::vector<FunctionModel::arguments_t> input;
+      data_t output;
+};
+
+#endif /* THREEBODYPOTENTIAL_ANGLEUNITTEST_HPP_ */
