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
7438455e
Commit
7438455e
authored
Sep 10, 2017
by
Matthieu Schaller
Browse files
DOPAIR_SUBSET now its business in the frame of ci
parent
ed75f7fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/runner_doiact.h
View file @
7438455e
...
...
@@ -503,33 +503,33 @@ void DOPAIR_SUBSET(struct runner *r, struct cell *restrict ci,
/* Get a hold of the ith part in ci. */
struct
part
*
restrict
pi
=
&
parts_i
[
ind
[
pid
]];
double
pix
[
3
]
;
for
(
int
k
=
0
;
k
<
3
;
k
++
)
pix
[
k
]
=
pi
->
x
[
k
]
-
shift
[
k
]
;
const
float
pix
=
pi
->
x
[
0
]
-
(
ci
->
loc
[
0
]
+
shift
[
0
])
;
const
float
piy
=
pi
->
x
[
1
]
-
(
ci
->
loc
[
1
]
+
shift
[
1
])
;
const
float
piz
=
pi
->
x
[
2
]
-
(
ci
->
loc
[
2
]
+
shift
[
2
]);
const
float
hi
=
pi
->
h
;
const
float
hig2
=
hi
*
hi
*
kernel_gamma2
;
const
float
di
=
hi
*
kernel_gamma
+
dxj
+
pix
[
0
]
*
runner_shift
[
sid
][
0
]
+
pi
x
[
1
]
*
runner_shift
[
sid
][
1
]
+
pi
x
[
2
]
*
runner_shift
[
sid
][
2
];
const
float
di
=
hi
*
kernel_gamma
+
dxj
+
pix
*
runner_shift
[
sid
][
0
]
+
pi
y
*
runner_shift
[
sid
][
1
]
+
pi
z
*
runner_shift
[
sid
][
2
];
/* Loop over the parts in cj. */
for
(
int
pjd
=
0
;
pjd
<
count_j
&&
sort_j
[
pjd
].
d
<
di
;
pjd
++
)
{
/* Get a pointer to the jth particle. */
struct
part
*
restrict
pj
=
&
parts_j
[
sort_j
[
pjd
].
i
];
const
float
hj
=
pj
->
h
;
const
float
pjx
=
pj
->
x
[
0
]
-
ci
->
loc
[
0
];
const
float
pjy
=
pj
->
x
[
1
]
-
ci
->
loc
[
1
];
const
float
pjz
=
pj
->
x
[
2
]
-
ci
->
loc
[
2
];
/* Compute the pairwise distance. */
float
r2
=
0
.
0
f
;
float
dx
[
3
];
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
dx
[
k
]
=
pix
[
k
]
-
pj
->
x
[
k
];
r2
+=
dx
[
k
]
*
dx
[
k
];
}
float
dx
[
3
]
=
{
pix
-
pjx
,
piy
-
pjy
,
piz
-
pjz
};
const
float
r2
=
dx
[
0
]
*
dx
[
0
]
+
dx
[
1
]
*
dx
[
1
]
+
dx
[
2
]
*
dx
[
2
];
/* Hit or miss? */
if
(
r2
<
hig2
)
{
IACT_NONSYM
(
r2
,
dx
,
hi
,
pj
->
h
,
pi
,
pj
);
IACT_NONSYM
(
r2
,
dx
,
hi
,
h
j
,
pi
,
pj
);
}
}
/* loop over the parts in cj. */
}
/* loop over the parts in ci. */
...
...
@@ -543,32 +543,33 @@ void DOPAIR_SUBSET(struct runner *r, struct cell *restrict ci,
/* Get a hold of the ith part in ci. */
struct
part
*
restrict
pi
=
&
parts_i
[
ind
[
pid
]];
double
pix
[
3
];
for
(
int
k
=
0
;
k
<
3
;
k
++
)
pix
[
k
]
=
pi
->
x
[
k
]
-
shift
[
k
];
const
float
pix
=
pi
->
x
[
0
]
-
(
ci
->
loc
[
0
]
+
shift
[
0
]);
const
float
piy
=
pi
->
x
[
1
]
-
(
ci
->
loc
[
1
]
+
shift
[
1
]);
const
float
piz
=
pi
->
x
[
2
]
-
(
ci
->
loc
[
2
]
+
shift
[
2
]);
const
float
hi
=
pi
->
h
;
const
float
hig2
=
hi
*
hi
*
kernel_gamma2
;
const
float
di
=
-
hi
*
kernel_gamma
-
dxj
+
pix
[
0
]
*
runner_shift
[
sid
][
0
]
+
pi
x
[
1
]
*
runner_shift
[
sid
][
1
]
+
pi
x
[
2
]
*
runner_shift
[
sid
][
2
];
-
hi
*
kernel_gamma
-
dxj
+
pix
*
runner_shift
[
sid
][
0
]
+
pi
y
*
runner_shift
[
sid
][
1
]
+
pi
z
*
runner_shift
[
sid
][
2
];
/* Loop over the parts in cj. */
for
(
int
pjd
=
count_j
-
1
;
pjd
>=
0
&&
di
<
sort_j
[
pjd
].
d
;
pjd
--
)
{
/* Get a pointer to the jth particle. */
struct
part
*
restrict
pj
=
&
parts_j
[
sort_j
[
pjd
].
i
];
const
float
hj
=
pj
->
h
;
const
float
pjx
=
pj
->
x
[
0
]
-
ci
->
loc
[
0
];
const
float
pjy
=
pj
->
x
[
1
]
-
ci
->
loc
[
1
];
const
float
pjz
=
pj
->
x
[
2
]
-
ci
->
loc
[
2
];
/* Compute the pairwise distance. */
float
r2
=
0
.
0
f
;
float
dx
[
3
];
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
dx
[
k
]
=
pix
[
k
]
-
pj
->
x
[
k
];
r2
+=
dx
[
k
]
*
dx
[
k
];
}
float
dx
[
3
]
=
{
pix
-
pjx
,
piy
-
pjy
,
piz
-
pjz
};
const
float
r2
=
dx
[
0
]
*
dx
[
0
]
+
dx
[
1
]
*
dx
[
1
]
+
dx
[
2
]
*
dx
[
2
];
/* Hit or miss? */
if
(
r2
<
hig2
)
{
IACT_NONSYM
(
r2
,
dx
,
hi
,
pj
->
h
,
pi
,
pj
);
IACT_NONSYM
(
r2
,
dx
,
hi
,
h
j
,
pi
,
pj
);
}
}
/* loop over the parts in cj. */
}
/* loop over the parts in ci. */
...
...
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