Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
grudge
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Andreas Klöckner
grudge
Commits
69b1707b
Commit
69b1707b
authored
4 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Delete some more unnecessary code in eager interface
parent
3f40665f
No related branches found
No related tags found
1 merge request
!63
Add eagerly evaluated interface to grudge, plus example
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
grudge/eager.py
+1
-29
1 addition, 29 deletions
grudge/eager.py
with
1 addition
and
29 deletions
grudge/eager.py
+
1
−
29
View file @
69b1707b
...
@@ -23,7 +23,7 @@ THE SOFTWARE.
...
@@ -23,7 +23,7 @@ THE SOFTWARE.
"""
"""
import
numpy
as
np
import
numpy
as
np
# noqa
from
grudge.discretization
import
DGDiscretizationWithBoundaries
from
grudge.discretization
import
DGDiscretizationWithBoundaries
from
pytools
import
memoize_method
from
pytools
import
memoize_method
from
pytools.obj_array
import
(
from
pytools.obj_array
import
(
...
@@ -55,34 +55,6 @@ class EagerDGDiscretization(DGDiscretizationWithBoundaries):
...
@@ -55,34 +55,6 @@ class EagerDGDiscretization(DGDiscretizationWithBoundaries):
def
nodes
(
self
):
def
nodes
(
self
):
return
self
.
_volume_discr
.
nodes
()
return
self
.
_volume_discr
.
nodes
()
@memoize_method
def
parametrization_derivative
(
self
):
with
cl
.
CommandQueue
(
self
.
cl_context
)
as
queue
:
fmat
=
sym
.
forward_metric_derivative_mat
(
self
.
ambient_dim
,
self
.
dim
)
result
=
bind
(
self
,
fmat
.
reshape
(
-
1
))(
queue
)
return
result
.
reshape
(
*
fmat
.
shape
)
@memoize_method
def
vol_jacobian
(
self
):
with
cl
.
CommandQueue
(
self
.
cl_context
)
as
queue
:
[
a
,
b
],
[
c
,
d
]
=
with_queue
(
queue
,
self
.
parametrization_derivative
())
return
(
a
*
d
-
b
*
c
).
with_queue
(
None
)
@memoize_method
def
inverse_parametrization_derivative
(
self
):
with
cl
.
CommandQueue
(
self
.
cl_context
)
as
queue
:
[
a
,
b
],
[
c
,
d
]
=
with_queue
(
queue
,
self
.
parametrization_derivative
())
result
=
np
.
zeros
((
2
,
2
),
dtype
=
object
)
det
=
a
*
d
-
b
*
c
result
[
0
,
0
]
=
d
/
det
result
[
0
,
1
]
=
-
b
/
det
result
[
1
,
0
]
=
-
c
/
det
result
[
1
,
1
]
=
a
/
det
return
without_queue
(
result
)
@memoize_method
@memoize_method
def
_bound_grad
(
self
):
def
_bound_grad
(
self
):
return
bind
(
self
,
sym
.
nabla
(
self
.
dim
)
*
sym
.
Variable
(
"
u
"
))
return
bind
(
self
,
sym
.
nabla
(
self
.
dim
)
*
sym
.
Variable
(
"
u
"
))
...
...
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