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
Xiaoyu Wei
meshmode
Commits
bf29a349
Commit
bf29a349
authored
4 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Make Mesh.boundary_tag_bit complain if not called with a known boundary tag
parent
11826f48
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
meshmode/discretization/connection/face.py
+5
-4
5 additions, 4 deletions
meshmode/discretization/connection/face.py
meshmode/mesh/__init__.py
+11
-0
11 additions, 0 deletions
meshmode/mesh/__init__.py
with
16 additions
and
4 deletions
meshmode/discretization/connection/face.py
+
5
−
4
View file @
bf29a349
...
...
@@ -168,9 +168,9 @@ def make_face_restriction(discr, group_factory, boundary_tag,
:arg boundary_tag: The boundary tag for which to create a face
restriction. May be
:class:`
meshmode.discretization.connection.F
RESTR_INTERIOR
_FACES
`
:class:`
FACE_
RESTR_INTERIOR`
to indicate interior faces, or
:class:`
meshmode.discretization.connection.F
RESTR_ALL
_FACES
`
:class:`
FACE_
RESTR_ALL`
to make a discretization consisting of all (interior and
boundary) faces.
...
...
@@ -199,7 +199,7 @@ def make_face_restriction(discr, group_factory, boundary_tag,
boundary_tag
=
FACE_RESTR_INTERIOR
from
warnings
import
warn
warn
(
"
passing *None* for boundary_tag is deprecated--pass
"
"
FRESTR_INTERIOR
_FACES
instead
"
,
"
F
ACE_
RESTR_INTERIOR instead
"
,
DeprecationWarning
,
stacklevel
=
2
)
logger
.
info
(
"
building face restriction: start
"
)
...
...
@@ -223,7 +223,8 @@ def make_face_restriction(discr, group_factory, boundary_tag,
bdry_mesh_groups
=
[]
connection_data
=
{}
btag_bit
=
discr
.
mesh
.
boundary_tag_bit
(
boundary_tag
)
if
boundary_tag
not
in
[
FACE_RESTR_ALL
,
FACE_RESTR_INTERIOR
]:
btag_bit
=
discr
.
mesh
.
boundary_tag_bit
(
boundary_tag
)
for
igrp
,
(
grp
,
fagrp_map
)
in
enumerate
(
zip
(
discr
.
groups
,
discr
.
mesh
.
facial_adjacency_groups
)):
...
...
This diff is collapsed.
Click to expand it.
meshmode/mesh/__init__.py
+
11
−
0
View file @
bf29a349
...
...
@@ -632,6 +632,11 @@ class Mesh(Record):
A mapping that maps boundary tag identifiers to their
corresponding index.
.. note::
Elements of :attr:`boundary_tags` that do not cover any
part of the boundary will not be keys in this dictionary.
.. attribute:: vertex_id_dtype
.. attribute:: element_id_dtype
...
...
@@ -882,6 +887,12 @@ class Mesh(Record):
return
self
.
_facial_adjacency_groups
def
boundary_tag_bit
(
self
,
boundary_tag
):
if
boundary_tag
is
BTAG_NONE
:
return
0
if
boundary_tag
not
in
self
.
boundary_tags
:
raise
ValueError
(
"
boundary tag
'
%s
'
is not known
"
%
boundary_tag
)
try
:
return
1
<<
self
.
btag_to_index
[
boundary_tag
]
except
KeyError
:
...
...
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