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
ca609faf
Commit
ca609faf
authored
4 years ago
by
Helen Schottenhamml
Browse files
Options
Downloads
Patches
Plain Diff
Custom floating point precision for boundary conditions.
parent
7df9ca58
No related branches found
No related tags found
1 merge request
!69
Custom floating point precision for boundary conditions.
Pipeline
#31118
passed
4 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lbmpy/boundaries/boundaryconditions.py
+7
-4
7 additions, 4 deletions
lbmpy/boundaries/boundaryconditions.py
with
7 additions
and
4 deletions
lbmpy/boundaries/boundaryconditions.py
+
7
−
4
View file @
ca609faf
...
@@ -125,7 +125,7 @@ class UBB(LbBoundary):
...
@@ -125,7 +125,7 @@ class UBB(LbBoundary):
name: optional name of the boundary.
name: optional name of the boundary.
"""
"""
def
__init__
(
self
,
velocity
,
adapt_velocity_to_force
=
False
,
dim
=
None
,
name
=
None
):
def
__init__
(
self
,
velocity
,
adapt_velocity_to_force
=
False
,
dim
=
None
,
name
=
None
,
data_type
=
'
double
'
):
super
(
UBB
,
self
).
__init__
(
name
)
super
(
UBB
,
self
).
__init__
(
name
)
self
.
_velocity
=
velocity
self
.
_velocity
=
velocity
self
.
_adaptVelocityToForce
=
adapt_velocity_to_force
self
.
_adaptVelocityToForce
=
adapt_velocity_to_force
...
@@ -134,13 +134,14 @@ class UBB(LbBoundary):
...
@@ -134,13 +134,14 @@ class UBB(LbBoundary):
elif
not
callable
(
self
.
_velocity
):
elif
not
callable
(
self
.
_velocity
):
dim
=
len
(
velocity
)
dim
=
len
(
velocity
)
self
.
dim
=
dim
self
.
dim
=
dim
self
.
data_type
=
data_type
@property
@property
def
additional_data
(
self
):
def
additional_data
(
self
):
"""
In case of the UBB boundary additional data is a velocity vector. This vector is added to each cell to
"""
In case of the UBB boundary additional data is a velocity vector. This vector is added to each cell to
realize velocity profiles for the inlet.
"""
realize velocity profiles for the inlet.
"""
if
self
.
velocity_is_callable
:
if
self
.
velocity_is_callable
:
return
[(
'
vel_%d
'
%
(
i
,),
create_type
(
"
double
"
))
for
i
in
range
(
self
.
dim
)]
return
[(
'
vel_%d
'
%
(
i
,),
create_type
(
self
.
data_type
))
for
i
in
range
(
self
.
dim
)]
else
:
else
:
return
[]
return
[]
...
@@ -291,7 +292,9 @@ class ExtrapolationOutflow(LbBoundary):
...
@@ -291,7 +292,9 @@ class ExtrapolationOutflow(LbBoundary):
def
__init__
(
self
,
normal_direction
,
lb_method
,
dt
=
1
,
dx
=
1
,
name
=
None
,
def
__init__
(
self
,
normal_direction
,
lb_method
,
dt
=
1
,
dx
=
1
,
name
=
None
,
streaming_pattern
=
'
pull
'
,
zeroth_timestep
=
Timestep
.
BOTH
,
streaming_pattern
=
'
pull
'
,
zeroth_timestep
=
Timestep
.
BOTH
,
initial_density
=
None
,
initial_velocity
=
None
):
initial_density
=
None
,
initial_velocity
=
None
,
data_type
=
'
double
'
):
self
.
data_type
=
data_type
self
.
lb_method
=
lb_method
self
.
lb_method
=
lb_method
self
.
stencil
=
lb_method
.
stencil
self
.
stencil
=
lb_method
.
stencil
...
@@ -359,7 +362,7 @@ class ExtrapolationOutflow(LbBoundary):
...
@@ -359,7 +362,7 @@ class ExtrapolationOutflow(LbBoundary):
def
additional_data
(
self
):
def
additional_data
(
self
):
"""
Used internally only. For the ExtrapolationOutflow information of the previous PDF values is needed. This
"""
Used internally only. For the ExtrapolationOutflow information of the previous PDF values is needed. This
information is stored in the index vector.
"""
information is stored in the index vector.
"""
data
=
[(
'
pdf
'
,
create_type
(
"
double
"
)),
(
'
pdf_nd
'
,
create_type
(
"
double
"
))]
data
=
[(
'
pdf
'
,
create_type
(
self
.
data_type
)),
(
'
pdf_nd
'
,
create_type
(
self
.
data_type
))]
return
data
return
data
@property
@property
...
...
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