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
ad48800d
Commit
ad48800d
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Cast the ints to enums correctly in the planetary EoS.
parent
c3ed06c5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/equation_of_state/planetary/equation_of_state.h
+20
-12
20 additions, 12 deletions
src/equation_of_state/planetary/equation_of_state.h
with
20 additions
and
12 deletions
src/equation_of_state/planetary/equation_of_state.h
+
20
−
12
View file @
ad48800d
...
@@ -54,7 +54,7 @@ enum eos_planetary_type_id {
...
@@ -54,7 +54,7 @@ enum eos_planetary_type_id {
eos_planetary_type_HM80
=
2
,
eos_planetary_type_HM80
=
2
,
eos_planetary_type_ANEOS
=
3
,
eos_planetary_type_ANEOS
=
3
,
eos_planetary_type_SESAME
=
4
,
eos_planetary_type_SESAME
=
4
,
}
__attribute__
((
packed
))
;
};
/**
/**
* @brief Minor type for the planetary equation of state.
* @brief Minor type for the planetary equation of state.
...
@@ -104,7 +104,7 @@ enum eos_planetary_material_id {
...
@@ -104,7 +104,7 @@ enum eos_planetary_material_id {
/*! SESAME iron */
/*! SESAME iron */
eos_planetary_id_SESAME_iron
=
eos_planetary_id_SESAME_iron
=
eos_planetary_type_SESAME
*
eos_planetary_type_factor
,
eos_planetary_type_SESAME
*
eos_planetary_type_factor
,
}
__attribute__
((
packed
))
;
};
/* Individual EOS function headers. */
/* Individual EOS function headers. */
#include
"aneos.h"
#include
"aneos.h"
...
@@ -132,7 +132,8 @@ __attribute__((always_inline)) INLINE static float
...
@@ -132,7 +132,8 @@ __attribute__((always_inline)) INLINE static float
gas_internal_energy_from_entropy
(
float
density
,
float
entropy
,
gas_internal_energy_from_entropy
(
float
density
,
float
entropy
,
enum
eos_planetary_material_id
mat_id
)
{
enum
eos_planetary_material_id
mat_id
)
{
const
enum
eos_planetary_type_id
type
=
mat_id
/
eos_planetary_type_factor
;
const
enum
eos_planetary_type_id
type
=
(
enum
eos_planetary_type_id
)(
mat_id
/
eos_planetary_type_factor
);
/* Select the material base type */
/* Select the material base type */
switch
(
type
)
{
switch
(
type
)
{
...
@@ -241,7 +242,8 @@ gas_internal_energy_from_entropy(float density, float entropy,
...
@@ -241,7 +242,8 @@ gas_internal_energy_from_entropy(float density, float entropy,
__attribute__
((
always_inline
))
INLINE
static
float
gas_pressure_from_entropy
(
__attribute__
((
always_inline
))
INLINE
static
float
gas_pressure_from_entropy
(
float
density
,
float
entropy
,
enum
eos_planetary_material_id
mat_id
)
{
float
density
,
float
entropy
,
enum
eos_planetary_material_id
mat_id
)
{
const
enum
eos_planetary_type_id
type
=
mat_id
/
eos_planetary_type_factor
;
const
enum
eos_planetary_type_id
type
=
(
enum
eos_planetary_type_id
)(
mat_id
/
eos_planetary_type_factor
);
/* Select the material base type */
/* Select the material base type */
switch
(
type
)
{
switch
(
type
)
{
...
@@ -344,7 +346,8 @@ __attribute__((always_inline)) INLINE static float gas_pressure_from_entropy(
...
@@ -344,7 +346,8 @@ __attribute__((always_inline)) INLINE static float gas_pressure_from_entropy(
__attribute__
((
always_inline
))
INLINE
static
float
gas_entropy_from_pressure
(
__attribute__
((
always_inline
))
INLINE
static
float
gas_entropy_from_pressure
(
float
density
,
float
P
,
enum
eos_planetary_material_id
mat_id
)
{
float
density
,
float
P
,
enum
eos_planetary_material_id
mat_id
)
{
const
enum
eos_planetary_type_id
type
=
mat_id
/
eos_planetary_type_factor
;
const
enum
eos_planetary_type_id
type
=
(
enum
eos_planetary_type_id
)(
mat_id
/
eos_planetary_type_factor
);
/* Select the material base type */
/* Select the material base type */
switch
(
type
)
{
switch
(
type
)
{
...
@@ -445,7 +448,8 @@ __attribute__((always_inline)) INLINE static float gas_entropy_from_pressure(
...
@@ -445,7 +448,8 @@ __attribute__((always_inline)) INLINE static float gas_entropy_from_pressure(
__attribute__
((
always_inline
))
INLINE
static
float
gas_soundspeed_from_entropy
(
__attribute__
((
always_inline
))
INLINE
static
float
gas_soundspeed_from_entropy
(
float
density
,
float
entropy
,
enum
eos_planetary_material_id
mat_id
)
{
float
density
,
float
entropy
,
enum
eos_planetary_material_id
mat_id
)
{
const
enum
eos_planetary_type_id
type
=
mat_id
/
eos_planetary_type_factor
;
const
enum
eos_planetary_type_id
type
=
(
enum
eos_planetary_type_id
)(
mat_id
/
eos_planetary_type_factor
);
/* Select the material base type */
/* Select the material base type */
switch
(
type
)
{
switch
(
type
)
{
...
@@ -549,8 +553,8 @@ __attribute__((always_inline)) INLINE static float gas_soundspeed_from_entropy(
...
@@ -549,8 +553,8 @@ __attribute__((always_inline)) INLINE static float gas_soundspeed_from_entropy(
__attribute__
((
always_inline
))
INLINE
static
float
__attribute__
((
always_inline
))
INLINE
static
float
gas_entropy_from_internal_energy
(
float
density
,
float
u
,
gas_entropy_from_internal_energy
(
float
density
,
float
u
,
enum
eos_planetary_material_id
mat_id
)
{
enum
eos_planetary_material_id
mat_id
)
{
const
enum
eos_planetary_type_id
type
=
const
enum
eos_planetary_type_id
type
=
mat_id
/
eos_planetary_type_factor
;
(
enum
eos_planetary_type_id
)(
mat_id
/
eos_planetary_type_factor
)
;
/* Select the material base type */
/* Select the material base type */
switch
(
type
)
{
switch
(
type
)
{
...
@@ -654,7 +658,8 @@ __attribute__((always_inline)) INLINE static float
...
@@ -654,7 +658,8 @@ __attribute__((always_inline)) INLINE static float
gas_pressure_from_internal_energy
(
float
density
,
float
u
,
gas_pressure_from_internal_energy
(
float
density
,
float
u
,
enum
eos_planetary_material_id
mat_id
)
{
enum
eos_planetary_material_id
mat_id
)
{
const
enum
eos_planetary_type_id
type
=
mat_id
/
eos_planetary_type_factor
;
const
enum
eos_planetary_type_id
type
=
(
enum
eos_planetary_type_id
)(
mat_id
/
eos_planetary_type_factor
);
/* Select the material base type */
/* Select the material base type */
switch
(
type
)
{
switch
(
type
)
{
...
@@ -762,7 +767,8 @@ __attribute__((always_inline)) INLINE static float
...
@@ -762,7 +767,8 @@ __attribute__((always_inline)) INLINE static float
gas_internal_energy_from_pressure
(
float
density
,
float
P
,
gas_internal_energy_from_pressure
(
float
density
,
float
P
,
enum
eos_planetary_material_id
mat_id
)
{
enum
eos_planetary_material_id
mat_id
)
{
const
enum
eos_planetary_type_id
type
=
mat_id
/
eos_planetary_type_factor
;
const
enum
eos_planetary_type_id
type
=
(
enum
eos_planetary_type_id
)(
mat_id
/
eos_planetary_type_factor
);
/* Select the material base type */
/* Select the material base type */
switch
(
type
)
{
switch
(
type
)
{
...
@@ -867,7 +873,8 @@ __attribute__((always_inline)) INLINE static float
...
@@ -867,7 +873,8 @@ __attribute__((always_inline)) INLINE static float
gas_soundspeed_from_internal_energy
(
float
density
,
float
u
,
gas_soundspeed_from_internal_energy
(
float
density
,
float
u
,
enum
eos_planetary_material_id
mat_id
)
{
enum
eos_planetary_material_id
mat_id
)
{
const
enum
eos_planetary_type_id
type
=
mat_id
/
eos_planetary_type_factor
;
const
enum
eos_planetary_type_id
type
=
(
enum
eos_planetary_type_id
)(
mat_id
/
eos_planetary_type_factor
);
/* Select the material base type */
/* Select the material base type */
switch
(
type
)
{
switch
(
type
)
{
...
@@ -975,7 +982,8 @@ gas_soundspeed_from_internal_energy(float density, float u,
...
@@ -975,7 +982,8 @@ gas_soundspeed_from_internal_energy(float density, float u,
__attribute__
((
always_inline
))
INLINE
static
float
gas_soundspeed_from_pressure
(
__attribute__
((
always_inline
))
INLINE
static
float
gas_soundspeed_from_pressure
(
float
density
,
float
P
,
enum
eos_planetary_material_id
mat_id
)
{
float
density
,
float
P
,
enum
eos_planetary_material_id
mat_id
)
{
const
enum
eos_planetary_type_id
type
=
mat_id
/
eos_planetary_type_factor
;
const
enum
eos_planetary_type_id
type
=
(
enum
eos_planetary_type_id
)(
mat_id
/
eos_planetary_type_factor
);
/* Select the material base type */
/* Select the material base type */
switch
(
type
)
{
switch
(
type
)
{
...
...
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