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
a62ba4bc
Commit
a62ba4bc
authored
7 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Store main cell locations in (i,j,k).
parent
329517a3
No related branches found
No related tags found
1 merge request
!350
Test periodic bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/testPeriodicBC.c
+11
-10
11 additions, 10 deletions
tests/testPeriodicBC.c
with
11 additions
and
10 deletions
tests/testPeriodicBC.c
+
11
−
10
View file @
a62ba4bc
...
...
@@ -449,14 +449,17 @@ int main(int argc, char *argv[]) {
}
}
/* Test cell location. */
const
int
loc_i
=
0
,
loc_j
=
dim
-
1
,
loc_k
=
0
;
/* Store the main cell for future use */
main_cell
=
cells
[
0
];
main_cell
=
cells
[
loc_i
*
(
dim
*
dim
)
+
loc_j
*
dim
+
loc_k
];
/* Zero the fields */
for
(
int
j
=
0
;
j
<
512
;
++
j
)
zero_particle_fields
(
cells
[
j
]);
/* Run all the pairs */
int
i
=
0
,
j
=
0
,
k
=
0
;
#if !(defined(MINIMAL_SPH) && defined(WITH_VECTORIZATION))
...
...
@@ -470,13 +473,13 @@ int main(int argc, char *argv[]) {
/* Now loop over all the neighbours of this cell
* and perform the pair interactions. */
for
(
int
ii
=
-
1
;
ii
<
2
;
ii
++
)
{
int
iii
=
i
+
ii
;
int
iii
=
loc_
i
+
ii
;
iii
=
(
iii
+
dim
)
%
dim
;
for
(
int
jj
=
-
1
;
jj
<
2
;
jj
++
)
{
int
jjj
=
j
+
jj
;
int
jjj
=
loc_
j
+
jj
;
jjj
=
(
jjj
+
dim
)
%
dim
;
for
(
int
kk
=
-
1
;
kk
<
2
;
kk
++
)
{
int
kkk
=
k
+
kk
;
int
kkk
=
loc_
k
+
kk
;
kkk
=
(
kkk
+
dim
)
%
dim
;
/* Get the neighbouring cell */
...
...
@@ -512,18 +515,16 @@ int main(int argc, char *argv[]) {
#if !(defined(MINIMAL_SPH) && defined(WITH_VECTORIZATION))
i
=
0
,
j
=
0
,
k
=
0
;
/* Now loop over all the neighbours of this cell
* and perform the pair interactions. */
for
(
int
ii
=
-
1
;
ii
<
2
;
ii
++
)
{
int
iii
=
i
+
ii
;
int
iii
=
loc_
i
+
ii
;
iii
=
(
iii
+
dim
)
%
dim
;
for
(
int
jj
=
-
1
;
jj
<
2
;
jj
++
)
{
int
jjj
=
j
+
jj
;
int
jjj
=
loc_
j
+
jj
;
jjj
=
(
jjj
+
dim
)
%
dim
;
for
(
int
kk
=
-
1
;
kk
<
2
;
kk
++
)
{
int
kkk
=
k
+
kk
;
int
kkk
=
loc_
k
+
kk
;
kkk
=
(
kkk
+
dim
)
%
dim
;
/* Get the neighbouring cell */
...
...
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