Dear Bhavesh, I'm not an expert on the topic you raise, but gazing into a crystal ball: does it work if you try B4 = FiniteElement("Bubble", "tetrahedron", 4) instead of the code you had B3 = FiniteElement("Bubble", "tetrahedron", 3) ? Example 8.7.2 in the book you cite uses degree 4 cell bubbles. Patrick On 25/06/2021 04:31, Bhavesh Shrimali wrote:
For the 3D Crouzeix-Raviart element see also Example 8.7.2 in the textbook by Brezzi : https://link.springer.com/content/pdf/10.1007%2F978-3-642-36519-5.pdf <https://link.springer.com/content/pdf/10.1007%2F978-3-642-36519-5.pdf>
"We therefore start from a quadratic approximation and enrich it by face bubbles to control the fluxes on the faces and by internal bubbles to control linear pressure. This yields "
image.png
Please let me know what you think! Note that this is different from the P1 non-conforming element that is denoted by "CR" and often simply called the "Crouzeix-Raviart" element.
Thanks again for your help
On Thu, 24 Jun 2021 at 22:11, Bhavesh Shrimali <bhavesh.shrimali@gmail.com <mailto:bhavesh.shrimali@gmail.com>> wrote:
Hi everyone,
I was trying to use a mixed-formulation for an incompressible hyperelasticity problem. See the following MWE which uses a Taylor-Hood approximation -- P2 for displacement (u) and P1 for pressure (p):
mesh = UnitCubeMesh(5,5,5) Vh = VectorFunctionSpace(mesh, "CG", 2) Qh = FunctionSpace(mesh, "CG", 1) Wh = Vho * Qh w = Function(Wh) dw = TrialFunction(Wh) v = TestFunction(Wh) u, p = split(w) mu, lmbda = Constant(1.), Constant(1.e3) Js = (lmbda + p + sqrt((lmbda + p)**2. + 4.*lmbda*mu ))/(2.*lmbda) F = Identity(mesh.geometric_dimension()) + grad(u) J = det(F) I1 = inner(F, F) Pi = p * (J - Js) + mu/2 * (I1 - 3) - mu * ln(Js) + lmbda/2 * (Js - 1)**2 Pi *= dx a = derivative(Pi, w, v) Jac = derivative(a, w, dw) bcs = [ DirichletBC(Wh.sub(0).sub(0), Constant(0.), 1), DirichletBC(Wh.sub(0).sub(1), Constant(0.), 3), DirichletBC(Wh.sub(0).sub(2), Constant(0.), 5), DirichletBC(Wh.sub(0).sub(0), Constant(1.), 2) ] problem = NonlinearVariationalProblem(a, w, bcs, J=Jac) solver = NonlinearVariationalSolver(problem) solver.solve() u, p = w.split() File("displacement.pvd").write(u)
Everything works fine as expected. Now, I wanted to try another pair of approximations that is inf-sup stable, namely the one in the celebrated paper by Crouzeix-Raviart (1973). See (4.36) in http://archive.numdam.org/article/M2AN_1973__7_3_33_0.pdf <http://archive.numdam.org/article/M2AN_1973__7_3_33_0.pdf>.
This amounts to approximating `u` by a "P2 + Bubble" and `p` by a "DG-1" space. This is also given in (3.2.3) in https://link.springer.com/content/pdf/10.1007%2F978-3-642-87047-7_5.pdf <https://link.springer.com/content/pdf/10.1007%2F978-3-642-87047-7_5.pdf> and (2.38) in https://link.springer.com/content/pdf/10.1007%2F978-3-642-61623-5_2.pdf <https://link.springer.com/content/pdf/10.1007%2F978-3-642-61623-5_2.pdf>
Now, in 3D as far as I can tell this amounds to approximating `u` with "P2 + an internal bubble + FacetBubble". Would anyone know how this could be achieved within firedrake? Because as far as I can see, firedrake supports `FacetBubble`. However, when I try something like:
B3 = FiniteElement("Bubble", "tetrahedron", 3) FB3 = FiniteElement("FacetBubble", "tetrahedron", 3) P2 = FiniteElement("CG", "tetrahedron", 2) Vh = FunctionSpace(mesh, P2 + B3 + FB3)
I get the following error
File "/usr/lib/python3.8/functools.py", line 875, in wrapper return dispatch(args[0].__class__)(*args, **kw) File "/home/firedrake/firedrake/src/tsfc/tsfc/finatinterface.py", line 189, in convert_enrichedelement elements, deps = zip(*[_create_element(elem, **kwargs) File "/home/firedrake/firedrake/src/tsfc/tsfc/finatinterface.py", line 189, in <listcomp> elements, deps = zip(*[_create_element(elem, **kwargs) File "/home/firedrake/firedrake/src/tsfc/tsfc/finatinterface.py", line 310, in _create_element finat_element, deps = convert(ufl_element, **kwargs) File "/usr/lib/python3.8/functools.py", line 875, in wrapper return dispatch(args[0].__class__)(*args, **kw) File "/home/firedrake/firedrake/src/tsfc/tsfc/finatinterface.py", line 177, in convert_finiteelement return lmbda(cell, element.degree()), set() File "/home/firedrake/firedrake/src/FInAT/finat/fiat_elements.py", line 318, in __init__ super(Bubble, self).__init__(FIAT.Bubble(cell, degree)) File "/home/firedrake/firedrake/src/fiat/FIAT/bubble.py", line 33, in __init__ super(Bubble, self).__init__(ref_el, degree, codim=0) File "/home/firedrake/firedrake/src/fiat/FIAT/bubble.py", line 24, in __init__ raise RuntimeError('Bubble element of degree %d and codimension %d has no dofs' % (degree, codim)) RuntimeError: Bubble element of degree 3 and codimension 0 has no dofs
Any pointers would be appreciated -- *Bhavesh Shrimali * *Ph.D. Student, **Civil and Environmental Engineering,* *University of Illinois Urbana-Champaign * *Champaign, IL, United States
* *Email : bshrima2@illinois.edu <mailto:bshrima2@illinois.edu> * *Web : **https://bhaveshshrimali.github.io/ <https://bhaveshshrimali.github.io/>*
-- *Bhavesh Shrimali * *Ph.D. Student, **Civil and Environmental Engineering,* *University of Illinois Urbana-Champaign * *Champaign, IL, United States
* *Email : bshrima2@illinois.edu <mailto:bshrima2@illinois.edu> * *Web : **https://bhaveshshrimali.github.io/ <https://bhaveshshrimali.github.io/>*
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake