Good afternoon,
Working with dolfinx 0.3.0,
i tried following the tutorial’s example with that code:
import numpy as np
from dolfinx import fem, cpp, io, mesh, generation
from mpi4py import MPI
import ufl
from petsc4py import PETSc
L, W, H=0.303, 0.19, 0.064
NX, NY, NZ = 30, 19, 6
points=[np.array([0, 0, 0]), np.array([L, W, H])]
domain=generation.BoxMesh(MPI.COMM_WORLD, points, [NX,NY,NZ], cell_type=cpp.mesh.CellType.hexahedron)
dim=domain.topology.dim
def bottom(x):
return np.isclose(x[2], 0, atol=1e-3)
U=fem.VectorFunctionSpace(domain, ("CG", 1))
bcdofs=fem.locate_dofs_geometrical(U, bottom)
u_0=np.array((0,)*dim, dtype=PETSc.ScalarType)
bc=fem.DirichletBC(u_0, bcdofs, U)
But i get :
Traceback (most recent call last):
File "/mnt/c/Users/stavfe/Documents/Optimisation/opti.py", line 92, in <module>
bc=fem.DirichletBC(u_0, bcdofs, U)
File "/usr/lib/petsc/lib/python3/dist-packages/dolfinx/fem/dirichletbc.py", line 147, in __init__
raise NotImplementedError
NotImplementedError
Is it because i need dolfinx 0.4 to for it to work?
What can be a replacement for Dolfinx 0.3?
Thanks in advance.