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
340d8c2a
Commit
340d8c2a
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added the gravitational potential as one of the default unit conversion schemes.
parent
19e7b795
No related branches found
No related tags found
1 merge request
!516
More cosmology work
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/units.c
+5
-0
5 additions, 0 deletions
src/units.c
src/units.h
+1
-0
1 addition, 0 deletions
src/units.h
with
6 additions
and
0 deletions
src/units.c
+
5
−
0
View file @
340d8c2a
...
...
@@ -220,6 +220,11 @@ void units_get_base_unit_exponants_array(float baseUnitsExp[5],
baseUnitsExp
[
UNIT_TIME
]
=
-
2
.
f
;
break
;
case
UNIT_CONV_POTENTIAL
:
baseUnitsExp
[
UNIT_LENGTH
]
=
2
.
f
;
baseUnitsExp
[
UNIT_TIME
]
=
-
2
.
f
;
break
;
case
UNIT_CONV_FORCE
:
baseUnitsExp
[
UNIT_MASS
]
=
1
.
f
;
baseUnitsExp
[
UNIT_LENGTH
]
=
1
.
f
;
...
...
This diff is collapsed.
Click to expand it.
src/units.h
+
1
−
0
View file @
340d8c2a
...
...
@@ -73,6 +73,7 @@ enum unit_conversion_factor {
UNIT_CONV_DENSITY
,
UNIT_CONV_SPEED
,
UNIT_CONV_ACCELERATION
,
UNIT_CONV_POTENTIAL
,
UNIT_CONV_FORCE
,
UNIT_CONV_ENERGY
,
UNIT_CONV_ENERGY_PER_UNIT_MASS
,
...
...
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