GRALE
sislens.h
Go to the documentation of this file.
1 /*
2 
3  This file is a part of GRALE, a library to facilitate the simulation
4  and inversion of gravitational lenses.
5 
6  Copyright (C) 2008-2012 Jori Liesenborgs
7 
8  Contact: jori.liesenborgs@gmail.com
9 
10  This program is free software; you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 2 of the License, or
13  (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 
24 */
25 
30 #ifndef GRALE_SISLENS_H
31 
32 #define GRALE_SISLENS_H
33 
34 #include "graleconfig.h"
35 #include "symmetriclens.h"
36 
37 namespace grale
38 {
39 
41 class GRALE_IMPORTEXPORT SISLensParams : public GravitationalLensParams
42 {
43 public:
44  SISLensParams() { dispersion = 0; }
45 
50  SISLensParams(double velocityDispersion) { SISLensParams::dispersion = velocityDispersion; }
51 
53  double getVelocityDispersion() const { return dispersion; }
54 
55  GravitationalLensParams *createCopy() const;
56  bool write(serut::SerializationInterface &si) const;
57  bool read(serut::SerializationInterface &si);
58 private:
59  double dispersion;
60 };
61 
66 class GRALE_IMPORTEXPORT SISLens : public SymmetricLens
67 {
68 public:
69  SISLens();
70  ~SISLens();
71 
72  bool getProjectedPotential(double D_s, double D_ds, Vector2D<double> theta,
73  double *pPotentialValue) const;
74 
75  bool getSuggestedScales(double *pDeflectionScale, double *pPotentialScale) const;
76  bool getCLParameterCounts(int *pNumIntParams, int *pNumFloatParams) const;
77  bool getCLParameters(double deflectionScale, double potentialScale, int *pIntParams, float *pFloatParams) const;
78  std::string getCLProgram(std::string &subRoutineName) const;
79  int getCLSubLenses() const { return 1; }
80 protected:
81  bool processParameters(const GravitationalLensParams *pLensParams);
82  double getMassInside(double thetaLength) const;
83  double getProfileSurfaceMassDensity(double thetaLength) const;
84 private:
85  double m_massFactor, m_densFactor;
86  double m_einstRad;
87 };
88 
89 } // end namespace
90 
91 #endif // GRALE_SISLENS_H
92