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
274bc00f
Commit
274bc00f
authored
May 31, 2017
by
James Willis
Browse files
Added BC tests for cells that are in the centre of the edges of the domain.
parent
61c89635
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/testPeriodicBC.c
View file @
274bc00f
...
...
@@ -511,7 +511,9 @@ int main(int argc, char *argv[]) {
/* Delete files if they already exist. */
remove
(
swiftOutputFileName
);
remove
(
bruteForceOutputFileName
);
const
int
half_dim
=
(
dim
-
1
)
/
2
;
/* Test the periodic boundary conditions for each of the 8 corners. */
test_boundary_conditions
(
cells
,
runner
,
0
,
0
,
0
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
dim
-
1
,
0
,
0
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
...
...
@@ -523,12 +525,28 @@ int main(int argc, char *argv[]) {
test_boundary_conditions
(
cells
,
runner
,
dim
-
1
,
dim
-
1
,
dim
-
1
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
/* Test the boundary conditions for cells at the centre of each face of the box. */
test_boundary_conditions
(
cells
,
runner
,
(
dim
-
1
)
/
2
,
(
dim
-
1
)
/
2
,
0
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
dim
-
1
,
(
dim
-
1
)
/
2
,
(
dim
-
1
)
/
2
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
(
dim
-
1
)
/
2
,
(
dim
-
1
)
/
2
,
dim
-
1
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
0
,
(
dim
-
1
)
/
2
,
(
dim
-
1
)
/
2
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
(
dim
-
1
)
/
2
,
0
,
(
dim
-
1
)
/
2
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
(
dim
-
1
)
/
2
,
dim
-
1
,
(
dim
-
1
)
/
2
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
half_dim
,
half_dim
,
0
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
dim
-
1
,
half_dim
,
half_dim
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
half_dim
,
half_dim
,
dim
-
1
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
0
,
half_dim
,
half_dim
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
half_dim
,
0
,
half_dim
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
half_dim
,
dim
-
1
,
half_dim
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
/* Test the boundary conditions for cells at the centre of each edge of the box. */
test_boundary_conditions
(
cells
,
runner
,
half_dim
,
dim
-
1
,
0
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
dim
-
1
,
dim
-
1
,
half_dim
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
half_dim
,
dim
-
1
,
dim
-
1
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
0
,
dim
-
1
,
half_dim
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
0
,
half_dim
,
0
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
dim
-
1
,
half_dim
,
0
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
dim
-
1
,
half_dim
,
dim
-
1
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
0
,
half_dim
,
dim
-
1
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
half_dim
,
0
,
0
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
dim
-
1
,
0
,
half_dim
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
half_dim
,
0
,
dim
-
1
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
test_boundary_conditions
(
cells
,
runner
,
0
,
0
,
half_dim
,
dim
,
swiftOutputFileName
,
bruteForceOutputFileName
);
/* Clean things to make the sanitizer happy ... */
for
(
int
i
=
0
;
i
<
512
;
++
i
)
clean_up
(
cells
[
i
]);
...
...
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