Thanks for the responses guys. However, I am running into issues regarding Dirichlet bcs for P2/P0 elements. Attached is the code:

I am trying to apply homogeneous boundary conditions in the P0 space, and when I looked at the documentation online it said to use DirichletBC(Q, <value>, <boundary_id>, method="geometric")
 but I am getting these kinds of errors:

Traceback (most recent call last):
  File "Compare_P2P0.py", line 69, in <module>
    solver.solve()
  File "<string>", line 2, in solve
  File "/home/justin/Software/firedrake-deps/PyOP2/pyop2/profiling.py", line 203, in wrapper
    return f(*args, **kwargs)
  File "/home/justin/Software/firedrake-deps/firedrake/firedrake/variational_solver.py", line 165, in solve
    bc.apply(self._problem.u)
  File "<string>", line 2, in apply
  File "/home/justin/Software/firedrake-deps/PyOP2/pyop2/profiling.py", line 203, in wrapper
    return f(*args, **kwargs)
  File "/home/justin/Software/firedrake-deps/firedrake/firedrake/bcs.py", line 199, in apply
    raise RuntimeError("%r defined on incompatible FunctionSpace!" % r)
RuntimeError: Coefficient(MixedElement(*[VectorElement('Lagrange', Domain(Coefficient(VectorElement('Lagrange', Domain(Cell('tetrahedron', 3), label=None, data='<data with id 140677727926224>'), 1, dim=3, quad_scheme=None), 1)), 2, dim=3, quad_scheme=None), FiniteElement('Discontinuous Lagrange', Domain(Coefficient(VectorElement('Lagrange', Domain(Cell('tetrahedron', 3), label=None, data='<data with id 140677727926224>'), 1, dim=3, quad_scheme=None), 1)), 0, quad_scheme=None)], **{'value_shape': (4,) }), 7) defined on incompatible FunctionSpace!


Anyone know what's wrong? Thanks

Thanks

On Wed, Jul 22, 2015 at 3:43 AM, Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 22/07/15 07:31, Andrew McRae wrote:
> 1)  Yes, this can be done in Firedrake.  However, we consider the
> local element to be enriched, not the function space:
>
> V1 = VectorFunctionSpace... Q_elt = FiniteElement("CG", interval,
> 1) P_elt = FiniteElement("DG", interval, 0) elt = Q_elt + P_elt V2
> = FunctionSpace(mesh, elt) W = V1 * V2
>
> 2)  Is P1disc the same as P1DG?  "All polynomials of degree 1 with
> no continuity between cells"?  If so, none of us have implemented
> the P1disc elements on quadrilaterals yet in FIAT.  We have full
> support for the third column of http://femtable.org/, which has all
> the "tensor product construction" elements, but not the fourth.  If
> you want to try implementing P1disc yourself, we can hopefully
> provide support.

Indeed yes.

Note that P1disc provides some problems for the standard approach of
pulling back to a reference element and integrating.  Unless your mesh
is asymptotically affine you only get 1st order convergence in the L_2
norm of P.  This is because the mapped global space doesn't contain P_k.

See:

Matthies and Tobiska. The Inf-Sup Condition for the Mapped
$Q_k-P_{k-1}^{\mathrm{disc}}$ Element in Arbitrary Space Dimensions (2002)

and

Boffi and Gastaldi. On the quadrilateral $Q_2–P_1$ element for the
Stokes problem (2002)

For details.

Lawrence

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJVr1e7AAoJECOc1kQ8PEYvzfwH/An12QUB2+WJb1I7BEixYF5D
u4IdLO3tcVqGgRRVQMxD8Som+hytnAZX/tJYpMvfjFBXjTAYxA95RClwthb4G9ut
muB7DYnzqkMC40VjnZdGlZ0MHRkuxOMLkFyg+oj5mH0sT/x/HK8mLLLQSeGW+0g3
Y+dbvHXAQWIouc6t/avmJKrJ4T+eiYhgB4rm4O/7ug34Tpd1tvRyYUlReDpfqNWS
X0qmIGPfksX3unTyETsmSZGcePSimPgf0YHfU5EeldqVv1BQxyQMyueRq9dnnUIh
YkGD75cn8FbBOWGyPiNNYxxHeplKE/j9T+8QcorCS4PZw9nupgNuKy+KYamkshU=
=vKDm
-----END PGP SIGNATURE-----

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