I try so solve the wave equation
$$
\ddot u(x,t) - \Delta u(x,t) = f(x,t) \text{ on } D \times (0, \infty)
$$
$$
u = 0 \text{ on } \partial D \times (0, \infty)
$$
$$
u(\cdot, 0) = u_0, \qquad \dot u(\cdot, 0) = v_0 \text{ on } D
$$
use the approach
$$
\frac{\partial}{\partial t}
\begin{bmatrix} u\ v \end{bmatrix}
=
\begin{bmatrix}
0 & I \
\Delta & 0
\end{bmatrix}
\begin{bmatrix} u\ v \end{bmatrix}
+
\begin{bmatrix}
0\
f(x,t)
\end{bmatrix}
$$
I think I got most of it done already, including the weak fomrulation BUT if I'm trying to get the actual solution from my mixed vector
V_1 = FunctionSpace(mesh, 'Lagrange', 1)
V_2 = FunctionSpace(mesh, 'Lagrange', 1)
VV = MixedFunctionSpace([V_1, V_2])
u_sol = interpolate(u_ini, V_1)
v_sol = interpolate(v_ini, V_2)
for i in xrange(N_k):
solve(A, u.vector(), b)
tmp_u, tmp_v = u.split()
u_sol.assign(tmp_u) # <- This is the problem
v_sol.assign(tmp_v)
I get the error
*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** fenics@fenicsproject.org
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error: Unable to initialize vector of degrees of freedom for function.
*** Reason: Cannot re-initialize a non-empty vector. Consider creating a new function.
*** Where: This error was encountered inside Function.cpp.
*** Process: 0
***
*** DOLFIN version: 1.6.0
*** Git changeset:
*** -------------------------------------------------------------------------
What am I missing here?