diff --git a/pytential/symbolic/execution.py b/pytential/symbolic/execution.py index 3e96b00c8ff6d951f346b13e4b01db48cb6a3c3a..213eb42827840ea4c4af770778953ee58bacfb99 100644 --- a/pytential/symbolic/execution.py +++ b/pytential/symbolic/execution.py @@ -406,8 +406,10 @@ def build_matrix(queue, places, expr, input_exprs, domains=None, :arg places: a mapping of symbolic names to :class:`pytential.discretization.Discretization` objects or a subclass of :class:`pytential.discretization.target.TargetBase`. - :arg input_exprs: A sequence of expressions corresponding to the + :arg input_exprs: An object array of expressions corresponding to the input block columns of the matrix. + + May also be a single expression. :arg domains: a list of discretization identifiers (see 'places') or *None* values indicating the domains on which each component of the solution vector lives. *None* values indicate that the component @@ -432,6 +434,12 @@ def build_matrix(queue, places, expr, input_exprs, domains=None, domains = _domains_default(len(input_exprs), places, domains, DEFAULT_SOURCE) + try: + iter(input_exprs) + except TypeError: + # not iterable, wrap in a list + input_exprs = [input_exprs] + input_exprs = list(input_exprs) nblock_rows = len(expr)