From: KIRK, B. (JSC-E. (NASA) <ben...@na...> - 2005-05-03 17:50:29
|
It would be interesting to have something like MeshTools::Generation::build_delaunay_triangulization (mesh, begin, end) where begin and end are node iterators. (That is all that should be needed, right?) You could then do Mesh quad_mesh(2); Mesh tri_mesh(2); MeshTools::Generation::build_delaunay_triangulization(tri_mesh, quad_mesh.nodes_begin(), quad_mesh.nodes_end()); BTW, I've downloaded the latest PETSc and will work though that crap again... Of course, since everyone uses their build system this is a non-issue, right? :-) 2.2.x sure was a short-lived release cycle. -Ben -----Original Message----- From: lib...@li... [mailto:lib...@li...] On Behalf Of John Peterson Sent: Monday, May 02, 2005 10:11 AM To: lib...@li... Subject: [Libmesh-devel] Triangle Interface Hi, There is now an initial interface to the Delaunay triangulation library known as "Triangle", written by J.R. Shewchuk (http://www-2.cs.cmu.edu/~quake/triangle.html). The code can be found in src{include}/mesh/mesh_triangle_support.C{h}. The current way to use Triangle is through the MeshTools::Generation::build_delaunay_square(...) routine. This routine operates similarly to the existing build_square(...) routines, except that it generates "unstructured looking" Delaunay triangulations with TRI3 elements. Use the test code attached at the end of this mail to check it out. I hope it will be useful in other parts of the library to have fast built-in Delaunay routines available. Additional enhancements will hopefully provide support for second-order (TRI6) elements, as well as the ability to generate triangulations of arbitrary 2D point sets. AFAIK, triangle deals exclusively with points in R2, so you can't use it to generate triangulations of surfaces in R3, but I think tetgen can possibly be used for that. At some point we should put tetgen in the contrib/ directory as well, it is much easier to configure and interface with software if we don't have to guess what version is out there (PETSc, I'm looking in your direction here ...) -John P.S. As already mentioned on the user's list, PETSc 2.3.0 is out, and they have changed a bunch of the Vec* and Mat* routines that we use. Unless any PETSc experts want to volunteer *cough* Ben *cough* I'll take a swing at d/ling and compiling against the new version, which BTW doesn't use BOPT! What is the world coming to? #include "mesh.h" #include "mesh_generation.h" int main(int argc, char** argv) { libMesh::init(argc,argv); { Mesh mesh(2); unsigned int nx=5, ny=5; Real xmax =1.0, ymax=1.0; if (argc >= 3) { nx = atoi(argv[1]); ny = atoi(argv[2]); } if (argc >= 5) { xmax = atof(argv[3]); ymax = atof(argv[4]); } MeshTools::Generation::build_delaunay_square(mesh, nx, ny, 0., xmax, 0., ymax); // Print the results to GMV mesh.write("triangulated_square.gmv"); } return libMesh::close(); } ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ Libmesh-devel mailing list Lib...@li... https://lists.sourceforge.net/lists/listinfo/libmesh-devel |