diff --git a/python/dune/perftool/options.py b/python/dune/perftool/options.py index a30ec5f71c74dc1c60d2f4da731adf91a49cd527..9661737148258057dbcaef3d775ef6d584ebc881 100644 --- a/python/dune/perftool/options.py +++ b/python/dune/perftool/options.py @@ -235,14 +235,19 @@ def get_form_option(key, form=None): def option_switch(opt): def _switch(): + if isinstance(opt, tuple): + opts = opt + else: + assert isinstance(opt, str) + opts = (opt,) try: - if get_option(opt): - return opt - else: - return "default" + for o in opts: + if get_option(o): + return o + return "default" except AttributeError: - if get_form_option(opt): - return opt - else: - return "default" + for o in opts: + if get_form_option(o): + return o + return "default" return _switch diff --git a/python/dune/perftool/pdelab/geometry.py b/python/dune/perftool/pdelab/geometry.py index d308917adbd3391d4b61832938b3a1c4f3355eb5..80ab0387e9728b2c05c2a214b9e7b2fb35c75ea4 100644 --- a/python/dune/perftool/pdelab/geometry.py +++ b/python/dune/perftool/pdelab/geometry.py @@ -338,7 +338,7 @@ def define_jacobian_inverse_transposed(name, restriction): dim = world_dimension() temporary_variable(name, decl_method=define_jacobian_inverse_transposed_temporary(restriction), shape=(dim, dim)) geo = name_cell_geometry(restriction) - pos = get_backend("qp_in_cell", selector=option_switch("blockstructured"))(restriction) + pos = get_backend("qp_in_cell", selector=option_switch(("blockstructured", "sumfact")))(restriction) return quadrature_preamble("{} = {}.jacobianInverseTransposed({});".format(name, geo, str(pos),