Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Romin Tomasetti
gmsh
Commits
86b3a8b3
There was an error fetching the commit references. Please try again later.
Commit
86b3a8b3
authored
3 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
explain that undesired output args in C API can be ignored by passing NULL (cf.
!470
)
parent
cb51a262
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/texinfo/gmsh.texi
+10
-2
10 additions, 2 deletions
doc/texinfo/gmsh.texi
tutorials/c/t2.c
+7
-7
7 additions, 7 deletions
tutorials/c/t2.c
with
17 additions
and
9 deletions
doc/texinfo/gmsh.texi
+
10
−
2
View file @
86b3a8b3
...
@@ -5286,6 +5286,8 @@ See
...
@@ -5286,6 +5286,8 @@ See
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
t
2
.geo,t
2
.geo
}
. Also
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
t
2
.geo,t
2
.geo
}
. Also
available in C
++
available in C
++
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
c
++/
t
2
.cpp,t
2
.cpp
}
)
,
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
c
++/
t
2
.cpp,t
2
.cpp
}
)
,
C
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
c
/
t
2
.c,t
2
.c
}
)
,
Python
Python
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
python
/
t
2
.py,t
2
.py
}
)
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
python
/
t
2
.py,t
2
.py
}
)
and Julia
and Julia
...
@@ -5365,7 +5367,9 @@ and Julia
...
@@ -5365,7 +5367,9 @@ and Julia
See
See
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
t
6
.geo,t
6
.geo
}
.
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
t
6
.geo,t
6
.geo
}
.
Also available in C
++
Also available in C
++
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
c
++/
t
6
.cpp,t
6
.cpp
}
)
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
c
++/
t
6
.cpp,t
6
.cpp
}
)
,
C
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
c
/
t
6
.c,t
6
.c
}
)
and Python
and Python
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
python
/
t
6
.py,t
6
.py
}
)
.
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
python
/
t
6
.py,t
6
.py
}
)
.
...
@@ -5439,7 +5443,9 @@ See
...
@@ -5439,7 +5443,9 @@ See
Also available in C
++
Also available in C
++
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
c
++/
t
10
.cpp,t
10
.cpp
}
)
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
c
++/
t
10
.cpp,t
10
.cpp
}
)
and Python
and Python
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
python
/
t
10
.py,t
10
.py
}
)
.
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
python
/
t
10
.py,t
10
.py
}
)
and Julia
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
julia
/
t
10
.jl,t
10
.jl
}
)
.
@smallformat
@smallformat
@verbatiminclude ..
/
..
/
tutorials
/
t
10
.geo
@verbatiminclude ..
/
..
/
tutorials
/
t
10
.geo
...
@@ -5546,6 +5552,8 @@ See
...
@@ -5546,6 +5552,8 @@ See
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
t
16
.geo,t
16
.geo
}
.
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
t
16
.geo,t
16
.geo
}
.
Also available in C
++
Also available in C
++
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
c
++/
t
16
.cpp,t
16
.cpp
}
)
,
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
c
++/
t
16
.cpp,t
16
.cpp
}
)
,
C
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
c
/
t
16
.c,t
16
.c
}
)
,
Python
Python
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
python
/
t
16
.py,t
16
.py
}
)
(
@url
{
@value
{
GITLAB
-
PREFIX
}
/
tutorials
/
python
/
t
16
.py,t
16
.py
}
)
and Julia
and Julia
...
...
This diff is collapsed.
Click to expand it.
tutorials/c/t2.c
+
7
−
7
View file @
86b3a8b3
...
@@ -82,8 +82,11 @@ int main(int argc, char **argv)
...
@@ -82,8 +82,11 @@ int main(int argc, char **argv)
// should be freed with `gmshFree()' when not used anymore:
// should be freed with `gmshFree()' when not used anymore:
gmshFree
(
ov
);
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
};
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
};
const
int
s2
[]
=
{
10
};
gmshModelGeoAddPlaneSurface
(
s2
,
sizeof
(
s2
)
/
sizeof
(
s2
[
0
]),
11
,
&
ierr
);
gmshModelGeoAddPlaneSurface
(
s2
,
sizeof
(
s2
)
/
sizeof
(
s2
[
0
]),
11
,
&
ierr
);
...
@@ -161,18 +164,15 @@ int main(int argc, char **argv)
...
@@ -161,18 +164,15 @@ int main(int argc, char **argv)
// the surface 11 along the z axis and automatically creates a new volume (as
// 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
// 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
// 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:
// translation vector; since we don't plan to use the output vector of (dim,
int
*
ov2
;
// tag) pairs, we pass NULL instead:
size_t
ov2_n
;
const
int
*
numElements
;
const
int
*
numElements
;
const
size_t
numElements_n
=
0
;
const
size_t
numElements_n
=
0
;
const
double
*
heights
;
const
double
*
heights
;
const
size_t
heights_n
=
0
;
const
size_t
heights_n
=
0
;
const
int
recombine
=
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
);
numElements_n
,
heights
,
heights_n
,
recombine
,
&
ierr
);
gmshFree
(
ov
);
gmshFree
(
ov2
);
// Mesh sizes associated to geometrical points can be set by passing a vector
// Mesh sizes associated to geometrical points can be set by passing a vector
// of (dim, tag) pairs for the corresponding points:
// of (dim, tag) pairs for the corresponding points:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment