Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lbmpy
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
lbmpy
Commits
d661f1e3
Commit
d661f1e3
authored
Mar 1, 2022
by
Markus Holzer
Browse files
Options
Downloads
Patches
Plain Diff
Try to fix FreeSlip
parent
5ab99291
No related branches found
No related tags found
1 merge request
!115
Fix FreeSlip boundary condition
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lbmpy/advanced_streaming/indexing.py
+4
-4
4 additions, 4 deletions
lbmpy/advanced_streaming/indexing.py
lbmpy/boundaries/boundaryconditions.py
+7
-5
7 additions, 5 deletions
lbmpy/boundaries/boundaryconditions.py
with
11 additions
and
9 deletions
lbmpy/advanced_streaming/indexing.py
+
4
−
4
View file @
d661f1e3
...
...
@@ -88,10 +88,10 @@ class BetweenTimestepsIndexing:
if
(
f_dir
,
inverse
)
in
self
.
_trivial_offset_translations
:
offsets
=
(
0
,
)
*
self
.
_dim
el
if
f_dir
==
'
in
'
:
offset_array_symbols
=
self
.
_offset_array_symbols
(
f_dir
,
Tru
e
)
offsets
=
tuple
(
sp
.
IndexedBase
(
s
,
shape
=
(
1
,))[
self
.
dir_symbol
]
for
s
in
offset_array_symbols
)
self
.
_required_offset_arrays
.
add
((
f_dir
,
Tru
e
))
el
se
:
offset_array_symbols
=
self
.
_offset_array_symbols
(
f_dir
,
invers
e
)
offsets
=
tuple
(
sp
.
IndexedBase
(
s
,
shape
=
(
1
,))[
index
]
for
s
in
offset_array_symbols
)
self
.
_required_offset_arrays
.
add
((
f_dir
,
invers
e
))
return
{
'
index
'
:
translated_index
,
'
offsets
'
:
offsets
}
...
...
This diff is collapsed.
Click to expand it.
lbmpy/boundaries/boundaryconditions.py
+
7
−
5
View file @
d661f1e3
...
...
@@ -208,24 +208,26 @@ class FreeSlip(LbBoundary):
def
get_additional_code_nodes
(
self
,
lb_method
):
if
self
.
normal_direction
:
return
[
MirroredStencilDirections
(
self
.
stencil
,
self
.
mirror_axis
)]
return
[
MirroredStencilDirections
(
self
.
stencil
,
self
.
mirror_axis
)
,
NeighbourOffsetArrays
(
lb_method
.
stencil
)
]
else
:
return
[]
return
[
NeighbourOffsetArrays
(
lb_method
.
stencil
)
]
def
__call__
(
self
,
f_out
,
f_in
,
dir_symbol
,
inv_dir
,
lb_method
,
index_field
):
neighbor_offset
=
NeighbourOffsetArrays
.
neighbour_offset
(
dir_symbol
,
lb_method
.
stencil
)
if
self
.
normal_direction
:
normal_direction
=
self
.
normal_direction
tangential_offset
=
tuple
(
offset
-
normal
for
offset
,
normal
in
zip
(
neighbor_offset
,
self
.
normal_direction
))
mirrored_stencil_symbol
=
MirroredStencilDirections
.
_mirrored_symbol
(
self
.
mirror_axis
)
mirrored_direction
=
inv_dir
[
sp
.
IndexedBase
(
mirrored_stencil_symbol
,
shape
=
(
1
,))[
dir_symbol
]
]
mirrored_direction
=
sp
.
IndexedBase
(
mirrored_stencil_symbol
,
shape
=
(
1
,))[
dir_symbol
]
else
:
normal_direction
=
list
()
for
i
,
cell_name
in
zip
(
range
(
self
.
dim
),
self
.
additional_data
):
normal_direction
.
append
(
index_field
[
0
](
cell_name
[
0
]))
normal_direction
=
tuple
(
normal_direction
)
tangential_offset
=
tuple
(
offset
-
normal
for
offset
,
normal
in
zip
(
neighbor_offset
,
normal_direction
))
mirrored_direction
=
index_field
[
0
](
'
ref_dir
'
)
return
Assignment
(
f_in
(
inv_dir
[
dir_symbol
]),
f_
in
[
normal_direction
](
mirrored_direction
))
return
Assignment
(
f_in
.
center
(
inv_dir
[
dir_symbol
]),
f_
out
[
tangential_offset
](
mirrored_direction
))
# end class FreeSlip
...
...
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
sign in
to comment