Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Frederik Hennig
waLBerla
Commits
1cd917f0
Commit
1cd917f0
authored
Jul 18, 2020
by
Markus Holzer
Browse files
Fixed waLBerla init
parent
8d12e04e
Changes
1
Hide whitespace changes
Inline
Side-by-side
python/waLBerla/__init__.py
View file @
1cd917f0
...
...
@@ -5,12 +5,12 @@ from .callbacks import memberCallback as member_callback # noqa:F401
import
sys
try
:
from
.walberla_cpp
import
field
,
cuda
,
geometry
,
lbm
,
postprocessing
,
timeloop
,
mpi
from
.walberla_cpp
import
*
# noqa: F403
cpp_available
=
True
except
ImportError
:
try
:
from
walberla_cpp
import
field
,
cuda
,
geometry
,
lbm
,
postprocessing
,
timeloop
,
mpi
from
walberla_cpp
import
*
# noqa: F403
cpp_available
=
True
except
ImportError
:
...
...
@@ -38,29 +38,29 @@ if cpp_available:
if
'field'
in
globals
():
# check if field was exported
# Update modules dict to be able to write e.g. from waLBerla import field
# otherwise "field" would only be a scope not a module
sys
.
modules
[
__name__
+
'.field'
]
=
field
sys
.
modules
[
__name__
+
'.field'
]
=
field
# noqa: F405
# extend the C++ module with some python functions
from
.field_extension
import
extend
as
extend_field
extend_field
(
field
)
extend_field
(
field
)
# noqa: F405
if
'cuda'
in
globals
():
sys
.
modules
[
__name__
+
'.cuda'
]
=
cuda
sys
.
modules
[
__name__
+
'.cuda'
]
=
cuda
# noqa: F405
from
.cuda_extension
import
extend
as
extend_cuda
extend_cuda
(
cuda
)
extend_cuda
(
cuda
)
# noqa: F405
if
'geometry'
in
globals
():
sys
.
modules
[
__name__
+
'.geometry'
]
=
geometry
sys
.
modules
[
__name__
+
'.geometry'
]
=
geometry
# noqa: F405
if
'lbm'
in
globals
():
sys
.
modules
[
__name__
+
'.lbm'
]
=
lbm
sys
.
modules
[
__name__
+
'.lbm'
]
=
lbm
# noqa: F405
if
'postprocessing'
in
globals
():
sys
.
modules
[
__name__
+
'postprocessing'
]
=
postprocessing
sys
.
modules
[
__name__
+
'postprocessing'
]
=
postprocessing
# noqa: F405
if
'mpi'
in
globals
():
sys
.
modules
[
__name__
+
'.mpi'
]
=
mpi
sys
.
modules
[
__name__
+
'.mpi'
]
=
mpi
# noqa: F405
if
'timeloop'
in
globals
():
sys
.
modules
[
__name__
+
'.timeloop'
]
=
timeloop
sys
.
modules
[
__name__
+
'.timeloop'
]
=
timeloop
# noqa: F405
from
.timeloop_extension
import
extend
as
extend_timeloop
extend_timeloop
(
timeloop
)
extend_timeloop
(
timeloop
)
# noqa: F405
else
:
class
Dummy
:
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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