Giter Site home page Giter Site logo

Comments (5)

Oblomov avatar Oblomov commented on May 30, 2024

I think that the problem you are having is that you create the cylinder as a local variable in fill_parts(), so it gets destroyed at the end of the function. Try making the cylinder a member of the class instead.

from gpusph.

alda30 avatar alda30 commented on May 30, 2024

I tried to duplicate the pattern of defining objects like what exists in "OdeObjects" example (because I am totally newbie in GPUSPH!). So, why the objects in OdeObjects examples are not destroyed and the example runs well?

from gpusph.

Oblomov avatar Oblomov commented on May 30, 2024

Because in OdeObjects the Sphere and Cylinder are declared as members of the class (see OdeObjects.h), and only initialized in fill_parts(); hence, the object persists as long as OdeObjects is instantiated (which is throughout the whole simulation). Instead, in your example you declare the object in fill_parts(), so by C++ scoping rules it gets destroyed at the end of the function.

from gpusph.

alda30 avatar alda30 commented on May 30, 2024

I already declared the cylinder in the header file (look at the Gprobe.hh file in the repository I created). However for being sure, even I declared the parameters for mass, radius, ect of cylinder in the header and assigned them in the class of the example in the cc file (not in the fill_parts() ).
However, I still get this error.

Maybe I am doing something like newbie mistake!?

from gpusph.

Oblomov avatar Oblomov commented on May 30, 2024

If it's still segfaulting you'll have to compile the host code in debug mode (add a CXXFLAGS=-g to your Makefile.local, then run a make cpuclean and then make again) and use gdb to track the cause of segmentation fault.

from gpusph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.