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
35332b91
Commit
35332b91
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Ported the differences to the other 2 SPH schemes
parent
2163286c
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!136
Master
,
!126
Support for XMF file descriptors with multiple particle types.
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/hydro/Default/hydro_io.h
+25
-18
25 additions, 18 deletions
src/hydro/Default/hydro_io.h
src/hydro/Gadget2/hydro_io.h
+2
-0
2 additions, 0 deletions
src/hydro/Gadget2/hydro_io.h
src/hydro/Minimal/hydro_io.h
+25
-18
25 additions, 18 deletions
src/hydro/Minimal/hydro_io.h
with
52 additions
and
36 deletions
src/hydro/Default/hydro_io.h
+
25
−
18
View file @
35332b91
...
...
@@ -56,6 +56,8 @@ __attribute__((always_inline)) INLINE static void hydro_read_particles(
*
* @param h_grp The HDF5 group in which to write the arrays.
* @param fileName The name of the file (unsued in MPI mode).
* @param partTypeGroupName The name of the group containing the particles in
*the HDF5 file.
* @param xmfFile The XMF file to write to (unused in MPI mode).
* @param N The number of particles on that MPI rank.
* @param N_total The total number of particles (only used in MPI mode)
...
...
@@ -67,26 +69,31 @@ __attribute__((always_inline)) INLINE static void hydro_read_particles(
*
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_write_particles
(
hid_t
h_grp
,
char
*
fileName
,
FILE
*
xmfFile
,
int
N
,
long
long
N_total
,
int
mpi_rank
,
long
long
offset
,
struct
part
*
parts
,
struct
UnitSystem
*
us
)
{
hid_t
h_grp
,
char
*
fileName
,
char
*
partTypeGroupName
,
FILE
*
xmfFile
,
int
N
,
long
long
N_total
,
int
mpi_rank
,
long
long
offset
,
struct
part
*
parts
,
struct
UnitSystem
*
us
)
{
/* Write arrays */
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"Coordinates"
,
DOUBLE
,
N
,
3
,
parts
,
N_total
,
mpi_rank
,
offset
,
x
,
us
,
UNIT_CONV_LENGTH
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"Velocities"
,
FLOAT
,
N
,
3
,
parts
,
N_total
,
mpi_rank
,
offset
,
v
,
us
,
UNIT_CONV_SPEED
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"Masses"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
mass
,
us
,
UNIT_CONV_MASS
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"SmoothingLength"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
h
,
us
,
UNIT_CONV_LENGTH
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"InternalEnergy"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
u
,
us
,
UNIT_CONV_ENERGY_PER_UNIT_MASS
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"ParticleIDs"
,
ULONGLONG
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
id
,
us
,
UNIT_CONV_NO_UNITS
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"Acceleration"
,
FLOAT
,
N
,
3
,
parts
,
N_total
,
mpi_rank
,
offset
,
a_hydro
,
us
,
UNIT_CONV_ACCELERATION
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"Density"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
rho
,
us
,
UNIT_CONV_DENSITY
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"Coordinates"
,
DOUBLE
,
N
,
3
,
parts
,
N_total
,
mpi_rank
,
offset
,
x
,
us
,
UNIT_CONV_LENGTH
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"Velocities"
,
FLOAT
,
N
,
3
,
parts
,
N_total
,
mpi_rank
,
offset
,
v
,
us
,
UNIT_CONV_SPEED
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"Masses"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
mass
,
us
,
UNIT_CONV_MASS
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"SmoothingLength"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
h
,
us
,
UNIT_CONV_LENGTH
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"InternalEnergy"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
u
,
us
,
UNIT_CONV_ENERGY_PER_UNIT_MASS
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"ParticleIDs"
,
ULONGLONG
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
id
,
us
,
UNIT_CONV_NO_UNITS
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"Acceleration"
,
FLOAT
,
N
,
3
,
parts
,
N_total
,
mpi_rank
,
offset
,
a_hydro
,
us
,
UNIT_CONV_ACCELERATION
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"Density"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
rho
,
us
,
UNIT_CONV_DENSITY
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/hydro/Gadget2/hydro_io.h
+
2
−
0
View file @
35332b91
...
...
@@ -56,6 +56,8 @@ __attribute__((always_inline)) INLINE static void hydro_read_particles(
*
* @param h_grp The HDF5 group in which to write the arrays.
* @param fileName The name of the file (unsued in MPI mode).
* @param partTypeGroupName The name of the group containing the particles in
*the HDF5 file.
* @param xmfFile The XMF file to write to (unused in MPI mode).
* @param N The number of particles on that MPI rank.
* @param N_total The total number of particles (only used in MPI mode)
...
...
This diff is collapsed.
Click to expand it.
src/hydro/Minimal/hydro_io.h
+
25
−
18
View file @
35332b91
...
...
@@ -56,6 +56,8 @@ __attribute__((always_inline)) INLINE static void hydro_read_particles(
*
* @param h_grp The HDF5 group in which to write the arrays.
* @param fileName The name of the file (unsued in MPI mode).
* @param partTypeGroupName The name of the group containing the particles in
*the HDF5 file.
* @param xmfFile The XMF file to write to (unused in MPI mode).
* @param N The number of particles on that MPI rank.
* @param N_total The total number of particles (only used in MPI mode)
...
...
@@ -67,26 +69,31 @@ __attribute__((always_inline)) INLINE static void hydro_read_particles(
*
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_write_particles
(
hid_t
h_grp
,
char
*
fileName
,
FILE
*
xmfFile
,
int
N
,
long
long
N_total
,
int
mpi_rank
,
long
long
offset
,
struct
part
*
parts
,
struct
UnitSystem
*
us
)
{
hid_t
h_grp
,
char
*
fileName
,
char
*
partTypeGroupName
,
FILE
*
xmfFile
,
int
N
,
long
long
N_total
,
int
mpi_rank
,
long
long
offset
,
struct
part
*
parts
,
struct
UnitSystem
*
us
)
{
/* Write arrays */
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"Coordinates"
,
DOUBLE
,
N
,
3
,
parts
,
N_total
,
mpi_rank
,
offset
,
x
,
us
,
UNIT_CONV_LENGTH
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"Velocities"
,
FLOAT
,
N
,
3
,
parts
,
N_total
,
mpi_rank
,
offset
,
v
,
us
,
UNIT_CONV_SPEED
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"Masses"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
mass
,
us
,
UNIT_CONV_MASS
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"SmoothingLength"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
h
,
us
,
UNIT_CONV_LENGTH
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"InternalEnergy"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
u
,
us
,
UNIT_CONV_ENERGY_PER_UNIT_MASS
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"ParticleIDs"
,
ULONGLONG
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
id
,
us
,
UNIT_CONV_NO_UNITS
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"Acceleration"
,
FLOAT
,
N
,
3
,
parts
,
N_total
,
mpi_rank
,
offset
,
a_hydro
,
us
,
UNIT_CONV_ACCELERATION
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
"Density"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
rho
,
us
,
UNIT_CONV_DENSITY
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"Coordinates"
,
DOUBLE
,
N
,
3
,
parts
,
N_total
,
mpi_rank
,
offset
,
x
,
us
,
UNIT_CONV_LENGTH
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"Velocities"
,
FLOAT
,
N
,
3
,
parts
,
N_total
,
mpi_rank
,
offset
,
v
,
us
,
UNIT_CONV_SPEED
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"Masses"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
mass
,
us
,
UNIT_CONV_MASS
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"SmoothingLength"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
h
,
us
,
UNIT_CONV_LENGTH
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"InternalEnergy"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
u
,
us
,
UNIT_CONV_ENERGY_PER_UNIT_MASS
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"ParticleIDs"
,
ULONGLONG
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
id
,
us
,
UNIT_CONV_NO_UNITS
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"Acceleration"
,
FLOAT
,
N
,
3
,
parts
,
N_total
,
mpi_rank
,
offset
,
a_hydro
,
us
,
UNIT_CONV_ACCELERATION
);
writeArray
(
h_grp
,
fileName
,
xmfFile
,
partTypeGroupName
,
"Density"
,
FLOAT
,
N
,
1
,
parts
,
N_total
,
mpi_rank
,
offset
,
rho
,
us
,
UNIT_CONV_DENSITY
);
}
/**
...
...
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