<HyperelasticForcefield />

Doxygen: SofaCaribou::forcefield::HyperelasticForcefield

Implementation of an hyperelasticity forcefield for any element type topologies.

Requires a mechanical object. Requires a topology container. Requires a material.

Attribute

Format

Default

Description

printLog

bool

false

Output informative messages at the initialization and during the simulation.

enable_multithreading

bool

false

Enable the multithreading computation of the stiffness matrix. Only use this if you have a very large number of elements, otherwise performance might be worse than single threading. When enabled, use the environment variable OMP_NUM_THREADS=N to use N threads.

material

path

Path to a material component.

topology

path

Path to a topology container (or path to a mesh) that contains the elements.

draw_scale

float

0.85

Scaling factor for the drawing of elements (between 0 and 1). The factor allows to shrink the element relative to its center point when drawing it.

template

option

The template argument is used to specified the element type on which to compute the hyperelasticity force. By default, the component will try to deduce its element type from the given topology.

  • Tetrahedron - 4 nodes tetrahedral elements

  • Tetrahedron10 - 10 nodes tetrahedral elements

  • Hexahedron - 8 nodes hexahedral elements

  • Hexahedron20 - 20 nodes hexahedral elements

Quick example

XML

<Node>
    <RegularGridTopology name="grid" min="-7.5 -7.5 0" max="7.5 7.5 80" n="9 9 21" />
    <MechanicalObject src="@grid" />
    <HexahedronSetTopologyContainer name="topology" src="@grid" />
    <SaintVenantKirchhoffMaterial young_modulus="3000" poisson_ratio="0.49" />
    <HyperelasticForcefield topology="@topology" template="Hexahedron" printLog="1" />
</Node>

Python

node.addObject("RegularGridTopology", name="grid", min=[-7.5, -7.5, 0], max=[7.5, 7.5, 80], n=[9, 9, 21])
node.addObject("MechanicalObject", src="@grid")
node.addObject("HexahedronSetTopologyContainer", name="topology", src="@grid")
node.addObject("SaintVenantKirchhoffMaterial", young_modulus=3000, poisson_ratio=0.49)
node.addObject("HyperelasticForcefield", topology="@topology", template="Hexahedron", printLog=True)

Available python bindings

class HyperelasticForceField
K()
Returns

Reference to the forcefield tangent stiffness matrix

Return type

scipy.sparse.csc_matrix

Note

No copy involved.

Get the tangent stiffness matrix of the force field as a compressed sparse column major matrix.

cond()
Returns

Condition number of the forcefield’s tangent stiffness matrix

Return type

numpy.double

eigenvalues()
Returns

Reference to the eigen values of the forcefield’s tangent stiffness matrix.

Return type

list[numpy.double]