<?xml version="1.0" ?>
<!-- See https://wiki.sofa-framework.org/wiki/TutorialTopologyVolumeToSurfaceTopologicalMapping -->
<Node name="root" gravity="0 -9.81 1" dt="0.05">
    <RequiredPlugin name="Sofa.Component.Collision.Detection.Algorithm"/> <!-- Needed to use components [BVHNarrowPhase BruteForceBroadPhase CollisionPipeline] -->
    <RequiredPlugin name="Sofa.Component.Collision.Detection.Intersection"/> <!-- Needed to use components [MinProximityIntersection] -->
    <RequiredPlugin name="Sofa.Component.Collision.Geometry"/> <!-- Needed to use components [TriangleCollisionModel] -->
    <RequiredPlugin name="Sofa.Component.Collision.Response.Contact"/> <!-- Needed to use components [CollisionResponse] -->
    <RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedProjectiveConstraint] -->
    <RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshGmshLoader] -->
    <RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
    <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.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
    <RequiredPlugin name="Sofa.Component.SolidMechanics.FEM.Elastic"/> <!-- Needed to use components [HexahedronFEMForceField] -->
    <RequiredPlugin name="Sofa.Component.SolidMechanics.Spring"/> <!-- Needed to use components [QuadularBendingSprings] -->
    <RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
    <RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [HexahedronSetGeometryAlgorithms HexahedronSetTopologyContainer HexahedronSetTopologyModifier QuadSetGeometryAlgorithms QuadSetTopologyContainer QuadSetTopologyModifier] -->
    <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] -->
    <!-- Basic Components to perform the collision detection -->
    <VisualStyle displayFlags="showBehaviorModels showVisual showWireframe" />
    <CollisionPipeline name="DefaultCollisionPipeline" depth="6" />
    <BruteForceBroadPhase/>
    <BVHNarrowPhase/>
    <MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" />
    <CollisionResponse name="Response" />
    <DefaultAnimationLoop/>
    
    <Node name="Cube">
        <MeshGmshLoader name="loader" filename="mesh/nine_hexa.msh" />
        <EulerImplicitSolver name="cg_odesolver" printLog="0"  rayleighStiffness="0.1" rayleighMass="0.1" />
        <CGLinearSolver template="GraphScattered" name="linear solver" iterations="25" tolerance="1e-09" threshold="1e-09" />
        <MechanicalObject src="@loader" template="Vec3" name="Hexa" />
        <UniformMass template="Vec3" name="Mass" vertexMass="0.25" />
        <HexahedronSetTopologyContainer src="@loader" name="Container" />
        <HexahedronSetTopologyModifier name="Modifier" />
        <HexahedronSetGeometryAlgorithms name="GeomAlgo" template="Vec3" drawHexa="1" drawColorHexahedra="1.0 1.0 0.3" />
        <!--    <RegularGridTopology name="grid" n="6 6 6" min="-10 -10 -10" max="10 10 10" 
      p0="-10 -10 -10"/>-->
        <HexahedronFEMForceField name="FEM" template="Vec3" poissonRatio="0.45" youngModulus="5000"/>
        <FixedProjectiveConstraint template="Vec3" name="Fixed Dofs" indices="12 15 28 31" drawSize="0" />
        <Node name="Q">
            <QuadSetTopologyContainer name="Container" />
            <QuadSetTopologyModifier name="Modifier" />
            <QuadSetGeometryAlgorithms template="Vec3" name="GeomAlgo" />
            <Hexa2QuadTopologicalMapping name="default6" input="@../Container" output="@Container" />
            <QuadularBendingSprings template="Vec3" name="FEM-Bend" stiffness="3000" damping="1" />
            <TriangleCollisionModel name="default7" />
            <Node name="Visu">
                <OglModel name="Visual" color="green" />
                <IdentityMapping template="Vec3,Vec3" name="default8" input="@../../Hexa" output="@Visual" />
            </Node>
        </Node>
    </Node>
</Node>
