Skip to content
Snippets Groups Projects
Commit 49ed00a7 authored by Marcel Koch's avatar Marcel Koch
Browse files

Makes usage of get_backend consistent

parent 9aa6c8ef
No related branches found
No related tags found
No related merge requests found
......@@ -333,10 +333,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)
if get_option('blockstructured'):
pos = get_backend("qp_in_cell", selector=lambda : "blockstructured")(restriction)
else:
pos = get_backend("qp_in_cell")(restriction)
pos = get_backend("qp_in_cell", selector=option_switch("blockstructured"))(restriction)
return quadrature_preamble("{} = {}.jacobianInverseTransposed({});".format(name,
geo,
str(pos),
......@@ -377,10 +374,7 @@ def define_constant_jacobian_determinant(name):
def define_jacobian_determinant(name):
temporary_variable(name, shape=())
geo = name_geometry()
if get_option('blockstructured'):
pos = get_backend("quad_pos", selector=lambda: 'blockstructured')()
else:
pos = get_backend("quad_pos")()
pos = get_backend("quad_pos", selector=option_switch("blockstructured"))()
code = "{} = {}.integrationElement({});".format(name,
geo,
str(pos),
......
......@@ -3,7 +3,8 @@ from os.path import splitext
import logging
from dune.perftool.options import get_option
from dune.perftool.options import (get_option,
option_switch)
from dune.perftool.generation import (backend,
base_class,
class_basename,
......@@ -242,10 +243,7 @@ def determine_accumulation_space(expr, number, measure, idims=None):
lfs = lfs_child(lfs, idims, shape=subel.value_shape(), symmetry=subel.symmetry())
subel = subel.sub_elements()[0]
if get_option("blockstructured"):
iname, = get_backend("lfs_inames", selector=lambda: "blockstructured")(subel, ma.restriction, count=number)
else:
iname, = get_backend("lfs_inames")(subel, ma.restriction, count=number)
iname, = get_backend("lfs_inames", selector=option_switch("blockstructured"))(subel, ma.restriction, count=number)
lfsi = Variable(iname)
# If the LFS is not yet a pymbolic expression, make it one
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment