From 8fc9f8375a8531fdf1b48eebdee2c5668448f0e0 Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Wed, 25 May 2011 16:43:23 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@200 ed2142bd-67ad-457f-ba7c-d818d4011675 --- vmodels/nfw_int.hpp | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 vmodels/nfw_int.hpp (limited to 'vmodels/nfw_int.hpp') diff --git a/vmodels/nfw_int.hpp b/vmodels/nfw_int.hpp new file mode 100644 index 0000000..b3e8b54 --- /dev/null +++ b/vmodels/nfw_int.hpp @@ -0,0 +1,57 @@ +/** + \file nfw_int.hpp + \brief NFW_INT model + \author Junhua Gu + */ + + +#ifndef NFW_INT_MODEL_H_ +#define NFW_INT_MODEL_H_ +#define OPT_HEADER +#include +#include +#include + +namespace opt_utilities +{ + template + class nfw_int + :public model,optvec,optvec,std::string> + { + private: + nfw_int* do_clone()const + { + return new nfw_int(*this); + } + + const char* do_get_type_name()const + { + return "nfw_int mass profile"; + } + public: + nfw_int() + { + this->push_param_info(param_info >("rho0",1)); + this->push_param_info(param_info >("rs",1)); + } + + optvec do_eval(const optvec& x,const optvec& param) + { + T rho0=get_element(param,0); + T rs=get_element(param,1); + return 4*3.1415926*rho0*rs*rs*rs*(std::log((x+rs)/rs)-x/(x+rs)); + } + + private: + std::string do_get_information()const + { + return "integrated NFW mass profile\n" + "y=rho0/(x/rs*(1+x/rs)^2)\n"; + } + }; +} + + + +#endif +//EOF -- cgit v1.2.2