Dear Dokken,
We are solving the problem of deforming boundaries with time. We are facing following error. please help us resolve this.
Thanks in advance
Wb=VectorFunctionSpace(blood_Mesh, "CG", 1)
x=SpatialCoordinate(blood_Mesh)
bou=project(as_vector((x[0], x[1], x[2])), Wb)
bc=DirichletBC(Wb, bou , blood_boundary, 7)
w=Function(Wb)
bc.apply(w.vector())
ALE.move(blood_Mesh, bc)
plot(blood_mesh)
plt.show()
Error as follows
Traceback (most recent call last):
File "Heat_distribution.py", line 108, in <module>
ALE.move(blood_Mesh, bc)
AttributeError: 'DirichletBC' object has no attribute '_cpp_object'
Dear @gangadhara ,
please note that your example is not a reproducible example, as there are several assumptions (such as the mesh and mesh marker) that are not included in your code. For future posts I will strongly suggest you to make sure that the code is reproducible.
Secondly, the issue is:
gangadhara:
ALE.move(blood_Mesh, bc)
which is not supported, see:
https://bitbucket.org/fenics-project/dolfin/src/402ae327ff0bfb8b619cbe4288646b1af38027f9/python/src/ale.cpp?at=master#lines-44:55
Here is an example of what you should do when creating reproducible examples, including the fix for your code:
from dolfin import *
import matplotlib.pyplot as plt
mesh = UnitCubeMesh(5, 3, 3)
ft = MeshFunction("size_t", mesh, mesh.topology().dim()-1, 0)
class Boundary(SubDomain):
def inside(self, x, on_boundary):
return on_boundary
marker = 7
Boundary().mark(ft, marker)
Wb = VectorFunctionSpace(mesh, "Lagrange", 1)
x = SpatialCoordinate(mesh)
bou = project(as_vector((x[0], x[1], x[2])), Wb)
bc = DirichletBC(Wb, bou, ft, marker)
w = Function(Wb)
bc.apply(w.vector())
ALE.move(mesh, w)
plot(mesh)
plt.savefig("deformed_mesh.png")