-
Notifications
You must be signed in to change notification settings - Fork 298
/
MatrixLinearSystem.scn
141 lines (117 loc) · 11.2 KB
/
MatrixLinearSystem.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<Node name="root" dt="0.02" gravity="0 -10 0">
<Node name="plugins">
<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.LinearSolver.Direct"/> <!-- Needed to use components [SparseLDLSolver] -->
<RequiredPlugin name="Sofa.Component.LinearSystem"/> <!-- Needed to use components [MatrixLinearSystem] -->
<RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [BarycentricMapping] -->
<RequiredPlugin name="Sofa.Component.Mapping.NonLinear"/> <!-- Needed to use components [RigidMapping] -->
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [UniformMass] -->
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
<RequiredPlugin name="Sofa.Component.SolidMechanics.FEM.Elastic"/> <!-- Needed to use components [HexahedronFEMForceField] -->
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [HexahedronSetGeometryAlgorithms] -->
<RequiredPlugin name="Sofa.Component.Topology.Container.Grid"/> <!-- Needed to use components [RegularGridTopology] -->
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
<RequiredPlugin name="SofaMatrix"/> <!-- Needed to use components [GlobalSystemMatrixImage] -->
<RequiredPlugin name="Sofa.Component.SolidMechanics.Spring"/> <!-- Needed to use components [StiffSpringForceField] -->
<RequiredPlugin name="Sofa.Component.MechanicalLoad"/> <!-- Needed to use components [ConstantForceField] -->
</Node>
<VisualStyle displayFlags="showBehaviorModels showWireframe" />
<DefaultAnimationLoop/>
<DefaultVisualManagerLoop/>
<Node name="rigidSections">
<EulerImplicitSolver name="odesolver" rayleighStiffness="0.1" rayleighMass="0.1" />
<Node name="matrices">
<MatrixLinearSystem template="CompressedRowSparseMatrixd" name="system" checkIndices="true" printLog="true"/>
<MatrixLinearSystem template="CompressedRowSparseMatrixd" name="GS" assembleStiffness="false" assembleMass="false" assembleDamping="false" assembleGeometricStiffness="true" applyProjectiveConstraints="false"/>
<GlobalSystemMatrixImage name="imageA" linearSystem="@system"/>
<GlobalSystemMatrixImage name="imageGS" linearSystem="@GS"/>
</Node>
<CompositeLinearSystem template="CompressedRowSparseMatrixd" name="solverSystem" linearSystems="@matrices/system @matrices/GS" solverLinearSystem="@matrices/system"/>
<EigenSimplicialLDLT template="CompressedRowSparseMatrixd" linearSystem="@solverSystem"/>
<Node name="red">
<RegularGridTopology name="grid" nx="1" ny="1" nz="20" xmin="0" xmax="0" ymin="-1.5" ymax="1.5" zmin="0" zmax="19" />
<MechanicalObject template="Rigid3d" name="DOFs" showObject="true" showObjectScale="1" position="@grid.position"/>
<FixedProjectiveConstraint indices="0" />
<Node name="FEM">
<RegularGridTopology name="FEM_grid" nx="4" ny="4" nz="20" xmin="-1.5" xmax="1.5" ymin="-1.5" ymax="1.5" zmin="0" zmax="19" />
<MechanicalObject template="Vec3d" name="DOFs" position="@FEM_grid.position" printLog="false"/>
<HexahedronSetGeometryAlgorithms/>
<MeshMatrixMass totalMass="320"/>
<HexahedronFEMForceField name="FEM_a" youngModulus="10000" poissonRatio="0.45" method="large" printLog="false"/>
<RigidMapping geometricStiffness="2" globalToLocalCoords="true" rigidIndexPerPoint="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19"/>
<Node name="Visual">
<RegularGridTopology name="grid" nx="2" ny="2" nz="20" xmin="-1.5" xmax="1.5" ymin="-1.5" ymax="1.5" zmin="0" zmax="19" computeTriangleList="false" />
<OglModel name="visu" lineWidth="5" material="Default Diffuse 0 1 1 1 1 Ambient 1 1 0 0 1 Specular 0 1 0 0 1 Emissive 0 1 0 0 1 Shininess 0 45"/>
<BarycentricMapping input="@../DOFs" output="@visu"/>
</Node>
</Node>
</Node>
<Node name="green">
<VisualStyle displayFlags="showInteractionForceFields" />
<MechanicalObject template="Vec3d" name="DOFs" printLog="false"/>
<RegularGridTopology name="grid" nx="4" ny="4" nz="20" xmin="-1.5" xmax="1.5" ymin="-9" ymax="-6" zmin="0" zmax="19" />
<HexahedronSetGeometryAlgorithms/>
<MeshMatrixMass totalMass="320"/>
<BoxROI template="Vec3d" name="box" box="-1.6 -9.1 -0.1 1.6 -5.1 0.0001"/>
<FixedProjectiveConstraint indices="@box.indices" />
<HexahedronFEMForceField name="FEM_b" youngModulus="10000" poissonRatio="0.45" method="large" printLog="false"/>
<Node name="a">
<BoxROI name="box" position="@../DOFs.position" box="1.4 -6.1 18.9 1.6 -5.9 19.1" drawBoxes="true" doUpdate="false"/>
<MechanicalObject template="Vec3d" name="DOFs"/>
<SubsetMapping input="@../DOFs" output="@DOFs" indices="@box.indices"/>
</Node>
<Node name="b">
<BoxROI name="box" position="@../DOFs.position" box="1.4 -6.1 1.9 1.6 -5.9 2.1" drawBoxes="true" doUpdate="false"/>
<MechanicalObject template="Vec3d" name="DOFs"/>
<SubsetMapping input="@../DOFs" output="@DOFs" indices="@box.indices"/>
</Node>
<MatrixProjectionMethod areJacobiansConstant="true" mechanicalStates="@/rigidSections/green/a/DOFs @/rigidSections/green/a/DOFs"/>
<MatrixProjectionMethod areJacobiansConstant="true" mechanicalStates="@/rigidSections/green/a/DOFs @/rigidSections/green/b/DOFs"/>
<MatrixProjectionMethod areJacobiansConstant="true" mechanicalStates="@/rigidSections/green/b/DOFs @/rigidSections/green/a/DOFs"/>
<MatrixProjectionMethod areJacobiansConstant="true" mechanicalStates="@/rigidSections/green/b/DOFs @/rigidSections/green/b/DOFs"/>
<StiffSpringForceField object1="@a/DOFs" object2="@b/DOFs" spring="0 0 100 1 1" showArrowSize="0.05" drawMode="2"/>
<Node name="Visual">
<RegularGridTopology name="grid" n="@../grid.n" xmin="-1.5" xmax="1.5" ymin="-9" ymax="-6" zmin="0" zmax="19" computeTriangleList="false" />
<OglModel name="visu" lineWidth="2" material="Default Diffuse 0 1 1 1 1 Ambient 1 0 1 0 1 Specular 0 1 0 0 1 Emissive 0 1 0 0 1 Shininess 0 45"/>
<BarycentricMapping input="@../DOFs" output="@visu"/>
</Node>
</Node>
<Node name="blue">
<RegularGridTopology name="grid" nx="1" ny="1" nz="20" xmin="5" xmax="5" ymin="-1.5" ymax="1.5" zmin="0" zmax="19" />
<MechanicalObject template="Rigid3d" name="DOFs" showObject="true" showObjectScale="1" position="@grid.position"/>
<FixedProjectiveConstraint indices="0" />
<Node name="intermediateMapping"> <!-- this mapping is introduced just to verify that geometric stiffness is well projected -->
<MechanicalObject template="Rigid3d" name="DOFs" showObject="false"/>
<ConstantForceField forces="0 0 0.0005 0 0 0"/>
<IdentityMapping input="@../DOFs" output="@DOFs"/>
<Node name="FEM">
<RegularGridTopology name="FEM_grid" nx="4" ny="4" nz="20" xmin="3.5" xmax="6.5" ymin="-1.5" ymax="1.5" zmin="0" zmax="19" />
<MechanicalObject template="Vec3d" name="DOFs" position="@FEM_grid.position" printLog="false"/>
<HexahedronSetGeometryAlgorithms/>
<MeshMatrixMass totalMass="320"/>
<HexahedronFEMForceField name="FEM_c" youngModulus="10000" poissonRatio="0.45" method="large" printLog="false"/>
<RigidMapping geometricStiffness="2" globalToLocalCoords="true" rigidIndexPerPoint="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19"/>
<Node name="Visual">
<RegularGridTopology name="grid" nx="2" ny="2" nz="20" xmin="3.5" xmax="6.5" ymin="-1.5" ymax="1.5" zmin="0" zmax="19" computeTriangleList="false" />
<OglModel name="visu" lineWidth="5" material="Default Diffuse 0 1 1 1 1 Ambient 1 0 0 1 1 Specular 0 1 0 0 1 Emissive 0 1 0 0 1 Shininess 0 45"/>
<BarycentricMapping input="@../DOFs" output="@visu"/>
</Node>
</Node>
</Node>
</Node>
<Node name="spring">
<VisualStyle displayFlags="showInteractionForceFields" />
<Node name="nonMappedDOFsSpring">
<StiffSpringForceField object1="@red/DOFs" object2="@blue/DOFs" spring="19 19 50 1 1" showArrowSize="0.05" drawMode="2"/>
</Node>
<Node name="springBetweenMappedAndNonMapped">
<BoxROI position="@red/FEM/DOFs.position" box="-1.6 -1.6 18.9 -1.4 -1.4 19.1" drawBoxes="true"/>
<BoxROI position="@green/DOFs.position" box="-1.6 -6.1 18.9 -1.4 -5.9 19.1" drawBoxes="true"/>
<StiffSpringForceField object1="@red/FEM/DOFs" object2="@green/DOFs" spring="304 316 100 1 1" showArrowSize="0.05" drawMode="2"/>
</Node>
</Node>
</Node>
</Node>