Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
e9c1723b
Commit
e9c1723b
authored
Jul 18, 2016
by
Matthieu Schaller
Browse files
Correct units for internal energy and documentation fixes
parent
d61ee7c0
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/hydro/Default/hydro_io.h
View file @
e9c1723b
...
...
@@ -42,7 +42,7 @@ void hydro_read_particles(struct part* parts, struct io_props* list,
list
[
3
]
=
io_make_input_field
(
"SmoothingLength"
,
FLOAT
,
1
,
COMPULSORY
,
UNIT_CONV_LENGTH
,
parts
,
h
);
list
[
4
]
=
io_make_input_field
(
"InternalEnergy"
,
FLOAT
,
1
,
COMPULSORY
,
UNIT_CONV_ENERGY
,
parts
,
u
);
UNIT_CONV_ENERGY
_PER_UNIT_MASS
,
parts
,
u
);
list
[
5
]
=
io_make_input_field
(
"ParticleIDs"
,
ULONGLONG
,
1
,
COMPULSORY
,
UNIT_CONV_NO_UNITS
,
parts
,
id
);
list
[
6
]
=
io_make_input_field
(
"Accelerations"
,
FLOAT
,
3
,
OPTIONAL
,
...
...
@@ -72,7 +72,7 @@ void hydro_write_particles(struct part* parts, struct io_props* list,
io_make_output_field
(
"Masses"
,
FLOAT
,
1
,
UNIT_CONV_MASS
,
parts
,
mass
);
list
[
3
]
=
io_make_output_field
(
"SmoothingLength"
,
FLOAT
,
1
,
UNIT_CONV_LENGTH
,
parts
,
h
);
list
[
4
]
=
io_make_output_field
(
"
Entrop
y"
,
FLOAT
,
1
,
list
[
4
]
=
io_make_output_field
(
"
InternalEnerg
y"
,
FLOAT
,
1
,
UNIT_CONV_ENERGY_PER_UNIT_MASS
,
parts
,
u
);
list
[
5
]
=
io_make_output_field
(
"ParticleIDs"
,
ULONGLONG
,
1
,
UNIT_CONV_NO_UNITS
,
parts
,
id
);
...
...
src/hydro/Gadget2/hydro_io.h
View file @
e9c1723b
...
...
@@ -43,7 +43,7 @@ void hydro_read_particles(struct part* parts, struct io_props* list,
list
[
3
]
=
io_make_input_field
(
"SmoothingLength"
,
FLOAT
,
1
,
COMPULSORY
,
UNIT_CONV_LENGTH
,
parts
,
h
);
list
[
4
]
=
io_make_input_field
(
"InternalEnergy"
,
FLOAT
,
1
,
COMPULSORY
,
UNIT_CONV_ENERGY
,
parts
,
entropy
);
UNIT_CONV_ENERGY
_PER_UNIT_MASS
,
parts
,
entropy
);
list
[
5
]
=
io_make_input_field
(
"ParticleIDs"
,
ULONGLONG
,
1
,
COMPULSORY
,
UNIT_CONV_NO_UNITS
,
parts
,
id
);
list
[
6
]
=
io_make_input_field
(
"Accelerations"
,
FLOAT
,
3
,
OPTIONAL
,
...
...
src/hydro/Minimal/hydro_io.h
View file @
e9c1723b
...
...
@@ -42,7 +42,7 @@ void hydro_read_particles(struct part* parts, struct io_props* list,
list
[
3
]
=
io_make_input_field
(
"SmoothingLength"
,
FLOAT
,
1
,
COMPULSORY
,
UNIT_CONV_LENGTH
,
parts
,
h
);
list
[
4
]
=
io_make_input_field
(
"InternalEnergy"
,
FLOAT
,
1
,
COMPULSORY
,
UNIT_CONV_ENERGY
,
parts
,
u
);
UNIT_CONV_ENERGY
_PER_UNIT_MASS
,
parts
,
u
);
list
[
5
]
=
io_make_input_field
(
"ParticleIDs"
,
ULONGLONG
,
1
,
COMPULSORY
,
UNIT_CONV_NO_UNITS
,
parts
,
id
);
list
[
6
]
=
io_make_input_field
(
"Accelerations"
,
FLOAT
,
3
,
OPTIONAL
,
...
...
@@ -72,7 +72,7 @@ void hydro_write_particles(struct part* parts, struct io_props* list,
io_make_output_field
(
"Masses"
,
FLOAT
,
1
,
UNIT_CONV_MASS
,
parts
,
mass
);
list
[
3
]
=
io_make_output_field
(
"SmoothingLength"
,
FLOAT
,
1
,
UNIT_CONV_LENGTH
,
parts
,
h
);
list
[
4
]
=
io_make_output_field
(
"
Entrop
y"
,
FLOAT
,
1
,
list
[
4
]
=
io_make_output_field
(
"
InternalEnerg
y"
,
FLOAT
,
1
,
UNIT_CONV_ENERGY_PER_UNIT_MASS
,
parts
,
u
);
list
[
5
]
=
io_make_output_field
(
"ParticleIDs"
,
ULONGLONG
,
1
,
UNIT_CONV_NO_UNITS
,
parts
,
id
);
...
...
src/io_properties.h
View file @
e9c1723b
...
...
@@ -62,7 +62,7 @@ struct io_props {
/* Conversion function for part */
float
(
*
convert_part
)(
struct
engine
*
,
struct
part
*
);
/* Conversion function for part */
/* Conversion function for
g
part */
float
(
*
convert_gpart
)(
struct
engine
*
,
struct
gpart
*
);
};
...
...
@@ -161,7 +161,6 @@ struct io_props io_make_output_field_(char name[FIELD_BUFFER_SIZE],
* @param name Name of the field to read
* @param type The type of the data
* @param dimension Dataset dimension (1D, 3D, ...)
* @param importance Is this dataset compulsory ?
* @param units The units of the dataset
* @param field Pointer to the field of the first particle
* @param partSize The size in byte of the particle
...
...
@@ -194,11 +193,11 @@ struct io_props io_make_output_field_convert_part_(
/**
* @brief Constructs an #io_props (with conversion) from its parameters
*/
#define io_make_output_field_convert_part(name, type, dim, units, part,
field,
\
convert)
\
io_make_output_field_convert_part_(name, type, dim, units,
\
(char*)(&(part[0]).field),
\
sizeof(part[0]), part, convert)
#define io_make_output_field_convert_
g
part(name, type, dim, units, part, \
field,
convert) \
io_make_output_field_convert_
g
part_(name, type, dim, units, \
(char*)(&(part[0]).field), \
sizeof(part[0]),
g
part, convert)
/**
* @brief Construct an #io_props from its parameters
...
...
@@ -206,12 +205,11 @@ struct io_props io_make_output_field_convert_part_(
* @param name Name of the field to read
* @param type The type of the data
* @param dimension Dataset dimension (1D, 3D, ...)
* @param importance Is this dataset compulsory ?
* @param units The units of the dataset
* @param field Pointer to the field of the first particle
* @param partSize The size in byte of the particle
* @param parts The particle array
* @param functionPtr The function used to convert a particle to a float
* @param
g
parts The particle array
* @param functionPtr The function used to convert a
g-
particle to a float
*
* Do not call this function directly. Use the macro defined above.
*/
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment