Skip to content
Snippets Groups Projects
Commit 1cd917f0 authored by Markus Holzer's avatar Markus Holzer
Browse files

Fixed waLBerla init

parent 8d12e04e
Branches
Tags
No related merge requests found
...@@ -5,12 +5,12 @@ from .callbacks import memberCallback as member_callback # noqa:F401 ...@@ -5,12 +5,12 @@ from .callbacks import memberCallback as member_callback # noqa:F401
import sys import sys
try: try:
from .walberla_cpp import field, cuda, geometry, lbm, postprocessing, timeloop, mpi from .walberla_cpp import * # noqa: F403
cpp_available = True cpp_available = True
except ImportError: except ImportError:
try: try:
from walberla_cpp import field, cuda, geometry, lbm, postprocessing, timeloop, mpi from walberla_cpp import * # noqa: F403
cpp_available = True cpp_available = True
except ImportError: except ImportError:
...@@ -38,29 +38,29 @@ if cpp_available: ...@@ -38,29 +38,29 @@ if cpp_available:
if 'field' in globals(): # check if field was exported if 'field' in globals(): # check if field was exported
# Update modules dict to be able to write e.g. from waLBerla import field # Update modules dict to be able to write e.g. from waLBerla import field
# otherwise "field" would only be a scope not a module # 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 # extend the C++ module with some python functions
from .field_extension import extend as extend_field from .field_extension import extend as extend_field
extend_field(field) extend_field(field) # noqa: F405
if 'cuda' in globals(): if 'cuda' in globals():
sys.modules[__name__ + '.cuda'] = cuda sys.modules[__name__ + '.cuda'] = cuda # noqa: F405
from .cuda_extension import extend as extend_cuda from .cuda_extension import extend as extend_cuda
extend_cuda(cuda) extend_cuda(cuda) # noqa: F405
if 'geometry' in globals(): if 'geometry' in globals():
sys.modules[__name__ + '.geometry'] = geometry sys.modules[__name__ + '.geometry'] = geometry # noqa: F405
if 'lbm' in globals(): if 'lbm' in globals():
sys.modules[__name__ + '.lbm'] = lbm sys.modules[__name__ + '.lbm'] = lbm # noqa: F405
if 'postprocessing' in globals(): if 'postprocessing' in globals():
sys.modules[__name__ + 'postprocessing'] = postprocessing sys.modules[__name__ + 'postprocessing'] = postprocessing # noqa: F405
if 'mpi' in globals(): if 'mpi' in globals():
sys.modules[__name__ + '.mpi'] = mpi sys.modules[__name__ + '.mpi'] = mpi # noqa: F405
if 'timeloop' in globals(): if 'timeloop' in globals():
sys.modules[__name__ + '.timeloop'] = timeloop sys.modules[__name__ + '.timeloop'] = timeloop # noqa: F405
from .timeloop_extension import extend as extend_timeloop from .timeloop_extension import extend as extend_timeloop
extend_timeloop(timeloop) extend_timeloop(timeloop) # noqa: F405
else: else:
class Dummy: class Dummy:
pass pass
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment