Mesh conversion: 6 quad faces == 1 hex volume
I am trying to build a volume mesh from a surface mesh containing all the cell-faces definition.
This translates into reconstructing the faces connectivity which defines the volume elements.
I other words, I have to find out which tuple of 6 quad-faces defines a hex-cell, and write out the result in some mesh format (CGNS, Nastran, whatever).
This seems a trivial operation: the haxahedrons are there, only... I need to "fill" them.
Does anybody know an algorithm (or, even better, a free software tool) to perform efficiently this operation?
I am browsing for references, but I didn't have much luck yet.
Many thanks in advance!
I am not sure if I am getting your question right, but do you think the operation you want to do is described in slides 9-11 of http://of-interfaces.sourceforge.net...1-2-open-e.pdf (create an ordered cell-points list from cell-faces and face-points lists)? If so and if you can bear with a quick and dirty code, you can download my opensource code that includes such a conversion from http://openfoamwiki.net/index.php/Co...r_for_ParaView and take a look at vtkOpenFOAMReaderPrivate::InsertCellsToGrid() in vtkNewOpenFOAMReader.cxx .
Thanks for your reply, but actually what I am trying to do is slightly different.
If I got it right, your code add to the following mesh definition hierarchy:
I'll try to write down some code, maybe I can handle that (at least for meshes with tet-cells only or hex-cells only).
Uh, got it. Although I am by no means an expert and hence don't have a concrete solution, I generally find basic algorithms that you see almost in every programming textbook, such as sorting and binary search, are quite effective and useful for this kind of operations.
For example, if the vertex numbers of your mesh fit in 32bit integer,
|All times are GMT -4. The time now is 03:53.|