I have a unit square mesh with a Dirichlet line defined by points 'a' and 'b'. I have defined a function that returns true
if an input 'x' is on this line, which I input into DirichletBC
. That is, something like:
def u0_boundary(x, on_boundary):
return on_boundary or on_line(x, line_x)
bc = DirichletBC(V, u0, u0_boundary)
However, I'm having trouble getting the mesh to overlap with this line, so that the vertex is actually defined as a boundary condition.
I imagine the easiest way to do this is to adjust the mesh using mesh.move
, but I'm having trouble parsing the documentation to figure out how this would work. Can I query the boundary with BoundaryMesh
and append the line somehow? Do I need to manually define the mesh with MeshEditor
?
Any advice would be greatly appreciated! Thank you!