Skip to content

Materials in "elements"

Current AsFem does not parse a top-level "mates" block. ReadInputFile.cpp only accepts the block names listed there, and "mates" is not one of them.

Materials are now defined inline inside each "elements" subblock:

json { "elements": { "elmt1": { "type": "diffusion", "dofs": ["c"], "material": { "type": "constdiffusion", "parameters": { "D": 1.0 } } } } }

Material object

  • "type": required if "material" is present.
  • "parameters": optional JSON object. The parser stores this object and passes it to the material implementation.

The parser checks the material type name here, but it does not validate every parameter key in ReadElmtsBlock.cpp. Parameter names are material-specific and are enforced later by the material code. The shipped example JSON files are the best reference for the expected parameter sets.

Supported material types

text constpoisson poisson1d-benchmark poisson2d-benchmark nonlinear-poisson2d nonlinear-poisson3d constdiffusion nonlinear-diffusion2d constthermal linearelastic saintvenant neohookean smallstrainj2plasticity smallstrainexplawj2plasticity doublewell binarymixture kobayashimate wave smallstraincahnhilliard smallstraindiffusion smallstraindiffusionj2plasticity linearelasticfracture neohookeanpffracture miehefracture diffusionacfracture user1 ... user10