<?xml version="1.0" ?>
<!-- See http://wiki.sofa-framework.org/mediawiki/index.php/TutorialForceFieldLiverSprings -->
<Node name="root" gravity="0 -9.81 0" dt="0.02">
    <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 [DiscreteIntersection] -->
    <RequiredPlugin name="Sofa.Component.Collision.Geometry"/> <!-- Needed to use components [SphereCollisionModel] -->
    <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 MeshOBJLoader SphereLoader] -->
    <RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
    <RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [BarycentricMapping] -->
    <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.Spring"/> <!-- Needed to use components [MeshSpringForceField] -->
    <RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
    <RequiredPlugin name="Sofa.Component.Topology.Container.Constant"/> <!-- Needed to use components [MeshTopology] -->
    <RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
    <RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
    <VisualStyle displayFlags="showForceFields" />
    <CollisionPipeline name="CollisionPipeline" verbose="0" />
    <BruteForceBroadPhase/>
    <BVHNarrowPhase/>
    <CollisionResponse name="collision response" response="PenalityContactForceField" />
    <DiscreteIntersection />
    <DefaultAnimationLoop/>
    
    <Node name="Liver" gravity="0 -9.81 0">
        <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" />
        <MeshGmshLoader name="meshLoader0" filename="mesh/liver.msh" />
        <MeshTopology name="mesh" src="@meshLoader0" />
        <MechanicalObject template="Vec3" name="dofs" />
        <MeshSpringForceField template="Vec3" name="Springs" stiffness="4500" />
        <UniformMass template="Vec3" name="mass" totalMass="1.0"/>
        <FixedProjectiveConstraint template="Vec3" name="FixedProjectiveConstraint" indices="3 39 64" />
        <Node name="Visu" gravity="0 -9.81 0">
            <MeshOBJLoader name="meshLoader_0" filename="mesh/liver-smooth.obj" handleSeams="1" />
            <OglModel name="VisualModel" src="@meshLoader_0" material="Default Diffuse 1 1 0 0 1 Ambient 1 0.2 0 0 1 Specular 0 1 0 0 1 Emissive 0 1 0 0 1 Shininess 0 45" />
            <BarycentricMapping template="Vec3,Vec3" name="visual mapping" input="@.." output="@VisualModel" />
        </Node>
        <Node name="Surf" gravity="0 -9.81 0">
            <SphereLoader filename="mesh/liver.sph" />
            <MechanicalObject position="@[-1].position" />
            <SphereCollisionModel listRadius="@[-2].listRadius" />
            <BarycentricMapping name="sphere mapping" />
        </Node>
    </Node>
</Node>
