Problems parsing form file with diff and derivative
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
FFC |
Fix Released
|
High
|
Kristian B. Ølgaard |
Bug Description
FFC has problems parsing the following form file. As I have pointed out in the code, I need to use the following:
from ufl.algorithms import expand_derivatives, strip_variables
L = strip_variables
a = strip_variables
to get it to compile via FFC. This is not needed for SFC, and while SFC takes a few seconds (without these lines), FFC takes 6m 25s)
Also, FFC doesn't like fractional exponents which is pointed out in bug #423398.
# Finite strain elasticity
# Function space
vector = VectorElement(
# Functions
v = TestFunction(
du = TrialFunction(
B = Function(vector) # Body force
u = Function(vector) # Displacement at previous iteration
# Kinematics
I = Identity(3)
F = I + grad(u).T
C = F.T*F
J = sqrt(det(C))
Fbar = J**(-1./3.)*F # Does not like fractional exponents
Cbar = J**(-2./3.)*C # Does not like fractional exponents
E = (J*C - I)/2 # Want to try Cbar here, but using J*C instead
E = variable(E)
# Material law
mu = Constant(
lmbda = Constant(
psi = lmbda/2*(tr(E)**2) + mu*tr(E*E)
S = diff(psi, E)
P = F*S
# Balance of momentum in the reference configuration
L_temp = inner(P, grad(v).T)*dx - inner(B, v)*dx
a_temp = derivative(L_temp, u, du)
# FIXME: Shouldn't need to do the following
from ufl.algorithms import expand_derivatives, strip_variables
L = strip_variables
a = strip_variables
Changed in ffc: | |
status: | New → Confirmed |
assignee: | nobody → oelgaard (k-b-oelgaard) |
Changed in ffc: | |
status: | Confirmed → Fix Released |
Changed in ffc: | |
status: | Fix Released → Fix Committed |
Changed in ffc: | |
status: | Fix Committed → Fix Released |
Are you using optimisation ('-O' flag)?