Saint Venant model of hyperelasticity in 2D
My question is dedicated to solving silmpe 2D system for Saint Venant–Kirchhoff model of hyperelasticity
-div(E) + grad(p) = 0
div u = 0
where
E = 0.5*(F.T*F - I)
F = grad(u) + I
Any suggestions how to solve it in fenics?
I have tried Mixed fem formulation with NonlinearVariat
from dolfin import *
mesh = Rectangle(0, 0, 1, 1, 10, 10, 'right')
# velocity field
V = VectorFunctionS
# pressure field
Q = FunctionSpace(mesh, "CG", 1)
W = V * Q
(u, p) = TrialFunctions(W)
(v, q) = TestFunctions(W)
def E(v):
return sym(grad(v)) + grad(v)*grad(v).T
F = inner(E(u), grad(v))*dx + div(v)*p*dx + q*div(u)*dx
U = Function(W)
dw = Function(W)
J = derivative(F,dw)
solve(F == 0, U, bcs=None, J=J, solver_
u, p = U.split()
The Error code:
Traceback (most recent call last):
File "/home/
solve(F == 0, U, bcs=None, J=J, solver_
File "/usr/lib/
_solve_
File "/usr/lib/
form_
File "/usr/lib/
F = Form(F, form_compiler_
File "/usr/lib/
common_cell)
File "/usr/lib/
return local_jit(*args, **kwargs)
File "/usr/lib/
return jit_compile(form, parameters=p, common_
File "/usr/lib/
return jit_form(object, parameters, common_cell)
File "/usr/lib/
common_
File "/usr/lib/
ir = compute_
File "/usr/lib/
for (i, fd) in enumerate(
File "/usr/lib/
parameters)
File "/usr/lib/
ir[
File "/usr/lib/
terms = transformer.
File "/usr/lib/
loop, entry = self._create_
File "/usr/lib/
error("Only rank 0, 1 and 2 tensors are currently supported: " + repr(key))
File "<string>", line 1, in <lambda>
File "/usr/lib/
raise self._exception
Exception: Only rank 0, 1 and 2 tensors are currently supported: ((0, 'j', 15, 15), (1, 'k', 15, 15), (1, 'k', 15, 15))
I have checked the ranks of used components and it looks like they are right, but there is something wrong with rank(F) i.e.
ufl.log.
Thank you in advance.
minak
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Praveen C
- Solved:
- Last query:
- Last reply: