diff --git a/examples/wave/wave-op-mpi.py b/examples/wave/wave-op-mpi.py index 19193ca068dee7cdff6d2728cb47ae3c73ccba2c..f02770e17e40ad99c54ea119a8ccab70c0fa5317 100644 --- a/examples/wave/wave-op-mpi.py +++ b/examples/wave/wave-op-mpi.py @@ -74,8 +74,8 @@ def wave_operator(discr, c, w): return ( op.inverse_mass(discr, flat_obj_array( - -c*op.weak_div(discr, v), - -c*op.weak_grad(discr, u) + -c*op.weak_local_div(discr, v), + -c*op.weak_local_grad(discr, u) ) + # noqa: W504 op.face_mass(discr, diff --git a/examples/wave/wave-op-var-velocity.py b/examples/wave/wave-op-var-velocity.py index 496b180289b048a4e749b1394ad1bc63223925d4..f1af804593232b459cca903622a0bd627d9d3a25 100644 --- a/examples/wave/wave-op-var-velocity.py +++ b/examples/wave/wave-op-var-velocity.py @@ -88,8 +88,8 @@ def wave_operator(discr, c, w): return ( op.inverse_mass(discr, flat_obj_array( - -op.weak_div(discr, dd_quad, c_quad*v_quad), - -op.weak_grad(discr, dd_quad, c_quad*u_quad) + -op.weak_local_div(discr, dd_quad, c_quad*v_quad), + -op.weak_local_grad(discr, dd_quad, c_quad*u_quad) ) + # noqa: W504 op.face_mass(discr, diff --git a/examples/wave/wave-op.py b/examples/wave/wave-op.py index cac70d6b5e24f2ce18071f7d1174fa2b8ca0d6ea..4af7c81c4bab96d28a33197ff573cc57514e7858 100644 --- a/examples/wave/wave-op.py +++ b/examples/wave/wave-op.py @@ -72,8 +72,8 @@ def wave_operator(discr, c, w): return ( op.inverse_mass(discr, flat_obj_array( - -c*op.weak_div(discr, v), - -c*op.weak_grad(discr, u) + -c*op.weak_local_div(discr, v), + -c*op.weak_local_grad(discr, u) ) + # noqa: W504 op.face_mass(discr, diff --git a/grudge/eager.py b/grudge/eager.py index 516b56290bdb5ee67e705a35524eb1668cbd81f0..5bf72f0862f6d5008a7093f2a0c61dd250ee9fb6 100644 --- a/grudge/eager.py +++ b/grudge/eager.py @@ -50,22 +50,22 @@ class EagerDGDiscretization(DGDiscretizationWithBoundaries): return op.normal(self, dd) def grad(self, vec): - return op.grad(self, vec) + return op.local_grad(self, vec) def d_dx(self, xyz_axis, vec): - return op.d_dx(self, xyz_axis, vec) + return op.local_d_dx(self, xyz_axis, vec) def div(self, vecs): - return op.d_dx(self, vecs) + return op.local_d_dx(self, vecs) def weak_grad(self, *args): - return op.weak_grad(self, *args) + return op.weak_local_grad(self, *args) def weak_d_dx(self, *args): - return op.weak_d_dx(self, *args) + return op.weak_local_d_dx(self, *args) def weak_div(self, *args): - return op.weak_div(self, *args) + return op.weak_local_div(self, *args) def mass(self, *args): return op.mass(self, *args) diff --git a/grudge/op.py b/grudge/op.py index c763f2bc8b65cc235168b4970095ed1d8c000151..a04f9571af3563dc64c38d45c1bba88f66d8509d 100644 --- a/grudge/op.py +++ b/grudge/op.py @@ -2,13 +2,13 @@ .. autofunction:: project .. autofunction:: nodes -.. autofunction:: grad -.. autofunction:: d_dx -.. autofunction:: div +.. autofunction:: local_grad +.. autofunction:: local_d_dx +.. autofunction:: local_div -.. autofunction:: weak_grad -.. autofunction:: weak_d_dx -.. autofunction:: weak_div +.. autofunction:: weak_local_grad +.. autofunction:: weak_local_d_dx +.. autofunction:: weak_local_div .. autofunction:: normal .. autofunction:: mass @@ -133,8 +133,9 @@ def _bound_grad(discrwb): return bind(discrwb, sym.nabla(discrwb.dim) * sym.Variable("u"), local_only=True) -def grad(discrwb, vec): - r"""Return the gradient of the volume function represented by *vec*. +def local_grad(discrwb, vec): + r"""Return the element-local gradient of the volume function represented by + *vec*. :arg vec: a :class:`~meshmode.dof_array.DOFArray` :returns: an object array of :class:`~meshmode.dof_array.DOFArray`\ s @@ -148,9 +149,9 @@ def _bound_d_dx(discrwb, xyz_axis): local_only=True) -def d_dx(discrwb, xyz_axis, vec): - r"""Return the derivative along axis *xyz_axis* of the volume function - represented by *vec*. +def local_d_dx(discrwb, xyz_axis, vec): + r"""Return the element-local derivative along axis *xyz_axis* of the volume + function represented by *vec*. :arg xyz_axis: an integer indicating the axis along which the derivative is taken @@ -179,8 +180,8 @@ def _div_helper(discrwb, diff_func, vecs): return result -def div(discrwb, vecs): - r"""Return the divergence of the vector volume function +def local_div(discrwb, vecs): + r"""Return the element-local divergence of the vector volume function represented by *vecs*. :arg vec: an object array of @@ -191,7 +192,7 @@ def div(discrwb, vecs): """ return _div_helper(discrwb, - lambda i, subvec: d_dx(discrwb, i, subvec), + lambda i, subvec: local_d_dx(discrwb, i, subvec), vecs) @@ -202,9 +203,9 @@ def _bound_weak_grad(discrwb, dd): local_only=True) -def weak_grad(discrwb, *args): - r"""Return the "weak gradient" of the volume function represented by - *vec*. +def weak_local_grad(discrwb, *args): + r"""Return the element-local weak gradient of the volume function + represented by *vec*. May be called with ``(vecs)`` or ``(dd, vecs)``. @@ -232,9 +233,9 @@ def _bound_weak_d_dx(discrwb, dd, xyz_axis): local_only=True) -def weak_d_dx(discrwb, *args): - r"""Return the derivative along axis *xyz_axis* of the volume function - represented by *vec*. +def weak_local_d_dx(discrwb, *args): + r"""Return the element-local weak derivative along axis *xyz_axis* of the + volume function represented by *vec*. May be called with ``(xyz_axis, vecs)`` or ``(dd, xyz_axis, vecs)``. @@ -254,8 +255,8 @@ def weak_d_dx(discrwb, *args): return _bound_weak_d_dx(discrwb, dd, xyz_axis)(u=vec) -def weak_div(discrwb, *args): - r"""Return the "weak divergence" of the vector volume function +def weak_local_div(discrwb, *args): + r"""Return the element-local weak divergence of the vector volume function represented by *vecs*. May be called with ``(vecs)`` or ``(dd, vecs)``. @@ -277,7 +278,7 @@ def weak_div(discrwb, *args): raise TypeError("invalid number of arguments") return _div_helper(discrwb, - lambda i, subvec: weak_d_dx(discrwb, dd, i, subvec), + lambda i, subvec: weak_local_d_dx(discrwb, dd, i, subvec), vecs) # }}}