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¶
linearelastic-2d.json: static 2D linear elasticity on a generatedquad9mesh.linearelastic-2d-tensile.json: transient 2D tensile loading with time-dependent Dirichlet data.linearelastic-3d-tensile.json: 3D transient tensile version.saintvenant-2d.jsonandsaintvenant-3d.json: finite-strain Saint Venant material in 2D and 3D.neohookean-2d.jsonandneohookean-3d.json: static neo-Hookean examples.neohookean-cookmembrane-2d.jsonandneohookean-cookmembrane-3d.json: imported Cook-membrane meshes with"type":"traction"boundary conditions and"projection":{"type":"fullleastsquare"}.neohookean-3d-rotation.json: rotated Dirichlet loading on a 3D bar.logo-rotation.json: imported multi-domain logo mesh with rotated Dirichlet loading.smallstrainj2-2d.jsonandsmallstrainj2-3d.json: small-strain J2 plasticity.smallstrainj2-explaw-2d.json: exponential-hardening J2 plasticity with nodal postprocessing.- Geometry and helper files:
cookmembrane2d.geo,cookmembrane3d.geo,logo.geo, andPlotExpLaw.py.
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, andsmallstrainexplawj2plasticity. - 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": trueinside"job", but the current parser ignores that field.