stranskyjan / dem-fem-coupling

Open source codes for coupling of Finite Element Method and Discrete Element Method using YADE, and OOFEM softwares.
43 stars 24 forks source link

Not finding demfemcoupling module #12

Closed zoheir1928 closed 4 years ago

zoheir1928 commented 4 years ago

Hi Jan,

Although I have "demfemcoupling.py" in the folder, I get the following error:

from yade._customConverters import * Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/usr/lib/python2.7/cProfile.py", line 200, in main() File "/usr/lib/python2.7/cProfile.py", line 193, in main runctx(code, globs, None, options.outfile, options.sort) File "/usr/lib/python2.7/cProfile.py", line 49, in runctx prof = prof.runctx(statement, globals, locals) File "/usr/lib/python2.7/cProfile.py", line 140, in runctx exec cmd in globals, locals File "surf1.py", line 10, in from demfemcoupling import OofemInterface,YadeInterface,OofemYadeMeshSurfaceMap,FemDemSurfaceCoupler,TimeStep ImportError: No module named demfemcoupling makefile:41: recipe for target 'example' failed make: *** [example] Error 1

Should I re-install Yade and OOFEM?

Thanks,

Zoheir

stranskyjan commented 4 years ago

Hi Zoheir, this is python problem, not (yet) oofem or yade. How did you install the project? Jan

zoheir1928 commented 4 years ago

Hi Jan, I used the makefiles.

I also tried "export PYTHONPATH=$PYTHONPATH:" for defining the path but the error is still there. All other files can be imported but demfemcoupling.py. When I try to open this file, it says: the link is broken and cannot be used as its target ("Installation/../src/demfemcoupling.py") does not exist.

stranskyjan commented 4 years ago

it seems is is again related to absolute / relative paths..

In the Makefile, there is this line ln -s $(CURDIR)/../src/demfemcoupling.py $(install-dir)/demfemcoupling.py which seems to be the problem. Could you try "manually" run the ln -s command with actual and correct paths?

zoheir1928 commented 4 years ago

Hi Jan,

I did that using: ln -s /home/zoheir/FEMDEM/Installation/_build/install/demfemcoupling.py /home/zoheir/FEMDEM/Installation/demfemcoupling.py

But I am still getting the same error. Any idea what would be the reason? Is there a way to look at the content of this file? Much appreciated Zoheir