Skip to content

HexahedronCompositeFEMForceFieldAndMass

Non uniform Hexahedral finite elements

Templates:

  • Vec3d

Target: Sofa.Component.SolidMechanics.FEM.NonUniform

namespace: sofa::component::solidmechanics::fem::nonuniform

parents:

  • NonUniformHexahedronFEMForceFieldAndMass

Data:

Name Description Default value
name object name unnamed
printLog if true, emits extra messages at runtime. 0
tags list of the subsets the objet belongs to
bbox this object bounding box
componentState The state of the component among (Dirty, Valid, Undefined, Loading, Invalid). Undefined
listening if true, handle the events, otherwise ignore the events 0
isCompliance Consider the component as a compliance, else as a stiffness 0
rayleighStiffness Rayleigh damping - stiffness matrix coefficient 0
separateGravity add separately gravity to velocity computation 0
rayleighMass Rayleigh damping - mass matrix coefficient 0
method "large" or "polar" or "small" displacements large
poissonRatio FEM Poisson Ratio in Hooke's law [0,0.5[ 0.45
youngModulus FEM Young's modulus in Hooke's law 5000
updateStiffnessMatrix 0
gatherPt number of dof accumulated per threads during the gather operation (Only use in GPU version)
gatherBsize number of dof accumulated per threads during the gather operation (Only use in GPU version)
stiffnessMatrices Stiffness matrices per element (K_i)
initialPoints Initial Position
massMatrices Mass matrices per element (M_i)
density density == volumetric mass in english (kg.m-3) 1
lumpedMass Does it use lumped masses? 0
nbVirtualFinerLevels use virtual finer levels, in order to compte non-uniform stiffness 0
useMass Using this ForceField like a Mass? (rather than using a separated Mass) 1
totalMass 0
finestToCoarse Does the homogenization is done directly from the finest level to the coarse one? 0
homogenizationMethod 0->static, 1->constrained static, 2->modal analysis 0
completeInterpolation Is the non-linear, complete interpolation used? 0
useRamification If SparseGridRamification, are ramifications taken into account? 1
Visualization
drawing draw the forcefield if true 1
drawPercentageOffset size of the hexa 0.15
drawType 0
drawColor 0
drawSize -1

Links:

Name Description
context Graph Node containing this object (or BaseContext::getDefault() if no graph is used)
slaves Sub-objects used internally by this object
master nullptr for regular objects, or master object for which this object is one sub-objects
mechanicalStates List of mechanical states to which this component is associated
mstate MechanicalState used by this component
topology link to the topology container
topology link to the topology container

Examples

Component/SolidMechanics/FEM/HexahedronCompositeFEMForceFieldAndMass.scn

<?xml version="1.0" ?>
<Node name="root" gravity="0 -700 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 [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.Engine.Select"/> <!-- Needed to use components [BoxROI] -->
    <RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
    <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.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
    <RequiredPlugin name="Sofa.Component.SolidMechanics.FEM.NonUniform"/> <!-- Needed to use components [HexahedronCompositeFEMForceFieldAndMass HexahedronCompositeFEMMapping] -->
    <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.Topology.Container.Grid"/> <!-- Needed to use components [SparseGridMultipleTopology] -->
    <RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
    <RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->

    <!-- A soft gelatin object contains 2 bead, one stiff and one soft. Even using large embedding mesh, the
      HexahedronCompositeFEM permits to well simulate the global behavior, and the HexahedronCompositeFEMMapping
      permits to have a good interpolation of the inside bead behaviors.-->
      <DefaultAnimationLoop/>
    <VisualStyle displayFlags="showVisual showForceFields" />
    <Node name="plane">
        <MeshOBJLoader name="meshLoader_0" filename="mesh/plane_loop_2.obj" scale=".2" handleSeams="1" />
        <OglModel name="plan" src="@meshLoader_0" rx="90" rz="90" dy="-2.01" material="Default Diffuse 1 1 0.4 0.4 1 Ambient 1 0.8 0.8 0.8 1 Specular 0 1 1 1 1 Emissive 0 1 1 1 1 Shininess 0 45" />
    </Node>
    <CollisionPipeline depth="6" verbose="0" draw="0" />
    <BruteForceBroadPhase/>
    <BVHNarrowPhase/>
    <MinProximityIntersection name="Proximity" alarmDistance="0.5" contactDistance="0.3" />
    <CollisionResponse name="Response" response="PenalityContactForceField" />
    <Node name="Composite elements with 3 differents material stiffnesses">
        <SparseGridMultipleTopology n="6 3 3" fileTopology="mesh/bubille_out.obj" fileTopologies="mesh/bubille_out.obj mesh/bubille_in1.obj mesh/bubille_in2.obj" nbVirtualFinerLevels="3" finestConnectivity="false" stiffnessCoefs="1 0.0001 50" massCoefs="1 1 1" />
        <EulerImplicitSolver vdamping="0" rayleighMass="0" rayleighStiffness="0" />
        <CGLinearSolver iterations="100" tolerance="1e-5" threshold="1e-5"/>
<!--         <SparseLDLSolver printLog="false"/>
 -->        <MechanicalObject />
        <HexahedronCompositeFEMForceFieldAndMass drawType="0" lumpedMass="false" nbVirtualFinerLevels="2" youngModulus="600" poissonRatio="0.3" method="polar" density=".1" updateStiffnessMatrix="false" printLog="0" />
        <BoxConstraint box="-5 -2.1 -10    10 -1.9 10" />
        <Node name="Collinonunif">
            <MeshOBJLoader name="loader" filename="mesh/bubille_out.obj" />
            <MeshTopology src="@loader" />
            <MechanicalObject src="@loader" />
            <HexahedronCompositeFEMMapping />
            <TriangleCollisionModel />
            <Node name="Soft gelatin">
                <MeshOBJLoader name="meshLoader_2" filename="mesh/bubille_out.obj" handleSeams="1" />
                <OglModel name="VisualBody" src="@meshLoader_2" normals="0" color="0.1 .8 .3 .6" />
                <IdentityMapping input="@.." output="@VisualBody" />
            </Node>
        </Node>
        <Node name="soft bead">
            <MeshOBJLoader name="meshLoader_1" filename="mesh/bubille_in1.obj" handleSeams="1" />
            <OglModel name="VisualBody1" src="@meshLoader_1" normals="0" color="1 0 0 1" />
            <HexahedronCompositeFEMMapping input="@.." output="@VisualBody1" />
        </Node>
        <Node name="stiff bead">
            <MeshOBJLoader name="meshLoader_3" filename="mesh/bubille_in2.obj" handleSeams="1" />
            <OglModel name="VisualBody2" src="@meshLoader_3" normals="0" color="0 0 1 1" />
            <HexahedronCompositeFEMMapping input="@.." output="@VisualBody2" />
        </Node>
    </Node>
</Node>
def createScene(rootNode):

    root = rootNode.addChild('root', gravity="0 -700 0", dt="0.02")
    root.addObject('RequiredPlugin', name="Sofa.Component.Collision.Detection.Algorithm")
    root.addObject('RequiredPlugin', name="Sofa.Component.Collision.Detection.Intersection")
    root.addObject('RequiredPlugin', name="Sofa.Component.Collision.Geometry")
    root.addObject('RequiredPlugin', name="Sofa.Component.Collision.Response.Contact")
    root.addObject('RequiredPlugin', name="Sofa.Component.Constraint.Projective")
    root.addObject('RequiredPlugin', name="Sofa.Component.Engine.Select")
    root.addObject('RequiredPlugin', name="Sofa.Component.IO.Mesh")
    root.addObject('RequiredPlugin', name="Sofa.Component.LinearSolver.Iterative")
    root.addObject('RequiredPlugin', name="Sofa.Component.Mapping.Linear")
    root.addObject('RequiredPlugin', name="Sofa.Component.ODESolver.Backward")
    root.addObject('RequiredPlugin', name="Sofa.Component.SolidMechanics.FEM.NonUniform")
    root.addObject('RequiredPlugin', name="Sofa.Component.StateContainer")
    root.addObject('RequiredPlugin', name="Sofa.Component.Topology.Container.Constant")
    root.addObject('RequiredPlugin', name="Sofa.Component.Topology.Container.Grid")
    root.addObject('RequiredPlugin', name="Sofa.Component.Visual")
    root.addObject('RequiredPlugin', name="Sofa.GL.Component.Rendering3D")
    root.addObject('DefaultAnimationLoop')
    root.addObject('VisualStyle', displayFlags="showVisual showForceFields")

    plane = root.addChild('plane')
    plane.addObject('MeshOBJLoader', name="meshLoader_0", filename="mesh/plane_loop_2.obj", scale=".2", handleSeams="1")
    plane.addObject('OglModel', name="plan", src="@meshLoader_0", rx="90", rz="90", dy="-2.01", material="Default Diffuse 1 1 0.4 0.4 1 Ambient 1 0.8 0.8 0.8 1 Specular 0 1 1 1 1 Emissive 0 1 1 1 1 Shininess 0 45")
    root.addObject('CollisionPipeline', depth="6", verbose="0", draw="0")
    root.addObject('BruteForceBroadPhase')
    root.addObject('BVHNarrowPhase')
    root.addObject('MinProximityIntersection', name="Proximity", alarmDistance="0.5", contactDistance="0.3")
    root.addObject('CollisionResponse', name="Response", response="PenalityContactForceField")

    Composite elements with 3 differents material stiffnesses = root.addChild('Composite elements with 3 differents material stiffnesses')
    Composite elements with 3 differents material stiffnesses.addObject('SparseGridMultipleTopology', n="6 3 3", fileTopology="mesh/bubille_out.obj", fileTopologies="mesh/bubille_out.obj mesh/bubille_in1.obj mesh/bubille_in2.obj", nbVirtualFinerLevels="3", finestConnectivity="false", stiffnessCoefs="1 0.0001 50", massCoefs="1 1 1")
    Composite elements with 3 differents material stiffnesses.addObject('EulerImplicitSolver', vdamping="0", rayleighMass="0", rayleighStiffness="0")
    Composite elements with 3 differents material stiffnesses.addObject('CGLinearSolver', iterations="100", tolerance="1e-5", threshold="1e-5")
    Composite elements with 3 differents material stiffnesses.addObject('MechanicalObject')
    Composite elements with 3 differents material stiffnesses.addObject('HexahedronCompositeFEMForceFieldAndMass', drawType="0", lumpedMass="false", nbVirtualFinerLevels="2", youngModulus="600", poissonRatio="0.3", method="polar", density=".1", updateStiffnessMatrix="false", printLog="0")
    Composite elements with 3 differents material stiffnesses.addObject('BoxConstraint', box="-5 -2.1 -10    10 -1.9 10")

    Collinonunif = Composite elements with 3 differents material stiffnesses.addChild('Collinonunif')
    Collinonunif.addObject('MeshOBJLoader', name="loader", filename="mesh/bubille_out.obj")
    Collinonunif.addObject('MeshTopology', src="@loader")
    Collinonunif.addObject('MechanicalObject', src="@loader")
    Collinonunif.addObject('HexahedronCompositeFEMMapping')
    Collinonunif.addObject('TriangleCollisionModel')

    Soft gelatin = Collinonunif.addChild('Soft gelatin')
    Soft gelatin.addObject('MeshOBJLoader', name="meshLoader_2", filename="mesh/bubille_out.obj", handleSeams="1")
    Soft gelatin.addObject('OglModel', name="VisualBody", src="@meshLoader_2", normals="0", color="0.1 .8 .3 .6")
    Soft gelatin.addObject('IdentityMapping', input="@..", output="@VisualBody")

    soft bead = Composite elements with 3 differents material stiffnesses.addChild('soft bead')
    soft bead.addObject('MeshOBJLoader', name="meshLoader_1", filename="mesh/bubille_in1.obj", handleSeams="1")
    soft bead.addObject('OglModel', name="VisualBody1", src="@meshLoader_1", normals="0", color="1 0 0 1")
    soft bead.addObject('HexahedronCompositeFEMMapping', input="@..", output="@VisualBody1")

    stiff bead = Composite elements with 3 differents material stiffnesses.addChild('stiff bead')
    stiff bead.addObject('MeshOBJLoader', name="meshLoader_3", filename="mesh/bubille_in2.obj", handleSeams="1")
    stiff bead.addObject('OglModel', name="VisualBody2", src="@meshLoader_3", normals="0", color="0 0 1 1")
    stiff bead.addObject('HexahedronCompositeFEMMapping', input="@..", output="@VisualBody2")