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
4f6ed809
Commit
4f6ed809
authored
5 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added the timebin interaction check to the testSymmetry unit test
parent
87d83f8f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/timestep_limiter_iact.h
+12
-8
12 additions, 8 deletions
src/timestep_limiter_iact.h
tests/testSymmetry.c
+4
-0
4 additions, 0 deletions
tests/testSymmetry.c
with
16 additions
and
8 deletions
src/timestep_limiter_iact.h
+
12
−
8
View file @
4f6ed809
...
...
@@ -32,8 +32,9 @@
* @param H Current Hubble parameter.
*/
__attribute__
((
always_inline
))
INLINE
static
void
runner_iact_timebin
(
float
r2
,
const
float
*
dx
,
float
hi
,
float
hj
,
struct
part
*
restrict
pi
,
struct
part
*
restrict
pj
,
float
a
,
float
H
)
{
const
float
r2
,
const
float
*
dx
,
const
float
hi
,
const
float
hj
,
struct
part
*
restrict
pi
,
struct
part
*
restrict
pj
,
const
float
a
,
const
float
H
)
{
/* Update the minimal time-bin */
if
(
pj
->
time_bin
>
0
)
...
...
@@ -58,8 +59,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_timebin(
* @param H Current Hubble parameter.
*/
__attribute__
((
always_inline
))
INLINE
static
void
runner_iact_nonsym_timebin
(
float
r2
,
const
float
*
dx
,
float
hi
,
float
hj
,
struct
part
*
restrict
pi
,
const
struct
part
*
restrict
pj
,
float
a
,
float
H
)
{
const
float
r2
,
const
float
*
dx
,
const
float
hi
,
const
float
hj
,
struct
part
*
restrict
pi
,
const
struct
part
*
restrict
pj
,
const
float
a
,
const
float
H
)
{
/* Update the minimal time-bin */
if
(
pj
->
time_bin
>
0
)
...
...
@@ -71,8 +73,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_timebin(
* @brief Timestep limiter loop
*/
__attribute__
((
always_inline
))
INLINE
static
void
runner_iact_limiter
(
float
r2
,
const
float
*
dx
,
float
hi
,
float
hj
,
struct
part
*
restrict
pi
,
struct
part
*
restrict
pj
,
float
a
,
float
H
)
{
const
float
r2
,
const
float
*
dx
,
const
float
hi
,
const
float
hj
,
struct
part
*
restrict
pi
,
struct
part
*
restrict
pj
,
const
float
a
,
const
float
H
)
{
/* Nothing to do here if both particles are active */
}
...
...
@@ -81,8 +84,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_limiter(
* @brief Timestep limiter loop (non-symmetric version)
*/
__attribute__
((
always_inline
))
INLINE
static
void
runner_iact_nonsym_limiter
(
float
r2
,
const
float
*
dx
,
float
hi
,
float
hj
,
struct
part
*
restrict
pi
,
struct
part
*
restrict
pj
,
float
a
,
float
H
)
{
const
float
r2
,
const
float
*
dx
,
const
float
hi
,
const
float
hj
,
const
struct
part
*
restrict
pi
,
struct
part
*
restrict
pj
,
const
float
a
,
const
float
H
)
{
/* Wake up the neighbour? */
if
(
pj
->
time_bin
>
pi
->
time_bin
+
time_bin_neighbour_max_delta_bin
)
{
...
...
This diff is collapsed.
Click to expand it.
tests/testSymmetry.c
+
4
−
0
View file @
4f6ed809
...
...
@@ -24,6 +24,7 @@
#include
<string.h>
#include
"swift.h"
#include
"timestep_limiter_iact.h"
void
print_bytes
(
void
*
p
,
size_t
len
)
{
printf
(
"("
);
...
...
@@ -219,13 +220,16 @@ void test(void) {
/* Call the symmetric version */
runner_iact_force
(
r2
,
dx
,
pi
.
h
,
pj
.
h
,
&
pi
,
&
pj
,
a
,
H
);
runner_iact_timebin
(
r2
,
dx
,
pi
.
h
,
pj
.
h
,
&
pi
,
&
pj
,
a
,
H
);
/* Call the non-symmetric version */
runner_iact_nonsym_force
(
r2
,
dx
,
pi2
.
h
,
pj2
.
h
,
&
pi2
,
&
pj2
,
a
,
H
);
runner_iact_nonsym_timebin
(
r2
,
dx
,
pi2
.
h
,
pj2
.
h
,
&
pi2
,
&
pj2
,
a
,
H
);
dx
[
0
]
=
-
dx
[
0
];
dx
[
1
]
=
-
dx
[
1
];
dx
[
2
]
=
-
dx
[
2
];
runner_iact_nonsym_force
(
r2
,
dx
,
pj2
.
h
,
pi2
.
h
,
&
pj2
,
&
pi2
,
a
,
H
);
runner_iact_nonsym_timebin
(
r2
,
dx
,
pj2
.
h
,
pi2
.
h
,
&
pj2
,
&
pi2
,
a
,
H
);
/* Check that the particles are the same */
#if defined(GIZMO_MFV_SPH)
...
...
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