Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
waLBerla
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Markus Holzer
waLBerla
Commits
f59f8d50
Commit
f59f8d50
authored
7 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix in Python test
- nesting check macros in iteration macros not working
parent
57281b6a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/python_coupling/FieldExportTest.cpp
+18
-14
18 additions, 14 deletions
tests/python_coupling/FieldExportTest.cpp
with
18 additions
and
14 deletions
tests/python_coupling/FieldExportTest.cpp
+
18
−
14
View file @
f59f8d50
...
...
@@ -29,18 +29,17 @@
#include
"blockforest/Initialization.h"
#include
"blockforest/python/Exports.h"
#include
"field/python/Exports.h"
#include
"field/iterators/IteratorMacros.h"
#include
"python_coupling/Manager.h"
#include
"python_coupling/PythonCallback.h"
#include
"python_coupling/DictWrapper.h"
#include
"stencil/D2Q9.h"
#include
<boost/mpl/vector.hpp>
using
namespace
walberla
;
int
main
(
int
argc
,
char
**
argv
)
{
debug
::
enterTestMode
();
...
...
@@ -86,6 +85,7 @@ int main( int argc, char ** argv )
cb
.
data
().
exposeValue
(
"blocks"
,
blocks
);
cb
();
// check for equivalence
for
(
auto
blockIt
=
blocks
->
begin
();
blockIt
!=
blocks
->
end
();
++
blockIt
)
{
...
...
@@ -95,20 +95,24 @@ int main( int argc, char ** argv )
auto
vec3Field
=
blockIt
->
getData
<
GhostLayerField
<
Vector3
<
int
>
,
1
>
>
(
vec3FieldID
);
{
WALBERLA_FOR_ALL_CELLS
(
scaIt
,
sca2Field
,
vecIt
,
vec2Field
,
WALBERLA_ASSERT_EQUAL
(
scaIt
[
0
],
(
*
vecIt
)[
0
]);
WALBERLA_ASSERT_EQUAL
(
scaIt
[
1
],
(
*
vecIt
)[
1
]);
)
}
{
WALBERLA_FOR_ALL_CELLS
(
scaIt
,
sca3Field
,
vecIt
,
vec3Field
,
WALBERLA_ASSERT_EQUAL
(
scaIt
[
0
],
(
*
vecIt
)[
0
]);
WALBERLA_ASSERT_EQUAL
(
scaIt
[
1
],
(
*
vecIt
)[
1
]);
WALBERLA_ASSERT_EQUAL
(
scaIt
[
2
],
(
*
vecIt
)[
2
]);
)
for
(
cell_idx_t
z
=
0
;
z
<
cell_idx_c
(
sca2Field
->
zSize
());
++
z
)
for
(
cell_idx_t
y
=
0
;
y
<
cell_idx_c
(
sca2Field
->
zSize
());
++
y
)
for
(
cell_idx_t
x
=
0
;
x
<
cell_idx_c
(
sca2Field
->
zSize
());
++
x
)
{
WALBERLA_CHECK_EQUAL
(
sca2Field
->
get
(
x
,
y
,
z
,
0
),
vec2Field
->
get
(
x
,
y
,
z
)[
0
]
);
WALBERLA_CHECK_EQUAL
(
sca2Field
->
get
(
x
,
y
,
z
,
1
),
vec2Field
->
get
(
x
,
y
,
z
)[
1
]
);
}
for
(
cell_idx_t
z
=
0
;
z
<
cell_idx_c
(
sca3Field
->
zSize
());
++
z
)
for
(
cell_idx_t
y
=
0
;
y
<
cell_idx_c
(
sca3Field
->
zSize
());
++
y
)
for
(
cell_idx_t
x
=
0
;
x
<
cell_idx_c
(
sca3Field
->
zSize
());
++
x
)
{
WALBERLA_CHECK_EQUAL
(
sca3Field
->
get
(
x
,
y
,
z
,
0
),
vec3Field
->
get
(
x
,
y
,
z
)[
0
]
);
WALBERLA_CHECK_EQUAL
(
sca3Field
->
get
(
x
,
y
,
z
,
1
),
vec3Field
->
get
(
x
,
y
,
z
)[
1
]
);
WALBERLA_CHECK_EQUAL
(
sca3Field
->
get
(
x
,
y
,
z
,
2
),
vec3Field
->
get
(
x
,
y
,
z
)[
2
]
);
}
}
}
return
0
;
}
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