diff --git a/python/dune/perftool/blockstructured/__init__.py b/python/dune/perftool/blockstructured/__init__.py index b82070c922324ddd59ee029b8926cbca4046dbd7..7c8ce39a8db130e47ae9c33f11376be48f7ea5f7 100644 --- a/python/dune/perftool/blockstructured/__init__.py +++ b/python/dune/perftool/blockstructured/__init__.py @@ -1,6 +1,39 @@ -import dune.perftool.blockstructured.accumulation import dune.perftool.blockstructured.quadrature import dune.perftool.blockstructured.argument import dune.perftool.blockstructured.geometry import dune.perftool.blockstructured.spaces import dune.perftool.blockstructured.basis + +from dune.perftool.blockstructured.spaces import lfs_inames +from dune.perftool.blockstructured.quadrature import pymbolic_quadrature_position +from dune.perftool.blockstructured.geometry import (pymbolic_jacobian_inverse_transposed, + pymbolic_jacobian_determinant, + to_global) + +from dune.perftool.pdelab import PDELabInterface +from dune.perftool.pdelab.quadrature import pymbolic_quadrature_position + + +class BlockStructuredInterface(PDELabInterface): + def __init__(self): + PDELabInterface.__init__(self) + + # + # Local function space related generator functions + # + + def lfs_inames(self, element, restriction, number=None, context=''): + return lfs_inames(element, restriction, number, context) + + # + # Geometry related generator functions + # + + def pymbolic_spatial_coordinate(self): + return to_global(pymbolic_quadrature_position()) + + def pymbolic_jacobian_determinant(self): + return pymbolic_jacobian_determinant() + + def pymbolic_jacobian_inverse_transposed(self, i, j, restriction): + return pymbolic_jacobian_inverse_transposed(i,j,restriction) diff --git a/python/dune/perftool/pdelab/__init__.py b/python/dune/perftool/pdelab/__init__.py index b232b899e3bea17fdbe6d4a69b1d9a5bf6bced2f..65e592907fe9c98f821e0d8e179d280740532ec6 100644 --- a/python/dune/perftool/pdelab/__init__.py +++ b/python/dune/perftool/pdelab/__init__.py @@ -58,7 +58,7 @@ class PDELabInterface(object): # def lfs_inames(self, element, restriction, number=None, context=''): - return get_backend("lfs_inames", selector=option_switch("blockstructured"))(element, restriction, number, context) + return lfs_inames(element, restriction, number, context) # # Test and trial function related generator functions @@ -113,10 +113,10 @@ class PDELabInterface(object): return name_facet_jacobian_determinant() def pymbolic_jacobian_determinant(self): - return get_backend("pymbolic_jacobian_determinant", selector=option_switch("blockstructured"))() + return pymbolic_jacobian_determinant() def pymbolic_jacobian_inverse_transposed(self, i, j, restriction): - return get_backend("pymbolic_jacobian_inverse_transposed",selector=option_switch("blockstructured"))(i,j,restriction) + return pymbolic_jacobian_inverse_transposed(i,j,restriction) def name_unit_inner_normal(self): return name_unit_inner_normal() diff --git a/python/dune/perftool/pdelab/driver.py b/python/dune/perftool/pdelab/driver.py index 5c8ceed0f2b35a81176c511ffa721056d9a1718a..7c8a92557a137c76e83a4739a4a369f9b99e30b7 100644 --- a/python/dune/perftool/pdelab/driver.py +++ b/python/dune/perftool/pdelab/driver.py @@ -179,8 +179,8 @@ def typedef_grid(name): if any(_driver_data['form'].ufl_cell().cellname() in x for x in ["vertex", "interval", "quadrilateral", "hexahedron"]): # For Yasp Grids the jacobi of the transformation is diagonal and constant on each cell from dune.perftool.options import set_option - # set_option('diagonal_transformation_matrix', True) - # set_option('constant_transformation_matrix', True) + set_option('diagonal_transformation_matrix', True) + set_option('constant_transformation_matrix', True) range_type = type_range() gridt = "Dune::YaspGrid<{}, Dune::EquidistantCoordinates<{},dim>>".format(dim, range_type) diff --git a/python/dune/perftool/pdelab/localoperator.py b/python/dune/perftool/pdelab/localoperator.py index dfc8e5d2f0d19560a6830609385ec823f2d4bef3..5481d08a43a4df210c9c9b7de300141a58066f0e 100644 --- a/python/dune/perftool/pdelab/localoperator.py +++ b/python/dune/perftool/pdelab/localoperator.py @@ -409,6 +409,9 @@ def visit_integrals(integrals): if get_option('sumfact'): from dune.perftool.sumfact import SumFactInterface interface = SumFactInterface() + elif get_option('blockstructured'): + from dune.perftool.blockstructured import BlockStructuredInterface + interface = BlockStructuredInterface() else: from dune.perftool.pdelab import PDELabInterface interface = PDELabInterface()