Commit 1cd917f0 authored by Markus Holzer's avatar Markus Holzer
Browse files

Fixed waLBerla init

parent 8d12e04e
......@@ -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
......
Markdown is supported
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