Home › Forum › SOFA › Programming with SOFA › [SOLVED] Question about tutorial for TopologyVolumeDifferentMesh
Tagged: 64_bits, Plugin_SoftRobots, SOFA_1912, Windows_10
- This topic has 2 replies, 2 voices, and was last updated 4 years, 6 months ago by Benjamin.
-
AuthorPosts
-
3 June 2020 at 13:28 #16528BenjaminBlocked
Hi everyone,
Can anyone help me with the code in this tutorial?
<?xml version="1.0" ?> <!-- See https://wiki.sofa-framework.org/wiki/TutorialTopologyVolumeMesh --> <Node name="root" gravity="0 -9.86 0" dt="0.05"> <RequiredPlugin name="SofaOpenglVisual"/> <!-- Basic Components to perform the collision detection --> <VisualStyle displayFlags="showBehaviorModels showVisual showWireframe" /> <DefaultPipeline name="DefaultCollisionPipeline" verbose="0" /> <BruteForceDetection name="Detection" /> <MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" /> <DefaultContactManager name="Response" /> <DefaultCollisionGroupManager name="Group" /> <Node name="Cylinder Static Mesh"> <MeshGmshLoader name="loader" filename="mesh/cylinder.msh" /> <MechanicalObject src="@loader" name="DOFs" template="Vec3d" translation="0 0 0" rotation="0 90 0" scale="10" /> <FixedConstraint name="FixedConstraint" template="Vec3d" indices="0" /> <UniformMass name="Mass" template="Vec3d" totalMass="50" /> <EulerImplicitSolver name="cg_odesolver" printLog="0" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver name="linear solver" template="GraphScattered" iterations="25" tolerance="1e-09" threshold="1e-09" /> <MeshGmshLoader name="meshLoader0" filename="mesh/cylinder.msh" /> <MeshTopology name="Static Mesh" src="@meshLoader0" /> <MeshSpringForceField name="FEM-Bend" template="Vec3d" stiffness="100" damping="1" /> <TetrahedronFEMForceField name="FEM" template="Vec3d" method="polar" poissonRatio="0.3" youngModulus="1116" assembling="0" /> <TetrahedronModel name="Models" /> <Node > <OglModel name="Visual" color="red" /> <IdentityMapping input="@.." output="@Visual" /> </Node> </Node> <Node name="Cylinder Regular Mesh"> <MechanicalObject name="DOFs" template="Vec3d" translation="0 0 -10" rotation="0 0 -90" /> <FixedConstraint name="FixedConstraint" template="Vec3d" indices="54 44 45 55" drawSize="0" /> <UniformMass name="Mass" template="Vec3d" totalMass="500" /> <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver name="linear solver" template="GraphScattered" iterations="25" tolerance="1e-09" threshold="1e-09" /> <CylinderGridTopology name="Regular Mesh" n="10 10 10" axis="0 1 0" radius="2" length="10" /> <MeshSpringForceField name="FEM-Bend" template="Vec3d" stiffness="100" damping="1" /> <TetrahedronFEMForceField name="FEM" template="Vec3d" method="polar" poissonRatio="0.3" youngModulus="1116" assembling="0" /> <Node > <OglModel name="Visual" color="blue" /> <IdentityMapping input="@.." output="@Visual" /> </Node> </Node> <Node name="Cylinder Dynamic Mesh"> <MeshGmshLoader name="loader" filename="mesh/cylinder.msh" /> <MechanicalObject src="@loader" name="DOFs" template="Vec3d" translation="0 0 10" rotation="0 90 0" scale="10" /> <FixedConstraint name="FixedConstraint" template="Vec3d" indices="0" /> <UniformMass name="Mass" template="Vec3d" totalMass="50" /> <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver name="linear solver" template="GraphScattered" iterations="25" tolerance="1e-09" threshold="1e-09" /> <MeshGmshLoader name="meshLoader1" filename="mesh/cylinder.msh" /> <TetrahedronSetTopologyContainer name="Topology Container" src="@meshLoader1" /> <TetrahedronSetTopologyModifier name="Topology Modifier" /> <TetrahedronSetTopologyAlgorithms name="Topology Algorithms" template="Vec3d" /> <TetrahedronSetGeometryAlgorithms name="Geometry Algorithms" template="Vec3d" /> <MeshSpringForceField name="FEM-Bend" template="Vec3d" stiffness="100" damping="1" /> <TetrahedronFEMForceField name="FEM" template="Vec3d" method="polar" poissonRatio="0.3" youngModulus="1116" assembling="0" /> <TetrahedronModel name="Models" /> <Node > <OglModel name="Visual" color="green" /> <IdentityMapping input="@.." output="@Visual" /> </Node> </Node> </Node>
It described three different types of mesh: static, general and dynamic. When we simulate a deformable object, are we supposed to use dynamic mesh instead of the other two? Because the geometry would be changed during manipulation and according to definition of above three types of mesh, the dynamic one seems the best option.
Also, why there are two force field used in above scene? I couldn’t find the answer in the tutorial.
Thanks for helping me.
11 June 2020 at 16:00 #16590HugoKeymasterThe two first meshes (stored in MeshTopology or regular CylinderGridTopology) are two static approaches. It allows obviously the object to deform during the simulation, but can not support topological changes: e.g. points added, triangle removed, edges duplicated etc. The last third mesh handles it.
Depending on your use case, you can use one of the other approach.
About the Forcefields, note that a component Forcefield corresponds to an internal or external force acting on your object. Several Forcefields can thus be defined. In this case, the simultaneous use of MeshSpringForceField & TetrahedronFEMForceField is strange I must say, since it mixes a elasticity implemented respectively on springs and over finite elements.
I hope this helps.
BestHugo
17 June 2020 at 03:31 #16653BenjaminBlockedHi Hugo,
Thanks for helping me. Your answers did solve my problems.
Regards,
-
AuthorPosts
- You must be logged in to reply to this topic.