Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
Xavier Garrido
CAMEL
Commits
0f17b1ec
Commit
0f17b1ec
authored
Jun 06, 2019
by
Xavier Garrido
Browse files
move Class engine into update method
parent
0a1ca84a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
src/camel/Astro/cib_interface.cc
src/camel/Astro/cib_interface.cc
+11
-11
src/camel/Astro/cib_interface.h
src/camel/Astro/cib_interface.h
+2
-2
No files found.
src/camel/Astro/cib_interface.cc
View file @
0f17b1ec
...
...
@@ -20,13 +20,11 @@ namespace cib {
}
void
cib_interface
::
initialize
(
// File to be parsed)
ClassEngine
*
klass_
)
{
if
(
_initialized_
)
{
throw
std
::
logic_error
(
"cib_interface::initialize: CIB model already initialized !"
);
}
_klass_
=
klass_
;
// law == "lognormal_sigevol"
_parameters_
.
Meffmax
=
8753289339381.791
;
...
...
@@ -42,14 +40,7 @@ namespace cib {
_ell_
=
{
187.
,
320.
,
502.
,
684.
,
890.
,
1158.
,
1505.
,
1956
};
_nell_
=
_ell_
.
size
();
cib
::
zeros
(
_gnu_
,
_nfreq_
);
const
double
h_p
=
6.62607004e-34
;
const
double
k_B
=
1.38064852e-23
;
const
double
T_cmb
=
_klass_
->
Tcmb
();
for
(
size_t
i
=
0
;
i
<
_nu_
.
size
();
i
++
)
{
const
double
x
=
h_p
*
_nu_
[
i
]
/
k_B
/
T_cmb
;
_gnu_
[
i
]
=
x
*
((
std
::
exp
(
x
)
+
1
)
/
(
std
::
exp
(
x
)
-
1
))
-
4
;
}
_gnu_
.
resize
(
_nfreq_
);
// Halo mass sampling
for
(
double
m
=
6
;
m
<=
15
;
m
+=
0.1
)
_mh_
.
push_back
(
std
::
pow
(
10
,
m
));
...
...
@@ -76,12 +67,21 @@ namespace cib {
_initialized_
=
true
;
}
void
cib_interface
::
update
(
const
cib
::
cib_parameters
&
parameters_
)
void
cib_interface
::
update
(
const
cib
::
cib_parameters
&
parameters_
,
ClassEngine
*
klass_
)
{
if
(
!
_initialized_
)
{
throw
std
::
logic_error
(
"cib_interface::update: CIB model not initialized !"
);
}
_parameters_
=
parameters_
;
_klass_
=
klass_
;
const
double
h_p
=
6.62607004e-34
;
const
double
k_B
=
1.38064852e-23
;
const
double
T_cmb
=
_klass_
->
Tcmb
();
for
(
size_t
i
=
0
;
i
<
_nu_
.
size
();
i
++
)
{
const
double
x
=
h_p
*
_nu_
[
i
]
/
k_B
/
T_cmb
;
_gnu_
[
i
]
=
x
*
((
std
::
exp
(
x
)
+
1
)
/
(
std
::
exp
(
x
)
-
1
))
-
4
;
}
// Update comoving distances for each z given cosmo. parameters
const
double
Om0
=
_klass_
->
Omega_m
();
...
...
src/camel/Astro/cib_interface.h
View file @
0f17b1ec
...
...
@@ -29,10 +29,10 @@ namespace cib {
~
cib_interface
();
/// Initialize method
void
initialize
(
ClassEngine
*
klass_
);
void
initialize
();
/// Update CIB parameters
void
update
(
const
cib
::
cib_parameters
&
parameters_
);
void
update
(
const
cib
::
cib_parameters
&
parameters_
,
ClassEngine
*
klass_
);
/// Compute and retrieve Cls
void
compute_cls
(
cib
::
array3d
&
cl_cib_
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment