## [Libmesh-devel] Support for 2D triangulations of meshes with holes

 [Libmesh-devel] Support for 2D triangulations of meshes with holes From: John Peterson - 2006-06-30 15:36:53 ```Hi, I just checked in some code that will produce 2D triangulations of rectangular domains with n-sided holes cut out. Arbitrary (non-polygonal) holes are also possible, that code will hopefully be coming soon. Here is a sample code that uses the new functionality #include "libmesh.h" #include "mesh_generation.h" #include "mesh.h" // This program creates a Delaunay mesh of a region with arbitrary hole(s). int main (int argc, char** argv) { libMesh::init (argc, argv); { // Libmesh mesh that will eventually be created. Mesh mesh(2); // Add description of holes to the vector typedef MeshTools::Generation::Hole Hole; std::vector holes; const Real xmin=-1., xmax=1., ymin=-1., ymax=1.; holes.push_back( Hole(Point( 0.5, 0.5), .25, 3 ) ); // triangular hole holes.push_back( Hole(Point(-0.5, 0.5), .1 , 50 ) ); // circular hole holes.push_back( Hole(Point(-0.5, -0.5), .1 , 4 ) ); // square hole holes.push_back( Hole(Point( 0.5, -0.5), .1 , 6 ) ); // hexagonal hole // Generate the mesh MeshTools::Generation::build_delaunay_square_with_hole(mesh, holes, 20, 20, xmin, xmax, ymin, ymax ); // Print result as GMV mesh.write("circular_hole2.gmv"); } return libMesh::close(); } ```

 [Libmesh-devel] Support for 2D triangulations of meshes with holes From: John Peterson - 2006-06-30 15:36:53 ```Hi, I just checked in some code that will produce 2D triangulations of rectangular domains with n-sided holes cut out. Arbitrary (non-polygonal) holes are also possible, that code will hopefully be coming soon. Here is a sample code that uses the new functionality #include "libmesh.h" #include "mesh_generation.h" #include "mesh.h" // This program creates a Delaunay mesh of a region with arbitrary hole(s). int main (int argc, char** argv) { libMesh::init (argc, argv); { // Libmesh mesh that will eventually be created. Mesh mesh(2); // Add description of holes to the vector typedef MeshTools::Generation::Hole Hole; std::vector holes; const Real xmin=-1., xmax=1., ymin=-1., ymax=1.; holes.push_back( Hole(Point( 0.5, 0.5), .25, 3 ) ); // triangular hole holes.push_back( Hole(Point(-0.5, 0.5), .1 , 50 ) ); // circular hole holes.push_back( Hole(Point(-0.5, -0.5), .1 , 4 ) ); // square hole holes.push_back( Hole(Point( 0.5, -0.5), .1 , 6 ) ); // hexagonal hole // Generate the mesh MeshTools::Generation::build_delaunay_square_with_hole(mesh, holes, 20, 20, xmin, xmax, ymin, ymax ); // Print result as GMV mesh.write("circular_hole2.gmv"); } return libMesh::close(); } ```
 Re: [Libmesh-devel] Support for 2D triangulations of meshes with holes From: Derek Gaston - 2006-06-30 17:04:49 ```Interesting.... I can definitely put this to use in my work... I'll let you know how it goes. Derek On 6/30/06, John Peterson wrote: > Hi, > > I just checked in some code that will produce 2D triangulations > of rectangular domains with n-sided holes cut out. Arbitrary > (non-polygonal) holes are also possible, that code will hopefully > be coming soon. > > > > Here is a sample code that uses the new functionality > > > > > > > > > #include "libmesh.h" > #include "mesh_generation.h" > #include "mesh.h" > > > // This program creates a Delaunay mesh of a region with arbitrary hole(s). > int main (int argc, char** argv) > { > libMesh::init (argc, argv); > { > > // Libmesh mesh that will eventually be created. > Mesh mesh(2); > > > // Add description of holes to the vector > typedef MeshTools::Generation::Hole Hole; > std::vector holes; > > const Real > xmin=-1., xmax=1., > ymin=-1., ymax=1.; > > holes.push_back( Hole(Point( 0.5, 0.5), .25, 3 ) ); // triangular hole > holes.push_back( Hole(Point(-0.5, 0.5), .1 , 50 ) ); // circular hole > holes.push_back( Hole(Point(-0.5, -0.5), .1 , 4 ) ); // square hole > holes.push_back( Hole(Point( 0.5, -0.5), .1 , 6 ) ); // hexagonal hole > > // Generate the mesh > MeshTools::Generation::build_delaunay_square_with_hole(mesh, > holes, > 20, 20, > xmin, xmax, > ymin, ymax > ); > > // Print result as GMV > mesh.write("circular_hole2.gmv"); > > > } > return libMesh::close(); > } > > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Libmesh-devel mailing list > Libmesh-devel@... > https://lists.sourceforge.net/lists/listinfo/libmesh-devel > ```