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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Romin Tomasetti
gmsh
Commits
ba08ae0f
Commit
ba08ae0f
authored
7 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
nicely handle argc/argv (gmshInitialize) in python
parent
c3571cfb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Common/gmsh.i
+8
-1
8 additions, 1 deletion
Common/gmsh.i
demos/api/t1.py
+0
-1
0 additions, 1 deletion
demos/api/t1.py
demos/api/t2.py
+6
-2
6 additions, 2 deletions
demos/api/t2.py
with
14 additions
and
4 deletions
Common/gmsh.i
+
8
−
1
View file @
ba08ae0f
%
module
gmsh
// "int &outTag" in function arguments is replaced by an append of outTag to the
// value returned by the function
%
include
typemaps
.
i
// reference to int is appended to the returned values of the function
%
apply
int
&OUTPUT
{ int &outTag }
;
// handle gracefully the arguments of gmshInitialize
%
include
argcargv
.
i
%
apply
(
int
ARGC
,
char
**
ARGV
)
{ (int argc, char **argv) }
%
{
#include "gmsh.h"
%}
...
...
This diff is collapsed.
Click to expand it.
demos/api/t1.py
+
0
−
1
View file @
ba08ae0f
...
...
@@ -50,7 +50,6 @@ gmshModelGeoAddLine(2, 3, 2);
gmshModelGeoAddLine
(
3
,
3
,
4
);
gmshModelGeoAddLine
(
4
,
4
,
1
);
# The philosophy to construct line loops and surfaces is similar: the second
# arguments are now vectors of integers.
gmshModelGeoAddLineLoop
(
1
,
[
4
,
1
,
-
2
,
3
]);
...
...
This diff is collapsed.
Click to expand it.
demos/api/t2.py
+
6
−
2
View file @
ba08ae0f
...
...
@@ -4,13 +4,17 @@
# API functions used, compared to the ones introduced in t1.py.
from
gmsh
import
*
import
sys
# If sys.argv is passed, Gmsh will parse the commandline in the same way as the
# standalone Gmsh code.
gmshInitialize
(
sys
.
argv
);
gmshInitialize
();
gmshOptionSetNumber
(
"
General.Terminal
"
,
1
);
gmshModelCreate
(
"
t2
"
);
# Copied from t1.
cp
p...
# Copied from t1.p
y
...
lc
=
1e-2
;
gmshModelGeoAddPoint
(
1
,
0
,
0
,
0
,
lc
);
gmshModelGeoAddPoint
(
2
,
.
1
,
0
,
0
,
lc
);
...
...
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