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
0aca0b89
Commit
0aca0b89
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Cosmetics and Doxygen documentation.
parent
e02b3299
No related branches found
No related tags found
2 merge requests
!136
Master
,
!126
Support for XMF file descriptors with multiple particle types.
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/common_io.c
+12
-4
12 additions, 4 deletions
src/common_io.c
src/gravity/Default/gravity_io.h
+2
-0
2 additions, 0 deletions
src/gravity/Default/gravity_io.h
src/serial_io.c
+4
-4
4 additions, 4 deletions
src/serial_io.c
src/single_io.c
+3
-5
3 additions, 5 deletions
src/single_io.c
with
21 additions
and
13 deletions
src/common_io.c
+
12
−
4
View file @
0aca0b89
...
@@ -405,7 +405,6 @@ void createXMFfile() {
...
@@ -405,7 +405,6 @@ void createXMFfile() {
*snapshot
*snapshot
*
*
* @param xmfFile The file to write in.
* @param xmfFile The file to write in.
* @param Nparts The number of particles.
* @param hdfFileName The name of the HDF5 file corresponding to this output.
* @param hdfFileName The name of the HDF5 file corresponding to this output.
* @param time The current simulation time.
* @param time The current simulation time.
*/
*/
...
@@ -422,11 +421,15 @@ void writeXMFoutputheader(FILE* xmfFile, char* hdfFileName, float time) {
...
@@ -422,11 +421,15 @@ void writeXMFoutputheader(FILE* xmfFile, char* hdfFileName, float time) {
* @brief Writes the end of the XMF file (closes all open markups)
* @brief Writes the end of the XMF file (closes all open markups)
*
*
* @param xmfFile The file to write in.
* @param xmfFile The file to write in.
* @param output The number of this output.
* @param time The current simulation time.
*/
*/
void
writeXMFoutputfooter
(
FILE
*
xmfFile
,
int
output
,
float
time
)
{
void
writeXMFoutputfooter
(
FILE
*
xmfFile
,
int
output
,
float
time
)
{
/* Write end of the section of this time step */
/* Write end of the section of this time step */
fprintf
(
xmfFile
,
"
\n
</Grid> <!-- output=%03i time=%f -->
\n
"
,
output
,
time
);
fprintf
(
xmfFile
,
"
\n
</Grid> <!-- End of meta-data for output=%03i, time=%f -->
\n
"
,
output
,
time
);
fprintf
(
xmfFile
,
"
\n
</Grid> <!-- timeSeries -->
\n
"
);
fprintf
(
xmfFile
,
"
\n
</Grid> <!-- timeSeries -->
\n
"
);
fprintf
(
xmfFile
,
"</Domain>
\n
"
);
fprintf
(
xmfFile
,
"</Domain>
\n
"
);
fprintf
(
xmfFile
,
"</Xdmf>
\n
"
);
fprintf
(
xmfFile
,
"</Xdmf>
\n
"
);
...
@@ -446,11 +449,14 @@ void writeXMFgroupheader(FILE* xmfFile, char* hdfFileName, size_t N,
...
@@ -446,11 +449,14 @@ void writeXMFgroupheader(FILE* xmfFile, char* hdfFileName, size_t N,
"Precision=
\"
8
\"
"
"Precision=
\"
8
\"
"
"Format=
\"
HDF
\"
>%s:/PartType%d/Coordinates</DataItem>
\n
"
,
"Format=
\"
HDF
\"
>%s:/PartType%d/Coordinates</DataItem>
\n
"
,
N
,
hdfFileName
,
ptype
);
N
,
hdfFileName
,
ptype
);
fprintf
(
xmfFile
,
"</Geometry>"
);
fprintf
(
xmfFile
,
"</Geometry>
\n
<!-- Done geometry for %s, start of particle fields "
"list -->
\n
"
,
particle_type_names
[
ptype
]);
}
}
void
writeXMFgroupfooter
(
FILE
*
xmfFile
,
enum
PARTICLE_TYPE
ptype
)
{
void
writeXMFgroupfooter
(
FILE
*
xmfFile
,
enum
PARTICLE_TYPE
ptype
)
{
fprintf
(
xmfFile
,
"</Grid> <!-- parttype=%s -->
\n
"
,
fprintf
(
xmfFile
,
"</Grid> <!--
End of meta-data for
parttype=%s -->
\n
"
,
particle_type_names
[
ptype
]);
particle_type_names
[
ptype
]);
}
}
...
@@ -459,6 +465,8 @@ void writeXMFgroupfooter(FILE* xmfFile, enum PARTICLE_TYPE ptype) {
...
@@ -459,6 +465,8 @@ void writeXMFgroupfooter(FILE* xmfFile, enum PARTICLE_TYPE ptype) {
*
*
* @param xmfFile The file in which to write
* @param xmfFile The file in which to write
* @param fileName The name of the HDF5 file associated to this XMF descriptor.
* @param fileName The name of the HDF5 file associated to this XMF descriptor.
* @param partTypeGroupName The name of the group containing the particles in
*the HDF5 file.
* @param name The name of the array in the HDF5 file.
* @param name The name of the array in the HDF5 file.
* @param N The number of particles.
* @param N The number of particles.
* @param dim The dimension of the quantity (1 for scalars, 3 for vectors).
* @param dim The dimension of the quantity (1 for scalars, 3 for vectors).
...
...
This diff is collapsed.
Click to expand it.
src/gravity/Default/gravity_io.h
+
2
−
0
View file @
0aca0b89
...
@@ -48,6 +48,8 @@ __attribute__((always_inline)) INLINE static void darkmatter_read_particles(
...
@@ -48,6 +48,8 @@ __attribute__((always_inline)) INLINE static void darkmatter_read_particles(
*
*
* @param h_grp The HDF5 group in which to write the arrays.
* @param h_grp The HDF5 group in which to write the arrays.
* @param fileName The name of the file (unsued in MPI mode).
* @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 xmfFile The XMF file to write to (unused in MPI mode).
* @param Ndm The number of DM particles on that MPI rank.
* @param Ndm The number of DM particles on that MPI rank.
* @param Ndm_total The total number of g-particles (only used in MPI mode)
* @param Ndm_total The total number of g-particles (only used in MPI mode)
...
...
This diff is collapsed.
Click to expand it.
src/serial_io.c
+
4
−
4
View file @
0aca0b89
...
@@ -256,17 +256,17 @@ void prepareArray(hid_t grp, char* fileName, FILE* xmfFile,
...
@@ -256,17 +256,17 @@ void prepareArray(hid_t grp, char* fileName, FILE* xmfFile,
* @param grp The group in which to write.
* @param grp The group in which to write.
* @param fileName The name of the file in which the data is written
* @param fileName The name of the file in which the data is written
* @param xmfFile The FILE used to write the XMF description
* @param xmfFile The FILE used to write the XMF description
* @param partTypeGroupName The name of the group containing the particles in
*the HDF5 file.
* @param name The name of the array to write.
* @param name The name of the array to write.
* @param type The #DATA_TYPE of the array.
* @param type The #DATA_TYPE of the array.
* @param N The number of particles to write.
* @param N The number of particles to write.
* @param dim The dimension of the data (1 for scalar, 3 for vector)
* @param dim The dimension of the data (1 for scalar, 3 for vector)
* @param part_c A (char*) pointer on the first occurrence of the field of
* @param part_c A (char*) pointer on the first occurrence of the field of
*interest in the parts array
*interest in the parts array
* @param partSize The size in bytes of the particle structure.
* @param us The UnitSystem currently in use
* @param us The UnitSystem currently in use
* @param convFactor The UnitConversionFactor for this array
* @param convFactor The UnitConversionFactor for this arrayo
*
*
* Calls #error() if an error occurs.
*/
*/
void
writeArrayBackEnd
(
hid_t
grp
,
char
*
fileName
,
FILE
*
xmfFile
,
void
writeArrayBackEnd
(
hid_t
grp
,
char
*
fileName
,
FILE
*
xmfFile
,
char
*
partTypeGroupName
,
char
*
name
,
enum
DATA_TYPE
type
,
char
*
partTypeGroupName
,
char
*
name
,
enum
DATA_TYPE
type
,
...
...
This diff is collapsed.
Click to expand it.
src/single_io.c
+
3
−
5
View file @
0aca0b89
...
@@ -53,14 +53,13 @@
...
@@ -53,14 +53,13 @@
* @param dim The dimension of the data (1 for scalar, 3 for vector)
* @param dim The dimension of the data (1 for scalar, 3 for vector)
* @param part_c A (char*) pointer on the first occurrence of the field of
* @param part_c A (char*) pointer on the first occurrence of the field of
*interest in the parts array
*interest in the parts array
* @param partSize The size in bytes of the particle structure.
* @param importance If COMPULSORY, the data must be present in the IC file. If
* @param importance If COMPULSORY, the data must be present in the IC file. If
*OPTIONAL, the array will be zeroed when the data is not present.
*OPTIONAL, the array will be zeroed when the data is not present.
*
*
* @todo A better version using HDF5 hyper-slabs to read the file directly into
* @todo A better version using HDF5 hyper-slabs to read the file directly into
*the part array
*the part array
* will be written once the structures have been stabilized.
* will be written once the structures have been stabilized.
*
* Calls #error() if an error occurs.
*/
*/
void
readArrayBackEnd
(
hid_t
grp
,
char
*
name
,
enum
DATA_TYPE
type
,
int
N
,
void
readArrayBackEnd
(
hid_t
grp
,
char
*
name
,
enum
DATA_TYPE
type
,
int
N
,
int
dim
,
char
*
part_c
,
size_t
partSize
,
int
dim
,
char
*
part_c
,
size_t
partSize
,
...
@@ -145,15 +144,14 @@ void readArrayBackEnd(hid_t grp, char* name, enum DATA_TYPE type, int N,
...
@@ -145,15 +144,14 @@ void readArrayBackEnd(hid_t grp, char* name, enum DATA_TYPE type, int N,
* @param N The number of particles to write.
* @param N The number of particles to write.
* @param dim The dimension of the data (1 for scalar, 3 for vector)
* @param dim The dimension of the data (1 for scalar, 3 for vector)
* @param part_c A (char*) pointer on the first occurrence of the field of
* @param part_c A (char*) pointer on the first occurrence of the field of
*interest in the parts array
*interest in the parts array.
* @param partSize The size in bytes of the particle structure.
* @param us The UnitSystem currently in use
* @param us The UnitSystem currently in use
* @param convFactor The UnitConversionFactor for this array
* @param convFactor The UnitConversionFactor for this array
*
*
* @todo A better version using HDF5 hyper-slabs to write the file directly from
* @todo A better version using HDF5 hyper-slabs to write the file directly from
*the part array
*the part array
* will be written once the structures have been stabilized.
* will be written once the structures have been stabilized.
*
* Calls #error() if an error occurs.
*/
*/
void
writeArrayBackEnd
(
hid_t
grp
,
char
*
fileName
,
FILE
*
xmfFile
,
void
writeArrayBackEnd
(
hid_t
grp
,
char
*
fileName
,
FILE
*
xmfFile
,
char
*
partTypeGroupName
,
char
*
name
,
enum
DATA_TYPE
type
,
char
*
partTypeGroupName
,
char
*
name
,
enum
DATA_TYPE
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