import numpy as np from arraycontext import thaw, flatten from pytential import GeometryCollection, bind, sym from sumpy.kernel import LaplaceKernel, HelmholtzKernel from meshmode import _acf # noqa: F401 from arraycontext import pytest_generate_tests_for_array_contexts from meshmode.array_context import PytestPyOpenCLArrayContextFactory import logging logger = logging.getLogger(__name__) pytest_generate_tests = pytest_generate_tests_for_array_contexts([ PytestPyOpenCLArrayContextFactory, ]) def test_spherical_bessel_functions(): import pytential.qbx.target_specific as ts nterms = 9 z = 3j scale = 1 j = np.zeros(1 + nterms, dtype=np.complex128) jder = np.zeros(1 + nterms, dtype=np.complex128) ts.jfuns3d_wrapper(nterms, z, scale, j, jder) # Reference solution computed using scipy.special.spherical_jn
import numpy as np from meshmode.dof_array import flatten, thaw import meshmode.mesh.generation as mgen from pytools.obj_array import flat_obj_array, make_obj_array from grudge import sym, bind, DiscretizationCollection import grudge.dof_desc as dof_desc import pytest from grudge.array_context import PytestPyOpenCLArrayContextFactoryWithHostScalars from arraycontext import pytest_generate_tests_for_array_contexts pytest_generate_tests = pytest_generate_tests_for_array_contexts( [PytestPyOpenCLArrayContextFactoryWithHostScalars]) import logging logger = logging.getLogger(__name__) # {{{ inverse metric @pytest.mark.parametrize("dim", [2, 3]) def test_inverse_metric(actx_factory, dim): actx = actx_factory() mesh = mgen.generate_regular_rect_mesh(a=(-0.5, ) * dim, b=(0.5, ) * dim, nelements_per_axis=(6, ) * dim,