diff --git a/doc/texinfo/api.texi b/doc/texinfo/api.texi index 522b6729230b640276898e0ff2921f1cb6384d56..2aab9a42733efd028ecaa2fabe822190b2753b10 100644 --- a/doc/texinfo/api.texi +++ b/doc/texinfo/api.texi @@ -288,6 +288,8 @@ the same name, select the one that was added first. - @item Return: - +@item Examples: +Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L123,x3.py}) @end table @item gmsh/model/getEntities @@ -303,7 +305,7 @@ entities are returned as a vector of (dim, tag) integer pairs. @item Return: - @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t5.cpp#L200,t5.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t13.cpp#L55,t13.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t16.cpp#L114,t16.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t18.cpp#L31,t18.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L81,t20.cpp}, ...), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t5.py#L195,t5.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t13.py#L47,t13.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t16.py#L97,t16.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t18.py#L29,t18.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L63,t20.py}, ...) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t5.cpp#L200,t5.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t13.cpp#L55,t13.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t16.cpp#L114,t16.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t18.cpp#L31,t18.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L97,t20.cpp}, ...), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t5.py#L195,t5.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t13.py#L47,t13.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t16.py#L97,t16.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t18.py#L29,t18.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L79,t20.py}, ...) @end table @item gmsh/model/setEntityName @@ -455,7 +457,7 @@ dimension (e.g. points if @code{dim} == 0). @item Return: - @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t16.cpp#L123,t16.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t18.cpp#L86,t18.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L96,t20.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t16.py#L105,t16.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t18.py#L80,t18.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L77,t20.py}) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t16.cpp#L123,t16.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t18.cpp#L86,t18.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L115,t20.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t16.py#L105,t16.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t18.py#L80,t18.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L95,t20.py}) @end table @item gmsh/model/getBoundingBox @@ -505,7 +507,7 @@ overall model. @item Return: integer value @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L77,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.cpp#L11,discrete.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/edges.cpp#L63,edges.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/faces.cpp#L63,faces.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L11,plugin.cpp}, ...), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L74,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.py#L10,discrete.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/mesh_from_discrete_curve.py#L11,mesh_from_discrete_curve.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L9,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/reparamOnFace.py#L23,reparamOnFace.py}, ...) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L77,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.cpp#L11,discrete.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/edges.cpp#L63,edges.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/faces.cpp#L63,faces.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L11,plugin.cpp}, ...), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L74,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L72,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.py#L10,discrete.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/mesh_from_discrete_curve.py#L11,mesh_from_discrete_curve.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L9,plugin.py}, ...) @end table @item gmsh/model/removeEntities @@ -520,7 +522,7 @@ true, remove all the entities on their boundaries, down to dimension 0. @item Return: - @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t18.cpp#L92,t18.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L110,t20.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t18.py#L84,t18.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L86,t20.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/spherical_surf.py#L16,spherical_surf.py}) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t18.cpp#L92,t18.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L129,t20.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t18.py#L84,t18.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L103,t20.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/spherical_surf.py#L16,spherical_surf.py}) @end table @item gmsh/model/removeEntityName @@ -1104,7 +1106,7 @@ automatically assigned to the nodes. @item Return: - @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L91,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.cpp#L14,discrete.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L12,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L11,view.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L88,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.py#L13,discrete.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/flatten.py#L37,flatten.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/mesh_from_discrete_curve.py#L16,mesh_from_discrete_curve.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L10,plugin.py}, ...) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L91,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.cpp#L14,discrete.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L12,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L11,view.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L88,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L73,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/discrete.py#L13,discrete.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/flatten.py#L37,flatten.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/mesh_from_discrete_curve.py#L16,mesh_from_discrete_curve.py}, ...) @end table @item gmsh/model/mesh/reclassifyNodes @@ -1358,7 +1360,7 @@ are automatically assigned to the elements. @item Return: - @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L97,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/edges.cpp#L67,edges.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/faces.cpp#L67,faces.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L94,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/terrain.py#L59,terrain.py}) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/x2.cpp#L97,x2.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/edges.cpp#L67,edges.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/faces.cpp#L67,faces.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x2.py#L94,x2.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L78,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/terrain.py#L59,terrain.py}) @end table @item gmsh/model/mesh/getIntegrationPoints @@ -3017,7 +3019,7 @@ tag of the rectangle. @item Return: integer value @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t1.cpp#L162,t1.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t17.cpp#L28,t17.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L63,t20.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t21.cpp#L40,t21.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L229,adapt_mesh.cpp}, ...), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t1.py#L157,t1.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t17.py#L27,t17.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L52,t20.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t21.py#L32,t21.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L77,adapt_mesh.py}, ...) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t1.cpp#L162,t1.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t17.cpp#L28,t17.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L68,t20.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t21.cpp#L40,t21.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L229,adapt_mesh.cpp}, ...), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t1.py#L157,t1.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t17.py#L27,t17.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L57,t20.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t21.py#L32,t21.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L77,adapt_mesh.py}, ...) @end table @item gmsh/model/occ/addDisk @@ -3400,7 +3402,7 @@ set. @item Return: - @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t16.cpp#L61,t16.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t18.cpp#L75,t18.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L72,t20.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t21.cpp#L44,t21.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/edges.cpp#L23,edges.cpp}, ...), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t16.py#L54,t16.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t18.py#L70,t18.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L56,t20.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t21.py#L34,t21.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/crack.py#L20,crack.py}, ...) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t16.cpp#L61,t16.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t18.cpp#L75,t18.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L91,t20.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t21.cpp#L44,t21.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/edges.cpp#L23,edges.cpp}, ...), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t16.py#L54,t16.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t18.py#L70,t18.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L73,t20.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t21.py#L34,t21.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/crack.py#L20,crack.py}, ...) @end table @item gmsh/model/occ/translate @@ -3415,7 +3417,7 @@ Translate the model entities @code{dimTags} along (@code{dx}, @code{dy}, @item Return: - @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t19.cpp#L47,t19.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t19.py#L44,t19.py}) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t19.cpp#L47,t19.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L78,t20.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t19.py#L44,t19.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L65,t20.py}) @end table @item gmsh/model/occ/rotate @@ -3431,7 +3433,7 @@ direction (@code{ax}, @code{ay}, @code{az}). @item Return: - @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t19.cpp#L78,t19.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t19.py#L69,t19.py}) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t19.cpp#L78,t19.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L70,t20.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t19.py#L69,t19.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L59,t20.py}) @end table @item gmsh/model/occ/dilate @@ -3503,7 +3505,7 @@ Copy the entities @code{dimTags}; the new entities are returned in @item Return: - @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t19.cpp#L46,t19.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t19.py#L43,t19.py}) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t19.cpp#L46,t19.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L83,t20.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t19.py#L43,t19.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L69,t20.py}) @end table @item gmsh/model/occ/remove @@ -3518,7 +3520,7 @@ entities on their boundaries, down to dimension 0. @item Return: - @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t19.cpp#L85,t19.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L82,t20.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t19.py#L76,t19.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L63,t20.py}) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t19.cpp#L85,t19.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L98,t20.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t19.py#L76,t19.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L79,t20.py}) @end table @item gmsh/model/occ/removeAllDuplicates @@ -3600,7 +3602,7 @@ entities are returned as a vector of (dim, tag) integer pairs. @item Return: - @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L85,t20.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L66,t20.py}) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t20.cpp#L101,t20.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t20.py#L82,t20.py}) @end table @item gmsh/model/occ/getEntitiesInBoundingBox @@ -3755,7 +3757,7 @@ associate a new tag. Return the view tag. @item Return: integer value @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t4.cpp#L111,t4.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L246,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L18,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L17,view.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L20,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t4.py#L119,t4.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L90,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L41,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L16,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/poisson.py#L228,poisson.py}, ...) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t4.cpp#L111,t4.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L246,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L18,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L17,view.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L20,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t4.py#L119,t4.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L27,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L90,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L41,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L16,plugin.py}, ...) @end table @item gmsh/view/remove @@ -3824,7 +3826,7 @@ data. @code{partition} allows to specify data in several sub-sets. @item Return: - @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L248,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L19,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L21,view.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L91,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L17,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/poisson.py#L229,poisson.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.py#L20,view.py}) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L248,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L19,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L21,view.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L86,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L91,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L17,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/poisson.py#L229,poisson.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.py#L20,view.py}) @end table @item gmsh/view/addHomogeneousModelData @@ -3842,6 +3844,8 @@ but only if data is associated to elements of the same type for - @item Return: - +@item Examples: +Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L96,x3.py}) @end table @item gmsh/view/getModelData @@ -3875,7 +3879,7 @@ contains the data for the @code{numEle} elements. @item Return: - @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L25,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L42,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view_combine.py#L19,view_combine.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.py#L20,viewlist.py}) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L25,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L44,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L42,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view_combine.py#L19,view_combine.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.py#L20,viewlist.py}) @end table @item gmsh/view/getListData @@ -3909,7 +3913,7 @@ views) strings. @code{style} contains pairs of styling parameters, concatenated. @item Return: - @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t4.cpp#L115,t4.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t4.py#L123,t4.py}) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/c++/t4.cpp#L115,t4.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/t4.py#L123,t4.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L50,x3.py}) @end table @item gmsh/view/getListDataStrings @@ -4005,7 +4009,7 @@ file extension. Append to the file if @code{append} is set. @item Return: - @item Examples: -C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L249,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L44,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L25,view.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L27,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L93,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L43,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L34,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.py#L28,view.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view_combine.py#L26,view_combine.py}, ...) +C++ (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.cpp#L249,adapt_mesh.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.cpp#L44,plugin.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.cpp#L25,view.cpp}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/viewlist.cpp#L27,viewlist.cpp}), Python (@url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/tutorial/python/x3.py#L121,x3.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/adapt_mesh.py#L93,adapt_mesh.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/normals.py#L43,normals.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/plugin.py#L34,plugin.py}, @url{https://gitlab.onelab.info/gmsh/gmsh/tree/master/demos/api/view.py#L28,view.py}, ...) @end table @end ftable diff --git a/tutorial/c++/t20.cpp b/tutorial/c++/t20.cpp index e5f61cbb2971979ff6114e9a46a83be9280dd719..98fca4ec02a75b991bed8c87fba243e8f0027c8f 100644 --- a/tutorial/c++/t20.cpp +++ b/tutorial/c++/t20.cpp @@ -54,30 +54,46 @@ int main(int argc, char **argv) // or just the surfaces obtained by the cutting: int N = 5; // Number of slices + std::string dir = "X"; // Direction: "X", "Y" or "Z" bool surf = false; // Keep only surfaces? - double dz = (zmax - zmin) / N; + double dx = (xmax - xmin); + double dy = (ymax - ymin); + double dz = (zmax - zmin); + double L = (dir == "X") ? dz : dx; + double H = (dir == "Y") ? dz : dy; + + // Create the first cutting plane + std::vector<std::pair<int, int> > s; + s.push_back({2, gmsh::model::occ::addRectangle(xmin, ymin, zmin, L, H)}); + if(dir == "X") { + gmsh::model::occ::rotate({s[0]}, xmin, ymin, zmin, 0, 1, 0, -M_PI/2); + } + else if(dir == "Y") { + gmsh::model::occ::rotate({s[0]}, xmin, ymin, zmin, 1, 0, 0, M_PI/2); + } + double tx = (dir == "X") ? dx / N : 0; + double ty = (dir == "Y") ? dy / N : 0; + double tz = (dir == "Z") ? dz / N : 0; + gmsh::model::occ::translate({s[0]}, tx, ty, tz); - // Define the cutting planes - for(int i = 1; i < N; i++) - gmsh::model::occ::addRectangle(xmin, ymin, zmin + i * dz, xmax - xmin, - ymax - ymin, 1000 + i); + // Create the other cutting planes: + std::vector<std::pair<int, int> > tmp; + for(int i = 1; i < N - 1; i++) { + gmsh::model::occ::copy({s[0]}, tmp); + s.push_back(tmp[0]); + gmsh::model::occ::translate({s.back()}, i * tx, i * ty, i * tz); + } // Fragment (i.e. intersect) the volume with all the cutting planes: - std::vector<std::pair<int, int> > p; - for(int i = 1000 + 1; i < 1000 + N; i++) - p.push_back(std::pair<int, int>(2, i)); std::vector<std::pair<int, int> > ov; std::vector<std::vector<std::pair<int, int> > > ovv; - gmsh::model::occ::fragment(v, p, ov, ovv); + gmsh::model::occ::fragment(v, s, ov, ovv); // Now remove all the surfaces (and their bounding entities) that are not on // the boundary of a volume, i.e. the parts of the cutting planes that "stick // out" of the volume: - gmsh::model::occ::synchronize(); - - std::vector<std::pair<int, int> > tmp; gmsh::model::getEntities(tmp, 2); gmsh::model::occ::remove(tmp, true); @@ -92,10 +108,13 @@ int main(int argc, char **argv) double eps = 1e-4; std::vector<std::pair<int, int> > s; for(int i = 1; i < N; i++) { + double xx = (dir == "X") ? xmin : xmax; + double yy = (dir == "Y") ? ymin : ymax; + double zz = (dir == "Z") ? zmin : zmax; std::vector<std::pair<int, int> > e; gmsh::model::getEntitiesInBoundingBox( - xmin - eps, ymin - eps, zmin + i * dz - eps, xmax + eps, ymax + eps, - zmin + i * dz + eps, e, 2); + xmin - eps + i * tx, ymin - eps + i * ty, zmin - eps + i * tz, + xx + eps + i * tx, yy + eps + i * ty, zz + eps + i * tz, e, 2); s.insert(s.end(), e.begin(), e.end()); } // ...and remove all the other entities (here directly in the model, as we diff --git a/tutorial/python/t20.py b/tutorial/python/t20.py index 7dd7c584fb56a87ac456940129b888f274a5d613..d76aa41b50c57f9d3c7363e9379a4ded39bd102c 100644 --- a/tutorial/python/t20.py +++ b/tutorial/python/t20.py @@ -43,22 +43,38 @@ xmin, ymin, zmin, xmax, ymax, zmax = gmsh.model.getBoundingBox( # or just the surfaces obtained by the cutting: N = 5 # Number of slices +dir = 'X' # Direction: 'X', 'Y' or 'Z' surf = False # Keep only surfaces? -dz = (zmax - zmin) / N - -# Define the cutting planes -for i in range(1, N): - gmsh.model.occ.addRectangle(xmin, ymin, zmin + i * dz, xmax - xmin, - ymax - ymin, 1000 + i) +dx = (xmax - xmin) +dy = (ymax - ymin) +dz = (zmax - zmin) +L = dz if (dir == 'X') else dx +H = dz if (dir == 'Y') else dy + +# Create the first cutting plane: +s = [] +s.append((2, gmsh.model.occ.addRectangle(xmin, ymin, zmin, L, H))) +if dir == 'X': + gmsh.model.occ.rotate([s[0]], xmin, ymin, zmin, 0, 1, 0, -math.pi/2) +elif dir == 'Y': + gmsh.model.occ.rotate([s[0]], xmin, ymin, zmin, 1, 0, 0, math.pi/2) +tx = dx / N if (dir == 'X') else 0 +ty = dy / N if (dir == 'Y') else 0 +tz = dz / N if (dir == 'Z') else 0 +gmsh.model.occ.translate([s[0]], tx, ty, tz) + +# Create the other cutting planes: +for i in range(1, N-1): + s.extend(gmsh.model.occ.copy([s[0]])) + gmsh.model.occ.translate([s[-1]], i * tx, i * ty, i * tz) # Fragment (i.e. intersect) the volume with all the cutting planes: -gmsh.model.occ.fragment(v, [(2, i) for i in range(1000 + 1, 1000 + N)]) +gmsh.model.occ.fragment(v, s) # Now remove all the surfaces (and their bounding entities) that are not on the # boundary of a volume, i.e. the parts of the cutting planes that "stick out" of # the volume: - gmsh.model.occ.synchronize() gmsh.model.occ.remove(gmsh.model.getEntities(2), True) @@ -73,11 +89,12 @@ if surf: eps = 1e-4 s = [] for i in range(1, N): - s.extend( - gmsh.model.getEntitiesInBoundingBox(xmin - eps, ymin - eps, - zmin + i * dz - eps, - xmax + eps, ymax + eps, - zmin + i * dz + eps, 2)) + xx = xmin if (dir == 'X') else xmax + yy = ymin if (dir == 'Y') else ymax + zz = zmin if (dir == 'Z') else zmax + s.extend(gmsh.model.getEntitiesInBoundingBox( + xmin - eps + i * tx, ymin - eps + i * ty, zmin - eps + i * tz, + xx + eps + i * tx, yy + eps + i * ty, zz + eps + i * tz, 2)) # ...and remove all the other entities (here directly in the model, as we # won't modify any OpenCASCADE entities later on): dels = gmsh.model.getEntities(2) diff --git a/tutorial/t20.geo b/tutorial/t20.geo index 07944d9ccd2e4a7f080c3323b84d80cbe0871b11..ed850b6b66ed5f58db6bbe96112a33525934cf2a 100644 --- a/tutorial/t20.geo +++ b/tutorial/t20.geo @@ -35,19 +35,37 @@ zmax = bbox(5); // We want to slice the model into N slices, and either keep the volume slices // or just the surfaces obtained by the cutting: DefineConstant[ - N = {5, Min 2, Max 100, Step 1, Name "Number of slices"} - surf = {0, Choices{0, 1}, Name "Keep only surfaces?"} + N = {5, Min 2, Max 100, Step 1, Name "Parameters/0Number of slices"} + dir = {0, Choices{0="X", 1="Y", 2="Z"}, Name "Parameters/1Direction"} + surf = {0, Choices{0, 1}, Name "Parameters/2Keep only surfaces?"} ]; -dz = (zmax - zmin) / N; -// Define the cutting planes -For i In {1:N-1} - Rectangle(1000 + i) = {xmin, ymin, zmin + i * dz, - xmax-xmin, ymax-ymin}; +dx = (xmax - xmin); +dy = (ymax - ymin); +dz = (zmax - zmin); +L = (dir == 0) ? dz : dx; +H = (dir == 1) ? dz : dy; + +// Create the first cutting plane: +s() = {news}; +Rectangle(s(0)) = {xmin, ymin, zmin, L, H}; +If(dir == 0) + Rotate{ {0, 1, 0}, {xmin, ymin, zmin}, -Pi/2 } { Surface{s(0)}; } +ElseIf(dir == 1) + Rotate{ {1, 0, 0}, {xmin, ymin, zmin}, Pi/2 } { Surface{s(0)}; } +EndIf +tx = (dir == 0) ? dx / N : 0; +ty = (dir == 1) ? dy / N : 0; +tz = (dir == 2) ? dz / N : 0; +Translate{tx, ty, tz} { Surface{s(0)}; } + +// Create the other cutting planes: +For i In {1:N-2} + s() += Translate{i * tx, i * ty, i * tz} { Duplicata{ Surface{s(0)}; } }; EndFor // Fragment (i.e. intersect) the volume with all the cutting planes: -BooleanFragments{ Volume{v()}; Delete; }{ Surface{1000+1:1000+N-1}; Delete; } +BooleanFragments{ Volume{v()}; Delete; }{ Surface{s()}; Delete; } // Now remove all the surfaces (and their bounding entities) that are not on the // boundary of a volume, i.e. the parts of the cutting planes that "stick out" @@ -60,8 +78,12 @@ If(surf) eps = 1e-4; s() = {}; For i In {1:N-1} - s() += Surface In BoundingBox{xmin-eps,ymin-eps,zmin + i * dz - eps, - xmax+eps,ymax+eps,zmin + i * dz + eps}; + xx = (dir == 0) ? xmin : xmax; + yy = (dir == 1) ? ymin : ymax; + zz = (dir == 2) ? zmin : zmax; + s() += Surface In BoundingBox + {xmin - eps + i * tx, ymin - eps + i * ty, zmin - eps + i * tz, + xx + eps + i * tx, yy + eps + i * ty, zz + eps + i * tz}; EndFor // ...and remove all the other entities: dels = Surface{:};