|
1 | 1 | <?xml version="1.0" ?> |
2 | | -<!-- SubsetTopologicalMultiMapping example |
3 | | - Demonstrates merging multiple topologies into one for every supported element type. |
4 | | - Four demos placed side by side along x: |
5 | | -
|
6 | | - x=0: Triangles - two 4x4 triangle grids merged, Source2 normals flipped |
7 | | - x=5: Quads - two 4x4 quad grids merged, Source2 normals flipped |
8 | | - x=10: Tetrahedra - two 3x3x3 grids converted to tetrahedra then merged |
9 | | - x=16: Hexahedra - two 3x3x3 hexahedral grids merged |
10 | | ---> |
11 | 2 | <Node name="root" dt="1e-3" gravity="0 -1 0"> |
12 | 3 | <RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [GridMeshCreator] --> |
13 | 4 | <RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] --> |
|
28 | 19 | <EulerImplicitSolver rayleighStiffness="0.1" rayleighMass="0.1" /> |
29 | 20 | <CGLinearSolver iterations="25" tolerance="1e-5" threshold="1e-5"/> |
30 | 21 |
|
31 | | - <!-- ==================== TRIANGLES (x=0) ==================== --> |
32 | 22 | <Node name="TriangleDemo"> |
33 | 23 | <Node name="Source1"> |
34 | 24 | <GridMeshCreator name="loader" filename="nofile" resolution="4 4" trianglePattern="2" /> |
|
47 | 37 | <MeshTopology name="topology" /> |
48 | 38 | <MechanicalObject template="Vec3" name="dofs" /> |
49 | 39 |
|
50 | | - <SubsetTopologicalMultiMapping |
| 40 | + <SubsetTopologicalMultiMapping name="topoMapping" |
51 | 41 | input="@../Source1/topology @../Source2/topology" |
52 | 42 | output="@topology" |
53 | | - subsetMultiMapping="@mapping" |
54 | 43 | flipNormals="0 1" /> |
55 | 44 |
|
56 | 45 | <SubsetMultiMapping template="Vec3,Vec3" name="mapping" |
57 | 46 | input="@../Source1/dofs @../Source2/dofs" |
58 | | - output="@dofs" /> |
| 47 | + output="@dofs" |
| 48 | + indexPairs="@topoMapping.indexPairs" /> |
59 | 49 |
|
60 | 50 | <UniformMass vertexMass="1" /> |
61 | 51 |
|
|
66 | 56 | </Node> |
67 | 57 | </Node> |
68 | 58 |
|
69 | | - <!-- ==================== QUADS (x=5) ==================== --> |
70 | 59 | <Node name="QuadDemo"> |
71 | 60 | <Node name="Source1"> |
72 | 61 | <GridMeshCreator name="loader" filename="nofile" resolution="4 4" trianglePattern="0" |
|
86 | 75 | <MeshTopology name="topology" /> |
87 | 76 | <MechanicalObject template="Vec3" name="dofs" /> |
88 | 77 |
|
89 | | - <SubsetTopologicalMultiMapping |
| 78 | + <SubsetTopologicalMultiMapping name="topoMapping" |
90 | 79 | input="@../Source1/topology @../Source2/topology" |
91 | 80 | output="@topology" |
92 | | - subsetMultiMapping="@mapping" |
93 | 81 | flipNormals="0 1" /> |
94 | 82 |
|
95 | 83 | <SubsetMultiMapping template="Vec3,Vec3" name="mapping" |
96 | 84 | input="@../Source1/dofs @../Source2/dofs" |
97 | | - output="@dofs" /> |
| 85 | + output="@dofs" |
| 86 | + indexPairs="@topoMapping.indexPairs" /> |
98 | 87 |
|
99 | 88 | <UniformMass vertexMass="1" /> |
100 | 89 |
|
|
105 | 94 | </Node> |
106 | 95 | </Node> |
107 | 96 |
|
108 | | - <!-- ==================== TETRAHEDRA (x=10) ==================== --> |
109 | 97 | <Node name="TetraDemo"> |
110 | | - <!-- Each source uses RegularGridTopology (hexa) + Hexa2TetraTopologicalMapping to produce tetrahedra --> |
111 | 98 | <Node name="Source1"> |
112 | 99 | <RegularGridTopology name="grid" n="3 3 3" min="10 0 0" max="12 2 2" /> |
113 | 100 | <MechanicalObject template="Vec3" name="dofs" /> |
|
132 | 119 | <MeshTopology name="topology" /> |
133 | 120 | <MechanicalObject template="Vec3" name="dofs" /> |
134 | 121 |
|
135 | | - <SubsetTopologicalMultiMapping |
| 122 | + <SubsetTopologicalMultiMapping name="topoMapping" |
136 | 123 | input="@../Source1/Tetra/topology @../Source2/Tetra/topology" |
137 | | - output="@topology" |
138 | | - subsetMultiMapping="@mapping" /> |
| 124 | + output="@topology" /> |
139 | 125 |
|
140 | 126 | <SubsetMultiMapping template="Vec3,Vec3" name="mapping" |
141 | 127 | input="@../Source1/dofs @../Source2/dofs" |
142 | | - output="@dofs" /> |
| 128 | + output="@dofs" |
| 129 | + indexPairs="@topoMapping.indexPairs" /> |
143 | 130 |
|
144 | 131 | <UniformMass vertexMass="1" /> |
145 | 132 |
|
|
150 | 137 | </Node> |
151 | 138 | </Node> |
152 | 139 |
|
153 | | - <!-- ==================== HEXAHEDRA (x=16) ==================== --> |
154 | 140 | <Node name="HexaDemo"> |
155 | 141 | <Node name="Source1"> |
156 | 142 | <RegularGridTopology name="grid" n="3 3 3" min="16 0 0" max="18 2 2" /> |
|
166 | 152 | <MeshTopology name="topology" /> |
167 | 153 | <MechanicalObject template="Vec3" name="dofs" /> |
168 | 154 |
|
169 | | - <SubsetTopologicalMultiMapping |
| 155 | + <SubsetTopologicalMultiMapping name="topoMapping" |
170 | 156 | input="@../Source1/grid @../Source2/grid" |
171 | | - output="@topology" |
172 | | - subsetMultiMapping="@mapping" /> |
| 157 | + output="@topology" /> |
173 | 158 |
|
174 | 159 | <SubsetMultiMapping template="Vec3,Vec3" name="mapping" |
175 | 160 | input="@../Source1/dofs @../Source2/dofs" |
176 | | - output="@dofs" /> |
| 161 | + output="@dofs" |
| 162 | + indexPairs="@topoMapping.indexPairs" /> |
177 | 163 |
|
178 | 164 | <UniformMass vertexMass="1" /> |
179 | 165 |
|
|
0 commit comments