FEniCS / dolfinx

Next generation FEniCS problem solving environment
https://fenicsproject.org
GNU Lesser General Public License v3.0
725 stars 177 forks source link

Missing Real finite element #225

Open michalhabera opened 5 years ago

michalhabera commented 5 years ago

Snippet

import dolfin
mesh = dolfin.UnitSquareMesh(dolfin.MPI.comm_world, 2, 2)
dolfin.FunctionSpace(mesh, ("Real", 0)).dofmap().dofs(mesh, 2)

returns

array([0, 1, 2, 3, 4, 5, 6, 7], dtype=int32)

but should return (as in 2018.1.0)

array([0, 0, 0, 0, 0, 0, 0, 0], dtype=int32)

In other words, Real works now as DG0, having one scalar per each cell, instead of one scalar per whole domain.

michalhabera commented 3 years ago

Real element is not like QuadratureElement or any BaseElement subclass because it does not have local basis. In old dolfin such element would export num_global_dofs in the generated ffc code and this was then used in dolfin to construct dofmap.

As we do not want to interfere with dofmap construction in dolfinx, these globally supported spaces must be handled separately, yet allow to be assembled into block matrices with dense rows/columns.

RemDelaporteMathurin commented 8 months ago

Hi team! Is this still planned for dolfinx?

RemDelaporteMathurin commented 5 months ago

Hi @michalhabera @garth-wells , I looked amongst the various repos for Real elements and found a couple of issues/PRs to add a Real space.

Is it now supported? I found mentions of real elements in FFCX https://github.com/FEniCS/ffcx/blob/06957dbc7428256760a52a2a543eaca37a80bebf/ffcx/codegeneration/ufcx.h#L69

EDIT:

Also found a reference to real elements in basix