Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
7b9db40e
Commit
7b9db40e
authored
6 years ago
by
Folkert Nobels
Browse files
Options
Downloads
Patches
Plain Diff
Add km/s/Mpc constant working to the code
parent
65707be6
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!681
Add example of isolated galaxy and change hernquist potential configuration
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/IsolatedGalaxy_potential/run.sh
+1
-1
1 addition, 1 deletion
examples/IsolatedGalaxy_potential/run.sh
src/physical_constants.c
+1
-0
1 addition, 0 deletions
src/physical_constants.c
src/potential/hernquist/potential.h
+2
-5
2 additions, 5 deletions
src/potential/hernquist/potential.h
with
4 additions
and
6 deletions
examples/IsolatedGalaxy_potential/run.sh
+
1
−
1
View file @
7b9db40e
...
@@ -6,7 +6,7 @@ then
...
@@ -6,7 +6,7 @@ then
./getIC.sh
./getIC.sh
fi
fi
../swift
hern
-g
-G
-S
-t
16 isolated_galaxy.yml 2>&1 |
tee
output.log
../swift
-g
-G
-S
-t
16 isolated_galaxy.yml 2>&1 |
tee
output.log
echo
"Make plots of conservation of total angular momentum"
echo
"Make plots of conservation of total angular momentum"
...
...
This diff is collapsed.
Click to expand it.
src/physical_constants.c
+
1
−
0
View file @
7b9db40e
...
@@ -158,6 +158,7 @@ void phys_const_print(const struct phys_const *internal_const) {
...
@@ -158,6 +158,7 @@ void phys_const_print(const struct phys_const *internal_const) {
internal_const
->
const_astronomical_unit
);
internal_const
->
const_astronomical_unit
);
message
(
"%25s = %e"
,
"Parsec"
,
internal_const
->
const_parsec
);
message
(
"%25s = %e"
,
"Parsec"
,
internal_const
->
const_parsec
);
message
(
"%25s = %e"
,
"Solar mass"
,
internal_const
->
const_solar_mass
);
message
(
"%25s = %e"
,
"Solar mass"
,
internal_const
->
const_solar_mass
);
message
(
"%25s = %e"
,
"km/s/Mpc"
,
internal_const
->
const_reduced_hubble
);
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
src/potential/hernquist/potential.h
+
2
−
5
View file @
7b9db40e
...
@@ -156,8 +156,6 @@ external_gravity_get_potential_energy(
...
@@ -156,8 +156,6 @@ external_gravity_get_potential_energy(
return
-
phys_const
->
const_newton_G
*
potential
->
mass
*
r_plus_alinv
;
return
-
phys_const
->
const_newton_G
*
potential
->
mass
*
r_plus_alinv
;
}
}
/* Standard values for a few parameters in the Hernquist potential */
#define Mpc_to_cm 3.08567781E24
/**
/**
* @brief Initialises the external potential properties in the internal system
* @brief Initialises the external potential properties in the internal system
...
@@ -211,7 +209,7 @@ static INLINE void potential_init_backend(
...
@@ -211,7 +209,7 @@ static INLINE void potential_init_backend(
* First read in the mandatory parameters in this case */
* First read in the mandatory parameters in this case */
const
float
G_newton
=
phys_const
->
const_newton_G
;
const
float
G_newton
=
phys_const
->
const_newton_G
;
/*
const float kmoversover
m
pc = phys_const->
*/
const
float
kmoversover
M
pc
=
phys_const
->
const_reduced_hubble
;
/* Initialize the variables */
/* Initialize the variables */
double
M200
=
parser_get_opt_param_double
(
double
M200
=
parser_get_opt_param_double
(
...
@@ -223,10 +221,9 @@ static INLINE void potential_init_backend(
...
@@ -223,10 +221,9 @@ static INLINE void potential_init_backend(
const
double
h
=
const
double
h
=
parser_get_param_double
(
parameter_file
,
"HernquistPotential:h"
);
parser_get_param_double
(
parameter_file
,
"HernquistPotential:h"
);
const
double
H0
=
h
*
100
*
1e5
/
Mpc_to_cm
*
us
->
UnitTime_in_cgs
;
const
double
H0
=
h
*
kmoversoverMpc
;
message
(
"H0 = %g"
,
H0
);
message
(
"H0 = %g"
,
H0
);
/* There are 3 legit runs possible with use disk,
/* There are 3 legit runs possible with use disk,
* with a known M200, V200 or R200 */
* with a known M200, V200 or R200 */
if
(
M200
!=
0
.
0
)
{
if
(
M200
!=
0
.
0
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment