Home › Forum › SOFA › Building SOFA › Runge Kutta issue: 'Segmentation fault (core dumped)'
Tagged: 64_bits, Linux_other, LLVM, SOFA_1712
- This topic has 5 replies, 3 voices, and was last updated 6 years, 3 months ago by Hugo.
-
AuthorPosts
-
13 August 2018 at 17:22 #11657adrienBlocked
Hello,
I use sofa in my internship to simulate micro-robots with @quentinfrancois0.
I tried to use Runge Kutta solvertube.createObject('RungeKutta4', name="odeExplicitSolver") tube.createObject('CGLinearSolver', iterations="100", tolerance="1e-5", threshold="1e-5")
but even if I change the linear solver I have a segmentation fault error.
Do you have any idea to solve this issue?I’m working on Fedora 28 64-bit.
Thanks in advance for your help
13 August 2018 at 17:48 #11659HugoKeymasterHi Adrien
do you have a simple scene hightlight the issue (to make sure it comes from the RungeKutta)?
Do you have any trace of the seg fault to share?Best,
Hugo
14 August 2018 at 13:51 #11670adrienBlockedHello @hugo,
Thanks for your answer. The complete error is:
########## SIG 11 - SIGSEGV: segfault ########## -> /home/stage/Documents/Adrien/sofa/build/build-v17.12/lib/libSofaHelper.so.17.12.01(sofa::helper::BackTrace::dump()+0x20) [0x7f794cb58970] -> /home/stage/Documents/Adrien/sofa/build/build-v17.12/lib/libSofaHelper.so.17.12.01(sofa::helper::BackTrace::sig(int)+0x358) [0x7f794cb58ee8] -> /lib64/libc.so.6(+0x36fb0) [0x7f7948ed8fb0] -> /home/stage/Documents/Adrien/sofa/build/build-v17.12/lib/libSofaBaseLinearSolver.so.17.12.01(sofa::component::linearsolver::MatrixLinearSolver<sofa::component::linearsolver::GraphScatteredMatrix, sofa::component::linearsolver::GraphScatteredVector, sofa::component::linearsolver::NoThreadManager>::setSystemLHVector(sofa::core::TMultiVecId<(sofa::core::VecType)2, (sofa::core::VecAccess)1>)+0x154) [0x7f7955044d14] -> /home/stage/Documents/Adrien/sofa/build/build-v17.12/lib/libSofaConstraint.so.17.12.01(sofa::component::constraintset::LinearSolverConstraintCorrection<sofa::defaulttype::StdVectorTypes<sofa::defaulttype::Vec<3, double>, sofa::defaulttype::Vec<3, double>, double> >::addComplianceInConstraintSpace(sofa::core::ConstraintParams const*, sofa::defaulttype::BaseMatrix*)+0xef) [0x7f7959539e2f] -> /home/stage/Documents/Adrien/sofa/build/build-v17.12/lib/libSofaConstraint.so.17.12.01(sofa::component::constraintset::GenericConstraintSolver::buildSystem(sofa::core::ConstraintParams const*, sofa::core::TMultiVecId<(sofa::core::VecType)0, (sofa::core::VecAccess)1>, sofa::core::TMultiVecId<(sofa::core::VecType)0, (sofa::core::VecAccess)1>)+0x115e) [0x7f79594fea7e] -> /home/stage/Documents/Adrien/sofa/build/build-v17.12/lib/libSofaCore.so.17.12.01(sofa::core::behavior::ConstraintSolver::solveConstraint(sofa::core::ConstraintParams const*, sofa::core::TMultiVecId<(sofa::core::VecType)0, (sofa::core::VecAccess)1>, sofa::core::TMultiVecId<(sofa::core::VecType)0, (sofa::core::VecAccess)1>)+0x3ae) [0x7f794e4dd64e] -> /home/stage/Documents/Adrien/sofa/build/build-v17.12/lib/libSofaConstraint.so.17.12.01(sofa::component::animationloop::FreeMotionAnimationLoop::step(sofa::core::ExecParams const*, double)+0x2b11) [0x7f79594a2271] -> /home/stage/Documents/Adrien/sofa/build/build-v17.12/lib/libSofaSimulationCore.so(sofa::simulation::Simulation::animate(sofa::simulation::Node*, double)+0x55) [0x7f794f0d8eb5] -> /home/stage/Documents/Adrien/sofa/build/build-v17.12/lib/libSofaGuiQt.so.17.12.01(sofa::gui::qt::RealGUI::step()+0xdb) [0x7f7960fe863b] -> /lib64/libQt5Core.so.5(QMetaObject::activate(QObject*, int, int, void**)+0x64e) [0x7f7949aa1cbe] -> /lib64/libQt5Core.so.5(QTimer::timeout(QTimer::QPrivateSignal)+0x3b) [0x7f7949aade1b] -> /lib64/libQt5Core.so.5(QObject::event(QEvent*)+0xab) [0x7f7949aa29db] -> /lib64/libQt5Widgets.so.5(QApplicationPrivate::notify_helper(QObject*, QEvent*)+0x85) [0x7f794a83be95] -> /lib64/libQt5Widgets.so.5(QApplication::notify(QObject*, QEvent*)+0x21a) [0x7f794a84383a] -> /lib64/libQt5Core.so.5(QCoreApplication::notifyInternal2(QObject*, QEvent*)+0x86) [0x7f7949a79376] -> /lib64/libQt5Core.so.5(QTimerInfoList::activateTimers()+0x3f9) [0x7f7949ac8f19] -> /lib64/libQt5Core.so.5(+0x2be7bc) [0x7f7949ac97bc] -> /lib64/libglib-2.0.so.0(g_main_context_dispatch+0x15d) [0x7f7944d788ad] -> /lib64/libglib-2.0.so.0(+0x4cc78) [0x7f7944d78c78] -> /lib64/libglib-2.0.so.0(g_main_context_iteration+0x30) [0x7f7944d78d10] -> /lib64/libQt5Core.so.5(QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)+0x63) [0x7f7949ac9c13] -> /lib64/libQt5XcbQpa.so.5(+0xd3065) [0x7f790fedd065] -> /lib64/libQt5Core.so.5(QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)+0x13b) [0x7f7949a7812b] -> /lib64/libQt5Core.so.5(QCoreApplication::exec()+0x96) [0x7f7949a805b6] -> /home/stage/Documents/Adrien/sofa/build/build-v17.12/lib/libSofaGuiQt.so.17.12.01(sofa::gui::qt::RealGUI::mainLoop()+0x182) [0x7f7960fdfc42] -> /home/stage/Documents/Adrien/sofa/build/build-v17.12/lib/libSofaGuiCommon.so.17.12.01(sofa::gui::GUIManager::MainLoop(boost::intrusive_ptr<sofa::simulation::Node>, char const*)+0x64) [0x7f7960aed064] -> ./bin/runSofa(main+0x3e3c) [0x41400c] -> /lib64/libc.so.6(__libc_start_main+0xeb) [0x7f7948ec518b] -> ./bin/runSofa(_start+0x2a) [0x40f8ea] Segmentation fault (core dumped)
And yes I have a simple scene:
import Sofa import SofaPython.Tools import os path_lo = os.path.dirname(os.path.abspath(__file__))+'/mesh/' def createScene(rootNode): rootNode.createObject('RequiredPlugin', name='SofaPython') rootNode.createObject('VisualStyle', displayFlags="showVisualModels showBehaviorModels hideCollisionModels hideBoundingCollisionModels showForceFields hideInteractionForceFields hideWireframe") rootNode.createObject('FreeMotionAnimationLoop', name='aniloop') rootNode.createObject('GenericConstraintSolver',name='genconsol', maxIterations='1000', tolerance = '1e-3',computeGraphs=True) rootNode.createObject('BackgroundSetting', color='0 0.168627 0.211765') rootNode.findData('gravity').value="0 0 -9.81" rootNode.findData('dt').value=0.01 tube = rootNode.createChild('tube') tube.createObject('RungeKutta4', name="odeExplicitSolver") tube.createObject('CGLinearSolver', iterations="800000", tolerance="1e-5", threshold="1e-5") tube.createObject('MeshVTKLoader', name='loader', filename=path_lo+'tubetronc_010-200.vtu', rotation="0 0 0") tube.createObject('TetrahedronSetTopologyContainer', src='@loader', name='container') tube.createObject('MechanicalObject', name='tubeMecha', template='Vec3d', showIndices='false', showIndicesScale='4e-5', rx='0', dz='0') tube.createObject('TetrahedronSetGeometryAlgorithms', template='Vec3d') tube.createObject('UniformMass', totalmass='9e-3') tube.createObject('TetrahedronFEMForceField', template='Vec3d', name='FEM', method='large', poissonRatio='0.26', youngModulus='5e9') tube.createObject('BoxROI', name='forceBox', box='-0.3 0.3 -0.3 0.3 0.9 0.3', drawBoxes='true', position="@tubeMecha.rest_position", tetrahedra="@container.tetrahedra") tube.createObject('BoxROI', name='fixedBox', box='-0.3 -0.01 -0.3 0.3 -0.45 0.3', drawBoxes='true', position="@tubeMecha.rest_position", tetrahedra="@container.tetrahedra") tube.createObject('RestShapeSpringsForceField', points='@fixedBox.indices', stiffness='1e12') tube.createObject('ConstantForceField', name='forceField',totalForce='0.0 -600.0 0.0', indices='@forceBox.indices', arrowSizeCoef=".01") tube.createObject('FixedConstraint', indices='@fixedBox.indices') tube.createObject('LinearSolverConstraintCorrection') tubeVisu = tube.createChild('visu') tubeVisu.createObject('OglModel', filename=path_lo+"tubetronc20.stl", color="0.4 0.4 0.4 0.5") tubeVisu.createObject('BarycentricMapping')
Thanks in advance for your help.
22 August 2018 at 09:52 #11701HugoKeymasterHi @adrien,
Thank you for sending the scene.
In your case, the issue comes from the fact that you are using an explicit solver (RungeKutta) that does not build the system: the RungeKutta computes the acceleration (unknown x of your system Ax=b) by directly computing A-1.b which is very simple in your case since the Mass matrix is diagonal (UniformMass). Neither b or A is constructed, but x is found directly.The resolution of your constraints requires to have build a compliance matrix. In explicit (with RungeKutta for instance), you might use the mass matrix as compliance and therefore use a UncoupledConstraintCorrection to build it. But usually constraints and compliance building requires the use of implicit schemes. Does this help you?
Best,
Hugo
17 September 2018 at 10:48 #11950quentinBlockedHello @Hugo,
To clarify, we have to add the UncoupledConstraintCorrection to correct the free calculation (without constraints), don’t we ? But you say that this correction needs to an implicit scheme, or in other words not RungeKutta, is it correct ?
Thanks for your help
Q
21 September 2018 at 11:45 #11980HugoKeymasterCould you share with me (privately if needed) your mesh so that I can give a try with the entire scene?
What I meant to say is that you can not use the LinearSolverConstraintCorrection in your case since this ConstraintCorrection needs the system matrix from the solvers, which the RungeKutta does not built. Instead, you can use the UncoupledConstraintCorrection that does not need to system matrix to compute the compliance matrix, but uses a simplified (diagonal) matrix. You can specify the value on the Diagonal of this matrix with the data compliance in the UncoupledConstraintCorrection.
Is this more understandable? (sorry for the first unclear explanation).
Best
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.