Skip to content
Snippets Groups Projects
Commit 314b7157 authored by Andreas Klöckner's avatar Andreas Klöckner Committed by Andreas Klöckner
Browse files

Change DeviceScalar -> Scalar

parent 3abe4991
No related branches found
No related tags found
No related merge requests found
Pipeline #281836 passed
......@@ -45,7 +45,7 @@ THE SOFTWARE.
import numpy as np
from arraycontext import ArrayContext, thaw, freeze, DeviceScalar
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) -> "DeviceScalar":
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) -> "DeviceScalar":
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.
......
......@@ -63,7 +63,7 @@ from arraycontext import (
make_loopy_program,
map_array_container,
serialize_container,
DeviceScalar
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) -> "DeviceScalar":
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) -> "DeviceScalar":
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) -> "DeviceScalar":
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) -> "DeviceScalar":
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) -> "DeviceScalar":
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) -> "DeviceScalar":
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) -> "DeviceScalar":
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) -> "DeviceScalar":
def integral(dcoll: DiscretizationCollection, dd, vec) -> Scalar:
"""Numerically integrates a function represented by a
:class:`~meshmode.dof_array.DOFArray` of degrees of freedom.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment