Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Markus Holzer
waLBerla
Commits
f65bfb0b
Commit
f65bfb0b
authored
May 20, 2022
by
Markus Holzer
Browse files
testing
parent
8a565966
Pipeline
#40102
failed with stages
in 16 minutes and 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
python/waLBerla_tests/test_blockforest.py
View file @
f65bfb0b
...
@@ -26,12 +26,12 @@ class BlockforestModuleTest(unittest.TestCase):
...
@@ -26,12 +26,12 @@ class BlockforestModuleTest(unittest.TestCase):
blocks
=
createUniformBlockGrid
(
blocks
=
(
1
,
1
,
1
),
cellsPerBlock
=
(
2
,
2
,
2
))
blocks
=
createUniformBlockGrid
(
blocks
=
(
1
,
1
,
1
),
cellsPerBlock
=
(
2
,
2
,
2
))
field
.
addToStorage
(
blocks
,
"TestField"
,
np
.
int64
)
field
.
addToStorage
(
blocks
,
"TestField"
,
np
.
int64
)
npf
=
field
.
toArray
(
blocks
[
0
][
"TestField"
])
npf
=
field
.
toArray
(
blocks
[
0
][
"TestField"
])
npf
[:,
:,
:]
=
42
.0
npf
[:,
:,
:]
=
42
del
blocks
del
blocks
# create another block structure - this has triggered segfault
# create another block structure - this has triggered segfault
# when previous blockstructure was already freed
# when previous blockstructure was already freed
blocks
=
createUniformBlockGrid
(
blocks
=
(
1
,
1
,
1
),
cellsPerBlock
=
(
2
,
2
,
2
))
# noqa: F841
blocks
=
createUniformBlockGrid
(
blocks
=
(
1
,
1
,
1
),
cellsPerBlock
=
(
2
,
2
,
2
))
# noqa: F841
self
.
assertEqual
(
npf
[
0
,
0
,
0
],
42
.0
)
self
.
assertEqual
(
npf
[
0
,
0
,
0
],
42
)
def
testMemoryManagement3
(
self
):
def
testMemoryManagement3
(
self
):
"""Same as testMemoryManagement2, but with iterators"""
"""Same as testMemoryManagement2, but with iterators"""
...
@@ -42,10 +42,10 @@ class BlockforestModuleTest(unittest.TestCase):
...
@@ -42,10 +42,10 @@ class BlockforestModuleTest(unittest.TestCase):
if
name
==
"TestField"
:
if
name
==
"TestField"
:
f
=
block
[
name
]
f
=
block
[
name
]
npf
=
field
.
toArray
(
f
)
npf
=
field
.
toArray
(
f
)
npf
[:,
:,
:]
=
42
.0
npf
[:,
:,
:]
=
42
del
blocks
,
block
,
name
,
f
del
blocks
,
block
,
name
,
f
blocks
=
createUniformBlockGrid
(
blocks
=
(
1
,
1
,
1
),
cellsPerBlock
=
(
2
,
2
,
2
))
# noqa: F841
blocks
=
createUniformBlockGrid
(
blocks
=
(
1
,
1
,
1
),
cellsPerBlock
=
(
2
,
2
,
2
))
# noqa: F841
self
.
assertEqual
(
npf
[
0
,
0
,
0
],
42
.0
)
self
.
assertEqual
(
npf
[
0
,
0
,
0
],
42
)
def
testExceptions
(
self
):
def
testExceptions
(
self
):
"""Check that the right exceptions are thrown when nonexistent or non-convertible fields are accessed"""
"""Check that the right exceptions are thrown when nonexistent or non-convertible fields are accessed"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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