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
9cb176a8
Commit
9cb176a8
authored
6 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Fix after merge with master. Hard coded G, needs fixing.
parent
d51b401b
No related branches found
No related tags found
1 merge request
!578
Swift velociraptor
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/engine.h
+1
-0
1 addition, 0 deletions
src/engine.h
src/velociraptor_interface.c
+3
-2
3 additions, 2 deletions
src/velociraptor_interface.c
with
4 additions
and
2 deletions
src/engine.h
+
1
−
0
View file @
9cb176a8
...
...
@@ -366,6 +366,7 @@ void engine_barrier(struct engine *e);
void
engine_compute_next_snapshot_time
(
struct
engine
*
e
);
void
engine_compute_next_stf_time
(
struct
engine
*
e
);
void
engine_compute_next_statistics_time
(
struct
engine
*
e
);
void
engine_recompute_displacement_constraint
(
struct
engine
*
e
);
void
engine_unskip
(
struct
engine
*
e
);
void
engine_drift_all
(
struct
engine
*
e
);
void
engine_drift_top_multipoles
(
struct
engine
*
e
);
...
...
This diff is collapsed.
Click to expand it.
src/velociraptor_interface.c
+
3
−
2
View file @
9cb176a8
...
...
@@ -57,7 +57,7 @@ void velociraptor_init(struct engine *e) {
error
(
"Failed to allocate VELOCIraptor conversion factors."
);
/* Initialize velociraptor unit system and constants */
units_init
(
e
->
stf_units
,
e
->
parameter_file
,
"VelociraptorUnitSystem"
);
units_init
_from_params
(
e
->
stf_units
,
e
->
parameter_file
,
"VelociraptorUnitSystem"
);
phys_const_init
(
e
->
stf_units
,
e
->
parameter_file
,
&
vel_const
);
/* Set cosmological constants. */
...
...
@@ -82,7 +82,8 @@ void velociraptor_init(struct engine *e) {
e
->
stf_conv_fac
->
velocitytokms
=
units_conversion_factor
(
e
->
internal_units
,
e
->
stf_units
,
UNIT_CONV_SPEED
);
/* 1km/s <=> 1e5cm/s */
e
->
stf_conv_fac
->
masstosolarmass
=
units_conversion_factor
(
e
->
internal_units
,
e
->
stf_units
,
UNIT_CONV_MASS
);
/* 1M_sol <=> 1.99e33g */
e
->
stf_conv_fac
->
energyperunitmass
=
units_conversion_factor
(
e
->
internal_units
,
e
->
stf_units
,
UNIT_CONV_ENERGY_PER_UNIT_MASS
);
/* Conversion for gravitational potential. */
e
->
stf_conv_fac
->
gravity
=
vel_const
.
const_newton_G
;
/* TODO: G = 6.67408e-8 (cgs) */
//e->stf_conv_fac->gravity = vel_const.const_newton_G; /* TODO: G = 6.67408e-8 (cgs) */
e
->
stf_conv_fac
->
gravity
=
4.302051e-06
;
/* TODO: G = 6.67408e-8 (cgs) */
e
->
stf_conv_fac
->
hubbleunit
=
e
->
cosmology
->
H
;
/* TODO: double check this. */
unit_info
=
*
e
->
stf_conv_fac
;
...
...
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