fenics-constitutive
Complex constitutive models beyond the FEniCS UFL.
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 7 DOI reference(s) in README -
✓Academic publication links
Links to: sciencedirect.com, zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.9%) to scientific vocabulary
Keywords
Repository
Complex constitutive models beyond the FEniCS UFL.
Basic Info
- Host: GitHub
- Owner: BAMresearch
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://fenics-constitutive.readthedocs.io/en/latest/
- Size: 12.2 MB
Statistics
- Stars: 13
- Watchers: 5
- Forks: 6
- Open Issues: 14
- Releases: 3
Topics
Metadata Files
README.md
fenics-constitutive
This project provides a framework for using nonlinear constitutive material models in dolfinx with the goal of making it easy to implement new models and to use these models interchangeably in a simulation. This is made possible by prescribing a simple interface for the constitutive models and by providing a simple wrapper around the dolfinx NonlinearProblem that uses the constitutive model to compute the residual and the stiffness matrix. The project is currently focussed on small strain models with the goal of supporting large deformations through the use of objective stress rates and, therefore, also supporting a subset of the functionality provided by Abaqus UMATs or Ansys material models.
Although the project contains some constitutive models -- and will contain more in the foreseeable future -- we are currently not focussed on creating a comprehensive library of models. Instead, through the simplicity of the provided interface which only uses numpy.ndarray as a complex datatype, we want to enable users to write their own models in any language that can be linked to Python, while still being able to use their models in simulation scripts that other users have written using our interface.
Documentation
https://fenics-constitutive.readthedocs.io/en/latest/
Installation using conda/mamba
Clone the repository and create a new environment from the environment.yml file:
bash
git clone https://github.com/BAMresearch/fenics-constitutive.git
cd fenics-constitutive
mamba env create -f environment.yml
This automatically installs the required dependencies and the package itself.
Alternatively, if you have all dependencies listed in the environment.yml file installed, you can install the package using pip after cloning:
bash
git clone https://github.com/BAMresearch/fenics-constitutive.git
cd fenics-constitutive
pip install -e .
Usage
Since this project is based on FEniCSx, a basic knowledge of using FEniCSx is required. Similarly to any other FEniCSx project, you need to create a mesh, function spaces and boundary conditions. Defining the weak form is handled by the IncrSmallStrainProblem class. However, you may write your own Newton solver.
```python import dolfinx as df from dolfinx.nls.petsc import NewtonSolver from fenicsconstitutive import ( IncrSmallStrainProblem, IncrSmallStrainModel, StressStrainConstraint, ) from fenicsconstitutive.models import LinearElasticityModel
youngsmodulus = 42.0 poissonsratio = 0.3
mesh = df.mesh.createunitcube(MPI.COMMWORLD, 2, 2, 2) V = df.fem.functionspace(mesh, ("CG", 2, (2,))) u = df.fem.Function(V) law = LinearElasticityModel( {"E": youngsmodulus, "nu": poissons_ratio}, StressStrainConstraint.FULL, )
def left_boundary(x): return np.isclose(x[0], 0.0)
def right_boundary(x): return np.isclose(x[0], 1.0)
dofsleft = df.fem.locatedofsgeometrical(V, leftboundary) dofsright = df.fem.locatedofsgeometrical(V, rightboundary) bcleft = df.fem.dirichletbc(np.array([0.0, 0.0, 0.0]), dofsleft, V) bcright = df.fem.dirichletbc(np.array([0.01, 0.0, 0.0]), dofsright, V)
problem = IncrSmallStrainProblem( law, u, [bcleft, bcright], 1, )
solver = NewtonSolver(MPI.COMM_WORLD, problem) n, converged = solver.solve(u) problem.update()
```
Currently the Python package contains the following models:
- Linear elasticity for uniaxial stress, uniaxial strain, plane stress, plane strain, and full 3D stress and strain states.
- Mises plasticity with isotropic nonlinear hardening.
- Two viscoelasticity models: Standard linear solid model in both Maxwell representation and Kelvin-Voigt representation.
Citing
If you use this package in your research, please cite it using the following bibtex entry for our paper in Advances in Engineering Software:
bibtex
@Article{Rosenbusch2025AiES,
author = {Sjard Mathis Rosenbusch and Philipp Diercks and Vitaliy Kindrachuk and Jörg F. Unger},
journal = {Advances in Engineering Software},
title = {Integrating custom constitutive models into FEniCSx: A versatile approach and case studies},
year = {2025},
issn = {0965-9978},
pages = {103922},
volume = {206},
doi = {https://doi.org/10.1016/j.advengsoft.2025.103922},
keywords = {Finite element method, Constitutive models, FEniCSx, UMAT, Rust, Python, C++},
url = {https://www.sciencedirect.com/science/article/pii/S0965997825000602},
}
Additionally, if you want to cite a specific version of the software, you can use the published records on Zenodo.
Owner
- Name: Bundesanstalt für Materialforschung und -prüfung
- Login: BAMresearch
- Kind: organization
- Email: oss@bam.de
- Location: Berlin/Germany
- Website: www.bam.de
- Repositories: 36
- Profile: https://github.com/BAMresearch
German Federal scientific research institute for materials testing and research
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: fenics-constitutive
message: Please cite this software using these metadata.
type: software
authors:
- given-names: Philipp
family-names: Diercks
orcid: 'https://orcid.org/0000-0003-4495-4423'
- given-names: Annika
family-names: Robens-Radermacher
orcid: 'https://orcid.org/0000-0001-9653-6085'
- given-names: Sjard Mathis
family-names: Rosenbusch
orcid: 'https://orcid.org/0009-0006-4444-2494'
- given-names: Jörg F.
family-names: Unger
orcid: 'https://orcid.org/0000-0003-0035-0951'
- given-names: Saif-Ur-Rehman
orcid: 'https://orcid.org/0009-0007-6609-8601'
repository-code: 'https://github.com/BAMresearch/fenics-constitutive'
abstract: >-
This software enables the use of nonlinear constitutive
models with FEniCSx.
license: MIT
GitHub Events
Total
- Create event: 11
- Issues event: 10
- Release event: 2
- Watch event: 1
- Delete event: 4
- Issue comment event: 16
- Push event: 55
- Pull request review comment event: 42
- Pull request review event: 41
- Pull request event: 13
- Fork event: 3
Last Year
- Create event: 11
- Issues event: 10
- Release event: 2
- Watch event: 1
- Delete event: 4
- Issue comment event: 16
- Push event: 55
- Pull request review comment event: 42
- Pull request review event: 41
- Pull request event: 13
- Fork event: 3
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 9
- Total pull requests: 7
- Average time to close issues: 9 months
- Average time to close pull requests: 2 months
- Total issue authors: 2
- Total pull request authors: 2
- Average comments per issue: 0.67
- Average comments per pull request: 0.29
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 5
- Pull requests: 7
- Average time to close issues: 3 days
- Average time to close pull requests: 2 months
- Issue authors: 1
- Pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 0.29
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- srosenbu (27)
- TTitscher (9)
- eriktamsen (2)
- joergfunger (1)
- pdiercks (1)
Pull Request Authors
- srosenbu (13)
- saifr68 (2)
- pdiercks (2)
- ajafarihub (1)
- aradermacher (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- doit *
- ipython *
- nbconvert *
- sphinx *
- sphinx_rtd_theme *
- JamesIves/github-pages-deploy-action 4.0.0-beta-01 composite
- actions/checkout v2 composite