Dear Lawrence It's 2D. Similar to wave_tank.geo in your examples. But: ... v = TestFunction(V) delv_B = nabla_grad(v) delv_B.shape = (1, 2) ... while it should be (2,2). Tomasz ________________________________________ From: firedrake-bounces@imperial.ac.uk <firedrake-bounces@imperial.ac.uk> on behalf of Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> Sent: 17 February 2016 15:00 To: firedrake@imperial.ac.uk Subject: Re: [firedrake] dimension with external mesh On 17/02/16 14:36, Tomasz Salwa [RPG] wrote:
Dear All,
How do I instruct Firedrake about the dimension of the problem when using external mesh from gmsh?
I had a working code with utility mesh. I changed:
mesh = RectangleMesh(nx, nz, Lx, Lz)
V = VectorFunctionSpace(mesh, "CG", 1)
to:
mesh = Mesh("mesh.msh")
Is this a 3-D mesh, or a 2-D mesh?
V = VectorFunctionSpace(mesh, "CG", 1, dim=2)
yet I get the error at further expressions that worked previously:
...
File "/home/mmtjs/work/programs/lin_coupled_fd_2d/lib/beam.py", line 73, in initialize_solvers + self.mu * ( fd.inner( delX, delv_B + fd.transpose(delv_B) ) )
Is delv_B a tensor? If so, what is its shape? It's possible that if you have a 3D mesh and build a 2D VectorFunctionSpace then if you have: f = grad(Function(V)) f will have shape (3, 2) whereas transpose(f) will have shape (2, 3). So clearly those don't match. Lawrence