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
269fadb3
Commit
269fadb3
authored
7 years ago
by
Bert Vandenbroucke
Browse files
Options
Downloads
Patches
Plain Diff
Some more cleaning up in GizmoMFM hydro.h.
parent
1e44cacd
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!588
Gizmo mfm clean
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hydro/GizmoMFM/hydro.h
+8
-6
8 additions, 6 deletions
src/hydro/GizmoMFM/hydro.h
with
8 additions
and
6 deletions
src/hydro/GizmoMFM/hydro.h
+
8
−
6
View file @
269fadb3
...
...
@@ -222,7 +222,8 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
/* Final operation on the geometry. */
/* we multiply with the smoothing kernel normalization ih3 and calculate the
* volume */
const
float
volume
=
1
.
0
f
/
(
ihdim
*
(
p
->
geometry
.
volume
+
kernel_root
));
const
float
volume_inv
=
ihdim
*
(
p
->
geometry
.
volume
+
kernel_root
);
const
float
volume
=
1
.
0
f
/
volume_inv
;
p
->
geometry
.
volume
=
volume
;
/* we multiply with the smoothing kernel normalization */
...
...
@@ -240,9 +241,10 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
p
->
geometry
.
centroid
[
1
]
*=
kernel_norm
;
p
->
geometry
.
centroid
[
2
]
*=
kernel_norm
;
p
->
geometry
.
centroid
[
0
]
/=
p
->
density
.
wcount
;
p
->
geometry
.
centroid
[
1
]
/=
p
->
density
.
wcount
;
p
->
geometry
.
centroid
[
2
]
/=
p
->
density
.
wcount
;
const
float
wcount_inv
=
1
.
0
f
/
p
->
density
.
wcount
;
p
->
geometry
.
centroid
[
0
]
*=
wcount_inv
;
p
->
geometry
.
centroid
[
1
]
*=
wcount_inv
;
p
->
geometry
.
centroid
[
2
]
*=
wcount_inv
;
/* Check the condition number to see if we have a stable geometry. */
float
condition_number_E
=
0
.
0
f
;
...
...
@@ -300,7 +302,7 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
momentum
[
0
]
=
p
->
conserved
.
momentum
[
0
];
momentum
[
1
]
=
p
->
conserved
.
momentum
[
1
];
momentum
[
2
]
=
p
->
conserved
.
momentum
[
2
];
p
->
rho
=
m
/
volume
;
p
->
rho
=
m
*
volume
_inv
;
if
(
m
==
0
.
0
f
)
{
p
->
v
[
0
]
=
0
.
0
f
;
p
->
v
[
1
]
=
0
.
0
f
;
...
...
@@ -328,7 +330,7 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
/* energy contains the total thermal energy, we want the specific energy.
this is why we divide by the volume, and not by the density */
p
->
P
=
hydro_gamma_minus_one
*
energy
/
volume
;
p
->
P
=
hydro_gamma_minus_one
*
energy
*
volume
_inv
;
#endif
/* sanity checks */
...
...
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