This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Hello;I'm trying to solve the elastodynamique problem and i get the error:this integral is missing an integration domain

0 votes

from future import print_function
from dolfin import *
from fenics import *
import time

variables

E=7109 #Young modulus
nu=0.33 #Poisson coefficient
rho=2700 #Density
lamda=6*10
9 #Lame coefficient
mu = 5
10**9

Time stepping

Time =2 # final time
steps=50 # numb of steps
dt=Time/steps # time step size

dolfin-convert plaque.msh plaque.xml

import os
os.system ('dolfin-convert plaque.msh plaque.xml')

Generate mesh

mesh=Mesh("plaque.xml")

create mesh

mesh = UnitSquareMesh(8, 8)

Define function space

V=VectorFunctionSpace(mesh,'Lagrange',2)

Define initial Values

u0=Constant ((0,0))
u1=Constant ((0,0))

define boundary condition

def left(x, on_boundary):
return x[0]<0.0001 and on_boundary

bc_left=DirichletBC(V, u0,left)

def free(x,on_boundary):
return x[0]>0.0001 and on_boundary

bc_free=DirichletBC(V,u1 ,free)

bcs=[bc_left,bc_free]

u_prev0=project(u0,V)
u_prev1=project(u1,V)

Define strain and stress

def epsilon(u):
return 0.5*(nabla_grad(u)+ nabla_grad(u).T)

def sigma(u):
return lamdanabla_div(u)Identity(len(u)) + 2muepsilon(u)

u = TrialFunction(V)
v = TestFunction(V)

d = u.geometric_dimension() #dimension space

f = Constant((0,0)) #body forces=0
traction = Constant((0,1))

a = inner(u,v)dx
L = inner (u_prev1,v)
dx + 2inner(u_prev0,v)dx + ((dt**2)/2)inner(sigma(u_prev0),epsilon(v))dx+ inner (traction,v)*ds

for t in range (steps):
u = Function(V)
t += dt

solve (a == L, u, bcs)

Save to file and plot solution

    vtkfile << (u, t)
    plot(u)

Update previous solution

    u_prev0.assign(u)
u_prev1.assign(u_prev0)

Hold plot

interactive()

asked Jun 9, 2017 by halarammouz FEniCS Novice (170 points)

Please indent your code snippets with four spaces, leaving newlines before and after it, so that it displays correctly, like this:

from dolfin import *
V = FunctionSpace(UnitSquareMesh(1,1), "CG", 2)
# ... 

Thanks for your answer, but actually I didn't understand what you meant...your answer solve my error?

No, but it will make your question more readable.

@halarammouz: As nabarnaf says, the question will be more readable but more importantly people can just copy and paste the code to try it and quickly find the problem, so it's not only about aesthetics :)

EXACTLY :) So plz did anyone find the error? thanks

It is difficult to see in which line you get the error. Try to substitute dx with dx(domain=mesh) in the line where you get the error message. That should at least fix this issue.

Thank you, the error is fixed:)

...