Discussion:
[Gmsh] from hexahedrons to tetrahedrons
Michel Dupront
2011-05-19 15:42:59 UTC
Permalink
Hello,

I have a structured mesh with hexahedrons and I would like to
split each hexahedrons into tetrahedrons.
Is it possible ? if yes into how many tetrahedrons ?

Thank you.
Geordie McBain
2011-05-20 02:04:34 UTC
Permalink
Post by Michel Dupront
I have a structured mesh with hexahedrons and I would like to
split each hexahedrons into tetrahedrons.
Is it possible ?
Hello. Someone asked me this the other day. At first I thought it
should be easy, but then I found I didn't know how to do it, in Gmsh
or otherwise. I had thought that one should be able to simply split
each hexahedron, but then reading the documentation for how it's done
in the VTK library:

 http://www.vtk.org/doc/nightly/html/classvtkDataSetTriangleFilter.html

I saw that one must meet `the issue of face compatibility across
quadrilateral faces (which way to orient the diagonal?)'.

I figure then that it should be possible to export a hexahedral mesh
as VTK, use this VTK function to split to tetrahedra and save as VTK,
then reread the VTK. I haven't actually gone on to try this.

I would be interested to hear of a pure Gmsh solution, if anyone has one.
Post by Michel Dupront
if yes into how many tetrahedrons ?
I think the answer for this should be six, since the volume of a
tetrahedron with three mutually perpendicular edges of unit length is
1/6.
Smith, Mark
2011-05-20 12:39:54 UTC
Permalink
I think 5 tets in a cube see attached.
mark

-----Original Message-----
From: gmsh-***@ace20.montefiore.ulg.ac.be [mailto:gmsh-***@ace20.montefiore.ulg.ac.be] On Behalf Of Geordie McBain
Sent: 20 May 2011 03:05
To: Michel Dupront
Cc: ***@geuz.org
Subject: Re: [Gmsh] from hexahedrons to tetrahedrons
I have a structured mesh with hexahedrons and I would like to split
each hexahedrons into tetrahedrons.
Is it possible ?
Hello. Someone asked me this the other day. At first I thought it should be easy, but then I found I didn't know how to do it, in Gmsh or otherwise. I had thought that one should be able to simply split each hexahedron, but then reading the documentation for how it's done in the VTK library:

 http://www.vtk.org/doc/nightly/html/classvtkDataSetTriangleFilter.html

I saw that one must meet `the issue of face compatibility across quadrilateral faces (which way to orient the diagonal?)'.

I figure then that it should be possible to export a hexahedral mesh as VTK, use this VTK function to split to tetrahedra and save as VTK, then reread the VTK. I haven't actually gone on to try this.

I would be interested to hear of a pure Gmsh solution, if anyone has one.
if yes into how many tetrahedrons ?
I think the answer for this should be six, since the volume of a tetrahedron with three mutually perpendicular edges of unit length is 1/6.

_______________________________________________
gmsh mailing list
***@geuz.org
http://www.geuz.org/mailman/listinfo/gmsh



Please be advised that this email may contain confidential
information. If you are not the intended recipient, please notify us
by email by replying to the sender and delete this message. The
sender disclaims that the content of this email constitutes an offer
to enter into, or the acceptance of, any agreement; provided that the
foregoing does not invalidate the binding effect of any digital or
other electronic reproduction of a manual signature that is included
in any attachment.
julien hoessler
2011-05-20 13:42:22 UTC
Permalink
I think it is supposed to be 6 tets: 3 successive rectangle to
triangle mappings
see the attached mesh:
David Colignon
2011-05-20 09:08:52 UTC
Permalink
Hi Michel,

does it work if you just remove the "Recombine" command(s) in your .geo file ?

Regards,

Dave
--
David Colignon, Ph.D.
Collaborateur Logistique du F.R.S.-FNRS
CÉCI - Consortium des Équipements de Calcul Intensif
ACE - Applied & Computational Electromagnetics
Sart-Tilman B28
Université de Liège
4000 Liège - BELGIQUE
Tél: +32 (0)4 366 37 32
Fax: +32 (0)4 366 29 10
WWW: http://hpc.montefiore.ulg.ac.be/
Agenda: http://www.google.com/calendar/embed?src=david.colignon%40gmail.com
Post by Michel Dupront
Hello,
I have a structured mesh with hexahedrons and I would like to
split each hexahedrons into tetrahedrons.
Is it possible ? if yes into how many tetrahedrons ?
Thank you.
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
Smith, Mark
2011-05-20 13:36:13 UTC
Permalink
see attached, 5 tets in a cube.

regards
mark


Please be advised that this email may contain confidential
information. If you are not the intended recipient, please notify us
by email by replying to the sender and delete this message. The
sender disclaims that the content of this email constitutes an offer
to enter into, or the acceptance of, any agreement; provided that the
foregoing does not invalidate the binding effect of any digital or
other electronic reproduction of a manual signature that is included
in any attachment.
Trevor Strickler
2011-05-20 15:10:49 UTC
Permalink
Hi Mark Smith, Michael Dupront and Everyone,

With regard to converting hexahedrons to tetrahedrons, I have written a
patch for Gmsh that allows one to interface quad faces on a structured
volume boundary to triangle faces with a layer or two of pyramids, prisms,
and tetrahedra. This will not convert ALL the hexahedra in a structured
volume to tetrahedra, but if you are trying to subdivide hexa for the
purposes of interfacing to an unstructured tetrahedral volume, this might
help.

I can email this patch to anyone interested. It will be distributed under
the GPL as a modified version of Gmsh. I will only email the source code,
so if you want it, you will have to build Gmsh on your own machine.

- Trevor Strickler
Tom
2012-07-23 13:59:55 UTC
Permalink
Hi Mark Smith, Michael Dupront and Everyone,With regard to converting
hexahedrons to tetrahedrons, I have written a patch for Gmsh that allows one
to interface quad faces on a structured volume boundary to triangle faces with
a layer or two of pyramids, prisms, and tetrahedra. This will not convert ALL
the hexahedra in a structured volume to tetrahedra, but if you are trying to
subdivide hexa for the purposes of interfacing to an unstructured tetrahedral
volume, this might help.I can email this patch to anyone interested.  It will
be distributed under the GPL as a modified version of Gmsh.  I will only email
the source code, so if you want it, you will have to build Gmsh on your own
machine.- Trevor Strickler
_______________________________________________
gmsh mailing list
http://www.geuz.org/mailman/listinfo/gmsh
I would like to have an hexahedron mesh and I manage to visualize one
hexahedron. But when I want to visualize more (mesh), nothing is visualized.
Here the code where I try to visualize 2 hexahedrons:

vtkSmartPointer<vtkUnstructuredGrid> vUGrid =
vtkSmartPointer<vtkUnstructuredGrid>::New();
vtkSmartPointer<vtkCellArray> vCellArray =
vtkSmartPointer<vtkCellArray>::New();
vtkSmartPointer<vtkPoints> vPoints =
vtkSmartPointer<vtkPoints>::New();
vtkSmartPointer<vtkHexahedron> vHexahedron =
vtkSmartPointer<vtkHexahedron>::New();

for (unsigned int i = 0; i < 2; i++)
{
vPoints->InsertNextPoint(0.0, 0.0, 0.0);
vPoints->InsertNextPoint(1.0, 0.0, 0.0);
vPoints->InsertNextPoint(1.0, 1.0, 0.0);
vPoints->InsertNextPoint(0.0, 1.0, 0.0);
vPoints->InsertNextPoint(0.0, 0.0, 1.0);
vPoints->InsertNextPoint(1.0, 0.0, 1.0);
vPoints->InsertNextPoint(1.0, 1.0, 1.0);
vPoints->InsertNextPoint(0.0, 1.0, 1.0);


vHexahedron->GetPointIds()->SetNumberOfIds(8);
for (unsigned int j = 0; j < 8; j++) {
vHexahedron->GetPointIds()->SetId(j,j);
}
vUGrid->SetPoints(vPoints);
vUGrid->InsertNextCell(vHexahedron->GetCellType(), vHexahedron-
GetPointIds());
}

vtkSmartPointer<vtkDataSetMapper> mapper =
vtkSmartPointer<vtkDataSetMapper>::New();
mapper->SetInput(vUGrid);

vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
actor->SetMapper(mapper);

vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
vtkSmartPointer<vtkRenderWindow> renderWindow =
vtkSmartPointer<vtkRenderWindow>::New();
renderWindow->AddRenderer(renderer);
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();

ui.qvtkWidget->SetRenderWindow(renderWindow);

renderer->AddActor(actor);
renderer->SetBackground(0.3, 0.6, 0.3); // Background color green

renderWindow->Render();




So, my question is why I do not see anything and how to construct a vtk
hexahedron mesh..

Loading...