Skip to content

Source: examples/mechanics

Mechanics examples

The upstream examples/mechanics folder covers small- and finite-strain solid mechanics, generated and imported meshes, static and transient loading, traction and rotated Dirichlet boundary conditions, and elastoplastic materials with optional postprocessing.

Files in this folder

Representative input

neohookean-cookmembrane-2d.json is a good reference for imported meshes, traction loading, and projected stresses:

json { "mesh": { "type": "msh4", "file": "cookmembrane2d.msh", "savemesh": false }, "dofs": { "names": ["ux", "uy"] }, "elements": { "elmt1": { "type": "mechanics", "dofs": ["ux", "uy"], "domain": ["alldomain"], "material": { "type": "neohookean", "parameters": { "Lame": 432.099, "mu": 185.185 } } } }, "projection": { "type": "fullleastsquare", "scalarmate": ["vonMises-stress", "vonMises-strain", "hydrostatic-stress"], "rank2mate": ["stress", "strain", "cauchy-stress"] }, "bcs": { "fix": { "type": "dirichlet", "dofs": ["ux", "uy"], "bcvalue": 0.0, "side": ["left"] }, "load": { "type": "traction", "dofs": ["uy"], "bcvalue": 0.0, "side": ["right"], "parameters": { "component": 2, "traction": [0.0, 20.0, 0.0] } } }, "job": { "type": "static", "print": "dep" } }

Notes

  • All files in this folder use "type":"mechanics" inside "elements", and the material selects the constitutive model.
  • Material coverage includes linearelastic, saintvenant, neohookean, smallstrainj2plasticity, and smallstrainexplawj2plasticity.
  • The folder is also the main reference for advanced mechanics boundary-condition types such as "traction" and "rotateddirichlet".
  • Elastoplastic cases are transient and are the main mechanics examples that also use "postprocess".
  • Several upstream files still include "restart": true inside "job", but the current parser ignores that field.