error while running a simple linear elasticity problem
hello I am new to Fenics and tried to run a simple example..it shows error
from dolfin import *
# Optimization options for the form compiler
parameters[
ffc_options = {"optimize": True, \
# Create mesh and define function space
mesh = dolfin.
V = VectorFunctionS
# Define boundary conditions
left = ["(std::abs(x[0]) < DOLFIN_EPS) && on_boundary"]
# Define Dirichlet boundary (x = 0)
c = Expression(("0.0", "0.0"))
bc = DirichletBC(V, c, left)
# Define functions
v = TestFunction(V) # Test function
U = TrialFunction(V)
f = Constant((0.0, -0.5)) # force on boundary
# Elasticity parameters
E, nu = 10.0, 0.3
mu, lmbda = Constant(E/(2*(1 + nu))), Constant(E*nu/((1 + nu)*(1 - 2*nu)))
def epsilon(v):return 0.5*(grad(
def sigma(v):return 2*mu*epsilon(
# Define variational problem
a= dot(grad(
L= dot(v,f)*dx
# Compute solution
U = Function(V)
solve(a == L, U, bc)
# Plot solution and mesh
plot(U)
# Dump solution to file in VTK format
file = File('elasticit
file << U
# Hold plot
interactive()
any suggestions???
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Blechta
- Solved:
- Last query:
- Last reply: