I am a little confused with the meaning of the block_size
property of a mixed element in FEniCSx. Consider the following FEniCS code:
from dolfin import *
mesh = UnitSquareMesh(1, 1)
FE = FiniteElement("Lagrange", mesh.ufl_cell(), 1)
ME = MixedElement([FE, FE])
V_ME = FunctionSpace(mesh, ME)
V = VectorFunctionSpace(mesh, "CG", 1)
print(V_ME.dofmap().block_size()) # 2
print(V.dofmap().block_size()) # 2
I think the result 2 of block_size()
means the number of components in a mixed element function space as that in a vector function space. However, the equivalent FEniCSx code (version 0.6.0) in my mind returns 1 for a mixed element function space as follows
from mpi4py import MPI
from dolfinx import mesh, fem
from ufl import FiniteElement, MixedElement
msh = mesh.create_unit_square(MPI.COMM_WORLD, 2, 2)
FE = FiniteElement("Lagrange", msh.ufl_cell(), 1)
ME = MixedElement([FE, FE])
V_ME = fem.FunctionSpace(msh, ME)
V = fem.VectorFunctionSpace(msh, ("CG", 1))
print(V_ME.dofmap.index_map_bs) # 1
print(V.dofmap.index_map_bs) # 2