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
ec7ebd18
Commit
ec7ebd18
authored
Nov 07, 2017
by
Martin Bauer
Browse files
Workaround for bug in joblib caching
see
https://github.com/joblib/joblib/pull/568
parent
baf5399f
Changes
1
Hide whitespace changes
Inline
Side-by-side
methods/momentbased.py
View file @
ec7ebd18
import
sympy
as
sp
from
collections
import
OrderedDict
,
Sequence
from
collections
import
OrderedDict
from
lbmpy.methods.abstractlbmethod
import
AbstractLbMethod
,
LbmCollisionRule
,
RelaxationInfo
from
lbmpy.methods.conservedquantitycomputation
import
AbstractConservedQuantityComputation
...
...
@@ -32,16 +32,6 @@ class MomentBasedLbMethod(AbstractLbMethod):
self
.
_conservedQuantityComputation
=
conservedQuantityComputation
self
.
_weights
=
None
equilibriumMoments
=
[]
for
moment
,
relaxInfo
in
momentToRelaxationInfoDict
.
items
():
equilibriumMoments
.
append
(
relaxInfo
.
equilibriumValue
)
conservedQuantities
=
set
()
for
v
in
self
.
_conservedQuantityComputation
.
definedSymbols
().
values
():
if
isinstance
(
v
,
Sequence
):
conservedQuantities
.
update
(
v
)
else
:
conservedQuantities
.
add
(
v
)
@
property
def
forceModel
(
self
):
return
self
.
_forceModel
...
...
@@ -126,6 +116,11 @@ class MomentBasedLbMethod(AbstractLbMethod):
def
momentMatrix
(
self
):
return
momentMatrix
(
self
.
moments
,
self
.
stencil
)
def
__getstate__
(
self
):
# Workaround for a bug in joblib
self
.
_momentToRelaxationInfoDictToPickle
=
[
i
for
i
in
self
.
_momentToRelaxationInfoDict
.
items
()]
return
self
.
__dict__
def
_repr_html_
(
self
):
table
=
"""
<table style="border:none; width: 100%">
...
...
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