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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
lbmpy
Commits
f927a48f
Commit
f927a48f
authored
2 years ago
by
Markus Holzer
Browse files
Options
Downloads
Patches
Plain Diff
sanity check for normal directions
parent
ed6cae82
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!137
Sanity checks for normal directions
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lbmpy/boundaries/boundaryconditions.py
+10
-3
10 additions, 3 deletions
lbmpy/boundaries/boundaryconditions.py
with
10 additions
and
3 deletions
lbmpy/boundaries/boundaryconditions.py
+
10
−
3
View file @
f927a48f
...
@@ -140,7 +140,10 @@ class FreeSlip(LbBoundary):
...
@@ -140,7 +140,10 @@ class FreeSlip(LbBoundary):
"
the normal direction is not defined for this class
"
)
"
the normal direction is not defined for this class
"
)
if
normal_direction
:
if
normal_direction
:
self
.
mirror_axis
=
normal_direction
.
index
(
*
[
dir
for
dir
in
normal_direction
if
dir
!=
0
])
normal_direction
=
tuple
([
int
(
n
)
for
n
in
normal_direction
])
assert
all
([
n
in
[
-
1
,
0
,
1
]
for
n
in
normal_direction
]),
\
"
Only -1, 0 and 1 allowed for defining the normal direction
"
self
.
mirror_axis
=
normal_direction
.
index
(
*
[
d
for
d
in
normal_direction
if
d
!=
0
])
self
.
normal_direction
=
normal_direction
self
.
normal_direction
=
normal_direction
self
.
dim
=
len
(
stencil
[
0
])
self
.
dim
=
len
(
stencil
[
0
])
...
@@ -369,7 +372,9 @@ class SimpleExtrapolationOutflow(LbBoundary):
...
@@ -369,7 +372,9 @@ class SimpleExtrapolationOutflow(LbBoundary):
if
name
is
None
:
if
name
is
None
:
name
=
f
"
Simple Outflow:
{
offset_to_direction_string
(
normal_direction
)
}
"
name
=
f
"
Simple Outflow:
{
offset_to_direction_string
(
normal_direction
)
}
"
self
.
normal_direction
=
normal_direction
self
.
normal_direction
=
tuple
([
int
(
n
)
for
n
in
normal_direction
])
assert
all
([
n
in
[
-
1
,
0
,
1
]
for
n
in
self
.
normal_direction
]),
\
"
Only -1, 0 and 1 allowed for defining the normal direction
"
super
(
SimpleExtrapolationOutflow
,
self
).
__init__
(
name
)
super
(
SimpleExtrapolationOutflow
,
self
).
__init__
(
name
)
def
get_additional_code_nodes
(
self
,
lb_method
):
def
get_additional_code_nodes
(
self
,
lb_method
):
...
@@ -436,7 +441,9 @@ class ExtrapolationOutflow(LbBoundary):
...
@@ -436,7 +441,9 @@ class ExtrapolationOutflow(LbBoundary):
if
name
is
None
:
if
name
is
None
:
name
=
f
"
Outflow:
{
offset_to_direction_string
(
normal_direction
)
}
"
name
=
f
"
Outflow:
{
offset_to_direction_string
(
normal_direction
)
}
"
self
.
normal_direction
=
normal_direction
self
.
normal_direction
=
tuple
([
int
(
n
)
for
n
in
normal_direction
])
assert
all
([
n
in
[
-
1
,
0
,
1
]
for
n
in
self
.
normal_direction
]),
\
"
Only -1, 0 and 1 allowed for defining the normal direction
"
self
.
streaming_pattern
=
streaming_pattern
self
.
streaming_pattern
=
streaming_pattern
self
.
zeroth_timestep
=
zeroth_timestep
self
.
zeroth_timestep
=
zeroth_timestep
self
.
dx
=
sp
.
Number
(
dx
)
self
.
dx
=
sp
.
Number
(
dx
)
...
...
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