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
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Andreas Klöckner
meshmode
Commits
5ed91ce0
Commit
5ed91ce0
authored
4 years ago
by
Ben Sepanski
Browse files
Options
Downloads
Patches
Plain Diff
renamed to fix flake8 errors
parent
947668b8
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!91
WIP: Firedrake connection-functional
,
!84
Firedrake connection
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
meshmode/interop/firedrake/mesh_geometry.py
+7
-6
7 additions, 6 deletions
meshmode/interop/firedrake/mesh_geometry.py
meshmode/interop/firedrake/mesh_topology.py
+9
-10
9 additions, 10 deletions
meshmode/interop/firedrake/mesh_topology.py
with
16 additions
and
16 deletions
meshmode/interop/firedrake/mesh_geometry.py
+
7
−
6
View file @
5ed91ce0
...
...
@@ -133,13 +133,14 @@ class FiredrakeMeshGeometryImporter(ExternalImportHandler):
coordinates_fs_importer
=
\
self
.
_coordinates_importer
.
function_space_importer
()
V_importer
=
FiredrakeWithGeometryImporter
(
cl_ctx
,
coordinates_fs
,
coordinates_fs_importer
,
self
)
f
=
Function
(
V_importer
.
data
,
val
=
self
.
_coordinates_a
.
data
)
fspace_importer
=
\
FiredrakeWithGeometryImporter
(
cl_ctx
,
coordinates_fs
,
coordinates_fs_importer
,
self
)
f
=
Function
(
fspace_importer
.
data
,
val
=
self
.
_coordinates_a
.
data
)
self
.
_coordinates_function_importer
=
\
FiredrakeFunctionImporter
(
f
,
V
_importer
)
FiredrakeFunctionImporter
(
f
,
fspace
_importer
)
del
self
.
_callback
...
...
This diff is collapsed.
Click to expand it.
meshmode/interop/firedrake/mesh_topology.py
+
9
−
10
View file @
5ed91ce0
...
...
@@ -157,39 +157,38 @@ class FiredrakeMeshTopologyImporter(ExternalImportHandler):
# TODO... not sure how to get around the private access
plex
=
self
.
data
.
_plex
# variable names follow a dmplex naming convention for
# cell Start/end and vertex Start/end.
cStart
,
cEnd
=
plex
.
getHeightStratum
(
0
)
vStart
,
vEnd
=
plex
.
getDepthStratum
(
0
)
# dmplex cell Start/end and vertex Start/end.
c_start
,
c_end
=
plex
.
getHeightStratum
(
0
)
v_start
,
v_end
=
plex
.
getDepthStratum
(
0
)
# TODO... not sure how to get around the private access
to_fd_id
=
np
.
vectorize
(
self
.
data
.
_cell_numbering
.
getOffset
)(
np
.
arange
(
c
S
tart
,
c
E
nd
,
dtype
=
np
.
int32
))
np
.
arange
(
c
_s
tart
,
c
_e
nd
,
dtype
=
np
.
int32
))
element_to_neighbors
=
{}
verts_checked
=
set
()
# dmplex ids of vertex checked
# If using all cells, loop over them all
if
self
.
icell_to_fd
is
None
:
range_
=
range
(
c
S
tart
,
c
E
nd
)
range_
=
range
(
c
_s
tart
,
c
_e
nd
)
# Otherwise, just the ones you're using
else
:
isin
=
np
.
isin
(
to_fd_id
,
self
.
icell_to_fd
)
range_
=
np
.
arange
(
c
S
tart
,
c
E
nd
,
dtype
=
np
.
int32
)[
isin
]
range_
=
np
.
arange
(
c
_s
tart
,
c
_e
nd
,
dtype
=
np
.
int32
)[
isin
]
# For each cell
for
cell_id
in
range_
:
# For each vertex touching the cell (that haven't already seen)
for
vert_id
in
plex
.
getTransitiveClosure
(
cell_id
)[
0
]:
if
v
S
tart
<=
vert_id
<
v
E
nd
and
vert_id
not
in
verts_checked
:
if
v
_s
tart
<=
vert_id
<
v
_e
nd
and
vert_id
not
in
verts_checked
:
verts_checked
.
add
(
vert_id
)
cells
=
[]
# Record all cells touching that vertex
support
=
plex
.
getTransitiveClosure
(
vert_id
,
useCone
=
False
)[
0
]
for
other_cell_id
in
support
:
if
c
S
tart
<=
other_cell_id
<
c
E
nd
:
cells
.
append
(
to_fd_id
[
other_cell_id
-
c
S
tart
])
if
c
_s
tart
<=
other_cell_id
<
c
_e
nd
:
cells
.
append
(
to_fd_id
[
other_cell_id
-
c
_s
tart
])
# If only using some cells, clean out extraneous ones
# and relabel them to new id
...
...
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