Download AV/code/ConstituitiveLaws.py from mapengfei/mesh-cardiology: direct link, hf CLI and curl.
- Browser
- Download file 531 Bytes
-
https://huggingface.co/datasets/mapengfei/mesh-cardiology/resolve/main/AV/code/ConstituitiveLaws.py
- Command line
-
hf download hf://datasets/mapengfei/mesh-cardiology/AV/code/ConstituitiveLaws.py
-
curl -L -o ConstituitiveLaws.py https://huggingface.co/datasets/mapengfei/mesh-cardiology/resolve/main/AV/code/ConstituitiveLaws.py
531 Bytes
| from ufl import Coefficient, as_vector | |
| from fenics import * | |
| C01 = 12100.0 | |
| C10 = 7.99 | |
| k1 = 242300.0 | |
| k2 = 57.62 | |
| V = VectorElement("Lagrange", tetrahedron, 2) | |
| f0 = Coefficient(V) | |
| X = Coefficient(V) | |
| F = grad(X) | |
| C = F.T*F | |
| I1 = tr(C) | |
| I4 = inner(f0, C*f0) | |
| P = 2.0*C01*C10*exp(C01*(I1-3))*F + 2.0*k1*(I4-1)*exp(k2*(I4-1.0)*(I4-1.0))*F*outer(f0,f0) | |
| u = TrialFunction(V) | |
| v = TestFunction(V) | |
| # F = inner(first_PK_stress(disp), grad(v))*dx + inner(u, v)*dx | |
| F = inner(F, grad(v))*dx(degree=5) + inner(u, v)*dx | |
| a = lhs(F) | |
| L = rhs(F) | |