diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi index b70aeec794dea83e67840ac1e777499ee96ee768..38208b67b6077cbb1b4c7d0b5b2303aeba1b36b2 100644 --- a/doc/texinfo/gmsh.texi +++ b/doc/texinfo/gmsh.texi @@ -5286,6 +5286,8 @@ See @url{@value{GITLAB-PREFIX}/tutorials/t2.geo,t2.geo}. Also available in C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/t2.cpp,t2.cpp}), +C +(@url{@value{GITLAB-PREFIX}/tutorials/c/t2.c,t2.c}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/t2.py,t2.py}) and Julia @@ -5365,7 +5367,9 @@ and Julia See @url{@value{GITLAB-PREFIX}/tutorials/t6.geo,t6.geo}. Also available in C++ -(@url{@value{GITLAB-PREFIX}/tutorials/c++/t6.cpp,t6.cpp}) +(@url{@value{GITLAB-PREFIX}/tutorials/c++/t6.cpp,t6.cpp}), +C +(@url{@value{GITLAB-PREFIX}/tutorials/c/t6.c,t6.c}) and Python (@url{@value{GITLAB-PREFIX}/tutorials/python/t6.py,t6.py}). @@ -5439,7 +5443,9 @@ See Also available in C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/t10.cpp,t10.cpp}) and Python -(@url{@value{GITLAB-PREFIX}/tutorials/python/t10.py,t10.py}). +(@url{@value{GITLAB-PREFIX}/tutorials/python/t10.py,t10.py}) +and Julia +(@url{@value{GITLAB-PREFIX}/tutorials/julia/t10.jl,t10.jl}). @smallformat @verbatiminclude ../../tutorials/t10.geo @@ -5546,6 +5552,8 @@ See @url{@value{GITLAB-PREFIX}/tutorials/t16.geo,t16.geo}. Also available in C++ (@url{@value{GITLAB-PREFIX}/tutorials/c++/t16.cpp,t16.cpp}), +C +(@url{@value{GITLAB-PREFIX}/tutorials/c/t16.c,t16.c}), Python (@url{@value{GITLAB-PREFIX}/tutorials/python/t16.py,t16.py}) and Julia diff --git a/tutorials/c/t2.c b/tutorials/c/t2.c index 83346f192e4d2630b6e9994b8243d62ab175251d..9c8097bdb441de1af5fb84a10b59428e8e6d5c23 100644 --- a/tutorials/c/t2.c +++ b/tutorials/c/t2.c @@ -82,8 +82,11 @@ int main(int argc, char **argv) // should be freed with `gmshFree()' when not used anymore: gmshFree(ov); + // Note that in the C API, undesired output values can be ignored by passing a + // NULL pointer. For example, to ignore the error flag, we can pass NULL as + // the last argument: const int cl2[] = {5, -8, -7, 3}; - gmshModelGeoAddCurveLoop(cl2, sizeof(cl2) / sizeof(cl2[0]), 10, 0, &ierr); + gmshModelGeoAddCurveLoop(cl2, sizeof(cl2) / sizeof(cl2[0]), 10, 0, NULL); const int s2[] = {10}; gmshModelGeoAddPlaneSurface(s2, sizeof(s2) / sizeof(s2[0]), 11, &ierr); @@ -161,18 +164,15 @@ int main(int argc, char **argv) // the surface 11 along the z axis and automatically creates a new volume (as // well as all the needed points, curves and surfaces). As expected, the // function takes a vector of (dim, tag) pairs as input as well as the - // translation vector, and returns a vector of (dim, tag) pairs as output: - int *ov2; - size_t ov2_n; + // translation vector; since we don't plan to use the output vector of (dim, + // tag) pairs, we pass NULL instead: const int *numElements; const size_t numElements_n = 0; const double *heights; const size_t heights_n = 0; const int recombine = 0; - gmshModelGeoExtrude(&(ov[2]), 2, 0.0, 0.0, 0.12, &ov2, &ov2_n, numElements, + gmshModelGeoExtrude(&(ov[2]), 2, 0.0, 0.0, 0.12, NULL, NULL, numElements, numElements_n, heights, heights_n, recombine, &ierr); - gmshFree(ov); - gmshFree(ov2); // Mesh sizes associated to geometrical points can be set by passing a vector // of (dim, tag) pairs for the corresponding points: