Skip to content

Commit d0dcb2a

Browse files
author
Lucas Burel
committed
clean examples 30/04
1 parent 1fed94f commit d0dcb2a

24 files changed

Lines changed: 1096 additions & 465 deletions

examples/xml/400shellComputationAnevrism.scn

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,48 @@
11
<?xml version="1.0" ?>
2-
<Node name="root" dt="0.04" showBehaviorModels="0" showCollisionModels="0" showMappings="0" showForceFields="1" showBoundingTree="0" showVisualModels="1" gravity="0 -10 0">
3-
<!-- <CollisionPipeline verbose="0" />-->
2+
<Node name="root" dt="0.04" gravity="0 -10 0">
3+
<!--Node name="root" dt="0.04" showBehaviorModels="0" showCollisionModels="0" showMappings="0" showForceFields="1" showBoundingTree="0" showVisualModels="1" gravity="0 -10 0"-->
4+
5+
6+
<Node name="plugins">
7+
<RequiredPlugin name="Sofa.Component.AnimationLoop"/> <!-- Needed to use components [FreeMotionAnimationLoop] -->
8+
<RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedProjectiveConstraint,FixedRotationProjectiveConstraint] -->
9+
<RequiredPlugin name="Sofa.Component.Constraint.Lagrangian.Solver"/> <!-- Needed to use components [LCPConstraintSolver] -->
10+
<RequiredPlugin name="Sofa.Component.Engine.Select"/> <!-- Needed to use components [BoxROI] -->
11+
<RequiredPlugin name="Sofa.Component.Engine.Transform"/> <!-- Needed to use components [Vertex2Frame] -->
12+
<RequiredPlugin name="Sofa.Component.LinearSolver.Direct"/> <!-- Needed to use components [SparseLDLSolver] -->
13+
<RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [PCGLinearSolver] -->
14+
<RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [IdentityMapping] -->
15+
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [UniformMass] -->
16+
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
17+
<RequiredPlugin name="Sofa.Component.SceneUtility"/> <!-- Needed to use components [InfoComponent] -->
18+
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
19+
<RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [TriangleSetTopologyContainer] -->
20+
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
21+
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
22+
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
23+
<RequiredPlugin name="Shell"/>
24+
</Node>
25+
26+
27+
28+
29+
30+
31+
<!-- <CollisionPipeline verbose="0" />-->
432
<!-- <BruteForceDetection name="N2" />-->
533
<!-- <CollisionResponse response="default" />-->
634
<!-- <MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" />-->
735
<!-- <CollisionGroup />-->
36+
<FreeMotionAnimationLoop computeBoundingBox="true"/>
837

938
<Node name="CoarseMesh">
10-
<MeshObjLoader name="coarseMesh" filename="../mesh/aneurysm400.obj"/>
11-
<Vertex2Frame name="coarseMeshVertex2Frame" template="Rigid" position="@coarseMesh.position" normals="@coarseMesh.normals" invertNormals="false"/>
39+
<MeshOBJLoader name="coarseMesh" filename="/home/lucasbureltojo/sofa3/plugins/Shell/mesh/aneurysm400.obj"/>
40+
<Vertex2Frame name="coarseMeshVertex2Frame" template="Rigid3" position="@coarseMesh.position" normals="@coarseMesh.normals" invertNormals="false"/>
1241
</Node>
1342

1443

1544
<Node name="TargetMesh">
16-
<MeshObjLoader name="targetMesh" filename="../mesh/aneurysmHighRes.obj"/>
45+
<MeshOBJLoader name="targetMesh" filename="/home/lucasbureltojo/sofa3/plugins/Shell/mesh/aneurysmHighRes.obj"/>
1746
<TriangleSetTopologyContainer name="targetTopo" src="@targetMesh"/>
1847
</Node>
1948

@@ -22,22 +51,22 @@
2251
<Node name="Shell">
2352
<EulerImplicitSolver />
2453
<!--<CGLinearSolver iterations="20" tolerance="0.05" threshold="1e-20"/>-->
25-
26-
<PCGLinearSolver iterations="5" tolerance="0.05" preconditioners="Precond"/>
27-
<SparseLDLSolver name="Precond"/>
54+
<LCPConstraintSolver/>
55+
<PCGLinearSolver iterations="5" tolerance="0.05" preconditioner="@Precond"/>
56+
<SparseLDLSolver name="Precond" template="CompressedRowSparseMatrixMat3x3"/>
2857

2958

3059
<TriangleSetTopologyContainer name="coarseTopo"
3160
position="@/CoarseMesh/coarseMesh.position"
3261
edges="@/CoarseMesh/coarseMesh.edges"
3362
triangles="@/CoarseMesh/coarseMesh.triangles" />
34-
<MechanicalObject name="coarseMesh_MO" template="Rigid" rest_position="@/CoarseMesh/coarseMeshVertex2Frame.frames" position="@/CoarseMesh/coarseMeshVertex2Frame.frames"/>
63+
<MechanicalObject name="coarseMesh_MO" template="Rigid3" rest_position="@/CoarseMesh/coarseMeshVertex2Frame.frames" position="@/CoarseMesh/coarseMeshVertex2Frame.frames"/>
3564

36-
<UniformMass mass="0.3 0.1 [ 0.1 0 0 , 0 0.1 0 , 0 0 0.05 ]" showAxisSizeFactor="0.03" compute_mapping_inertia="0" />
65+
<UniformMass vertexMass="0.3 0.1 [ 0.1 0 0 , 0 0.1 0 , 0 0 0.05 ]" showAxisSizeFactor="0.03" compute_mapping_inertia="0" />
3766

3867
<BoxConstraint box="-0.2 -1 -0.2 0.2 -0.8 0.2 0.4 0.3 -0.8 0.8 0.7 -0.7" />
3968

40-
<FixedRotationConstraint FixedZRotation="true" />
69+
<FixedRotationProjectiveConstraint FixedZRotation="true" />
4170
<TriangularBendingFEMForceField name="FEM" bending="true"
4271
youngModulus="5000000" poissonRatio="0.45" thickness="0.05" />
4372

@@ -48,11 +77,11 @@
4877
<TriangleSetTopologyContainer name="subTrianglesTopo"
4978
position="@/TargetMesh/targetTopo.position" triangles="@/TargetMesh/targetTopo.triangles" />
5079
<MechanicalObject name="subCoarse_MO" rest_position="@/TargetMesh/targetTopo.position" />
51-
<BendingPlateMechanicalMapping printLog="1" object1="coarseMesh_MO" object2="subCoarse_MO" name="MappingShells" isMechanical="false"/>
80+
<BendingPlateMechanicalMapping printLog="1" input="@../coarseMesh_MO" output="@subCoarse_MO" name="MappingShells" isMechanical="false"/>
5281

53-
<Node>
82+
<Node name="Visu">
5483
<OglModel name="Visual" color="red"/>
55-
<IdentityMapping object1="subCoarse_MO" object2="Visual"/>
84+
<IdentityMapping input="@../subCoarse_MO" output="@Visual"/>
5685
</Node>
5786
</Node>
5887

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,70 @@
11
<?xml version="1.0" ?>
22
<Node name="root" dt="0.04" gravity="0 -10 0">
33

4-
<VisualStyle displayFlags="showForceFields showVisualModels" />
4+
<Node name="plugins">
5+
<RequiredPlugin name="Sofa.Component.AnimationLoop"/> <!-- Needed to use components [FreeMotionAnimationLoop] -->
6+
<RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedProjectiveConstraint,FixedRotationProjectiveConstraint] -->
7+
<RequiredPlugin name="Sofa.Component.Constraint.Lagrangian.Solver"/> <!-- Needed to use components [LCPConstraintSolver] -->
8+
<RequiredPlugin name="Sofa.Component.Engine.Select"/> <!-- Needed to use components [BoxROI] -->
9+
<RequiredPlugin name="Sofa.Component.Engine.Transform"/> <!-- Needed to use components [Vertex2Frame] -->
10+
<RequiredPlugin name="Sofa.Component.LinearSolver.Direct"/> <!-- Needed to use components [SparseLDLSolver] -->
11+
<RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [PCGLinearSolver] -->
12+
<RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [IdentityMapping] -->
13+
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [UniformMass] -->
14+
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
15+
<RequiredPlugin name="Sofa.Component.SceneUtility"/> <!-- Needed to use components [InfoComponent] -->
16+
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
17+
<RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [TriangleSetTopologyContainer] -->
18+
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
19+
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
20+
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
21+
<RequiredPlugin name="Shell"/>
22+
</Node>
23+
24+
25+
26+
527

6-
<!-- <CollisionPipeline verbose="0" />-->
28+
29+
<!-- <CollisionPipeline verbose="0" />-->
730
<!-- <BruteForceDetection name="N2" />-->
831
<!-- <CollisionResponse response="default" />-->
932
<!-- <MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" />-->
1033
<!-- <CollisionGroup />-->
34+
<FreeMotionAnimationLoop computeBoundingBox="true"/>
1135

1236
<Node name="CoarseMesh">
13-
<MeshObjLoader name="coarseMesh" filename="../mesh/aneurysm600.obj"/>
14-
<Vertex2Frame name="coarseMeshVertex2Frame" template="Rigid" position="@coarseMesh.position" normals="@coarseMesh.normals" invertNormals="false"/>
15-
37+
<MeshOBJLoader name="coarseMesh" filename="/home/lucasbureltojo/sofa3/plugins/Shell/mesh/aneurysm600.obj"/>
38+
<Vertex2Frame name="coarseMeshVertex2Frame" template="Rigid3" position="@coarseMesh.position" normals="@coarseMesh.normals" invertNormals="false"/>
1639
</Node>
1740

18-
41+
1942
<Node name="TargetMesh">
20-
<MeshObjLoader name="targetMesh" filename="../mesh/aneurysmHighRes.obj"/>
21-
<TriangleSetTopologyContainer name="targetTopo" src="@targetMesh" />
22-
<!-- <MechanicalObject name="targetMesh_MO" template="Vec3d"/> -->
43+
<MeshOBJLoader name="targetMesh" filename="/home/lucasbureltojo/sofa3/plugins/Shell/mesh/aneurysmHighRes.obj"/>
44+
<TriangleSetTopologyContainer name="targetTopo" src="@targetMesh"/>
2345
</Node>
2446

2547

2648

2749
<Node name="Shell">
2850
<EulerImplicitSolver />
2951
<!--<CGLinearSolver iterations="20" tolerance="0.05" threshold="1e-20"/>-->
30-
31-
<PCGLinearSolver iterations="5" tolerance="0.05" preconditioners="Precond"/>
32-
<SparseLDLSolver name="Precond"/>
52+
<LCPConstraintSolver/>
53+
<PCGLinearSolver iterations="5" tolerance="0.05" preconditioner="@Precond"/>
54+
<SparseLDLSolver name="Precond" template="CompressedRowSparseMatrixMat3x3"/>
3355

3456

3557
<TriangleSetTopologyContainer name="coarseTopo"
3658
position="@/CoarseMesh/coarseMesh.position"
3759
edges="@/CoarseMesh/coarseMesh.edges"
3860
triangles="@/CoarseMesh/coarseMesh.triangles" />
39-
<MechanicalObject name="coarseMesh_MO" template="Rigid" rest_position="@/CoarseMesh/coarseMeshVertex2Frame.frames" position="@/CoarseMesh/coarseMeshVertex2Frame.frames"/>
61+
<MechanicalObject name="coarseMesh_MO" template="Rigid3" rest_position="@/CoarseMesh/coarseMeshVertex2Frame.frames" position="@/CoarseMesh/coarseMeshVertex2Frame.frames"/>
4062

41-
<UniformMass mass="0.3 0.1 [ 0.1 0 0 , 0 0.1 0 , 0 0 0.05 ]" showAxisSizeFactor="0.03" compute_mapping_inertia="0" />
63+
<UniformMass vertexMass="0.3 0.1 [ 0.1 0 0 , 0 0.1 0 , 0 0 0.05 ]" showAxisSizeFactor="0.03" compute_mapping_inertia="0" />
4264

4365
<BoxConstraint box="-0.2 -1 -0.2 0.2 -0.8 0.2 0.4 0.3 -0.8 0.8 0.7 -0.7" />
4466

45-
<FixedRotationConstraint FixedZRotation="true" />
67+
<FixedRotationProjectiveConstraint FixedZRotation="true" />
4668
<TriangularBendingFEMForceField name="FEM" bending="true"
4769
youngModulus="5000000" poissonRatio="0.45" thickness="0.05" />
4870

@@ -53,13 +75,13 @@
5375
<TriangleSetTopologyContainer name="subTrianglesTopo"
5476
position="@/TargetMesh/targetTopo.position" triangles="@/TargetMesh/targetTopo.triangles" />
5577
<MechanicalObject name="subCoarse_MO" rest_position="@/TargetMesh/targetTopo.position" />
56-
<BendingPlateMechanicalMapping printLog="1" object1="coarseMesh_MO" object2="subCoarse_MO" name="MappingShells" isMechanical="false"/>
78+
<BendingPlateMechanicalMapping printLog="1" input="@../coarseMesh_MO" output="@subCoarse_MO" name="MappingShells" isMechanical="false"/>
5779

58-
<Node>
80+
<Node name="Visu">
5981
<OglModel name="Visual" color="red"/>
60-
<IdentityMapping object1="subCoarse_MO" object2="Visual"/>
82+
<IdentityMapping input="@../subCoarse_MO" output="@Visual"/>
6183
</Node>
6284
</Node>
6385

6486
</Node>
65-
</Node>
87+
</Node>
Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,70 @@
11
<?xml version="1.0" ?>
22
<Node name="root" dt="0.04" gravity="0 -10 0">
33

4-
<VisualStyle displayFlags="showForceFields showVisualModels" />
4+
<Node name="plugins">
5+
<RequiredPlugin name="Sofa.Component.AnimationLoop"/> <!-- Needed to use components [FreeMotionAnimationLoop] -->
6+
<RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedProjectiveConstraint,FixedRotationProjectiveConstraint] -->
7+
<RequiredPlugin name="Sofa.Component.Constraint.Lagrangian.Solver"/> <!-- Needed to use components [LCPConstraintSolver] -->
8+
<RequiredPlugin name="Sofa.Component.Engine.Select"/> <!-- Needed to use components [BoxROI] -->
9+
<RequiredPlugin name="Sofa.Component.Engine.Transform"/> <!-- Needed to use components [Vertex2Frame] -->
10+
<RequiredPlugin name="Sofa.Component.LinearSolver.Direct"/> <!-- Needed to use components [SparseLDLSolver] -->
11+
<RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [PCGLinearSolver] -->
12+
<RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [IdentityMapping] -->
13+
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [UniformMass] -->
14+
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
15+
<RequiredPlugin name="Sofa.Component.SceneUtility"/> <!-- Needed to use components [InfoComponent] -->
16+
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
17+
<RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [TriangleSetTopologyContainer] -->
18+
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
19+
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
20+
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
21+
<RequiredPlugin name="Shell"/>
22+
</Node>
23+
24+
25+
26+
527

6-
<!-- <CollisionPipeline verbose="0" />-->
28+
29+
<!-- <CollisionPipeline verbose="0" />-->
730
<!-- <BruteForceDetection name="N2" />-->
831
<!-- <CollisionResponse response="default" />-->
932
<!-- <MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" />-->
1033
<!-- <CollisionGroup />-->
34+
<FreeMotionAnimationLoop computeBoundingBox="true"/>
1135

1236
<Node name="CoarseMesh">
13-
<MeshObjLoader name="coarseMesh" filename="../mesh/aneurysm800.obj"/>
14-
<Vertex2Frame name="coarseMeshVertex2Frame" template="Rigid" position="@coarseMesh.position" normals="@coarseMesh.normals" invertNormals="false"/>
15-
37+
<MeshOBJLoader name="coarseMesh" filename="/home/lucasbureltojo/sofa3/plugins/Shell/mesh/aneurysm800.obj"/>
38+
<Vertex2Frame name="coarseMeshVertex2Frame" template="Rigid3" position="@coarseMesh.position" normals="@coarseMesh.normals" invertNormals="false"/>
1639
</Node>
1740

18-
41+
1942
<Node name="TargetMesh">
20-
<MeshObjLoader name="targetMesh" filename="../mesh/aneurysmHighRes.obj"/>
21-
<TriangleSetTopologyContainer name="targetTopo" src="@targetMesh" />
22-
<!-- <MechanicalObject name="targetMesh_MO" template="Vec3d"/> -->
43+
<MeshOBJLoader name="targetMesh" filename="/home/lucasbureltojo/sofa3/plugins/Shell/mesh/aneurysmHighRes.obj"/>
44+
<TriangleSetTopologyContainer name="targetTopo" src="@targetMesh"/>
2345
</Node>
2446

2547

2648

2749
<Node name="Shell">
2850
<EulerImplicitSolver />
2951
<!--<CGLinearSolver iterations="20" tolerance="0.05" threshold="1e-20"/>-->
30-
31-
<PCGLinearSolver iterations="5" tolerance="0.05" preconditioners="Precond"/>
32-
<SparseLDLSolver name="Precond"/>
52+
<LCPConstraintSolver/>
53+
<PCGLinearSolver iterations="5" tolerance="0.05" preconditioner="@Precond"/>
54+
<SparseLDLSolver name="Precond" template="CompressedRowSparseMatrixMat3x3"/>
3355

3456

3557
<TriangleSetTopologyContainer name="coarseTopo"
3658
position="@/CoarseMesh/coarseMesh.position"
3759
edges="@/CoarseMesh/coarseMesh.edges"
3860
triangles="@/CoarseMesh/coarseMesh.triangles" />
39-
<MechanicalObject name="coarseMesh_MO" template="Rigid" rest_position="@/CoarseMesh/coarseMeshVertex2Frame.frames" position="@/CoarseMesh/coarseMeshVertex2Frame.frames"/>
61+
<MechanicalObject name="coarseMesh_MO" template="Rigid3" rest_position="@/CoarseMesh/coarseMeshVertex2Frame.frames" position="@/CoarseMesh/coarseMeshVertex2Frame.frames"/>
4062

41-
<UniformMass mass="0.3 0.1 [ 0.1 0 0 , 0 0.1 0 , 0 0 0.05 ]" showAxisSizeFactor="0.03" compute_mapping_inertia="0" />
63+
<UniformMass vertexMass="0.3 0.1 [ 0.1 0 0 , 0 0.1 0 , 0 0 0.05 ]" showAxisSizeFactor="0.03" compute_mapping_inertia="0" />
4264

4365
<BoxConstraint box="-0.2 -1 -0.2 0.2 -0.8 0.2 0.4 0.3 -0.8 0.8 0.7 -0.7" />
4466

45-
<FixedRotationConstraint FixedZRotation="true" />
67+
<FixedRotationProjectiveConstraint FixedZRotation="true" />
4668
<TriangularBendingFEMForceField name="FEM" bending="true"
4769
youngModulus="5000000" poissonRatio="0.45" thickness="0.05" />
4870

@@ -53,13 +75,13 @@
5375
<TriangleSetTopologyContainer name="subTrianglesTopo"
5476
position="@/TargetMesh/targetTopo.position" triangles="@/TargetMesh/targetTopo.triangles" />
5577
<MechanicalObject name="subCoarse_MO" rest_position="@/TargetMesh/targetTopo.position" />
56-
<BendingPlateMechanicalMapping printLog="1" object1="coarseMesh_MO" object2="subCoarse_MO" name="MappingShells" isMechanical="false"/>
78+
<BendingPlateMechanicalMapping printLog="1" input="@../coarseMesh_MO" output="@subCoarse_MO" name="MappingShells" isMechanical="false"/>
5779

58-
<Node>
80+
<Node name="Visu">
5981
<OglModel name="Visual" color="red"/>
60-
<IdentityMapping object1="subCoarse_MO" object2="Visual"/>
82+
<IdentityMapping input="@../subCoarse_MO" output="@Visual"/>
6183
</Node>
6284
</Node>
6385

6486
</Node>
65-
</Node>
87+
</Node>

0 commit comments

Comments
 (0)