On 2 August 2016 at 06:40, Justin Chang <jychang48@gmail.com> wrote:
So I am working with Hanie on this problem. We're using VMS formulation for double porosity Darcy equation, which requires strongly enforced normal velocity boundary conditions. We're interested in using hexahedron elements.

How easy is it to add support for single component VectorFunctionSpace to ExtrudedMeshes?

Also, what is the other workaround we could go with?

You could use separate components instead of a VFS.  If you want to make your forms a bit nicer then I think you can use as_vector to group the components:

wSpace = W*V*V*V
p, u1, u2, u3 = TrialFunctions(wSpace)
u = as_vector(u1, u2, u3)
a = dot(u, ...)*dx + ...
bcs = [DirichletBC(wSpace.sub(1), 0.0, (1, 2)),
      DirichletBC(wSpace.sub(2), 0.0, (3, 4)),
      DirichletBC(wSpace.sub(3), 0.0, ("bottom", "top"))]

(haven't run, so may contain typos, bugs, ...)
 
Make a hexahedral mesh out of GMSH and use the appropriate physical ID's?

No, as Firedrake doesn't support unstructured hexes, only extruded quad meshes.  There are hard orientation issues to think about when the hexes are fully unstructured.
 

Thanks,
Justin

On Mon, Aug 1, 2016 at 6:08 PM, Andrew McRae <A.T.T.McRae@bath.ac.uk> wrote:
Hi Hanie,

An ExtrudedMesh inherits boundary ids from the 'base mesh', plus the extra identifiers "bottom" and "top".  So, the sides x==0 through y==1 are id 1-4, because this is what the base mesh has.  Then z==0 is "bottom" and z==1 is "top".

However, your code is failing because (I believe) you're trying to set one component of a VectorFunctionSpace to 0.  Firedrake allows you to do this on normal meshes, but doesn't yet support this on extruded meshes, hence the error message.  (You could set all components of the vector to 0 by using just wSpace.sub(0), but presumably this isn't what you want).

There are various workarounds you could use for now, such as setting the boundary condition weakly, but they're not completely satisfying.

Andrew

On 1 August 2016 at 21:15, Hanie Joodat <hanie.joodat88@gmail.com> wrote:
Dear all,

I want to enforce DirichletBCs on an extruded mesh. For a normal unit cube tetrahedron mesh I could use the following face ID's:

1: x ==0
2: x==1
3: y==0
4: y==1
5: z==0
6: z==1

However, when I do the following:

meshbase = RectangleMesh(Nx, Ny, Lx, Ly, quadrilateral=True)
mesh = ExtrudedMesh(meshbase, Nz, Dz)

I get this error:

Traceback (most recent call last):
  File "VMS_patch_test_3D_Double_firedrake.py", line 51, in <module>
    FrontBackBC1 = DirichletBC(wSpace.sub(0).sub(1),Constant(0.0),(3,4))
  File "/data/Software/firedrake/src/firedrake/firedrake/bcs.py", line 68, in __init__
    raise NotImplementedError("Indexed VFS bcs not implemented on extruded meshes")
NotImplementedError: Indexed VFS bcs not implemented on extruded meshes

What should I do to properly identify my boundary faces?

 Regards,

Hanie


_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake