Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
SWIFTsim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
70
Issues
70
List
Boards
Labels
Milestones
Merge Requests
13
Merge Requests
13
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
SWIFT
SWIFTsim
Commits
167fc7b5
Commit
167fc7b5
authored
Apr 23, 2018
by
Matthieu Schaller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not force the linkeage in , just check it.
parent
80157091
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
src/space.c
src/space.c
+17
-7
No files found.
src/space.c
View file @
167fc7b5
...
@@ -2317,8 +2317,10 @@ void space_first_init_parts_mapper(void *restrict map_data, int count,
...
@@ -2317,8 +2317,10 @@ void space_first_init_parts_mapper(void *restrict map_data, int count,
const
struct
space
*
restrict
s
=
(
struct
space
*
)
extra_data
;
const
struct
space
*
restrict
s
=
(
struct
space
*
)
extra_data
;
const
struct
engine
*
e
=
s
->
e
;
const
struct
engine
*
e
=
s
->
e
;
struct
xpart
*
restrict
xp
=
s
->
xparts
+
(
ptrdiff_t
)(
p
-
s
->
parts
);
const
ptrdiff_t
delta
=
p
-
s
->
parts
;
struct
xpart
*
restrict
xp
=
s
->
xparts
+
delta
;
/* Extract some constants */
const
struct
cosmology
*
cosmo
=
s
->
e
->
cosmology
;
const
struct
cosmology
*
cosmo
=
s
->
e
->
cosmology
;
const
struct
phys_const
*
phys_const
=
s
->
e
->
physical_constants
;
const
struct
phys_const
*
phys_const
=
s
->
e
->
physical_constants
;
const
struct
unit_system
*
us
=
s
->
e
->
internal_units
;
const
struct
unit_system
*
us
=
s
->
e
->
internal_units
;
...
@@ -2328,7 +2330,7 @@ void space_first_init_parts_mapper(void *restrict map_data, int count,
...
@@ -2328,7 +2330,7 @@ void space_first_init_parts_mapper(void *restrict map_data, int count,
const
float
u_init
=
hydro_props
->
initial_internal_energy
;
const
float
u_init
=
hydro_props
->
initial_internal_energy
;
const
float
u_min
=
hydro_props
->
minimal_internal_energy
;
const
float
u_min
=
hydro_props
->
minimal_internal_energy
;
const
struct
chemistry_data
*
chemistry
=
e
->
chemistry
;
const
struct
chemistry_
global_
data
*
chemistry
=
e
->
chemistry
;
const
struct
cooling_function_data
*
cool_func
=
e
->
cooling_func
;
const
struct
cooling_function_data
*
cool_func
=
e
->
cooling_func
;
for
(
int
k
=
0
;
k
<
count
;
k
++
)
{
for
(
int
k
=
0
;
k
<
count
;
k
++
)
{
...
@@ -2359,10 +2361,12 @@ void space_first_init_parts_mapper(void *restrict map_data, int count,
...
@@ -2359,10 +2361,12 @@ void space_first_init_parts_mapper(void *restrict map_data, int count,
/* And the cooling */
/* And the cooling */
cooling_first_init_part
(
phys_const
,
us
,
cosmo
,
cool_func
,
&
p
[
k
],
&
xp
[
k
]);
cooling_first_init_part
(
phys_const
,
us
,
cosmo
,
cool_func
,
&
p
[
k
],
&
xp
[
k
]);
#ifdef SWIFT_DEBUG_CHECKS
/* Check part->gpart->part linkeage. */
/* Check part->gpart->part linkeage. */
if
(
p
[
i
].
gpart
)
p
[
i
].
gpart
->
id_or_neg_offset
=
-
i
;
if
(
p
[
k
].
gpart
&&
p
[
k
].
gpart
->
id_or_neg_offset
!=
-
(
k
+
delta
))
error
(
"Invalid gpart -> part link"
);
#ifdef SWIFT_DEBUG_CHECKS
/* Initialise the time-integration check variables */
p
[
k
].
ti_drift
=
0
;
p
[
k
].
ti_drift
=
0
;
p
[
k
].
ti_kick
=
0
;
p
[
k
].
ti_kick
=
0
;
#endif
#endif
...
@@ -2417,6 +2421,7 @@ void space_first_init_gparts_mapper(void *restrict map_data, int count,
...
@@ -2417,6 +2421,7 @@ void space_first_init_gparts_mapper(void *restrict map_data, int count,
gravity_first_init_gpart
(
&
gp
[
k
],
grav_props
);
gravity_first_init_gpart
(
&
gp
[
k
],
grav_props
);
#ifdef SWIFT_DEBUG_CHECKS
#ifdef SWIFT_DEBUG_CHECKS
/* Initialise the time-integration check variables */
gp
[
k
].
ti_drift
=
0
;
gp
[
k
].
ti_drift
=
0
;
gp
[
k
].
ti_kick
=
0
;
gp
[
k
].
ti_kick
=
0
;
#endif
#endif
...
@@ -2446,6 +2451,10 @@ void space_first_init_sparts_mapper(void *restrict map_data, int count,
...
@@ -2446,6 +2451,10 @@ void space_first_init_sparts_mapper(void *restrict map_data, int count,
struct
spart
*
restrict
sp
=
(
struct
spart
*
)
map_data
;
struct
spart
*
restrict
sp
=
(
struct
spart
*
)
map_data
;
const
struct
space
*
restrict
s
=
(
struct
space
*
)
extra_data
;
const
struct
space
*
restrict
s
=
(
struct
space
*
)
extra_data
;
#ifdef SWIFT_DEBUG_CHECKS
const
ptrdiff_t
delta
=
sp
-
s
->
sparts
;
#endif
const
struct
cosmology
*
cosmo
=
s
->
e
->
cosmology
;
const
struct
cosmology
*
cosmo
=
s
->
e
->
cosmology
;
const
float
a_factor_vel
=
cosmo
->
a
*
cosmo
->
a
;
const
float
a_factor_vel
=
cosmo
->
a
*
cosmo
->
a
;
...
@@ -2467,10 +2476,11 @@ void space_first_init_sparts_mapper(void *restrict map_data, int count,
...
@@ -2467,10 +2476,11 @@ void space_first_init_sparts_mapper(void *restrict map_data, int count,
star_first_init_spart
(
&
sp
[
k
]);
star_first_init_spart
(
&
sp
[
k
]);
/* Check spart->gpart->spart linkeage. */
if
(
sp
[
i
].
gpart
)
sp
[
i
].
gpart
->
id_or_neg_offset
=
-
i
;
#ifdef SWIFT_DEBUG_CHECKS
#ifdef SWIFT_DEBUG_CHECKS
if
(
sp
[
k
].
gpart
&&
sp
[
k
].
gpart
->
id_or_neg_offset
!=
-
(
k
+
delta
))
error
(
"Invalid gpart -> spart link"
);
/* Initialise the time-integration check variables */
sp
[
k
].
ti_drift
=
0
;
sp
[
k
].
ti_drift
=
0
;
sp
[
k
].
ti_kick
=
0
;
sp
[
k
].
ti_kick
=
0
;
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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