SubSetTopology
From SOFAWiki
Contents |
Description
This engine separate topology in two parts, considering a ROI, a topology inside and a topology outside the ROI which can be a sphere or a box
ROI used in this engine are similar to BoxROI and SphereROI
Topological primitives handle are now:
- dofs/vertices - edges - triangles - tetrahedra
Input Data's
- box
- Box defined by two points (xmin,ymin,zmin, xmax,ymax,zmax).
- centers
- Center(s) of the sphere(s).
- radii
- Radius(i) of the sphere(s).
- direction
- Edge direction(if edgeAngle > 0).
- normal
- Normal direction of the triangles (if triAngle > 0)".
- edgeAngle
- Max angle between the direction of the selected edges and the specified direction.
- triAngle
- Max angle between the normal of the selected triangle and the specified normal direction.
Input topology:
- position/rest_position
- Rest position coordinates of the degrees of freedom
- edges
- Edge Topology array.
- triangles
- Triangle Topology array.
- tetrahedra
- Tetrahedron Topology array.
Input parameters
For display:
- drawROI
- If true, Draw ROI(s).
- drawPoints
- If true, Draw Points.
- drawEdges
- If true, Draw Edges.
- drawTriangle
- If true, Draw Triangles.
- drawTetrahedra
- If true, Draw Tetrahedra.
- drawSize
- Rendering size for box and elements.
For behaviour:
- localIndices
- If true, will compute local dof indices in topological elements. (see examples below)
Output Data's
- indices
- Indices of the points contained in the ROI.
- edgeIndices
- Indices of the edges contained in the ROI.
- triangleIndices
- Indices of the triangles contained in the ROI.
- tetrahedronIndices
- Indices of the tetrahedra contained in the ROI.
- pointsInROI
- Points contained in the ROI.
- pointsOutROI
- Points contained out of the ROI.
- edgesInROI
- Edges contained in the ROI.
- edgesOutROI
- Edges contained out of the ROI.
- trianglesInROI
- Triangles contained in the ROI.
- trianglesOutROI
- Triangles contained out of the ROI.
- tetrahedraInROI
- Tetrahedra contained in the ROI.
- tetrahedraOutROI
- Tetrahedra contained out of the ROI.
- nbrborder
- If localIndices option is activated, will give the number of vertices on the border of the ROI (being the n first points of each output Topology).
Simple Examples
Examples using this engine can be found in:
Sofa/examples/Components/engine/SubsetTopology.scn
Same scene, but using the option localIndices:
Sofa/examples/Components/engine/SubsetTopology_localIndicesOption.scn
More complex Example
This example shows how, from a simple mesh, split the input topology into two independent topologies using the engine SubsetTopology and then use different kind of behaviours.
Sofa/examples/Components/engine/SubsetTopology_refiningMesh.scn
For example, here we take a cylinder composed of Tetrahedra and we use tetrahedral finite element on one part of this cylinder and hexahedra finite element on the other part, using a sparse grid.
As you can see this trick could be use to have a global coarse behaviour of an object and just refine one part wanted for observation. These changes, resulting in much faster computation of the global system.
To to this, you need to use the localIndices option of the SubsetTopology engine. And then basically:
Put the MeshLoader and the engine in the parent node:
<Node name="Group"> <MeshGmshLoader name="meshLoader" filename="mesh/truthcylinder1.msh"/> <SubsetTopology template="Vec3d" box="-5 -20 -5 5 -10 5" src="@meshLoader" rest_position="@meshLoader.position" name="Subset" localIndices="1"/> </Node>
Then create two child nodes for the inside and the outside topology, regarding the ROI.
Inside topology:
<Node name="Group"> <Node name="in"> <MechanicalObject template="Vec3d" name="mecaObj1" position="@../Subset.pointsInROI" /> <TetrahedronSetTopologyContainer name="Container" position="@mecaObj1.position" tetrahedra="@../Subset.tetrahedraInROI"/> <TetrahedronSetTopologyModifier name="Modifier" /> <TetrahedronSetTopologyAlgorithms template="Vec3d" name="TopoAlgo" /> <TetrahedronSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" drawTetrahedra="0"/> <TetrahedronFEMForceField name="FEM" youngModulus="1116" ... </Node>
Outside topology:
<Node name="Group"> <Node name="Out"> <MechanicalObject template="Vec3d" name="mecaObj2" /> <SparseGridTopology n="4 7 4" vertices="@../Subset.pointsOutROI" name="name" drawHexahedra="0"/> <UniformMass totalmass="15" /> <HexahedronFEMForceField template="Vec3d" name="FEM" youngModulus="200" /> <Node name="tetra"> <TetrahedronSetTopologyContainer name="Container" position="@../../Subset.pointsOutROI" tetrahedra="@../../Subset.tetrahedraOutROI"/> .... </Node>
And finally use springs for example to link both "objetcs". The Data nbrBorder give you the number of vertices which where on the border of the subdivision. Thus, these vertices are present in both topologies and are placed as the n first vertices.
