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
3c64394f
Commit
3c64394f
authored
Aug 27, 2019
by
Max Orok
Browse files
Options
Downloads
Patches
Plain Diff
Add first draft of t17.py
parent
694dc368
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
demos/api/t17.py
+49
-0
49 additions, 0 deletions
demos/api/t17.py
with
49 additions
and
0 deletions
demos/api/t17.py
0 → 100644
+
49
−
0
View file @
3c64394f
# This file reimplements gmsh/tutorial/t17.geo in Python.
#
# Anisotropic background mesh
import
gmsh
import
math
model
=
gmsh
.
model
factory
=
model
.
geo
gmsh
.
initialize
()
gmsh
.
option
.
setNumber
(
"
General.Terminal
"
,
1
)
factory
.
addPoint
(
-
1
,
-
1
,
0
)
factory
.
addPoint
(
1
,
-
1
,
0
)
factory
.
addPoint
(
1
,
1
,
0
)
factory
.
addPoint
(
-
1
,
1
,
0
)
factory
.
addLine
(
1
,
2
,
1
)
factory
.
addLine
(
2
,
3
,
2
)
factory
.
addLine
(
3
,
4
,
3
)
factory
.
addLine
(
4
,
1
,
4
)
factory
.
addCurveLoop
([
1
,
2
,
3
,
4
],
1
)
factory
.
addPlaneSurface
([
1
],
1
)
factory
.
synchronize
()
# add a post-processing view to use as a size field
gmsh
.
merge
(
"
t17.pos
"
)
field
=
gmsh
.
model
.
mesh
.
field
# The field is of type "PostView"
bg_field
=
field
.
add
(
"
PostView
"
)
# "IView" is the index of the view you want to use.
field
.
setNumber
(
bg_field
,
"
IView
"
,
0
)
# set the field as a background mesh
field
.
setAsBackgroundMesh
(
bg_field
)
# use bamg
gmsh
.
option
.
setNumber
(
"
Mesh.SmoothRatio
"
,
3
)
gmsh
.
option
.
setNumber
(
"
Mesh.AnisoMax
"
,
1000
)
gmsh
.
option
.
setNumber
(
"
Mesh.Algorithm
"
,
7
)
gmsh
.
model
.
mesh
.
generate
(
2
)
gmsh
.
write
(
"
t17.msh
"
)
gmsh
.
fltk
.
run
()
gmsh
.
finalize
()
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