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
4bd6d3b0
Commit
4bd6d3b0
authored
3 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Freeze geometric quantities before memoizing/thaw upon return
parent
c3c707ff
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
grudge/geometry/metrics.py
+7
-7
7 additions, 7 deletions
grudge/geometry/metrics.py
with
7 additions
and
7 deletions
grudge/geometry/metrics.py
+
7
−
7
View file @
4bd6d3b0
...
...
@@ -59,7 +59,7 @@ THE SOFTWARE.
import
numpy
as
np
from
grudge
import
DiscretizationCollection
from
arraycontext
import
thaw
,
ArrayContext
from
arraycontext
import
thaw
,
freeze
,
ArrayContext
from
meshmode.dof_array
import
DOFArray
from
grudge.dof_desc
import
(
...
...
@@ -403,8 +403,8 @@ def inverse_surface_metric_derivative(
actx
,
dcoll
,
xyz_axis
,
d
,
dd
=
dd
)
for
d
in
range
(
dim
)
)
return
imd
return
_inv_surf_metric_deriv
()
return
freeze
(
imd
,
actx
)
return
thaw
(
_inv_surf_metric_deriv
()
,
actx
)
def
_signed_face_ones
(
...
...
@@ -498,10 +498,10 @@ def area_element(
"
area_elements_adim%s_gdim%s
"
%
(
dcoll
.
ambient_dim
,
dim
)))
def
_area_elements
():
return
actx
.
np
.
sqrt
(
pseudoscalar
(
actx
,
dcoll
,
dd
=
dd
).
norm_squared
()
)
return
_area_elements
()
return
freeze
(
actx
.
np
.
sqrt
(
pseudoscalar
(
actx
,
dcoll
,
dd
=
dd
).
norm_squared
()
),
actx
)
return
thaw
(
_area_elements
()
,
actx
)
# }}}
...
...
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