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
2c177bd1
Commit
2c177bd1
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Get the correct conversion factors for volumes.
parent
f769a31b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/hydro/Gizmo/hydro_io.h
+2
-2
2 additions, 2 deletions
src/hydro/Gizmo/hydro_io.h
src/units.c
+3
-0
3 additions, 0 deletions
src/units.c
src/units.h
+2
-1
2 additions, 1 deletion
src/units.h
with
7 additions
and
3 deletions
src/hydro/Gizmo/hydro_io.h
+
2
−
2
View file @
2c177bd1
...
...
@@ -124,8 +124,8 @@ void hydro_write_particles(struct part* parts, struct io_props* list,
UNIT_CONV_ACCELERATION
,
parts
,
a_hydro
);
list
[
7
]
=
io_make_output_field
(
"Density"
,
FLOAT
,
1
,
UNIT_CONV_DENSITY
,
parts
,
primitives
.
rho
);
list
[
8
]
=
io_make_output_field
(
"Volume"
,
FLOAT
,
1
,
UNIT_CONV_VOLUME
,
parts
,
geometry
.
volume
);
list
[
8
]
=
io_make_output_field
(
"Volume"
,
FLOAT
,
1
,
UNIT_CONV_
INV_
VOLUME
,
parts
,
geometry
.
volume
);
list
[
9
]
=
io_make_output_field
(
"GradDensity"
,
FLOAT
,
3
,
UNIT_CONV_DENSITY
,
parts
,
primitives
.
gradients
.
rho
);
list
[
10
]
=
io_make_output_field_convert_part
(
...
...
This diff is collapsed.
Click to expand it.
src/units.c
+
3
−
0
View file @
2c177bd1
...
...
@@ -319,6 +319,9 @@ void units_get_base_unit_exponants_array(float baseUnitsExp[5],
break
;
case
UNIT_CONV_VOLUME
:
baseUnitsExp
[
UNIT_LENGTH
]
=
3
.
f
;
case
UNIT_CONV_INV_VOLUME
:
baseUnitsExp
[
UNIT_LENGTH
]
=
-
3
.
f
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/units.h
+
2
−
1
View file @
2c177bd1
...
...
@@ -90,7 +90,8 @@ enum UnitConversionFactor {
UNIT_CONV_MAGNETIC_FIELD
,
UNIT_CONV_MAGNETIC_INDUCTANCE
,
UNIT_CONV_TEMPERATURE
,
UNIT_CONV_VOLUME
UNIT_CONV_VOLUME
,
UNIT_CONV_INV_VOLUME
};
void
units_init_cgs
(
struct
UnitSystem
*
);
...
...
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