Hello. I am using mixed elements formulation (Lagrange and Raviart - Thomas ) and my domain is a 3D box inside another 3D box. I would like to ask how can i get nodes from one specific surface. For example i expect 6 nodes in every cell (3 from Lagrange and another 3 from Raviart Thomas) or in other words 4 nodes in every surface (3 from Lagrange and 1 from Raviart Thomas). With the following code i get only 3 nodes in every surface. I want something similar for my problem. Thank you very much !!!
mesh = Mesh(“dolfinmesh.xml”)
mesh_file_boundary=MeshFunction(‘size_t’,mesh,“dolfinmesh_bcfunc.xml”)
CG0 = FiniteElement("CG", mesh.ufl_cell(), 1)
RT1 = FiniteElement("RT", mesh.ufl_cell(), 1)
W = FunctionSpace(mesh, MixedElement((RT1, CG0)))
bcs = [DirichletBC(W.sub(0), Constant((0.0, 0.0, 10.0)), mesh_file_boundary, 6),
DirichletBC(W.sub(0), Constant((0.0, 0.0, -10.0)), mesh_file_boundary, 7)]
PecSurface = list()
PmcSurface = list()
Pec_vertices = list()
Pmc_vertices = list()
mesh.init(3, 2)
c2f = mesh.topology()(3,2)
mesh.init(2,0)
f2v = mesh.topology()(2,0)
for cell in range(mesh.num_cells()):
facets = c2f(cell)
for facet in facets:
vertices = f2v(facet)
print(len(vertices))
if mesh_file_boundary[facet] == 6:
PecSurface.append(facet)
PecSurface = list(dict.fromkeys(PecSurface))
#ipologismos twn komvwn twn eswterikwn epifaneiwn
for i in range(0,3):
Pec_vertices.append(vertices[i])
Pec_vertices = list(dict.fromkeys(Pec_vertices))
elif mesh_file_boundary[facet] == 7:
PmcSurface.append(facet)
PmcSurface = list(dict.fromkeys(PmcSurface))
for j in range(0,3):
Pmc_vertices.append(vertices[j])
Pmc_vertices = list(dict.fromkeys(Pmc_vertices))