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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Alexander Reinauer
lbmpy
Commits
16a284a6
Commit
16a284a6
authored
6 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
SerialDataHandling now also supports arbitrary tensor fields
parent
160123f5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
boundaries/boundaryconditions.py
+18
-14
18 additions, 14 deletions
boundaries/boundaryconditions.py
phasefield/kerneleqs.py
+1
-1
1 addition, 1 deletion
phasefield/kerneleqs.py
with
19 additions
and
15 deletions
boundaries/boundaryconditions.py
+
18
−
14
View file @
16a284a6
...
@@ -20,15 +20,19 @@ class Boundary:
...
@@ -20,15 +20,19 @@ class Boundary:
"""
"""
This function defines the boundary behavior and must therefore be implemented by all boundaries.
This function defines the boundary behavior and must therefore be implemented by all boundaries.
Here the boundary is defined as a list of sympy equations, from which a boundary kernel is generated.
Here the boundary is defined as a list of sympy equations, from which a boundary kernel is generated.
:param pdf_field: pystencils field describing the pdf. The current cell is cell next to the boundary,
which is influenced by the boundary cell i.e. has a link from the boundary cell to
Args:
itself.
pdf_field: pystencils field describing the pdf. The current cell is cell next to the boundary,
:param direction_symbol: a sympy symbol that can be used as index to the pdf_field. It describes
which is influenced by the boundary cell i.e. has a link from the boundary cell to
the direction pointing from the fluid to the boundary cell
itself.
:param lb_method: an instance of the LB method used. Use this to adapt the boundary to the method
direction_symbol: a sympy symbol that can be used as index to the pdf_field. It describes
(e.g. compressibility)
the direction pointing from the fluid to the boundary cell
:param index_field: the boundary index field that can be used to retrieve and update boundary data
lb_method: an instance of the LB method used. Use this to adapt the boundary to the method
:return: list of sympy equations
(e.g. compressibility)
index_field: the boundary index field that can be used to retrieve and update boundary data
Returns:
:return: list of sympy equations
"""
"""
raise
NotImplementedError
(
"
Boundary class has to overwrite __call__
"
)
raise
NotImplementedError
(
"
Boundary class has to overwrite __call__
"
)
...
@@ -84,11 +88,11 @@ class UBB(Boundary):
...
@@ -84,11 +88,11 @@ class UBB(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
):
"""
"""
Args:
:param
velocity: can either be a constant, an access into a field, or a callback function.
velocity: can either be a constant, an access into a field, or a callback function.
The callback functions gets a numpy record array with members,
'
x
'
,
'
y
'
,
'
z
'
,
'
dir
'
(direction)
The callback functions gets a numpy record array with members,
'
x
'
,
'
y
'
,
'
z
'
,
'
dir
'
(direction)
and
'
velocity
'
which has to be set to the desired velocity of the corresponding link
and
'
velocity
'
which has to be set to the desired velocity of the corresponding link
:param
adapt_velocity_to_force:
adapt_velocity_to_force:
"""
"""
super
(
UBB
,
self
).
__init__
(
name
)
super
(
UBB
,
self
).
__init__
(
name
)
self
.
_velocity
=
velocity
self
.
_velocity
=
velocity
...
...
This diff is collapsed.
Click to expand it.
phasefield/kerneleqs.py
+
1
−
1
View file @
16a284a6
...
@@ -99,7 +99,7 @@ class CahnHilliardFDStep:
...
@@ -99,7 +99,7 @@ class CahnHilliardFDStep:
self
.
phi_field
=
self
.
data_handling
.
fields
[
phi_field_name
]
self
.
phi_field
=
self
.
data_handling
.
fields
[
phi_field_name
]
self
.
tmp_field
=
self
.
data_handling
.
add_array_like
(
name
+
'
_tmp
'
,
phi_field_name
,
latex_name
=
'
tmp
'
)
self
.
tmp_field
=
self
.
data_handling
.
add_array_like
(
name
+
'
_tmp
'
,
phi_field_name
,
latex_name
=
'
tmp
'
)
num_phases
=
self
.
data_handling
.
values_per_cell
(
phi_field_name
)
num_phases
=
self
.
phi_field
.
index_shape
[
0
]
if
not
hasattr
(
mobilities
,
'
__len__
'
):
if
not
hasattr
(
mobilities
,
'
__len__
'
):
mobilities
=
[
mobilities
]
*
num_phases
mobilities
=
[
mobilities
]
*
num_phases
...
...
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