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

Merging mesh with BoxMesh.

+1 vote

Hi,
I know how to merge Box, thanks to Alawvahr. For example:

box_1 = Box(Point(0.0, 0.0, 0.0), Point(1.0, 1.0, 1.0))
box_2 = Box(Point(1.0, 1.0, 1.0), Point(2.0, 0.0, 0.0)) 
box_tot = box_1 + box_2
mesh_tot = generate_mesh (box_tot, 32)

I would like to know if there is a similar syntax for BoxMesh ? I do have too much cells with generate_mesh (i have to merge thousands of box)

Any help would be much appreciated
Regards,

asked Sep 27, 2016 by fussegli FEniCS Novice (700 points)

Why do you need this? What is your application.

I have data from tomography (a long array of 0 and 1). Each 0 represents a pore and is not meshed. Each 1 is a solid that i want to represent as a unit cube mesh. Then, I want to merge all the obtained cube.
Since i have dozen of thousands of voxels, i can't use generate_mesh, there are just too many cells generated by this operator. I would like the minimum number of nodes for each voxel to keep the cpu time and memory use reasonable. Mesh from BoxMesh have a limited number of nodes, then i want to use it... but i don't know how to merge meshes from BoxMesh.
Did i answer your question?

Why not use an implicit representation? You can use

parameters["reorder_dofs_serial"] = False

together with a DG0 function.

And here comes my limit in Fenics (i have started very recently). I have no idea what you are talking about... :(
If you are good enough to give a short explanation (or give me a link where it is explained), i will appreciate a lot.
However, the good news is I managed to create my mesh the hard way with the mesh editor. It works well actually. I will now make some calculations on it.

...