-
agniv replied to the topic External force on a vertex in the forum Programming with SOFA 1 year, 2 months ago
Hi Hugo,
I’m in Rainbow team, not Hybrid.
Thanks for the information, I’ll stick to explicit solvers for the purpose.
Regards,
Agniv -
agniv replied to the topic External force on a vertex in the forum Programming with SOFA 1 year, 3 months ago
So, can I assume that the VecDeriv object ‘f’ in the
addForce()
method of FastTetrahedralCorotationalForceField would provide the force on each indices?So the inverse of the resultant of all the forces is the external force needed to cause the same displacement?
If that is correct, it will neatly solve my problem. I will try this out…[Read more]
-
agniv started the topic External force on a vertex in the forum Programming with SOFA 1 year, 3 months ago
I am trying to build a scene (with the SOFA Python plugin) where a particular vertex of a tetrahedral mesh is subjected to a sequence of translation, given by this:
[Read more]
node.createObject('LinearMovementConstraint',name='moveConst',template='Vec3d',relativeMovements='true',movements='4 0 0 0 4 0 0 0 4',showMovement='true', keyTimes='1 1.5 2 2.5',… -
agniv replied to the topic Scene reset in SOFA Python in the forum Programming with SOFA 2 years, 3 months ago
Hey @Hugo,
Sorry for responding so late, but I indeed managed to reset the scene by re-initializing the state vectors of the MechnicalObject.
Thanks a lot for the help.
Best Regards,
Agniv. -
agniv replied to the topic Scene reset in SOFA Python in the forum Programming with SOFA 2 years, 4 months ago
Dear @hugo,
One more update, I tried to reset the mechanical object using:
self.myMechanicalObjectPointer.reset()
However, it still seems like the model is slowly converging back to the neutral configuration. The surface of the object slowly oscillates back to rest.
Regards,
Agniv. -
agniv replied to the topic Scene reset in SOFA Python in the forum Programming with SOFA 2 years, 4 months ago
Dear @Hugo
I am trying to apply a small force to a specific node along X, Y and Z axis…. and study the result of the application of this force on the object.
Given the object in its rest configuration, I apply Delta F_x, Delta F_y and Delta F_z on the node. This produces three different output, which I capture using the OBJExporter script. I…[Read more]
-
agniv started the topic Scene reset in SOFA Python in the forum Programming with SOFA 2 years, 4 months ago
I am simulating a scene in SOFA-Python. A model of a cube with tetrahedral mesh topology is acted upon by a linear force in a TetrahedralCorotationalFEMForceField.
Upon detecting certain criteria for displacement of the vertices of the cube, I want to reset the scene. By ‘reset’, I mean a return to the original undeformed, rest position of the…[Read more]
-
agniv replied to the topic Writing a scene in cpp fails in the forum Building SOFA 2 years, 7 months ago
Hi Hugo,
Stripping down the code to the basics, and using the CMakeLists.txt you suggested results in the following compilation error:
/usr/bin/ld: cannot find -lSofaComponentCommon
[Read more]
collect2: error: ld returned 1 exit status
CMakeFiles/Sofa.dir/build.make:130: recipe for target 'Sofa' failed
make[2]: *** [Sofa] Error 1
CMakeFiles/Makefile2:67:… -
agniv replied to the topic Writing a scene in cpp fails in the forum Building SOFA 2 years, 7 months ago
@egarcm Ah! Yes, those fields are empty, indeed!
Did you figure out a workaround? Is that actually the root cause?
(What OS are you using, btw? I have a suspicion, the interaction between TinyXML and Ubuntu 17 might be going wrong in my case!)
-
agniv replied to the topic Writing a scene in cpp fails in the forum Building SOFA 2 years, 7 months ago
Hi @egarcm,
Do you mean
sofa_scene/build/CMakeCache.txt
?I do not have those strings in that file! In a fresh build, I do not have nearly as many lines as that.
-
agniv replied to the topic Writing a scene in cpp fails in the forum Building SOFA 2 years, 7 months ago
Hi,
My CMakeLists.txt, in the SOFA scene project, now reads:
cmake_minimum_required(VERSION 3.1)
project(Sofa)set(CMAKE_PREFIX_PATH "/path/to/sofa/build/install/lib/cmake")
find_package(SofaComponentCommon)
add_executable(${PROJECT_NAME} Main.cpp)
target_link_libraries(${PROJECT_NAME} SofaComponentCommon)I ran
make
andsudo make install
…[Read more] -
agniv replied to the topic Writing a scene in cpp fails in the forum Building SOFA 2 years, 7 months ago
The same code as given in: the demo.
I do not want Main.cpp to do much, as of now. I just want it to compile with full functionality, so that I can play around with it, and eventually do a FEM simulation of sorts.
-
agniv replied to the topic Writing a scene in cpp fails in the forum Building SOFA 2 years, 7 months ago
If I link it with just SofaComponentCommon, I get a different output:
CMake Warning at CMakeLists.txt:7 (find_package):
By not providing "FindSofaComponentCommon.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"SofaComponentCommon", but CMake did not find one.Could not find a…[Read more]
-
agniv replied to the topic Writing a scene in cpp fails in the forum Building SOFA 2 years, 7 months ago
I changed the cmake file to:
cmake_minimum_required(VERSION 3.1)
project(Sofa)set(SofaFramework_DIR "/path/to/sofa/build/cmake/")
find_package(SofaFramework REQUIRED)
find_package(SofaComponentCommon)add_executable(${PROJECT_NAME} Main.cpp)
target_link_libraries(${PROJECT_NAME} SofaFramework SofaComponentCommon)Looks like that worked!…[Read more]
-
agniv replied to the topic Writing a scene in cpp fails in the forum Building SOFA 2 years, 7 months ago
So I change the Cmake file to:
cmake_minimum_required(VERSION 3.1)
project(Sofa)set(SofaFramework_DIR "/path/to/sofa/build/")
find_package(SofaFramework REQUIRED)
find_package(SofaComponentCommon)add_executable(${PROJECT_NAME} Main.cpp)
target_link_libraries(${PROJECT_NAME} SofaFramework SofaComponentCommon)This still does not work!
-
agniv replied to the topic Writing a scene in cpp fails in the forum Building SOFA 2 years, 7 months ago
How do I do that? I tried setting SofaFramework_DIR to the build path, but that did not work.
-
agniv replied to the topic Writing a scene in cpp fails in the forum Building SOFA 2 years, 7 months ago
Hi,
I have tried to build the demo scene. Here’s what I do:
I have the following directory structure:
sofa_scene
|
+—>build/
|
+—>CMakeLists.txt
|
+—>Main.cppThe Main.cpp is an exact copy from the tutorial.
The CMakeLists.txt contains:
cmake_minimum_required(VERSION 3.1)
project(sofa_scene)find_package(SofaFramework…[Read more]
-
agniv replied to the topic Writing a scene in cpp fails in the forum Building SOFA 2 years, 7 months ago
I have the following folders in examples/Tutorials/ folder:
Basic
Collision
ForceFields
Mappings
OldTutorials
sandbox
Solvers
StepByStep
TopologiesBut none of them seem to contain any cpp files.
I do understand how to create a simple scene using XML and to solve it. But how do I do the same using cpp?
Best,
Agniv. -
agniv started the topic Writing a scene in cpp fails in the forum Building SOFA 2 years, 7 months ago
I would like to write a scene in cpp.
For this, I was trying to compile the demo application provided in sofa/applications/tutorials/chainHybrid/
I created a ‘build’ directory under tutorials/chainHybrid/ and run
cmake ..
from the directory.I get the following output:
CMake Warning at CMakeLists.txt:6 (find_package):
[Read more]
By not providing… -
agniv became a registered member 2 years, 7 months ago