/*
 * Project: MoleCuilder
 * Description: creates and alters molecular systems
 * 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 .
 */
/*
 * FourBodyPotential_Improper.cpp
 *
 *  Created on: Jul 10, 2013
 *      Author: heber
 */
// include config.h
#ifdef HAVE_CONFIG_H
#include 
#endif
#include "CodePatterns/MemDebug.hpp"
#include "FourBodyPotential_Improper.hpp"
#include  // for 'map_list_of()'
#include "Potentials/InternalCoordinates/FourBody_ImproperAngle.hpp"
// static definitions
const FourBodyPotential_Improper::ParameterNames_t
FourBodyPotential_Improper::ParameterNames =
      boost::assign::list_of
      ("spring_constant")
      ("equilibrium_distance")
    ;
const std::string FourBodyPotential_Improper::improper_token("improper");
Coordinator::ptr FourBodyPotential_Improper::coordinator(new FourBody_ImproperAngle());
FourBodyPotential_Improper::FourBodyPotential_Improper() :
    FourBodyPotential_Torsion()
{}
FourBodyPotential_Improper::FourBodyPotential_Improper(
    const ParticleTypes_t &_ParticleTypes) :
    FourBodyPotential_Torsion(_ParticleTypes)
{}
FourBodyPotential_Improper::FourBodyPotential_Improper(
    const ParticleTypes_t &_ParticleTypes,
    const double _spring_constant,
    const double _equilibrium_distance) :
    FourBodyPotential_Torsion(
        _ParticleTypes,
        _spring_constant,
        _equilibrium_distance)
{}
FourBodyPotential_Improper::result_t
FourBodyPotential_Improper::function_theta(
    const double &r_ij,
    const double &r_ik,
    const double &r_il,
    const double &r_jk,
    const double &r_jl,
    const double &r_kl
  ) const
{
  // just relay call to torsion's theta function with some flipped arguments
  return FourBodyPotential_Torsion::function_theta(
      r_jk,
      r_ik,
      r_kl,
      r_ij,
      r_jl,
      r_il
      );
}