Suppose I have the unit square (a 2D problem) as my domain and I have a SubDomain class defined on the boundary of the unit square. After I have computed my first solution, I want to add edges to the existing SubDomain by marking it and compute the new solution. How am supposed to achieve that?
Suppose the mesh is defined as:
mesh = UnitSquareMesh(10,10)
My subdomain is defined and marked as follows:
class u0_boundary(SubDomain):
def inside(self, x, on_boundary):
return on_boundary and (x[0] < 1e-10)
u0_boundary = u0_boundary()
boundaries = FacetFunction('size_t', mesh)
u0_boundary.mark(boundaries,1)
Suppose I have the index of a point(vertex) in the dofmap after my first computation:
dof_x = CG.dofmap().tabulate_all_coordinates(mesh).reshape((-1,d))
where CG is the name of my FunctionSpace and d is 2.
How do I mark the edge connected to this vertex as u0_boundary (the marker is 1 in this case) ?
Thank you very much!