Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arraycontext
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
arraycontext
Commits
b0d70e67
Commit
b0d70e67
authored
2 years ago
by
Kaushik Kulkarni
Committed by
Andreas Klöckner
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
CI: modernize the freezes on DOFArrays
parent
8b627d73
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#304103
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_arraycontext.py
+9
-17
9 additions, 17 deletions
test/test_arraycontext.py
with
9 additions
and
17 deletions
test/test_arraycontext.py
+
9
−
17
View file @
b0d70e67
...
...
@@ -32,7 +32,7 @@ from arraycontext import (
ArrayContext
,
dataclass_array_container
,
with_container_arithmetic
,
serialize_container
,
deserialize_container
,
freeze
,
thaw
,
freeze
,
thaw
,
with_array_context
,
FirstAxisIsElementsTag
,
PyOpenCLArrayContext
,
PytatoPyOpenCLArrayContext
,
...
...
@@ -188,22 +188,9 @@ def _deserialize_dof_container(
for
i
,
(
stream_i
,
v
)
in
enumerate
(
iterable
)))
@freeze.register
(
DOFArray
)
def
_freeze_dofarray
(
ary
,
actx
=
None
):
assert
actx
is
None
return
type
(
ary
)(
None
,
tuple
(
ary
.
array_context
.
freeze
(
subary
)
for
subary
in
ary
.
data
))
@thaw.register
(
DOFArray
)
def
_thaw_dofarray
(
ary
,
actx
):
if
ary
.
array_context
is
not
None
:
raise
ValueError
(
"
cannot thaw DOFArray that already has an array context
"
)
return
type
(
ary
)(
actx
,
tuple
(
actx
.
thaw
(
subary
)
for
subary
in
ary
.
data
))
@with_array_context.register
(
DOFArray
)
def
_with_actx_dofarray
(
ary
,
actx
):
return
type
(
ary
)(
actx
,
ary
.
data
)
# }}}
...
...
@@ -1195,6 +1182,11 @@ class Velocity2D:
array_context
:
ArrayContext
@with_array_context.register
(
Velocity2D
)
def
_with_actx_velocity_2d
(
ary
,
actx
):
return
type
(
ary
)(
ary
.
u
,
ary
.
v
,
actx
)
def
scale_and_orthogonalize
(
alpha
,
vel
):
from
arraycontext
import
rec_map_array_container
actx
=
vel
.
array_context
...
...
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