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

Deriving weak form equation

0 votes

Hello,
I want to derive the weak form (variational problem) for a wave equation in a an elastic solid:

enter image description here

It should be noted that λ and µ are constant and u is a vector. If I discretize the left hand side in time, I will have:
enter image description here

I want to assume that the previous solutions are u0 and u1 and equal to zero at t=0. I defined my domain which is a rectangle(2D) and wrote the other lines like:

V=FunctionSpace(mesh, "Lagrange", 1)
u1= interpolate(Constant(0.0), V)
u0= interpolate(Constant(0.0), V)

But I think I have to change my FunctionSpace to VectorFunctionSpace. Because u is a vector and not a scalar. So there are two questions:
1- How can I write the Variational form of the first equation (I mean RHS)?
2- How can I define u0 and u1 as zero vectors at t=0 and interpolate them into the VectorFunctionSpace?

Thanks in advance for your help.

asked Jan 8, 2016 by jafar FEniCS Novice (670 points)

2 Answers

0 votes

1- Not a FEniCS question (but in short: just like any other equation)
2- If V is a vector function space, then anything you'll interpolate in V will be vector valued

V = VectorFunctionSpace(mesh, "Lagrange", 1)
u1= interpolate(Constant((0.0, 0.0)), V)
u0= interpolate(Constant((0.0, 0.0)), V)

Note that when you initialize a function on a function space, it is zero by default:

u1= Function(V)
u0= Function(V)

As you are applying divergences to you unknown field, you'll probably need H(div) vector elements, e.g.,

V = FunctionSpace(mesh, "RT", 1)

Note that Raviart-Thomas (RT) elements are vectorial, so you have a (scalar) function space of vector elements, in stead of a vector function space of scalar elements)

answered Jan 8, 2016 by stevenvdk FEniCS User (1,590 points)
+3 votes

1.- If $\pmb{w}$ is a test function of an appropriate function space, then the weak formulation would be:
$$\int_{\Omega}\rho_0\ddot{\pmb{u}}\cdot \pmb{w} \;d\Omega + \int_{\Omega}[(\lambda+2\mu)(\nabla\cdot \pmb{u})(\nabla\cdot \pmb{w}) + 2\mu\epsilon(\pmb{u}):\epsilon(\pmb{w})]\;d\Omega = \int_{\Gamma_N} \pmb{g} \cdot \pmb{w}\; d\Gamma$$,
where $\Omega$ is your 2D rectangle domain, $\pmb{g}$ tractions on the Neumann boundary (if they exist) and
$$\epsilon(\pmb{u}) = \frac{1}{2}(grad(\pmb{u}) + grad(\pmb{u})^T).$$
Maybe take a look to the section 26.6.4 (page 522) of the fenics book can be useful for you.

answered Jan 8, 2016 by hernan_mella FEniCS Expert (19,460 points)
edited Jan 9, 2016 by hernan_mella
...