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
d396d847
Commit
d396d847
authored
7 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
sympy 1.1 compatibility
parent
605d25c2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
boundaries/boundaryconditions.py
+11
-1
11 additions, 1 deletion
boundaries/boundaryconditions.py
with
11 additions
and
1 deletion
boundaries/boundaryconditions.py
+
11
−
1
View file @
d396d847
import
sympy
as
sp
from
lbmpy.simplificationfactory
import
createSimplificationStrategy
from
pystencils.astnodes
import
SympyAssignment
from
pystencils.sympyextensions
import
getSymmetricPart
from
pystencils
import
Field
from
lbmpy.boundaries.boundary_kernel
import
offsetFromDir
,
weightOfDirection
,
invDir
...
...
@@ -159,7 +160,9 @@ class FixedDensity(Boundary):
subExprs
=
[
sp
.
Eq
(
eq
.
lhs
,
transformedDensity
if
eq
.
lhs
==
densitySymbol
else
eq
.
rhs
)
for
eq
in
symmetricEq
.
subexpressions
]
return
subExprs
+
[
sp
.
Eq
(
pdfField
[
neighbor
](
inverseDir
),
2
*
eq_component
-
pdfField
(
directionSymbol
))]
return
subExprs
+
[
SympyAssignment
(
pdfField
[
neighbor
](
inverseDir
),
2
*
eq_component
-
pdfField
(
directionSymbol
))]
class
NeumannByCopy
(
Boundary
):
...
...
@@ -173,3 +176,10 @@ class NeumannByCopy(Boundary):
def
__eq__
(
self
,
other
):
return
type
(
other
)
==
NeumannByCopy
if
__name__
==
'
__main__
'
:
from
lbmpy.scenarios
import
*
sc
=
createForceDrivenChannel
(
domainSize
=
[
60
,
30
])
sc
.
boundaryHandling
.
setBoundary
(
FixedDensity
(
1.01
),
makeSlice
[
0.2
:
0.25
,
:])
sc
.
boundaryHandling
.
prepare
()
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