Where do the Yade pass through its code ?

Asked by Masayuki

Hello,

I am trying to read Yade source code after I read "Introduction to debugging" page.
I cannot understand which file names and lines are passed through when the simulation ran, though I did two things like below.
Please tell me some examples of file names and lines which would be passed in many example simulations.

I cannot get any standard output from Yade
when I ran some examples such as mill.py and simple-scene-default-engines.py
after compiling with c++ sentence, std::cerr << "something\n"; in a lot of function of source code
such as pyboot.cpp, Body.cpp, Omega.cpp, Scene.cpp, and etc.

Also, I tried debugging with kdevelop according to the page of "Debugging using Kdevelop",
but simulation didn't freeze after I added a lot of breakpoints in the code.
(when I did "attach to process" to yade, yade's gui freezed, so it seemed work.)

Thanks,

Masayuki

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Masayuki
Solved:
Last query:
Last reply:
Revision history for this message
Anton Gladky (gladky-anton) said :
#1

Hi,

it is not clear to me what you want to achieve. I am also usually
add some more "std::cerr`s" into the code to fix some bugs, but
it always works. Let me know, what function you want to study
and I will probably be able to tell you, what to modify.

Be sure to start the edited version of Yade, not from the package.

Best regards

Anton

2015-12-06 12:03 GMT+01:00 Masayuki <email address hidden>:

> New question #277023 on Yade:
> https://answers.launchpad.net/yade/+question/277023
>
> Hello,
>
> I am trying to read Yade source code after I read "Introduction to
> debugging" page.
> I cannot understand which file names and lines are passed through when the
> simulation ran, though I did two things like below.
> Please tell me some examples of file names and lines which would be passed
> in many example simulations.
>
> I cannot get any standard output from Yade
> when I ran some examples such as mill.py and
> simple-scene-default-engines.py
> after compiling with c++ sentence, std::cerr << "something\n"; in a lot of
> function of source code
> such as pyboot.cpp, Body.cpp, Omega.cpp, Scene.cpp, and etc.
>
> Also, I tried debugging with kdevelop according to the page of "Debugging
> using Kdevelop",
> but simulation didn't freeze after I added a lot of breakpoints in the
> code.
> (when I did "attach to process" to yade, yade's gui freezed, so it seemed
> work.)
>
> Thanks,
>
> Masayuki
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Masayuki (inba-masayuki) said :
#2

My final goal is to introduce electrostatics phenomenon to the DEM simulation.
When different materials contact, electric charge transfer from one to another,
then they are charged oppositely.
The amount of charge depends on contact area and physical property of materials.

So, I want to understand algorithm about contact detection mainly.
For example, mill.py uses Bo1_Sphere_Aabb(),
and there is similar file name, ..../pkg/common/Bo1_Aabb.cpp.
but when I added standard output sentence and breakpoints in function
such as "void Bo1_Sphere_Aabb::go(....),
I didn't get any response as I mentioned above.

I got the source code by git clone according to the installation guide.

By the way, I inform you about recompilation process just in case.
I always use "make" instead of "make install" for recompilation after "make clean",
because if I type "make install", starting simulation generates error like below.
I'm not sure whether it is problem or not.
When I compile with "make", I can run simulation properly.

===error=====================================================
Traceback(most recent call last):
  File "/home/username/myYade/install/bin/yade", line 129, in <module>
    import yade
  File "/home/username/myYade/install/lib/x86_64-linux-gnu/yade-2015-10-09.git-b8083be/py/yade__init__.py", line 65, in <module>
    import boot
ImportError: /home/username/myYade/install/lib/x86_64-linux-gnu/yade-2015-10-09.git-b8083be/py/yade/qt/_GLViewer.so: undefined symbol: _ZN5boost7archive18basic_xml_oarchiveINS0_12xml_oarchiveEE13save_overrideERKNS0_14object_id_typeE
===error=====================================================

Thanks,

Masayuki

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#3

Hi, if you don't "make install" then you don't run the modified code, and then it is expected that you don't see any output from the cerr's.
You real problem is a compilation issue. Did you only manage to compile and run once? Or do you run yadedaily?
Bruno

Revision history for this message
Anton Gladky (gladky-anton) said :
#4

2015-12-07 3:26 GMT+01:00 Masayuki <email address hidden>:
> Masayuki is still having a problem:
> My final goal is to introduce electrostatics phenomenon to the DEM simulation.
> When different materials contact, electric charge transfer from one to another,
> then they are charged oppositely.
> The amount of charge depends on contact area and physical property of materials.

As far as I can understand, you probably need just a new constitutive law or
modification of an existing one. See how capillary forces were implemented,
maybe it is something similar [1].

[1] https://github.com/yade/trunk/blob/master/pkg/dem/ViscoelasticCapillarPM.cpp

> By the way, I inform you about recompilation process just in case.
> I always use "make" instead of "make install" for recompilation after "make clean",
> because if I type "make install", starting simulation generates error like below.
> I'm not sure whether it is problem or not.
> When I compile with "make", I can run simulation properly.

You do have a compilation issue and use libyade from package. That is why
you do not get any output.

What operating system do you use? What compiler?

Regards

Anton

Revision history for this message
Masayuki (inba-masayuki) said :
#5

> As far as I can understand, you probably need just a new constitutive law or
> modification of an existing one. See how capillary forces were implemented,
> maybe it is something similar
Thanks, I will try capillary forces first.

> Did you only manage to compile and run once? Or do you run yadedaily?
I didn't install and run yadedaily.
I just compiled souce code of yade.

> What operating system do you use? What compiler?
Ubuntu14.04 LTS
g++ 4.8.4
boost 1.59
python 2.7.6
ipython 1.2.1

Masayuki

Revision history for this message
Masayuki (inba-masayuki) said :
#6

I will download the source code and try to recompile again.
Masayuki

Revision history for this message
Masayuki (inba-masayuki) said :
#7

Finally I could "make install" without error.
I reinstalled Ubuntu14.04.3 OS to my computer
and also reinstall Yade from the beggining.
Now I can use breakpoints in debug mode.

Somehow words like "Yade [1] :" in terminal is not shown properly.
There are strange letters between spaces, though it is little problem.

By the way, during the process of cmake,
I had some message like below.
Will it be problem later?

Masayuki

=======messages by cmake=======================================
-- Found Qt4: /usr/bin/qmake (found version "4.8.6")
-- Version is set to 1.20.0
-- GTS using gts-config /usr/bin/gts-config
-- Using GTS from /usr
-- GCC Version >= 4.8. Adding -ftrack-macro-expansion=0 and -save-temps
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- python
-- thread
-- filesystem
-- iostreams
-- regex
-- serialization
-- system
-- date_time
-- Found Eigen3, version: 3.2.1
-- Disable vectorization
-- The imported target "vtkParseJava" references the file
   "/usr/bin/vtkParseJava"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkWrapJava" references the file
   "/usr/bin/vtkWrapJava"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkCommonJava" references the file
   "/usr/lib/jni/libvtkCommonJava.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkFilteringJava" references the file
   "/usr/lib/jni/libvtkFilteringJava.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkImagingJava" references the file
   "/usr/lib/jni/libvtkImagingJava.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkGraphicsJava" references the file
   "/usr/lib/jni/libvtkGraphicsJava.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkGenericFilteringJava" references the file
   "/usr/lib/jni/libvtkGenericFilteringJava.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkIOJava" references the file
   "/usr/lib/jni/libvtkIOJava.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkRenderingJava" references the file
   "/usr/lib/jni/libvtkRenderingJava.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkVolumeRenderingJava" references the file
   "/usr/lib/jni/libvtkVolumeRenderingJava.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkHybridJava" references the file
   "/usr/lib/jni/libvtkHybridJava.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkWidgetsJava" references the file
   "/usr/lib/jni/libvtkWidgetsJava.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkParallelJava" references the file
   "/usr/lib/jni/libvtkParallelJava.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkInfovisJava" references the file
   "/usr/lib/jni/libvtkInfovisJava.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkGeovisJava" references the file
   "/usr/lib/jni/libvtkGeovisJava.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkViewsJava" references the file
   "/usr/lib/jni/libvtkViewsJava.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkQtChart" references the file
   "/usr/lib/libvtkQtChart.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "QVTK" references the file
   "/usr/lib/libQVTK.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkChartsJava" references the file
   "/usr/lib/jni/libvtkChartsJava.so.5.8.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- Found VTK
-- Found OpenMP
-- GTS using gts-config /usr/bin/gts-config
-- Using GTS from /usr
-- Found GTS
-- Found Qt4: /usr/bin/qmake (found version "4.8.6")
-- Found GUI-LIBS
-- GMP libs: /usr/lib/x86_64-linux-gnu/libgmp.so /usr/lib/x86_64-linux-gnu/libgmpxx.so
-- GMP libs: /usr/lib/x86_64-linux-gnu/libgmp.so /usr/lib/x86_64-linux-gnu/libgmpxx.so
-- Found CGAL
-- Found Cholmod
-- Found OpenBlas
-- Found Metis
-- Found GL2PS
-- Suffix is set to -1.20.0
-- LIBRARY_OUTPUT_PATH is set to lib/x86_64-linux-gnu
-- runtimePREFIX is set to /home/inba/myYade/install
-- Use system gts version
-- ===========================================================
-- Yade configured with following features: Odeint VTK OpenMP GTS GUI CGAL PFVFLOW LINSOLV GL2PS LBMFLOW
-- Disabled features: SPH LIQMIGRATION MASK_ARBITRARY PROFILING
-- Optimized build
-- ===========================================================
-- Configuring done
-- Generating done
-- Build files have been written to: /home/inba/myYade/build
=======messages by cmake=======================================

Revision history for this message
Anton Gladky (gladky-anton) said :
#8

No, those warnings are OK, they are coming
from VTK.

Anton

Revision history for this message
Masayuki (inba-masayuki) said :
#9

Ok, so really thank you so much, Anton and Bruno.
Thanks,
Masayuki