Hi,
can I retrieve the vector size (block size) from a generated c-file?
For example:
from pathlib import Path
import ffcx.main
cwd = Path.cwd()
infile = cwd / "elasticity.py"
ffcx.main.main(["-o", str(cwd), "--visualise", str(infile)])
with elasticity.py
from dolfinx import fem, mesh
from mpi4py import MPI
from ufl import Identity, TestFunction, TrialFunction, dx, inner, nabla_grad, tr
domain = mesh.create_unit_square(MPI.COMM_WORLD, 1, 1, mesh.CellType.quadrilateral)
V = fem.functionspace(domain, ("Lagrange", 1, (domain.geometry.dim, )))
u = TrialFunction(V)
v = TestFunction(V)
E = 7e9
nu = 0.33
lam = E*nu/((1+nu)*(1-2*nu))
mu = 0.5*E/(1+nu)
def epsilon(u):
return 0.5*(nabla_grad(u) + nabla_grad(u).T)
def sigma(v):
return 2.0 * mu * epsilon(v) + lam * tr(epsilon(v)) * Identity(len(v))
a = inner(sigma(u), epsilon(v)) * dx
From elasticity.c I would like to retrieve the vector size (=2).
(Fenics 0.9)
Thanks in advance!