diff --git a/sumpy/expansion/__init__.py b/sumpy/expansion/__init__.py index 888ba26de762f328a8ba41376764fb10ce65eb43..a2d5c6f29853efe6ee5cfc3625a4fb22d41d22b8 100644 --- a/sumpy/expansion/__init__.py +++ b/sumpy/expansion/__init__.py @@ -30,7 +30,7 @@ from pytools import memoize_method import sumpy.symbolic as sym from collections import defaultdict from sumpy.tools import add_mi -from .pde_utils import (make_pde_syms, process_pde, laplacian, div, curl, grad, +from .pde_utils import (make_pde_syms, process_pde, laplacian, div, grad, PDE) __doc__ = """ @@ -580,7 +580,6 @@ class LinearPDEBasedExpansionTermsWrangler(ExpansionTermsWrangler): return rows - class LaplaceExpansionTermsWrangler(LinearPDEBasedExpansionTermsWrangler): init_arg_names = ("order", "dim", "max_mi") diff --git a/sumpy/expansion/pde_utils.py b/sumpy/expansion/pde_utils.py index 1b26e0380a3f594d85421b0c44fd48cd7bd0294d..bd856a622fd281006e2a5eeda5c2c42ddb1a883f 100644 --- a/sumpy/expansion/pde_utils.py +++ b/sumpy/expansion/pde_utils.py @@ -26,6 +26,7 @@ from collections import defaultdict from sumpy.tools import CoeffIdentifier, add_mi, nth_root_assume_positive import sumpy.symbolic as sym + class PDE(object): r""" Represents a system of PDEs of dimension `dim`. It is represented by a @@ -93,10 +94,10 @@ class PDE(object): def laplacian(pde): - p = PDE(pde.dim) + eqs = [] for j in range(len(pde.eqs)): - p.eqs.append(div(grad(pde[j])).eqs[0]) - return p + eqs.append(div(grad(pde[j])).eqs[0]) + return PDE(pde.dim, *eqs) def diff(pde, mi): @@ -197,4 +198,3 @@ def make_pde_syms(dim, nexprs): eq[CoeffIdentifier(tuple(mi), iexpr)] = 1 eqs.append(eq) return PDE(dim, *eqs) -