Forum Replies Created
-
AuthorPosts
-
HugoKeymaster
Dear Madani,
Sorry for the late reply.
Many things are going on for the Consortium.
Did you solve your issue?
If not, when compiling your plugin, are the NI library well appearing in the make process? If you have a doubt about your CMakeList file, we can also have a look for you.Best,
Hugo
HugoKeymasterFirst, you are well describing the two different type of damping.
This might help other users!In SOFA, the Rayleigh damping can be directly (and easily defined) by defining the Rayleigh mass or Rayleigh stiffness parameter in the integration scheme component (e.g. EulerImplicitSolver). Both parameters are set to zero by default.
To implement your own damping in a ForceField, you can follow what is done in addForce() in DiagonalVelocityDampingForceField.inl to computing damping based on the derivative of your function f.
$B = \frac{\partial f}{\partial v}$
However, in the case of DiagonalVelocityDampingForceField, it is an “explicit” damping. Assuming your are solving a system Ax = b, the damping is included in b since it uses the addForce function.To implement your own implicit damping (based on an unknown velocity v(t+1)), you need to implement your damping in the addDForce function (as you can see on the commented code in DiagonalVelocityDampingForceField). This addDForce() function will include the damping in the A matrix of our linear system.
My explanation is valid if you are using an iterative linear solver (e.g. CG). If you are using a direct solver, replace addDForce by addBToMatrix.
This topic remains complex to explain and understand on a forum. For deeper explanation about this, we can propose you a specific training.
Best regards,
Hugo
HugoKeymasterNice to hear !
thank you Juan and do not hesitate to contribute to the forum as well 😉16 March 2016 at 14:05 in reply to: [SOLVED] I am confused on the dependencies when compiling Sofa On WIN10. vs2015 #6334HugoKeymasterDear Cui,
Welcome and thank you for your interest in SOFA!
Here, I think you are getting confused between two different options: either you use the binaries of SOFA, or you use the compiled version of the sources. Let me explain those two options:- If you want to play with SOFA or use the classic version of SOFA, you can simply use the binaries of SOFA. The explanations about how to download the SOFA binaries are given on top of the download page. With this first option, you need to:
- get the dependencies for Win32 (boost & Qt5)
- get the LGPL sources of the Qt5 dependencies
- download the required dependency to VisualStudio 2015 runtime libraries
- and finally, download the binaries of SOFA
- The second option is independent of the first one. If you wan to work with the sources of SOFA, you need to compile all the SOFA sources. This second option is more complicated, especially if you have no skills in compilation. For this second option, you need to following the guidelines given on the build page. In a few workds, you need to:
- have Qt installed. With VS 2015, you need : qt-opensource-windows-x86-msvc2015_64-5.6.0.exe
- have Boost installed. You will find a Boost 1.60.0 official executable for every Visual Studio version here
- Download the SOFA sources: git clone -b v15.12 git://scm.gforge.inria.fr/sofa/sofa.git sofa/v15.12/src/
- Configure and build the SOFA sources.
Definitely, the binary option (first option) is the best if you are not used to compile yourself sources of a software. Hope this helps,
Cheers,
HugoKeymasterDear Lucas,
We know about this issue. This issue is due to a bug in the Modeler. We plan to fix and renew the Modeler soon. Unfortunately, we got quite busy these days.
Thank you for sharing.
Cheers,Hugo
HugoKeymasterDear Medhi,
Even if this is not working, you did well for the first steps. Creating a specific plugin which includes a component making the interface between the NI acquisition board and SOFA is a good start.
You need to make sure that your plugin includes all the NI dependencies. In the documentation Create your Plugin, in the section “CMake configuration/CMakeList.txt”, a default CMakeList was described. In your case, you need to make sure that the target_link_libraries() function includes the NI library. You also might have to add the include NI directories using the CMake function include_directories(). You can find examples in the plugins (applications/plugin): Sensable (OpenHaptics librabry), LeapMotion (LeapMotion library) or Xitact (XiRobot library).
Could you tell us more about the error you have?
you said you “cannot compile the program”Cheers,
Hugo
HugoKeymasterPerfect nice to hear.
Enjoy SOFA!Hugo
HugoKeymasterHi Thien,
First, I can’t find the function createContact you are talking about in BilateralInteractionConstraint. So I cannot really help.
Second, the constraints are not related to the mappings. Therefore, I don’t see why this constraint would only work with some mappings and not others.
Hugo
HugoKeymasterDear Thien,
I am no expert in contraint resolution. Here is what I can explain. In a BilateralInteractionConstraint-like component, you need to implement the functions described below. Assuming your unconstrained linear system is A.x=b (where the solution is noted y) and your constraint problem is written trans(H).A.H λ = trans(H).y – d. Then:
- buildConstraint: this build the H matrix,
- getConstraintViolation: adds the -d to the right hand side,
- getConstraintResolution: implements a the diagonal resolution of the Gauss Seidel,
Hope this helps.
Hugo
HugoKeymasterHi Binesh,
When pulling a point of the mesh with the mouse interaction, what occurs is that a spring (StiffSpringForceField) is created between the mouse location and your object. This spring will apply a force on your object. So, there is two ways of recovering the nodal force (and not the pressure): either you modify the StiffSpringForceField to export/print the value of the force applied in addForce function, or you directly export the field “force” of your object (MechanicalObject). The second option was already discussed here.
Cheers,
Hugo
HugoKeymasterHi Binesh,
Nice to hear! Could you tell us more about what exactly solved your issue? Thanks in advance,
Cheers,
Hugo
HugoKeymasterDear Juan Jo,
The diffusion forcefield has been added in SofaSimpleFEM module in the master branch. You can find an example for this in: examples/Components/forcefield/TetrahedronDiffusionFEMForceField.scn. Enjoy!
Cheers,
Hugo
HugoKeymasterHi @tuanthienbk,
What you’re asking is pretty advanced and therefore complicated to support remotely. The best (but obvious) advice would be to get inspired from the original BilateralInteractionConstraint component. You can send us the error you have or give us your code to review, but as stressed before, this will be very complicated to support.
Best regards,
Hugo
HugoKeymasterDear Zahra,
To answer component by component:
-
The TriangularFEMForecefield implements the linear elasticity material law for linear triangular element based on the finite-element method. This theory makes a discretization in space. In other words, it describes the physics (deformation) of the object by considering small elements (triangles here).
-
The TriangularBendingSprings is very similar in the sense that it simulates the physics of an object. However, the integration in space of the physics in not computed on the surface of the triangles but through the edges. The stiffness of your material is defined through these edges.
-
The EulerImplicitSolver corresponds to the integration scheme: this defines how to go from one time step to the next. This is a discretization in time.
-
The CGLinearSolver is an iterative linear solver. The whole physics simulation can be linearized into a problem: Ax=b where x is your unknown. The CGLinearSolver is an iterative solver (Conjugate Gradient) finding an optimal solution for x.
Moreover, in case you need a beginner training, do not hesitate to join the Consortium. We would be happy to make you a theoretical introduction to SOFA.
Cheers,
Hugo
HugoKeymasterDear Binesh,
It seems (if you really copy-pasted your code) that you set all the functions in the constructor. You need to define these functions in the draw() of your GUI. Take a look at the QtViewer.h to get inspiration.
We obviously can’t just send you private code. But if you need a closer support, you can join the Consortium and subscribe for a support request.
Best regards,
Hugo
29 February 2016 at 10:33 in reply to: [SOLVED] What is SOFA dedicated to? How to use it as physics engine? #5985HugoKeymasterHi Korcan,
You have basically two options:
- the cleaner way is to do as illustrated in the projet SofaPhysicsAPI (sofa/applications/projects/SofaPhysicsAPI). This project illustrate how to use SOFA as physics engine while using another gui (called “fakegui” in this example). Look especially the component SofaPhysicsAPI.h.
- or a bit dirtier: you can include SOFA in your project, and recover all the pointers of the simulation from the scene nodes.
Best regards,
Hugo
HugoKeymasterHi Juan Jo,
Did this help you in any way?
Do you need further info?Cheers,
Hugo
HugoKeymasterDear Zahra,
I asked the developers and they noted this example : examples/Components/misc/sleep/test_sleep.scn. The sleep functions should do what you want: it detects when a body stops moving and set the node to sleep.
Hope this helps.
Hugo
HugoKeymasterNice to hear Zahra,
If you need any further details, let us know. Moreover, we are currently writing the documentation about the main principles of SOFA including these aspects. I will let you know when this will be released.
Cheers,
Hugo
HugoKeymasterDear Zahra,
You’re very welcome.
Enjoy SOFA,Hugo
23 February 2016 at 08:03 in reply to: [SOLVED] What is SOFA dedicated to? How to use it as physics engine? #5890HugoKeymasterDear Korcan,
You are very welcome! Thank you for your interest in SOFA.
Indeed, SOFA is originally dedicated to soft body deformation and can handle topological changes, such as cutting. The example examples/Demos/TriangleSurfaceCutting.scn is indeed on a surface mesh, but volumetric meshes (e.g. tetra-FE model) can also be cut. There was already two topics in the forum about this:
SOFA can be plugged in with another rendering engine. However, I have personally no experience with this. I’ll try to find someone who could give you some first hints and guidelines.
Cheers,
Hugo
HugoKeymasterHi Juan Jo,
That’s a good point: today the heat equation isn’t available in SOFA. However, I worked during 3 years (PhD) around this topic. I intend to release a plugin for heat diffusion in tetrahedra. How urgent is that for you (this would need few days maybe some weeks max to officially release it with Inria)? I also implemented different solvers dedicated to heat transfer, would this be of interest for you too?
Best regards,
Hugo
HugoKeymasterOk perfect, thank you for letting us know what solved your problem.
Enjoy SOFA!Cheers,
Hugo
HugoKeymasterDear Juan Jo,
My mistake, there is a remaining line which should not be here. Look at the How to build a new plugin page, I made the correction.
The line with “preProject” should be deleted, and your CMakeList.txt should start with:
cmake_minimum_required(VERSION 2.8.12) project(MyPlugin)
Let me know whether this works now.
Hugo
HugoKeymasterHi Juan Jo,
Indeed, as mentioned in some other posts, we are currently working on the documentation of SOFA. This takes a huge amount of time. I just updated the documentation regarding How to build a new plugin in SOFA. Please do not hesitate to report any issue, missing information or typos.
Best regards,
Hugo
- If you want to play with SOFA or use the classic version of SOFA, you can simply use the binaries of SOFA. The explanations about how to download the SOFA binaries are given on top of the download page. With this first option, you need to:
-
AuthorPosts