Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
meshmode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ellis Hoag
meshmode
Commits
5a9b3ccb
Commit
5a9b3ccb
authored
10 years ago
by
Shivam Gupta
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
http://github.com/inducer/meshmode
into refinement
parents
ae597b40
990cbadb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
meshmode/mesh/visualization.py
+9
-2
9 additions, 2 deletions
meshmode/mesh/visualization.py
with
9 additions
and
2 deletions
meshmode/mesh/visualization.py
+
9
−
2
View file @
5a9b3ccb
...
@@ -29,7 +29,8 @@ import numpy as np
...
@@ -29,7 +29,8 @@ import numpy as np
# {{{ draw_2d_mesh
# {{{ draw_2d_mesh
def
draw_2d_mesh
(
mesh
,
draw_numbers
=
True
,
**
kwargs
):
def
draw_2d_mesh
(
mesh
,
draw_vertex_numbers
=
True
,
draw_element_numbers
=
True
,
**
kwargs
):
assert
mesh
.
ambient_dim
==
2
assert
mesh
.
ambient_dim
==
2
import
matplotlib.pyplot
as
pt
import
matplotlib.pyplot
as
pt
...
@@ -55,7 +56,7 @@ def draw_2d_mesh(mesh, draw_numbers=True, **kwargs):
...
@@ -55,7 +56,7 @@ def draw_2d_mesh(mesh, draw_numbers=True, **kwargs):
patch
=
mpatches
.
PathPatch
(
path
,
**
kwargs
)
patch
=
mpatches
.
PathPatch
(
path
,
**
kwargs
)
pt
.
gca
().
add_patch
(
patch
)
pt
.
gca
().
add_patch
(
patch
)
if
draw_numbers
:
if
draw_
element_
numbers
:
centroid
=
(
np
.
sum
(
elverts
,
axis
=
1
)
centroid
=
(
np
.
sum
(
elverts
,
axis
=
1
)
/
elverts
.
shape
[
1
])
/
elverts
.
shape
[
1
])
...
@@ -68,6 +69,12 @@ def draw_2d_mesh(mesh, draw_numbers=True, **kwargs):
...
@@ -68,6 +69,12 @@ def draw_2d_mesh(mesh, draw_numbers=True, **kwargs):
ha
=
"
center
"
,
va
=
"
center
"
,
ha
=
"
center
"
,
va
=
"
center
"
,
bbox
=
dict
(
facecolor
=
'
white
'
,
alpha
=
0.5
,
lw
=
0
))
bbox
=
dict
(
facecolor
=
'
white
'
,
alpha
=
0.5
,
lw
=
0
))
if
draw_vertex_numbers
:
for
ivert
,
vert
in
enumerate
(
mesh
.
vertices
.
T
):
pt
.
text
(
vert
[
0
],
vert
[
1
],
str
(
ivert
),
fontsize
=
15
,
ha
=
"
center
"
,
va
=
"
center
"
,
color
=
"
blue
"
,
bbox
=
dict
(
facecolor
=
'
white
'
,
alpha
=
0.5
,
lw
=
0
))
# }}}
# }}}
# vim: foldmethod=marker
# vim: foldmethod=marker
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