Thank you very much for your help.
Since in one of their example the continuation method is implemented, I will try to modify my initial code to include it.
from dolfin import *
import fenics as fe
import numpy as np
mesh = RectangleMesh(Point(0.0, 0.0), Point(1.0, 0.1), 50, 50, "crossed")
V = VectorFunctionSpace(mesh, "Lagrange", 2)
left = CompiledSubDomain("near(x[0], side) && on_boundary", side=0.0, tol=10e-15)
right = CompiledSubDomain("near(x[0], side) && on_boundary", side=1.0, tol=10e-15)
c = Expression(("0.0", "0.0"), degree=2)
d = Expression(("0.0", "0.0"), degree=2)
t = Expression((("-hh","0.0")), hh=2200., degree=2)
du = TrialFunction(V)
v = TestFunction(V)
u = Function(V)
D = mesh.topology().dim()
print(D)
neumann_domain = MeshFunction("size_t", mesh, D-1)
neumann_domain.set_all(0)
CompiledSubDomain("near(x[0], side) && on_boundary", side=1.0, tol=10e-15).mark(neumann_domain, 1)
ds = Measure("ds", subdomain_data=neumann_domain)
bc1 = DirichletBC(V, c, left)
# Kinematics
d = u.geometric_dimension()
I = Identity(d)
F = I + grad(u)
C = F.T*F
# Invariants of deformation tensors
Ic = tr(C)
J = det(F)
E, nu = 1e6, 0.3
mu, lmbda = Constant(E/(2*(1 + nu))), Constant(E*nu/((1 + nu)*(1 - 2*nu)))
#Neo-Hookean
psi = (mu/2)*(Ic - 2) - mu*ln(J) + (lmbda/2)*(ln(J))**2
bb = Expression(("0.0", "-1000.0"), degree=2)
# Total potential energy
Pi = psi*dx - dot(t, u)*ds(1) #+ dot(bb,u)*dx
F = derivative(Pi, u, v)
# Compute Jacobian of F
J = derivative(F, u, du)
init=Function(V)
u.assign(init)
problem = NonlinearVariationalProblem(F, u, bc1, J)
solver = NonlinearVariationalSolver(problem)
prm = solver.parameters
prm['newton_solver']['absolute_tolerance'] = 1E-8
#prm['newton_solver']['relative_tolerance'] = 1E-9
#prm['newton_solver']['maximum_iterations'] = 200
cs=np.linspace(2200,2500,70)
for count, i in enumerate(cs):
t.hh = i
solver.solve()
plot(u, title='Displacement', mode='displacement')
Here I’m considering the case of buckling of the beam under compression.
I’m trying to reproduce the continuation method showed here: Buckling of a heated von-Kármán plate — fenics-shells
however I’m still not able to get the buckling solution. Could you tell me what is the error?
Thank you