Conversation
|
Resolves: #225 |
You mean that you cannot create a Real element with nontrivial shape, but should work in MFS? |
No, one should not be able to do: el = basix.ufl.element("Lagrange", mesh.basix_cell(), 2)
r_el = basix.ufl.real_element(mesh.basix_cell(), shape=(2,))
me = basix.ufl.mixed_element([el, r_el])but one can do: el = basix.ufl.element("Lagrange", mesh.basix_cell(), 2)
V = dolfinx.fem.functionspace(mesh, el)
r_el = basix.ufl.real_element(mesh.basix_cell(), shape=(2,))
R = dolfinx.fem.functionspace(mesh, r_el)
W = ufl.MixedFunctionSpace(V, R)
u, lmbd = ufl.TrialFunctions(W)
v, mu = ufl.TestFunctions(W) |
michalhabera
left a comment
There was a problem hiding this comment.
This change is minimal and nicely isolated. I like you've added custom dofmap builder and did not try to tweak the existing one -- which was the bad design in legacy FEniCS if I remember well.
I still believe we should follow matrix-free/MATSHELL approach for all these extremely skew spaces, but this is a good solution until we have more time to work on the alternative.
In combination with: |
Co-authored-by: Matthew Scroggs <matthew.w.scroggs@gmail.com>
| topology.comm(), num_dofs, ghosts, owners); | ||
|
|
||
| // Create element dof layout | ||
| dolfinx::fem::ElementDofLayout dof_layout(value_size, entity_dofs, |
There was a problem hiding this comment.
Can use auto, type explicit in use of make_shared
There was a problem hiding this comment.
But we are not using a make_shared pointer here as it is not used further down the line?
Co-authored-by: Jack S. Hale <mail@jackhale.co.uk> Co-authored-by: Jørgen Schartum Dokken <dokken92@gmail.com>
Add the notion of real element to DOLFINx. Implemented based on https://github.com/scientificcomputing/scifem/blob/main/src/scifem.cpp
Relies on FEniCS/basix#1001
One should not be able to make a
mixed_elementwith real element. One should use the block constructor (i.e. MixedFunctionSpace or manually block it).The real element is now: