Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pycodegen
lbmpy
Commits
799589c6
Commit
799589c6
authored
Jan 17, 2021
by
Markus Holzer
Browse files
test with init ghost layer
parent
ac29539a
Changes
1
Hide whitespace changes
Inline
Side-by-side
doc/notebooks/09_tutorial_lees-edwards.ipynb
View file @
799589c6
...
...
@@ -150,14 +150,14 @@
%% Cell type:code id: tags:
```
python
def
init
():
dh
.
fill
(
rho
.
name
,
1.0
)
dh
.
fill
(
rho
.
name
,
1.0
,
ghost_layers
=
True
)
dh
.
run_kernel
(
init_kernel
)
dh
.
fill
(
u
.
name
,
0.0
)
dh
.
fill
(
F
.
name
,
0.0
)
dh
.
fill
(
u
.
name
,
0.0
,
ghost_layers
=
True
)
dh
.
fill
(
F
.
name
,
0.0
,
ghost_layers
=
True
)
```
%% Cell type:markdown id: tags:
## Interpolation
...
...
@@ -313,11 +313,11 @@
# decimal=5)
```
%%%% Output: execute_result
<matplotlib.legend.Legend at 0x7f3
0b431bac
0>
<matplotlib.legend.Legend at 0x7f3
4da6d5e8
0>
%%%% Output: display_data

...
...
@@ -341,14 +341,14 @@
dh
.
swap
(
src
.
name
,
dst
.
name
)
dh
.
all_to_cpu
()
def
init_2
():
dh
.
fill
(
rho
.
name
,
1.
)
dh
.
fill
(
rho
.
name
,
1.
0
,
ghost_layers
=
True
)
dh
.
run_kernel
(
init_kernel
)
dh
.
fill
(
u
.
name
,
0.0
)
dh
.
fill
(
F
.
name
,
0.0
)
dh
.
fill
(
u
.
name
,
0.0
,
ghost_layers
=
True
)
dh
.
fill
(
F
.
name
,
0.0
,
ghost_layers
=
True
)
dh
.
cpu_arrays
[
F
.
name
][
N
//
3
,
1
,
:]
=
[
1e-2
,
-
1e-1
]
```
%% Cell type:markdown id: tags:
...
...
@@ -418,24 +418,30 @@

%% Cell type:code id: tags:
```
python
np
.
linalg
.
norm
(
dh
.
gather_array
(
u
.
name
))
```
%%%% Output: execute_result

$\displaystyle 1340.02348386776$
1340.0234838677563
%% Cell type:code id: tags:
```
python
np
.
testing
.
assert_array_almost_equal
(
np
.
linalg
.
norm
(
dh
.
gather_array
(
u
.
name
)),
1209.89231204
)
```
%%%% Output: error
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-2
2
-f2f5dd901784> in <module>
<ipython-input-2
3
-f2f5dd901784> in <module>
----> 1 np.testing.assert_array_almost_equal(np.linalg.norm(dh.gather_array(u.name)), 1209.89231204)
[... skipping hidden 2 frame]
AssertionError:
Arrays are not almost equal to 6 decimals
...
...
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