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
314b7157
Commit
314b7157
authored
2 years ago
by
Andreas Klöckner
Committed by
Andreas Klöckner
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Change DeviceScalar -> Scalar
x-ref:
https://github.com/inducer/arraycontext/pull/153
parent
3abe4991
No related branches found
No related tags found
No related merge requests found
Pipeline
#281836
passed
2 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
grudge/dt_utils.py
+3
-3
3 additions, 3 deletions
grudge/dt_utils.py
grudge/reductions.py
+9
-9
9 additions, 9 deletions
grudge/reductions.py
with
12 additions
and
12 deletions
grudge/dt_utils.py
+
3
−
3
View file @
314b7157
...
...
@@ -45,7 +45,7 @@ THE SOFTWARE.
import
numpy
as
np
from
arraycontext
import
ArrayContext
,
thaw
,
freeze
,
Device
Scalar
from
arraycontext
import
ArrayContext
,
thaw
,
freeze
,
Scalar
from
meshmode.transform_metadata
import
FirstAxisIsElementsTag
from
grudge.dof_desc
import
DD_VOLUME
,
DOFDesc
,
as_dofdesc
...
...
@@ -158,7 +158,7 @@ def dt_non_geometric_factors(
@memoize_on_first_arg
def
h_max_from_volume
(
dcoll
:
DiscretizationCollection
,
dim
=
None
,
dd
=
None
)
->
"
Device
Scalar
"
:
dcoll
:
DiscretizationCollection
,
dim
=
None
,
dd
=
None
)
->
Scalar
:
"""
Returns a (maximum) characteristic length based on the volume of the
elements. This length may not be representative if the elements have very
high aspect ratios.
...
...
@@ -189,7 +189,7 @@ def h_max_from_volume(
@memoize_on_first_arg
def
h_min_from_volume
(
dcoll
:
DiscretizationCollection
,
dim
=
None
,
dd
=
None
)
->
"
Device
Scalar
"
:
dcoll
:
DiscretizationCollection
,
dim
=
None
,
dd
=
None
)
->
Scalar
:
"""
Returns a (minimum) characteristic length based on the volume of the
elements. This length may not be representative if the elements have very
high aspect ratios.
...
...
This diff is collapsed.
Click to expand it.
grudge/reductions.py
+
9
−
9
View file @
314b7157
...
...
@@ -63,7 +63,7 @@ from arraycontext import (
make_loopy_program
,
map_array_container
,
serialize_container
,
Device
Scalar
Scalar
)
from
arraycontext.container
import
ArrayOrContainerT
...
...
@@ -79,7 +79,7 @@ import grudge.dof_desc as dof_desc
# {{{ Nodal reductions
def
norm
(
dcoll
:
DiscretizationCollection
,
vec
,
p
,
dd
=
None
)
->
"
Device
Scalar
"
:
def
norm
(
dcoll
:
DiscretizationCollection
,
vec
,
p
,
dd
=
None
)
->
Scalar
:
r
"""
Return the vector p-norm of a function represented
by its vector of degrees of freedom *vec*.
...
...
@@ -113,7 +113,7 @@ def norm(dcoll: DiscretizationCollection, vec, p, dd=None) -> "DeviceScalar":
raise
ValueError
(
"
unsupported norm order
"
)
def
nodal_sum
(
dcoll
:
DiscretizationCollection
,
dd
,
vec
)
->
"
Device
Scalar
"
:
def
nodal_sum
(
dcoll
:
DiscretizationCollection
,
dd
,
vec
)
->
Scalar
:
r
"""
Return the nodal sum of a vector of degrees of freedom *vec*.
:arg dd: a :class:`~grudge.dof_desc.DOFDesc`, or a value
...
...
@@ -136,7 +136,7 @@ def nodal_sum(dcoll: DiscretizationCollection, dd, vec) -> "DeviceScalar":
comm
.
allreduce
(
actx
.
to_numpy
(
nodal_sum_loc
(
dcoll
,
dd
,
vec
)),
op
=
MPI
.
SUM
))
def
nodal_sum_loc
(
dcoll
:
DiscretizationCollection
,
dd
,
vec
)
->
"
Device
Scalar
"
:
def
nodal_sum_loc
(
dcoll
:
DiscretizationCollection
,
dd
,
vec
)
->
Scalar
:
r
"""
Return the rank-local nodal sum of a vector of degrees of freedom *vec*.
:arg dd: a :class:`~grudge.dof_desc.DOFDesc`, or a value
...
...
@@ -156,7 +156,7 @@ def nodal_sum_loc(dcoll: DiscretizationCollection, dd, vec) -> "DeviceScalar":
return
sum
([
actx
.
np
.
sum
(
grp_ary
)
for
grp_ary
in
vec
])
def
nodal_min
(
dcoll
:
DiscretizationCollection
,
dd
,
vec
)
->
"
Device
Scalar
"
:
def
nodal_min
(
dcoll
:
DiscretizationCollection
,
dd
,
vec
)
->
Scalar
:
r
"""
Return the nodal minimum of a vector of degrees of freedom *vec*.
:arg dd: a :class:`~grudge.dof_desc.DOFDesc`, or a value
...
...
@@ -177,7 +177,7 @@ def nodal_min(dcoll: DiscretizationCollection, dd, vec) -> "DeviceScalar":
comm
.
allreduce
(
actx
.
to_numpy
(
nodal_min_loc
(
dcoll
,
dd
,
vec
)),
op
=
MPI
.
MIN
))
def
nodal_min_loc
(
dcoll
:
DiscretizationCollection
,
dd
,
vec
)
->
"
Device
Scalar
"
:
def
nodal_min_loc
(
dcoll
:
DiscretizationCollection
,
dd
,
vec
)
->
Scalar
:
r
"""
Return the rank-local nodal minimum of a vector of degrees
of freedom *vec*.
...
...
@@ -200,7 +200,7 @@ def nodal_min_loc(dcoll: DiscretizationCollection, dd, vec) -> "DeviceScalar":
vec
,
actx
.
from_numpy
(
np
.
array
(
np
.
inf
)))
def
nodal_max
(
dcoll
:
DiscretizationCollection
,
dd
,
vec
)
->
"
Device
Scalar
"
:
def
nodal_max
(
dcoll
:
DiscretizationCollection
,
dd
,
vec
)
->
Scalar
:
r
"""
Return the nodal maximum of a vector of degrees of freedom *vec*.
:arg dd: a :class:`~grudge.dof_desc.DOFDesc`, or a value
...
...
@@ -221,7 +221,7 @@ def nodal_max(dcoll: DiscretizationCollection, dd, vec) -> "DeviceScalar":
comm
.
allreduce
(
actx
.
to_numpy
(
nodal_max_loc
(
dcoll
,
dd
,
vec
)),
op
=
MPI
.
MAX
))
def
nodal_max_loc
(
dcoll
:
DiscretizationCollection
,
dd
,
vec
)
->
"
Device
Scalar
"
:
def
nodal_max_loc
(
dcoll
:
DiscretizationCollection
,
dd
,
vec
)
->
Scalar
:
r
"""
Return the rank-local nodal maximum of a vector of degrees
of freedom *vec*.
...
...
@@ -244,7 +244,7 @@ def nodal_max_loc(dcoll: DiscretizationCollection, dd, vec) -> "DeviceScalar":
vec
,
actx
.
from_numpy
(
np
.
array
(
-
np
.
inf
)))
def
integral
(
dcoll
:
DiscretizationCollection
,
dd
,
vec
)
->
"
Device
Scalar
"
:
def
integral
(
dcoll
:
DiscretizationCollection
,
dd
,
vec
)
->
Scalar
:
"""
Numerically integrates a function represented by a
:class:`~meshmode.dof_array.DOFArray` of degrees of freedom.
...
...
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