Forum Replies Created
-
AuthorPosts
-
gaetanBlocked
As complementary, you can check this git repository. I ran in debug mode with breakpoints and as you can see on the screenshot, the addForce called is not the one I would like to.
Moreover, I get the warning
RTTI symbol not found for class
which I found is qt specific but I’m not sure to understand this error.Best,
Gaetan
gaetanBlockedHi Hugo,
Yes I tried with a python scene different from the default one and I got the expected results on a simple solid deformation. However I have the error core dumped when not in batch mode.
Hope it helps,
Gaetan
29 July 2019 at 11:46 in reply to: [SOLVED] undefined reference to 'boost::program_options::abstrac_variables_map::operator' #14015gaetanBlockedHi @hugo,
I was myself in vacations last week and hope you feel better ! I tried this morning your solution and it works quite well.
Because I’m using cmake v3.5, the command is a bit different :
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0)
may work for cmake 3.12 and older.Thank you very much for your help,
Gaetan
gaetanBlockedI tried to execute runSofa in batch mode and with the gui, here are the outputs : https://drive.google.com/open?id=1CzTR7KeLln-DATJZFw4nLr3xza1aJ562
Thanks,
GaetangaetanBlockedHi Guillaume, thanks for your answer !
The package is not found with
dnf install
, I have a version of this library with my Qt distribution, I tried to use it : it works in batch mode but generates the errorlibQt5Core.so.5: undefined symbol: ucnv_getDefaultName_55
with the gui.As it may be related and it’s not urgent for me to use the binaries, I will just wait until you generate new ones.
Best,
Gaetan
gaetanBlockedHi Hugo,
Thanks I will try the explicit links. For the moment, changing the state from MechanicalObject to MechanicalState seems to solve my problem, here is the sample code in case somebody needs it :
#include "Flexible/types/DeformationGradientTypes.h" #include <sofa/core/behavior/BaseMechanicalState.h> typedef defaulttype::F331Types F331; sofa::core::behavior::MechanicalState<F331>* _state; // SingleLink<DataExporter, core::behavior::MechanicalState<F331>, BaseLink::FLAG_STRONGLINK> _state; this->getContext()->get(_state); // Then in a loop : helper::ReadAccessor<Data<F331::VecCoord>> vf(state->read(core::ConstVecCoordId::position())); F331::Frame F = vf[0].getF();
Best regards,
Gaetan
gaetanBlockedHi Hugo, thank you for your answer. I don’t think my problem is specific to Flexible since I’m trying to get the state vector of a MechanicalObject. That’s right the scene is written in Python, I can post the full scene Tuesday but the main components are in my previous message. I will try to explain a bit more :
The node I called Meca contains the state vector of the positions (type vec3d) with the associated shape functions.
The MechanicalObject of the child node behavior contains the state vector for the deformation gradients under the form of a 3×3 matrix (type F331 coded in the Flexible plugin). The values of the deformation gradients are computed by the MLSMapping at points defined by the TopologyGaussPointSampler.My component “DataExporter” exports, for each integration point, the 9 values of the gradient matrix stored in the state vector (with the getF() method).
My problem, if I well understood, is to get a pointer toward the MechanicalObject within the node of my component. I didn’t quite understand the difference between the following types and when I should use one of them :
sofa::component::container::MechanicalObject<TYPE>* mecaState; sofa::core::behavior::BaseMechanicalState* mecaState; sofa::core::State<TYPE>* mecaState;
When I have defined mecaState, should I use the get method as following ?
this->getContext()->get(mecaState);
Then I think I will be able to retrieve the state vectors with a ReadAccessor and the read method.
If you need the full python/c++ code I can post them as well.
Best regards,
Gaëtan
gaetanBlockedYes it helps a lot thank you that solved the problem!
I also had to add SofaComponentBase in addition to SofaBaseTopology to the target_link_libraries.
Thank you again,
Gaetan
gaetanBlockedSure, here it is (I removed the unrelated components).
cmake_minimum_required(VERSION 3.1) project(CardiacReduction VERSION 0.1) find_package(SofaFramework REQUIRED) set(HEADER_FILES initCardiacReduction.h config.h # main.h ) set(SOURCE_FILES initCardiacReduction.cpp # main.cpp ) add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) target_link_libraries(${PROJECT_NAME} SofaCore) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_CARDIACREDUCTION") install(TARGETS CardiacReduction RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
gaetanBlockedHi Hugo, sorry I should have been more precise.
I downloaded the sources of the last stable version (18.12.01), added my plugins (without the file causing the error) and compiled it successfully. Everything works fine but when I add (to the CMakeLists) the file containing this include
#include <SofaBaseTopology/TetrahedronSetTopologyContainer.h>
I get the error
SofaBaseTopology/TetrahedronSetTopologyContainer.h : No such file or directory
Probably the compiler doesn’t find the directory SofaBaseTopology because it works when I modify the path as
#include <sofa/../../modules/SofaBaseTopology/TetrahedronSetTopologyContainer.h>
But I cannot do it for all the SofaBase source files.My plugins are in a separate directory as follow :
sofa/external-plugins/MyPlugins/MyComponentsSource and build of sofa paths are :
sofa/sofa-18.12.01/src
sofa/sofa-18.12.01/buildGaetan
gaetanBlockedSuper merci beaucoup !
-
AuthorPosts