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

Integration in vector function space

0 votes

I'd like to discretize the following system of PDEs (left hand side):

A dq/dx + B dq/dy

where A and B are simple 5x5 arrays of scalar coefficients (Expression).
q and q test belong to 5-D VectorFunctionSpace. Mesh dimension is obviously 2D.
In my opinion LHS will be as follows:

(dot(A, vector_of_x_derivatives_of_q)+dot(A, vector_of_y_derivatives_of_q))qtestdx

but I end up with shape mismatch.
I think the problem lies in taking vector of derivatives instead of full gradient, which would be 2nd rank tensor.
I've tried grad(q)[:,0] but did not work...

asked Dec 8, 2015 by bp FEniCS Novice (520 points)

1 Answer

0 votes
 
Best answer

Hi, consider

from dolfin import *

mesh = UnitSquareMesh(10, 10)
V = VectorFunctionSpace(mesh, 'CG', 1, 5)
u = TrialFunction(V)
v = TestFunction(V)

C = Identity(5)

a = inner(dot(C, u.dx(0)), v)*dx
answered Dec 8, 2015 by MiroK FEniCS Expert (80,920 points)
selected Dec 8, 2015 by bp

Works perfectly.
Thank You very much :)

...