Skip to content
GitLab
Menu
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
047fa75a
Commit
047fa75a
authored
Dec 11, 2017
by
James Willis
Browse files
Changed name of number of neighbours to log.
parent
64b583b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/hydro/Gadget2/hydro.h
View file @
047fa75a
...
...
@@ -176,7 +176,7 @@ __attribute__((always_inline)) INLINE static void hydro_init_part(
struct
part
*
restrict
p
,
const
struct
hydro_space
*
hs
)
{
#ifdef DEBUG_INTERACTIONS_SPH
for
(
int
i
=
0
;
i
<
NUM_OF_NEIGHBOURS
;
++
i
)
p
->
ids_ngbs_density
[
i
]
=
-
1
;
for
(
int
i
=
0
;
i
<
MAX_
NUM_OF_NEIGHBOURS
;
++
i
)
p
->
ids_ngbs_density
[
i
]
=
-
1
;
p
->
num_ngb_density
=
0
;
#endif
...
...
@@ -317,7 +317,7 @@ __attribute__((always_inline)) INLINE static void hydro_reset_acceleration(
struct
part
*
restrict
p
)
{
#ifdef DEBUG_INTERACTIONS_SPH
for
(
int
i
=
0
;
i
<
NUM_OF_NEIGHBOURS
;
++
i
)
p
->
ids_ngbs_force
[
i
]
=
-
1
;
for
(
int
i
=
0
;
i
<
MAX_
NUM_OF_NEIGHBOURS
;
++
i
)
p
->
ids_ngbs_force
[
i
]
=
-
1
;
p
->
num_ngb_force
=
0
;
#endif
...
...
src/hydro/Gadget2/hydro_iact.h
View file @
047fa75a
...
...
@@ -106,13 +106,13 @@ __attribute__((always_inline)) INLINE static void runner_iact_density(
#ifdef DEBUG_INTERACTIONS_SPH
/* Update ngb counters */
if
(
pi
->
num_ngb_density
<
NUM_OF_NEIGHBOURS
)
{
if
(
pi
->
num_ngb_density
<
MAX_
NUM_OF_NEIGHBOURS
)
{
pi
->
ids_ngbs_density
[
pi
->
num_ngb_density
]
=
pj
->
id
;
++
pi
->
num_ngb_density
;
}
else
++
pi
->
num_ngb_density
;
if
(
pj
->
num_ngb_density
<
NUM_OF_NEIGHBOURS
)
{
if
(
pj
->
num_ngb_density
<
MAX_
NUM_OF_NEIGHBOURS
)
{
pj
->
ids_ngbs_density
[
pj
->
num_ngb_density
]
=
pi
->
id
;
++
pj
->
num_ngb_density
;
}
...
...
@@ -170,7 +170,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_density(
#ifdef DEBUG_INTERACTIONS_SPH
/* Update ngb counters */
if
(
pi
->
num_ngb_density
<
NUM_OF_NEIGHBOURS
)
{
if
(
pi
->
num_ngb_density
<
MAX_
NUM_OF_NEIGHBOURS
)
{
pi
->
ids_ngbs_density
[
pi
->
num_ngb_density
]
=
pj
->
id
;
++
pi
->
num_ngb_density
;
}
...
...
@@ -503,13 +503,13 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
#ifdef DEBUG_INTERACTIONS_SPH
/* Update ngb counters */
if
(
pi
->
num_ngb_force
<
NUM_OF_NEIGHBOURS
)
{
if
(
pi
->
num_ngb_force
<
MAX_
NUM_OF_NEIGHBOURS
)
{
pi
->
ids_ngbs_force
[
pi
->
num_ngb_force
]
=
pj
->
id
;
++
pi
->
num_ngb_force
;
}
else
++
pi
->
num_ngb_force
;
if
(
pj
->
num_ngb_force
<
NUM_OF_NEIGHBOURS
)
{
if
(
pj
->
num_ngb_force
<
MAX_
NUM_OF_NEIGHBOURS
)
{
pj
->
ids_ngbs_force
[
pj
->
num_ngb_force
]
=
pi
->
id
;
++
pj
->
num_ngb_force
;
}
...
...
@@ -608,7 +608,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
#ifdef DEBUG_INTERACTIONS_SPH
/* Update ngb counters */
if
(
pi
->
num_ngb_force
<
NUM_OF_NEIGHBOURS
)
{
if
(
pi
->
num_ngb_force
<
MAX_
NUM_OF_NEIGHBOURS
)
{
pi
->
ids_ngbs_force
[
pi
->
num_ngb_force
]
=
pj
->
id
;
++
pi
->
num_ngb_force
;
}
...
...
src/hydro/Gadget2/hydro_io.h
View file @
047fa75a
...
...
@@ -122,9 +122,9 @@ void hydro_write_particles(const struct part* parts, struct io_props* list,
parts
,
num_ngb_density
);
list
[
11
]
=
io_make_output_field
(
"Num_ngb_force"
,
INT
,
1
,
UNIT_CONV_NO_UNITS
,
parts
,
num_ngb_force
);
list
[
12
]
=
io_make_output_field
(
"Ids_ngb_density"
,
LONGLONG
,
NUM_OF_NEIGHBOURS
,
list
[
12
]
=
io_make_output_field
(
"Ids_ngb_density"
,
LONGLONG
,
MAX_
NUM_OF_NEIGHBOURS
,
UNIT_CONV_NO_UNITS
,
parts
,
ids_ngbs_density
);
list
[
13
]
=
io_make_output_field
(
"Ids_ngb_force"
,
LONGLONG
,
NUM_OF_NEIGHBOURS
,
list
[
13
]
=
io_make_output_field
(
"Ids_ngb_force"
,
LONGLONG
,
MAX_
NUM_OF_NEIGHBOURS
,
UNIT_CONV_NO_UNITS
,
parts
,
ids_ngbs_force
);
#endif
...
...
src/runner_doiact_vec.c
View file @
047fa75a
...
...
@@ -669,7 +669,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
#ifdef DEBUG_INTERACTIONS_SPH
for
(
int
bit_index
=
0
;
bit_index
<
VEC_SIZE
;
bit_index
++
)
{
if
(
doi_mask
&
(
1
<<
bit_index
))
{
if
(
pi
->
num_ngb_density
<
NUM_OF_NEIGHBOURS
)
{
if
(
pi
->
num_ngb_density
<
MAX_
NUM_OF_NEIGHBOURS
)
{
pi
->
ids_ngbs_density
[
pi
->
num_ngb_density
]
=
parts
[
pjd
+
bit_index
].
id
;
++
pi
->
num_ngb_density
;
}
...
...
@@ -677,7 +677,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
}
if
(
doi_mask2
&
(
1
<<
bit_index
))
{
if
(
pi
->
num_ngb_density
<
NUM_OF_NEIGHBOURS
)
{
if
(
pi
->
num_ngb_density
<
MAX_
NUM_OF_NEIGHBOURS
)
{
pi
->
ids_ngbs_density
[
pi
->
num_ngb_density
]
=
parts
[
pjd
+
VEC_SIZE
+
bit_index
].
id
;
++
pi
->
num_ngb_density
;
}
...
...
@@ -897,7 +897,7 @@ __attribute__((always_inline)) INLINE void runner_doself_subset_density_vec(
#ifdef DEBUG_INTERACTIONS_SPH
for
(
int
bit_index
=
0
;
bit_index
<
VEC_SIZE
;
bit_index
++
)
{
if
(
doi_mask
&
(
1
<<
bit_index
))
{
if
(
pi
->
num_ngb_density
<
NUM_OF_NEIGHBOURS
)
{
if
(
pi
->
num_ngb_density
<
MAX_
NUM_OF_NEIGHBOURS
)
{
pi
->
ids_ngbs_density
[
pi
->
num_ngb_density
]
=
parts
[
pjd
+
bit_index
].
id
;
++
pi
->
num_ngb_density
;
}
...
...
@@ -905,7 +905,7 @@ __attribute__((always_inline)) INLINE void runner_doself_subset_density_vec(
}
if
(
doi_mask2
&
(
1
<<
bit_index
))
{
if
(
pi
->
num_ngb_density
<
NUM_OF_NEIGHBOURS
)
{
if
(
pi
->
num_ngb_density
<
MAX_
NUM_OF_NEIGHBOURS
)
{
pi
->
ids_ngbs_density
[
pi
->
num_ngb_density
]
=
parts
[
pjd
+
VEC_SIZE
+
bit_index
].
id
;
++
pi
->
num_ngb_density
;
}
...
...
@@ -1121,7 +1121,7 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec(
#ifdef DEBUG_INTERACTIONS_SPH
for
(
int
bit_index
=
0
;
bit_index
<
VEC_SIZE
;
bit_index
++
)
{
if
(
vec_is_mask_true
(
v_doi_mask
)
&
(
1
<<
bit_index
))
{
if
(
pi
->
num_ngb_force
<
NUM_OF_NEIGHBOURS
)
{
if
(
pi
->
num_ngb_force
<
MAX_
NUM_OF_NEIGHBOURS
)
{
pi
->
ids_ngbs_force
[
pi
->
num_ngb_force
]
=
parts
[
pjd
+
bit_index
].
id
;
++
pi
->
num_ngb_force
;
}
...
...
@@ -1373,7 +1373,7 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
#ifdef DEBUG_INTERACTIONS_SPH
for
(
int
bit_index
=
0
;
bit_index
<
VEC_SIZE
;
bit_index
++
)
{
if
(
vec_is_mask_true
(
v_doi_mask
)
&
(
1
<<
bit_index
))
{
if
(
pi
->
num_ngb_density
<
NUM_OF_NEIGHBOURS
)
{
if
(
pi
->
num_ngb_density
<
MAX_
NUM_OF_NEIGHBOURS
)
{
pi
->
ids_ngbs_density
[
pi
->
num_ngb_density
]
=
parts_j
[
sort_j
[
pjd
+
bit_index
].
i
].
id
;
++
pi
->
num_ngb_density
;
}
...
...
@@ -1500,7 +1500,7 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
#ifdef DEBUG_INTERACTIONS_SPH
for
(
int
bit_index
=
0
;
bit_index
<
VEC_SIZE
;
bit_index
++
)
{
if
(
vec_is_mask_true
(
v_doj_mask
)
&
(
1
<<
bit_index
))
{
if
(
pj
->
num_ngb_density
<
NUM_OF_NEIGHBOURS
)
{
if
(
pj
->
num_ngb_density
<
MAX_
NUM_OF_NEIGHBOURS
)
{
pj
->
ids_ngbs_density
[
pj
->
num_ngb_density
]
=
parts_i
[
sort_i
[
ci_cache_idx
+
first_pi
+
bit_index
].
i
].
id
;
++
pj
->
num_ngb_density
;
}
...
...
@@ -1762,7 +1762,7 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci,
#ifdef DEBUG_INTERACTIONS_SPH
for
(
int
bit_index
=
0
;
bit_index
<
VEC_SIZE
;
bit_index
++
)
{
if
(
vec_is_mask_true
(
v_doi_mask
)
&
(
1
<<
bit_index
))
{
if
(
pi
->
num_ngb_force
<
NUM_OF_NEIGHBOURS
)
{
if
(
pi
->
num_ngb_force
<
MAX_
NUM_OF_NEIGHBOURS
)
{
pi
->
ids_ngbs_force
[
pi
->
num_ngb_force
]
=
parts_j
[
sort_j
[
pjd
+
bit_index
].
i
].
id
;
++
pi
->
num_ngb_force
;
}
...
...
@@ -1899,7 +1899,7 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci,
#ifdef DEBUG_INTERACTIONS_SPH
for
(
int
bit_index
=
0
;
bit_index
<
VEC_SIZE
;
bit_index
++
)
{
if
(
vec_is_mask_true
(
v_doj_mask
)
&
(
1
<<
bit_index
))
{
if
(
pj
->
num_ngb_force
<
NUM_OF_NEIGHBOURS
)
{
if
(
pj
->
num_ngb_force
<
MAX_
NUM_OF_NEIGHBOURS
)
{
pj
->
ids_ngbs_force
[
pj
->
num_ngb_force
]
=
parts_i
[
sort_i
[
ci_cache_idx
+
first_pi
+
bit_index
].
i
].
id
;
++
pj
->
num_ngb_force
;
}
...
...
Write
Preview
Supports
Markdown
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