GRALE
cosmology.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_COSMOLOGY_H
31 
32 #define GRALE_COSMOLOGY_H
33 
34 #include "graleconfig.h"
35 #include <errut/errorbase.h>
36 
37 namespace grale
38 {
39 
43 class GRALE_IMPORTEXPORT Cosmology : public errut::ErrorBase
44 {
45 public:
56  Cosmology(double h = 0.71, double Wm = 0.27, double Wr = 0, double Wv = 0.73, double w = -1.0);
57  ~Cosmology();
58 
60  void setH(double h) { m_h = h; }
61 
63  void setMatter(double Wm) { m_Wm = Wm; }
64 
66  void setRadiation(double Wr) { m_Wr = Wr; }
67 
69  void setVacuum(double Wv) { m_Wv = Wv; }
70 
72  void setVacuumEOSParameter(double w) { m_w = w; }
73 
74  double getH() const { return m_h; }
75  double getMatter() const { return m_Wm; }
76  double getRadiation() const { return m_Wr; }
77  double getVacuum() const { return m_Wv; }
78  double getVacuumEOSParameter() const { return m_w; }
79 
85  double getAngularDiameterDistance(double z1, double z2, int integrationSteps = 1000) const;
86 
92  double getAngularDiameterDistance(double z, int integrationSteps = 1000) const { return getAngularDiameterDistance(0, z, integrationSteps); }
93 private:
94  double m_h;
95  double m_Wm, m_Wr, m_Wv;
96  double m_w;
97 };
98 
99 } // end namespace
100 
101 #endif // GRALE_COSMOLOGY_H
102