tianjuxue / jax-am

Additive manufacturing simulation with JAX.
https://jax-am.readthedocs.io/en/latest/
GNU General Public License v3.0
265 stars 56 forks source link

Improving FEniCSx benchmark #6

Open jorgensd opened 1 year ago

jorgensd commented 1 year ago

In https://github.com/tianjuxue/jax-am/blob/e43203f1d6db76a1ae902ed8e9f79d3720d1b1da/jax_am/fem/tests/fenicsx_gold.py#L460-L461 you state that you have problems with modifying the value of the Dirichlet BC, and hence have to redefine the solver at every time step.

Consider: https://jsdokken.com/dolfinx-tutorial/chapter2/hyperelasticity.html

which uses a dolfinx.fem.Constant to assign a value to the traction (similarly you can do this for a dirichlet BC), which means that the solver can be defined outside of the loop.

If you need help implementing this I can help you