Forum Replies Created
-
AuthorPosts
-
HugoKeymaster
Hi Mahmoud,
Have you checked the GearSpringForceField ? it’s defining a spring with torque support.
NB: For your notice, this code should be refactorized soon with the JointSpringForceFields.
HTH
Hugo
HugoKeymasterThanks for the input Garibalde!
By the way, there has been dev-effort put in this direction (solving issues in debug mode) recently. Stay tuned!HugoKeymasterOr wetransfer.
HugoKeymasterOkay,
sorry I did not notice your post.
Are you allowed to share your mesh with us?Best,
Hugo
HugoKeymasterHey Wendy,
did you notice my post?
Is that helping in anyway?HugoKeymasterOk, are both ovary_xx.msh and cyst.msh created from Fusion ? Are they volumetric meshes (with nodes, edges, faces and tetra) ?
But, the issue might simply come from the node “Extern” : you need to set the TetrahedronSetTopologyContainer before the MechanicalObject.
Cheers,
H
HugoKeymasterHi Anna,
The collision model is a separate representation than the physical model. The collision model does not build a dynamic system, therefore no linear system Ax=b is build there.
The collision model computes no physics but computes forces (from the collision detection and response) and send these forces to the physics representation (where the simulation is run).
If I understand correctly, you want to simulate a sphere model (where the collision is computed) but you would like to use an hexahedral mesh for the physical model. In addition, you would like to have accurate dirichlet boundary conditions on your sphere object. Am I correct?
But this is not directly possible since you physics is not computed on the sphere but on hexa. An alternative is currently studied by researchers from the Mimesis team regarding IBM for mechanical simulation : An Immersed Boundary Method for Detail-Preserving Soft Tissue Simulation from Medical Images.If you need their contact or if anything is unclear do not hesitate to tell.
Best,Hugo
HugoKeymasterHi Wendy,
Could you post your scene file please?
And indeed the error output would be useful as well.
If it doesn’t work, you can send it through the contact form.Best,
H
HugoKeymasterHi Anna
Could you share with us your SOFA scene so that we can better help you?
Cheers,Hugo
9 October 2017 at 16:40 in reply to: mapping between the haptic device and a deformable instrument #10047HugoKeymasterHey @xiaojuan,
You should use the RigidRigidMapping creating a connection between two rigid bodies. RigidMapping links a deformable on a rigid body FYI.
See previous discussion : https://www.sofa-framework.org/community/forum/topic/mapping-between-rigid-and-deformable-objects/
Best,
Hugo
HugoKeymasterHey,
can you share with us the exact crash output ?
ThxHugo
HugoKeymasterHi Binesh,
I am not familiar with two-phase medium and simulation of the phase-interface. All that I know is that level set or similar methods are used in such cases, since they allow for relatively good modeling of the discontinuity between the two phases. Sorry not to help more on this. Google scholar will be your best ally.
For bubble modeling, I also remember this paper/video focusing on bubble simulation to reproduce the sound of fluid! Interesting and sexy!Best,
Hugo
HugoKeymasterHi Binesh,
There is plenty of options depending on the level of accuracy / realism expected, I see at least two:
1) using simple independent vertices with mass and under a “Archimedes-like” forcefield (or Buoyant..)
2) or advanced modelling, using for instance level set method or others two simulate a two-phase mediumBest,
Hugo
HugoKeymasterHi Micha,
as you know for the EulerImplicit integration scheme, you can write the derivatives (v and a) of the position as:
v_{t+h} = v_t + h a_{t+h}
You can therefore write:
a_{t+h} = (v_{t+h} – v_t) / h
or
a_{t} = (v_{t} – v_{t-h}) / hwhere h = dt. This is therefore the analytical value of the acceleration. This is not an approximated value of the acceleration.
Best,
HugoKeymasterHi Binesh,
It depends what kind of bubbles do you want to simulate? For what purpose?
Best regards,H
HugoKeymasterHey Christian!
Unfortunately, the Suture plugin starts being a bit old plugin and would need some update and cleaning. This work was a private work from Inria. We are currently investigating how to re-implement it fresh and clean. Hopefully this work will be back soon on the Marketplace!
Do you already have experience with SOFA?
Would you be interested in developing or only licensing this work?Best regards,
Hugo
HugoKeymasterHi Micha,
Yes, only data visible in the GUI can be exported.
That’s most the data of the MechanicalObject. To compute the acceleration (you can’t access it by default), you can use the velocity field v(t) at the current time step and the v(t-dt) at the previous time step and compute : a(t) = (v(t)-v(t-dt)) / dtAbout the export of the force, one question : is your force solved explicitly ?
Best,
Hugo
HugoKeymasteralright, keep us updated and do not hesitate to share it! It could be interesting to others!
CheersHugo
3 October 2017 at 16:08 in reply to: [SOLVED] How to generate one specific deformation in two different mesh resolutions? #10028HugoKeymasterThis should do what you want with the three mappings:
<?xml version="1.0"?> <Node name="root" dt="0.02" > <DefaultPipeline name="CollisionPipeline" verbose="0" /> <BruteForceDetection name="N2" /> <DefaultContactManager name="collision response" response="default" /> <DiscreteIntersection name="discreteIntersection1" /> <Node name="Liver" depend="topo dofs" > <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver template="GraphScattered" name="linear solver" iterations="25" tolerance="1e-009" threshold="1e-009" /> <MeshGmshLoader name="loader" filename="/Users/sofaconsortium/Desktop/Bnk/livertetra7509.msh" tetrahedraGroups=" -1 0 38144" /> <TetrahedronSetTopologyContainer name="topo" position="@loader.position" edges="@loader.edges" triangles="@loader.triangles" tetrahedra="@loader.tetras" /> <MechanicalObject template="Vec3d" name="dofs" position="@loader.position" velocity="0 0 0" force="0 0 0" externalForce="0 0 0" restScale="1" /> <TetrahedronSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" showPointIndices="0" /> <DiagonalMass template="Vec3d" name="computed using mass density" massDensity="1" /> <TetrahedralCorotationalFEMForceField template="Vec3d" name="FEM" method="large" poissonRatio="0.45" youngModulus="1000" computeGlobalMatrix="0" /> <PlaneForceField template="Vec3d" name="planeFF0" normal="0 1 0" /> <ConstantForceField template="Vec3d" name="constantFF0" indices="111" forces="0 -120 0" /> <FixedConstraint template="Vec3d" name="fixedConstraint0" indices="11 17 16 15 14 4 3 0 45 95 42 40 38 39 53 62 61 60 4 63 59 125 24 20 19 9" drawSize="0" /> <MeshExporter name="meshExporter3" filename="/Users/sofaconsortium/Desktop/Bnk/barytestfine" edges="0" quads="0" hexas="0" exportEveryNumberOfSteps="1" exportAtBegin="1" exportAtEnd="1" /> <TetrahedronSetTopologyModifier name="tetrahedronSetTopologyModifier9" /> <TetrahedronSetTopologyAlgorithms template="Vec3d" name="tetrahedronSetTopologyAlgorithms10" /> <Node name="Visu-fine" > <OglModel template="ExtVec3f" name="oglModel0" color="red" /> <IdentityMapping /> </Node> <Node name="coarse" > <MeshGmshLoader name="meshGmshLoader1" filename="/Users/sofaconsortium/Desktop/Bnk/livertetra181.msh" tetrahedraGroups=" -1 0 596" /> <TetrahedronSetTopologyContainer name="tetrahedronSetTopologyContainer2" src="@meshGmshLoader1"/> <MechanicalObject template="Vec3d" name="mObject0" src="@meshGmshLoader1" restScale="1" /> <TetrahedronSetTopologyModifier name="tetrahedronSetTopologyModifier3" /> <TetrahedronSetGeometryAlgorithms template="Vec3d" name="tetrahedronSetGeometryAlgorithms0" flipNormals="1" recomputeTrianglesOrientation="0" /> <TetrahedronSetTopologyAlgorithms template="Vec3d" name="tetrahedronSetTopologyAlgorithms1" /> <BarycentricMapping template="Vec3d,Vec3d" name="mapping" input="@../dofs" output="@mObject0" /> <VTKExporter name="vTKExporter1" filename="/Users/sofaconsortium/Desktop/Bnk/fromtut19" edges="0" tetras="1" exportEveryNumberOfSteps="1" exportAtBegin="1" exportAtEnd="1" overwrite="1" /> <Node name="Visu-coarse" > <OglModel template="ExtVec3f" name="oglModel0" color="blue"/> <IdentityMapping /> </Node> </Node> </Node> </Node>
HTH
Hugo
HugoKeymasterDear @yannie,
the OglViewport can be driven by a simulated point indeed. There is two options for this:
- either you give a cameraRigid=”RigidPoint.position” ../> if you have access to a rigid point (3 x,y,z and a quaternion)
- or you can give separately a position (Vec3) and an orientation which is a quaternion
Hope this helps.
Hugo
29 September 2017 at 18:29 in reply to: [SOLVED] Visualizing DiagonalCompliance (Compliance Plugin) #10021HugoKeymasterHi Mahmoud,
Thank you for your interest in SOFA and more especially the Compliant plugin. Unfortunately, I am personally not using this plugin. But I guess you could inherit (or modify) from the DiagonalCompliance code and implement the handleEvent() function to export the compliance matrix using the getComplianceMatrix() already available.
HTH,Hugo
HugoKeymasterHi @pin-huachiu
Have you tried to add another:
<GeomagicDriver name="GeomagicDevice" deviceName="Default Device" />
just take care of specifying the right device names.
Let us know it this works,Hugo
HugoKeymasterHi Wendy,
I think I got it.
Then, the best way to simulate this wouldn’t it be to have springs that would have a stiffness that would be set to zero when its elongation exceeds a threshold? This could be done in C++ (inheriting from SpringForceField) or maybe in a simpler way using Python.Best,
27 September 2017 at 03:24 in reply to: [SOLVED] How to generate one specific deformation in two different mesh resolutions? #10010HugoKeymasterDear Zahra,
I gave a try to your scene. I guess there was some issue in the ordering of components. Here is a corrected version, but I am not sure what it’ supposed to do:
<?xml version="1.0"?> <Node name="root" dt="0.02" > <DefaultPipeline name="CollisionPipeline" verbose="0" /> <BruteForceDetection name="N2" /> <DefaultContactManager name="collision response" response="default" /> <DiscreteIntersection name="discreteIntersection1" /> <Node name="Liver" depend="topo dofs" > <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver template="GraphScattered" name="linear solver" iterations="25" tolerance="1e-009" threshold="1e-009" /> <MeshGmshLoader name="loader" filename="/Users/sofaconsortium/Desktop/Bnk/livertetra7509.msh" tetrahedraGroups=" -1 0 38144" /> <TetrahedronSetTopologyContainer name="topo" position="@loader.position" edges="@loader.edges" triangles="@loader.triangles" tetrahedra="@loader.tetras" /> <MechanicalObject template="Vec3d" name="dofs" position="@loader.position" velocity="0 0 0" force="0 0 0" externalForce="0 0 0" restScale="1" /> <TetrahedronSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" showPointIndices="0" /> <DiagonalMass template="Vec3d" name="computed using mass density" massDensity="1" /> <TetrahedralCorotationalFEMForceField template="Vec3d" name="FEM" method="large" poissonRatio="0.45" youngModulus="1000" computeGlobalMatrix="0" /> <PlaneForceField template="Vec3d" name="planeFF0" normal="0 1 0" /> <ConstantForceField template="Vec3d" name="constantFF0" indices="111" forces="0 -120 0" /> <FixedConstraint template="Vec3d" name="fixedConstraint0" indices="11 17 16 15 14 4 3 0 45 95 42 40 38 39 53 62 61 60 4 63 59 125 24 20 19 9" drawSize="0" /> <MeshExporter name="meshExporter3" filename="/Users/sofaconsortium/Desktop/Bnk/barytestfine" edges="0" quads="0" hexas="0" exportEveryNumberOfSteps="1" exportAtBegin="1" exportAtEnd="1" /> <TetrahedronSetTopologyModifier name="tetrahedronSetTopologyModifier9" /> <TetrahedronSetTopologyAlgorithms template="Vec3d" name="tetrahedronSetTopologyAlgorithms10" /> <OglModel template="ExtVec3f" name="oglModel0" material="Default Diffuse 1 0.666667 0 0 1 Ambient 1 0.2 0.2 0.2 1 Specular 0 1 1 1 1 Emissive 0 0 0 0 0 Shininess 0 45 " primitiveType="DEFAULT" blendEquation="GL_FUNC_ADD" sfactor="GL_SRC_ALPHA" dfactor="GL_ONE_MINUS_SRC_ALPHA" /> <BarycentricMapping template="Vec3d,ExtVec3f" name="barycentricMap1" input="@." output="@oglModel0" /> <Node name="node3" > <MeshGmshLoader name="meshGmshLoader1" filename="/Users/sofaconsortium/Desktop/Bnk/livertetra181.msh" tetrahedraGroups=" -1 0 596" /> <TetrahedronSetTopologyContainer name="tetrahedronSetTopologyContainer2" /> <MechanicalObject template="Vec3d" name="mObject0" position="0 0 0" velocity="0 0 0" force="0 0 0" externalForce="0 0 0" restScale="1" /> <TetrahedronSetTopologyModifier name="tetrahedronSetTopologyModifier3" /> <TetrahedronSetGeometryAlgorithms template="Vec3d" name="tetrahedronSetGeometryAlgorithms0" /> <TetrahedronSetTopologyAlgorithms template="Vec3d" name="tetrahedronSetTopologyAlgorithms1" /> <BarycentricMapping template="Vec3d,Vec3d" name="mapping" input="@dofs" output="@mObject0" /> <VTKExporter name="vTKExporter1" filename="/Users/sofaconsortium/Desktop/Bnk/fromtut19" edges="0" tetras="1" exportEveryNumberOfSteps="1" exportAtBegin="1" exportAtEnd="1" overwrite="1" /> <OglModel template="ExtVec3f" name="ogl1" translation="0 3 0" material="Default Diffuse 1 0.74902 0.74902 0.74902 1 Ambient 1 0.2 0.2 0.2 1 Specular 0 1 1 1 1 Emissive 0 0 0 0 0 Shininess 0 45 " primitiveType="DEFAULT" blendEquation="GL_FUNC_ADD" sfactor="GL_SRC_ALPHA" dfactor="GL_ONE_MINUS_SRC_ALPHA" /> </Node> </Node> </Node>
HTH. Cheers,
Hugo
24 September 2017 at 22:59 in reply to: [SOLVED] Retrieve Sofa Scene's OpenGL Viewport from within a component #9990 -
AuthorPosts