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
fa561bd5
Commit
fa561bd5
authored
Jan 03, 2017
by
Pedro Gonnet
Browse files
compile even if gadget-sph is used.
parent
74656d28
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/logger.c
View file @
fa561bd5
...
...
@@ -118,25 +118,29 @@ void logger_log_part(struct part *p, unsigned int mask, size_t *offset,
/* Particle position as three doubles. */
if
(
mask
&
logger_mask_x
)
{
memcpy
(
buff
,
p
->
x
,
3
*
sizeof
(
double
))
memcpy
(
buff
,
p
->
x
,
3
*
sizeof
(
double
))
;
buff
+=
3
*
sizeof
(
double
);
}
/* Particle velocity as three floats. */
if
(
mask
&
logger_mask_v
)
{
memcpy
(
buff
,
p
->
v
,
3
*
sizeof
(
float
))
memcpy
(
buff
,
p
->
v
,
3
*
sizeof
(
float
))
;
buff
+=
3
*
sizeof
(
float
);
}
/* Particle accelleration as three floats. */
if
(
mask
&
logger_mask_a
)
{
memcpy
(
buff
,
p
->
a_hydro
,
3
*
sizeof
(
float
))
memcpy
(
buff
,
p
->
a_hydro
,
3
*
sizeof
(
float
))
;
buff
+=
3
*
sizeof
(
float
);
}
/* Particle internal energy as a single float. */
if
(
mask
&
logger_mask_u
)
{
#if defined(GADGET2_SPH)
memcpy
(
buff
,
&
p
->
entropy
,
sizeof
(
float
));
#else
memcpy
(
buff
,
&
p
->
u
,
sizeof
(
float
));
#endif
buff
+=
sizeof
(
float
);
}
...
...
src/logger.h
View file @
fa561bd5
...
...
@@ -25,7 +25,7 @@
/**
* Logger entries contain messages representing the particle data at a given
* point in time during the simulation.
* point in time during the simulation.
*
* The logger messages always start with an 8-byte header structured as
* follows:
...
...
@@ -43,7 +43,8 @@
* | | | stored as three doubles.
* 1 | v | 12 | Particle velocity, stored as three floats.
* 2 | a | 12 | Particle acceleration, stored as three floats.
* 3 | u | 4 | Particle internal energy, stored as a single float.
* 3 | u | 4 | Particle internal energy (or entropy, if Gadget-SPH
* | | | is used), stored as a single float.
* 4 | h | 4 | Particle smoothing length, stored as a single float.
* 5 | rho | 4 | Particle density, stored as a single float.
* 6 | consts | 12 | Particle constants, i.e. mass and ID.
...
...
@@ -71,8 +72,11 @@
/* Function prototypes. */
int
logger_size
(
unsigned
int
mask
);
void
logger_log_part
(
struct
part
*
p
,
unsigned
int
mask
,
struct
dump
*
dump
);
void
logger_log_gpart
(
struct
gpart
*
p
,
unsigned
int
mask
,
struct
dump
*
dump
);
void
logger_lot_timestamp
(
unsigned
long
long
int
timestamp
,
struct
dump
*
dump
);
void
logger_log_part
(
struct
part
*
p
,
unsigned
int
mask
,
size_t
*
offset
,
struct
dump
*
dump
);
void
logger_log_gpart
(
struct
gpart
*
p
,
unsigned
int
mask
,
size_t
*
offset
,
struct
dump
*
dump
);
void
logger_lot_timestamp
(
unsigned
long
long
int
timestamp
,
size_t
*
offset
,
struct
dump
*
dump
);
#endif
/* SWIFT_LOGGER_H */
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