Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Markus Holzer
lbmpy
Commits
c21c12b8
Commit
c21c12b8
authored
May 06, 2021
by
Markus Holzer
Browse files
Adapted corrections
parent
69ab9e8c
Pipeline
#31952
passed with stage
in 14 minutes and 25 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lbmpy/updatekernels.py
View file @
c21c12b8
import
numpy
as
np
import
sympy
as
sp
import
warnings
from
lbmpy.fieldaccess
import
StreamPullTwoFieldsAccessor
from
lbmpy.methods.abstractlbmethod
import
LbmCollisionRule
...
...
@@ -58,9 +59,23 @@ def create_stream_only_kernel(stencil, numpy_arr=None, src_field_name="src", dst
generic_layout
=
'numpy'
,
generic_field_type
=
np
.
float64
,
accessor
=
None
):
"""Creates a stream kernel, without collision.
For parameters see function ``create_stream_pull_collide_kernel``
Args:
stencil: lattice Boltzmann stencil which is used
numpy_arr: numpy array which containes the pdf field data. If no numpy array is provided the symbolic field
accesses are created with 'Field.create_generic'. Otherwise 'Field.create_from_numpy_array' is used.
src_field_name: name of the source field.
dst_field_name: name of the destination field.
generic_layout: data layout. for example 'fzyx' of 'zyxf'.
generic_field_type: field data type.
accessor: Field accessor which is used to create the update rule. See 'fieldaccess.PdfFieldAccessor'
Returns:
AssignmentCollection of the stream only update rule
"""
if
accessor
is
None
:
accessor
=
StreamPullTwoFieldsAccessor
()
dim
=
len
(
stencil
[
0
])
if
numpy_arr
is
None
:
src
=
Field
.
create_generic
(
src_field_name
,
dim
,
index_shape
=
(
len
(
stencil
),),
...
...
@@ -81,6 +96,8 @@ def create_stream_pull_only_kernel(stencil, numpy_arr=None, src_field_name="src"
For parameters see function ``create_stream_pull_collide_kernel``
"""
warnings
.
warn
(
"This function is depricated. Please use create_stream_only_kernel. If no PdfFieldAccessor is "
"provided to this function a standard StreamPullTwoFieldsAccessor is used "
,
DeprecationWarning
)
return
create_stream_only_kernel
(
stencil
,
numpy_arr
=
numpy_arr
,
src_field_name
=
src_field_name
,
dst_field_name
=
dst_field_name
,
generic_layout
=
generic_layout
,
generic_field_type
=
generic_field_type
,
accessor
=
StreamPullTwoFieldsAccessor
())
...
...
lbmpy_tests/phasefield/test_phasefield.py
View file @
c21c12b8
...
...
@@ -88,7 +88,7 @@ def test_neumann_angle():
sc
.
run
(
10000
)
angles
=
liquid_lens_neumann_angles
(
sc
.
concentration
[:,
:,
:])
assert
sum
(
angles
)
==
360
np
.
testing
.
assert_almost_equal
(
sum
(
angles
)
,
360
)
analytic_angles
=
analytic_neumann_angles
([
0.01
,
0.02
,
kappa3
])
for
ref
,
simulated
in
zip
(
analytic_angles
,
angles
):
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment