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
Model registry
Analyze
Contributor 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
gmsh
gmsh
Commits
73997e58
Commit
73997e58
authored
5 years ago
by
Max Orok
Browse files
Options
Downloads
Patches
Plain Diff
Use the new field::fromView function to clean up background mesh setup
parent
f16305bb
No related branches found
No related tags found
1 merge request
!270
Add more python tutorials
Pipeline
#4668
failed
5 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
demos/api/t17.py
+2
-8
2 additions, 8 deletions
demos/api/t17.py
demos/api/t7.py
+1
-5
1 addition, 5 deletions
demos/api/t7.py
with
3 additions
and
13 deletions
demos/api/t17.py
+
2
−
8
View file @
73997e58
...
@@ -28,14 +28,8 @@ factory.synchronize()
...
@@ -28,14 +28,8 @@ factory.synchronize()
# add a post-processing view to use as a size field
# add a post-processing view to use as a size field
gmsh
.
merge
(
"
t17.pos
"
)
gmsh
.
merge
(
"
t17.pos
"
)
field
=
gmsh
.
model
.
mesh
.
field
bg_field
=
model
.
mesh
.
field
.
fromView
(
0
)
model
.
mesh
.
field
.
setAsBackgroundMesh
(
bg_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
# use bamg
gmsh
.
option
.
setNumber
(
"
Mesh.SmoothRatio
"
,
3
)
gmsh
.
option
.
setNumber
(
"
Mesh.SmoothRatio
"
,
3
)
...
...
This diff is collapsed.
Click to expand it.
demos/api/t7.py
+
1
−
5
View file @
73997e58
...
@@ -36,11 +36,7 @@ gmsh.merge("bgmesh.pos")
...
@@ -36,11 +36,7 @@ gmsh.merge("bgmesh.pos")
field
=
gmsh
.
model
.
mesh
.
field
field
=
gmsh
.
model
.
mesh
.
field
# add the post-processing view as a new size field
# add the post-processing view as a new size field
bg_field
=
field
.
add
(
"
PostView
"
)
bg_field
=
field
.
fromView
(
0
)
# pass the view tag you want to use as a size field
field
.
setNumber
(
bg_field
,
"
IView
"
,
0
)
# set the field as a background mesh
field
.
setAsBackgroundMesh
(
bg_field
)
field
.
setAsBackgroundMesh
(
bg_field
)
gmsh
.
model
.
mesh
.
generate
(
2
)
gmsh
.
model
.
mesh
.
generate
(
2
)
...
...
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