Marking the boundary of a complex 3D geometry

Hi everyone!

I have the .h5 file of a complex 3d mesh with outer and inner boundaries. I can import the mesh and read the markers of these boundaries, and apply an adaptive mesh refinement by using FEniCS. Now, I’d to keep the markers of the boundary in order to apply again my adaptive refinement. However, since the information of the markers is not available anymore, I can’t perform a second refinement for a new level of the adaptive procedure. Is there a way to mark the two boundaries in the second step?

Here my code to call the mesh:

def create_mesh():
	# Read mesh
	mesh = Mesh()
	file = HDF5File(mesh.mpi_comm(), "mesh/colin27_coarse_boundaries.h5", "r")
	file.read(mesh, "/mesh", False)

	# Read white/gray markers
	D = mesh.topology().dim()

	# Read skull/ventricle markers
	boundaries = MeshFunction("size_t", mesh, D-1)
	file.read(boundaries, "/boundaries")
	file.close()

	return mesh, boundaries

mesh, boundaries = create_mesh()

Paulo

1 Like