/
EulerExplicitSolver_diagonal.scn
57 lines (48 loc) · 3.24 KB
/
EulerExplicitSolver_diagonal.scn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!--
This scene shows an example of a forward Euler integration scheme.
This is the variant of the component EulerExplicitSolver where the Data
'symplectic' is set to false (true by default).
In this example, the mass is diagonal. Since it can be inverted
trivially, it does not require a linear solver.
-->
<Node name="root" gravity="0 -9.81 0" dt="0.00001">
<RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedProjectiveConstraint] -->
<RequiredPlugin name="Sofa.Component.Engine.Select"/> <!-- Needed to use components [BoxROI] -->
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
<RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [IdentityMapping] -->
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [UniformMass] -->
<RequiredPlugin name="Sofa.Component.ODESolver.Forward"/> <!-- Needed to use components [EulerExplicitSolver] -->
<RequiredPlugin name="Sofa.Component.SolidMechanics.Spring"/> <!-- Needed to use components [MeshSpringForceField] -->
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [HexahedronSetGeometryAlgorithms QuadSetTopologyContainer QuadSetTopologyModifier] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Grid"/> <!-- Needed to use components [RegularGridTopology] -->
<RequiredPlugin name="Sofa.Component.Topology.Mapping"/> <!-- Needed to use components [Hexa2QuadTopologicalMapping] -->
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
<DefaultAnimationLoop/>
<VisualStyle displayFlags="showBehaviorModels showForceFields" />
<Node name="DeformableObject">
<!-- Matrix system is diagonal because integration is explicit and Mass is diagonal -->
<!-- No need for a LinearSolver -->
<EulerExplicitSolver name="odeExplicitSolver" symplectic="false"/>
<MechanicalObject name="dofs"/>
<RegularGridTopology name="topology" nx="4" ny="4" nz="11" xmin="-1.5" xmax="1.5" ymin="-1.5" ymax="1.5" zmin="0" zmax="10" />
<HexahedronSetGeometryAlgorithms/>
<UniformMass totalMass="15"/>
<BoxROI box="-1.5 -1.5 0 1.5 1.5 0.0001" name="box"/>
<FixedProjectiveConstraint indices="@box.indices" />
<MeshSpringForceField stiffness="3E2"/>
<Node name="visual">
<QuadSetTopologyContainer name="Container" />
<QuadSetTopologyModifier/>
<Hexa2QuadTopologicalMapping input="@../topology" output="@Container" />
<OglModel name="Visual" color="yellow" quads="@Container.quads" />
<IdentityMapping input="@../dofs" output="@Visual" />
</Node>
</Node>
<Node name="floor-visual">
<MeshOBJLoader name="meshLoader" filename="mesh/floorFlat.obj" scale3d="0.5 0.5 0.5"/>
<OglModel src="@meshLoader" dy="-8" dz="10"/>
<OglModel src="@meshLoader" rx="90" dy="2"/>
</Node>
</Node>