Skip to content

ParallelTetrahedronFEMForceField

Parallel tetrahedral finite elements

Vec3d

Templates:

  • Vec3d

Target: MultiThreading

namespace: multithreading::component::solidmechanics::fem::elastic

parents:

  • TetrahedronFEMForceField

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
rayleighStiffness Rayleigh damping - stiffness matrix coefficient 0
poissonRatio FEM Poisson Ratio in Hooke's law [0,0.5[ 0.45
youngModulus FEM Young's Modulus in Hooke's law 5000
initialPoints Initial Position
method "small", "large" (by QR), "polar" or "svd" displacements large
localStiffnessFactor Allow specification of different stiffness per element. If there are N element and M values are specified, the youngModulus factor for element i would be localStiffnessFactor[i*M/N]
updateStiffnessMatrix 0
computeGlobalMatrix 0
plasticMaxThreshold Plastic Max Threshold (2-norm of the strain) 0
plasticYieldThreshold Plastic Yield Threshold (2-norm of the strain) 0.0001
plasticCreep Plastic Creep Factor * dt [0,1]. Warning this factor depends on dt. 0.9
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)
computeVonMisesStress compute and display von Mises stress: 0: no computations, 1: using corotational strain, 2: using full Green strain. Set listening=1 0
vonMisesPerElement von Mises Stress per element
vonMisesPerNode von Mises Stress per node
vonMisesStressColors Vector of colors describing the VonMises stress
updateStiffness udpate structures (precomputed in init) using stiffness parameters in each iteration (set listening=1) 0
nbThreads If not yet initialized, the main task scheduler is initialized with this number of threads. 0 corresponds to the number of available cores on the CPU. -n (minus) corresponds to the number of available cores on the CPU minus the provided number. 0
taskSchedulerType Type of task scheduler to use. _default
Visualization
drawHeterogeneousTetra Draw Heterogeneous Tetra in different color 0
showStressColorMap Color map used to show stress values Blue to Red
showStressAlpha Alpha for vonMises visualisation 1
showVonMisesStressPerNode draw points showing vonMises stress interpolated in nodes 0
showVonMisesStressPerNodeColorMap draw elements showing vonMises stress interpolated in nodes 0
showVonMisesStressPerElement draw triangles showing vonMises stress interpolated in elements 0
showElementGapScale draw gap between elements (when showWireFrame is disabled) [0,1]: 0: no gap, 1: no element 0.333
Name Description Destination type name
context Graph Node containing this object (or BaseContext::getDefault() if no graph is used) BaseContext
slaves Sub-objects used internally by this object BaseObject
master nullptr for regular objects, or master object for which this object is one sub-objects BaseObject
mechanicalStates List of mechanical states to which this component is associated BaseMechanicalState
mstate MechanicalState used by this component MechanicalState<Vec3d>
topology link to the topology container BaseMeshTopology

Examples

ParallelTetrahedronFEMForceField.scn

<?xml version="1.0"?>
<Node name="root" dt="0.01" gravity="0 -9 0">
    <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.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
    <RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [DiagonalMass] -->
    <RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
    <RequiredPlugin name="Sofa.Component.SolidMechanics.FEM.Elastic"/> <!-- Needed to use components [TetrahedronFEMForceField] -->
    <RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
    <RequiredPlugin name="Sofa.Component.Topology.Container.Dynamic"/> <!-- Needed to use components [TetrahedronSetGeometryAlgorithms TetrahedronSetTopologyContainer TetrahedronSetTopologyModifier] -->
    <RequiredPlugin name="Sofa.Component.Topology.Container.Grid"/> <!-- Needed to use components [RegularGridTopology] -->
    <RequiredPlugin name="Sofa.Component.Topology.Mapping"/> <!-- Needed to use components [Hexa2TetraTopologicalMapping] -->
    <RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->

    <VisualStyle displayFlags="showBehaviorModels showForceFields" />

    <Node name="BeamFEM_LARGE">
        <EulerImplicitSolver name="cg_odesolver" printLog="false"  rayleighStiffness="0.1" rayleighMass="0.1" />
        <CGLinearSolver iterations="25" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9"/>

        <RegularGridTopology name="grid" min="-5 -5 0" max="5 5 40" n="5 5 20"/>
        <MechanicalObject template="Vec3d" translation="11 0 0"/>

        <TetrahedronSetTopologyContainer name="Tetra_topo"/>
        <TetrahedronSetTopologyModifier name="Modifier" />
        <TetrahedronSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" />
        <Hexa2TetraTopologicalMapping input="@grid" output="@Tetra_topo" />

        <DiagonalMass massDensity="0.2" />
        <ParallelTetrahedronFEMForceField name="FEM" youngModulus="1000" poissonRatio="0.4" computeGlobalMatrix="false"
                                  method="large" computeVonMisesStress="1" showVonMisesStressPerElement="true"/>

        <BoxROI template="Vec3d" name="box_roi" box="-6 -6 -1 50 6 0.1" drawBoxes="1" />
        <FixedProjectiveConstraint template="Vec3d" indices="@box_roi.indices" />
    </Node>

</Node>
def createScene(root_node):

   root = root_node.addChild('root', dt="0.01", gravity="0 -9 0")

   root.addObject('RequiredPlugin', name="Sofa.Component.Constraint.Projective")
   root.addObject('RequiredPlugin', name="Sofa.Component.Engine.Select")
   root.addObject('RequiredPlugin', name="Sofa.Component.LinearSolver.Iterative")
   root.addObject('RequiredPlugin', name="Sofa.Component.Mass")
   root.addObject('RequiredPlugin', name="Sofa.Component.ODESolver.Backward")
   root.addObject('RequiredPlugin', name="Sofa.Component.SolidMechanics.FEM.Elastic")
   root.addObject('RequiredPlugin', name="Sofa.Component.StateContainer")
   root.addObject('RequiredPlugin', name="Sofa.Component.Topology.Container.Dynamic")
   root.addObject('RequiredPlugin', name="Sofa.Component.Topology.Container.Grid")
   root.addObject('RequiredPlugin', name="Sofa.Component.Topology.Mapping")
   root.addObject('RequiredPlugin', name="Sofa.Component.Visual")
   root.addObject('VisualStyle', displayFlags="showBehaviorModels showForceFields")

   beam_fem__large = root.addChild('BeamFEM_LARGE')

   beam_fem__large.addObject('EulerImplicitSolver', name="cg_odesolver", printLog="false", rayleighStiffness="0.1", rayleighMass="0.1")
   beam_fem__large.addObject('CGLinearSolver', iterations="25", name="linear solver", tolerance="1.0e-9", threshold="1.0e-9")
   beam_fem__large.addObject('RegularGridTopology', name="grid", min="-5 -5 0", max="5 5 40", n="5 5 20")
   beam_fem__large.addObject('MechanicalObject', template="Vec3d", translation="11 0 0")
   beam_fem__large.addObject('TetrahedronSetTopologyContainer', name="Tetra_topo")
   beam_fem__large.addObject('TetrahedronSetTopologyModifier', name="Modifier")
   beam_fem__large.addObject('TetrahedronSetGeometryAlgorithms', template="Vec3d", name="GeomAlgo")
   beam_fem__large.addObject('Hexa2TetraTopologicalMapping', input="@grid", output="@Tetra_topo")
   beam_fem__large.addObject('DiagonalMass', massDensity="0.2")
   beam_fem__large.addObject('ParallelTetrahedronFEMForceField', name="FEM", youngModulus="1000", poissonRatio="0.4", computeGlobalMatrix="false", method="large", computeVonMisesStress="1", showVonMisesStressPerElement="true")
   beam_fem__large.addObject('BoxROI', template="Vec3d", name="box_roi", box="-6 -6 -1 50 6 0.1", drawBoxes="1")
   beam_fem__large.addObject('FixedProjectiveConstraint', template="Vec3d", indices="@box_roi.indices")