From f328d297f3c5567a8b7a86cecd03823e37999f5f Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Fri, 23 Sep 2011 15:25:08 +0000 Subject: [PATCH] --- tutorial/t12.geo | 2 +- tutorial/t13.geo | 83 ++++------------------------------------------- tutorial/t14.geo | 84 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+), 78 deletions(-) create mode 100644 tutorial/t14.geo diff --git a/tutorial/t12.geo b/tutorial/t12.geo index a2ca10b4f2..88b8c74769 100644 --- a/tutorial/t12.geo +++ b/tutorial/t12.geo @@ -2,7 +2,7 @@ * * Gmsh tutorial 12 * - * Remeshing with compounds + * Remeshing STL with compounds * *********************************************************************/ diff --git a/tutorial/t13.geo b/tutorial/t13.geo index 1da987136b..62a15a318d 100644 --- a/tutorial/t13.geo +++ b/tutorial/t13.geo @@ -1,84 +1,13 @@ /********************************************************************* * * Gmsh tutorial 13 - * - * Homology computation + * + * Cross-patch meshing with compounds * *********************************************************************/ - -// Homology computation in Gmsh finds representative chains of -// (relative) homology spaces using a mesh of a model. Those -// representatives generate the (relative) homology spaces of the -// model. Alternatively, Gmsh can only look for the ranks of the -// (relative) homology spaces, the Betti numbers of the model. - -// The generators chains are stored in a given .msh-file as physical -// groups, whose mesh elements are oriented such that their -// coefficients are 1 in the generator chain. - -// Create an example geometry - -m = 0.5; // mesh characteristic length -h = 2; // height in the z-direction - -Point(1) = {0, 0, 0, m}; Point(2) = {10, 0, 0, m}; -Point(3) = {10, 10, 0, m}; Point(4) = {0, 10, 0, m}; -Point(5) = {4, 4, 0, m}; Point(6) = {6, 4, 0, m}; -Point(7) = {6, 6, 0, m}; Point(8) = {4, 6, 0, m}; - -Point(9) = {2, 0, 0, m}; Point(10) = {8, 0, 0, m}; -Point(11) = {2, 10, 0, m}; Point(12) = {8, 10, 0, m}; - -Line(1) = {1, 9}; Line(2) = {9, 10}; Line(3) = {10, 2}; -Line(4) = {2, 3}; Line(5) = {3, 12}; Line(6) = {12, 11}; -Line(7) = {11, 4}; Line(8) = {4, 1}; Line(9) = {5, 6}; -Line(10) = {6, 7}; Line(11) = {7, 8}; Line(12) = {8, 5}; - -Line Loop(13) = {6, 7, 8, 1, 2, 3, 4, 5}; -Line Loop(14) = {11, 12, 9, 10}; -Plane Surface(15) = {13, 14}; - -Extrude {0, 0, h}{ Surface{15}; } - -// Create physical groups, which are used to define the domain of the -// homology computation and the subdomain of the relative homology -// computation. - -// Whole domain -Physical Volume(1) = {1}; - -// Four "terminals" of the model -Physical Surface(70) = {36}; -Physical Surface(71) = {44}; -Physical Surface(72) = {52}; -Physical Surface(73) = {60}; - -// Whole domain surface -bnd[] = Boundary{ Volume{1}; }; -Physical Surface(80) = bnd[]; - -// Complement of the domain surface respect to the four terminals -bnd[] -= {36, 44, 52, 60}; -Physical Surface(75) = bnd[]; - -// Create a mesh of the model -Mesh 3; - -// Find generators of relative homology spaces of the domain modulo -// the four terminals. Save the generator chains to t13_hom.msh. -HomGen("t13_hom.msh") = {{1}, {70, 71, 72, 73}}; - -// Find the corresponding thin cuts, generators of relative homology -// spaces modulo the non-terminal domain surface. Save the cut chains -// to t13_hom.msh. -HomGen("t13_hom.msh") = {{1}, {75}}; -// Find the corresponding thick cuts. Save the cut chains to -// t13_hom.msh. -HomCut("t13_hom.msh") = {{1}, {70, 71, 72, 73}}; +// Compound geometrical entities can be defined to compute a new +// parametrization of groups of elementary geometrical entities. This +// parametrization can then be used for remeshing the compound as if +// it were a CAD entity. -// More examples: -// HomGen("t13_hom.msh") = {{1}, {}}; -// HomGen("t13_hom.msh") = {{}, {}}; -// HomGen("t13_hom.msh") = {{1}, {80}}; -// HomGen("t13_hom.msh") = {{}, {80}}; diff --git a/tutorial/t14.geo b/tutorial/t14.geo new file mode 100644 index 0000000000..95e240cda2 --- /dev/null +++ b/tutorial/t14.geo @@ -0,0 +1,84 @@ +/********************************************************************* + * + * Gmsh tutorial 14 + * + * Homology computation + * + *********************************************************************/ + +// Homology computation in Gmsh finds representative chains of +// (relative) homology spaces using a mesh of a model. Those +// representatives generate the (relative) homology spaces of the +// model. Alternatively, Gmsh can only look for the ranks of the +// (relative) homology spaces, the Betti numbers of the model. + +// The generators chains are stored in a given .msh-file as physical +// groups, whose mesh elements are oriented such that their +// coefficients are 1 in the generator chain. + +// Create an example geometry + +m = 0.5; // mesh characteristic length +h = 2; // height in the z-direction + +Point(1) = {0, 0, 0, m}; Point(2) = {10, 0, 0, m}; +Point(3) = {10, 10, 0, m}; Point(4) = {0, 10, 0, m}; +Point(5) = {4, 4, 0, m}; Point(6) = {6, 4, 0, m}; +Point(7) = {6, 6, 0, m}; Point(8) = {4, 6, 0, m}; + +Point(9) = {2, 0, 0, m}; Point(10) = {8, 0, 0, m}; +Point(11) = {2, 10, 0, m}; Point(12) = {8, 10, 0, m}; + +Line(1) = {1, 9}; Line(2) = {9, 10}; Line(3) = {10, 2}; +Line(4) = {2, 3}; Line(5) = {3, 12}; Line(6) = {12, 11}; +Line(7) = {11, 4}; Line(8) = {4, 1}; Line(9) = {5, 6}; +Line(10) = {6, 7}; Line(11) = {7, 8}; Line(12) = {8, 5}; + +Line Loop(13) = {6, 7, 8, 1, 2, 3, 4, 5}; +Line Loop(14) = {11, 12, 9, 10}; +Plane Surface(15) = {13, 14}; + +Extrude {0, 0, h}{ Surface{15}; } + +// Create physical groups, which are used to define the domain of the +// homology computation and the subdomain of the relative homology +// computation. + +// Whole domain +Physical Volume(1) = {1}; + +// Four "terminals" of the model +Physical Surface(70) = {36}; +Physical Surface(71) = {44}; +Physical Surface(72) = {52}; +Physical Surface(73) = {60}; + +// Whole domain surface +bnd[] = Boundary{ Volume{1}; }; +Physical Surface(80) = bnd[]; + +// Complement of the domain surface respect to the four terminals +bnd[] -= {36, 44, 52, 60}; +Physical Surface(75) = bnd[]; + +// Create a mesh of the model +Mesh 3; + +// Find generators of relative homology spaces of the domain modulo +// the four terminals. Save the generator chains to t14_hom.msh. +HomGen("t14_hom.msh") = {{1}, {70, 71, 72, 73}}; + +// Find the corresponding thin cuts, generators of relative homology +// spaces modulo the non-terminal domain surface. Save the cut chains +// to t14_hom.msh. +HomGen("t14_hom.msh") = {{1}, {75}}; + +// Find the corresponding thick cuts. Save the cut chains to +// t14_hom.msh. +HomCut("t14_hom.msh") = {{1}, {70, 71, 72, 73}}; + +// More examples: +// HomGen("t14_hom.msh") = {{1}, {}}; +// HomGen("t14_hom.msh") = {{}, {}}; +// HomGen("t14_hom.msh") = {{1}, {80}}; +// HomGen("t14_hom.msh") = {{}, {80}}; -- GitLab