def face_jacobian(self, where): bdry_discr = self.get_discr(where) ((a, ), (b, )) = parametrization_derivative(self._setup_actx, bdry_discr) return freeze((a**2 + b**2)**0.5)
def normal(self, where): bdry_discr = self.get_discr(where) ((a, ), (b, )) = parametrization_derivative(self._setup_actx, bdry_discr) nrm = 1 / (a**2 + b**2)**0.5 return freeze(flat_obj_array(b * nrm, -a * nrm))
def normal(self, dd): surface_discr = self.discr_from_dd(dd) actx = surface_discr._setup_actx return freeze( bind(self, sym.normal(dd, surface_discr.ambient_dim, surface_discr.dim), local_only=True) (array_context=actx))
def inverse_parametrization_derivative(self): [a, b], [c, d] = thaw(self._setup_actx, self.parametrization_derivative()) result = np.zeros((2, 2), dtype=object) det = a * d - b * c result[0, 0] = d / det result[0, 1] = -b / det result[1, 0] = -c / det result[1, 1] = a / det return freeze(result)
def normal(dcoll, dd): """Get unit normal to specified surface discretization, *dd*. :arg dd: a :class:`~grudge.dof_desc.DOFDesc` as the surface discretization. :returns: an object array of :class:`~meshmode.dof_array.DOFArray`. """ surface_discr = dcoll.discr_from_dd(dd) actx = surface_discr._setup_actx return freeze( bind(dcoll, sym.normal(dd, surface_discr.ambient_dim, surface_discr.dim), local_only=True)(array_context=actx))
def vol_jacobian(self): [a, b], [c, d] = thaw(self._setup_actx, self.parametrization_derivative()) return freeze(a * d - b * c)
def parametrization_derivative(self): return freeze( parametrization_derivative(self._setup_actx, self.volume_discr))