This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Uniform mesh generation on image mask

0 votes

I would like to mesh the blue area, using boundaries between blue-green and blue-red as different BCsIs there a way to create a uniform mesh in 2D and 3D image masks? I have a very complex geometry I'd like to mesh, consisting of many internal sources and holes in the mesh. The easiest way to do it, it seems, would be to turn each pixel in the binary mask into two triangular elements. I need to do this for 2D and 3D cases.

Does anyone know of a tutorial which might help, or some simple mesh generation functions which might work? I was thinking about creating a uniform mesh the size of the image and deleting the cells which are not contained in the mask, but I'm unsure how to reference the cells given a position x,y in the image.

Thanks!

Ryan

asked Mar 28, 2017 by rwoodall FEniCS Novice (120 points)

1 Answer

+1 vote

It may be simpler to mesh the entire domain of the image and set a marker function for the mask. You can integrate over marked cells by using a Measure.

answered Mar 28, 2017 by chris_richardson FEniCS Expert (31,740 points)
...