diff --git a/python/dune/perftool/options.py b/python/dune/perftool/options.py index 62da51b6024fcf8d4d28b5fc6bfce700fe27ffc2..ded7826e994cd51a017415825775f7a5d5d8ebcd 100644 --- a/python/dune/perftool/options.py +++ b/python/dune/perftool/options.py @@ -48,7 +48,7 @@ def get_form_compiler_arguments(): parser.add_argument("--sumfact", action="store_true", help="Use sumfactorization") parser.add_argument("--vectorize-quad", action="store_true", help="whether to generate code with explicit vectorization") parser.add_argument("--vectorize-grads", action="store_true", help="whether to generate code with explicit vectorization") - parser.add_argument("--diagonal_jacobian_bug_workaround", action="store_true", help="Do not use diagonal_jacobian transformation and cast result of jacobianInverseTransposed to FieldMatrx. This is a temporary workaround to avoid a nasty splitting bug.") + parser.add_argument("--turn-off-diagonal-jacobian", action="store_true", help="Do not use diagonal_jacobian transformation on the ufl tree and cast result of jacobianInverseTransposed into a FieldMatrix.") # Modify the positional argument to not be a list args = vars(parser.parse_args()) diff --git a/python/dune/perftool/pdelab/geometry.py b/python/dune/perftool/pdelab/geometry.py index 1b9669f48b989b2563530b5972ca19392a1f4075..bb50344c1a553d9587757e58889b9c6fd979ee37 100644 --- a/python/dune/perftool/pdelab/geometry.py +++ b/python/dune/perftool/pdelab/geometry.py @@ -288,8 +288,12 @@ def name_unit_inner_normal(): def type_jacobian_inverse_transposed(restriction): - geo = type_cell_geometry(restriction) - return "typename {}::JacobianInverseTransposed".format(geo) + if get_option('turn_off_diagonal_jacobian'): + dim = world_dimension() + return "typename Dune::FieldMatrix<double,{},{}>".format(dim,dim) + else: + geo = type_cell_geometry(restriction) + return "typename {}::JacobianInverseTransposed".format(geo) @kernel_cached @@ -316,7 +320,7 @@ def define_constant_jacobian_inveser_transposed(name, restriction): globalarg(name, dtype=np.float64, shape=(dim, dim), managed=False) - if get_option('diagonal_jacobian_bug_workaround'): + if get_option('turn_off_diagonal_jacobian'): jit_type = 'Dune::FieldMatrix<double,{},{}>'.format(dim,dim) else: jit_type = 'auto' diff --git a/python/dune/perftool/pdelab/localoperator.py b/python/dune/perftool/pdelab/localoperator.py index a925c2134a2b9a10d17346e7e6493b4e7dae4dff..689ec62a07dbfe1f8041d8474d166e1d92c8ec7b 100644 --- a/python/dune/perftool/pdelab/localoperator.py +++ b/python/dune/perftool/pdelab/localoperator.py @@ -376,7 +376,7 @@ def visit_integrals(integrals): # Maybe make the jacobian inverse diagonal! if get_option('diagonal_transformation_matrix'): - if not get_option('diagonal_jacobian_bug_workaround'): + if not get_option('turn_off_diagonal_jacobian'): from dune.perftool.ufl.transformations.axiparallel import diagonal_jacobian integrand = diagonal_jacobian(integrand) diff --git a/test/stokes/stokes_quadrilateral.mini b/test/stokes/stokes_quadrilateral.mini index a35a389f3fae9642065498c140ef0ec581339968..0c2a459d2ebdec9279635e47c679d13aff548c89 100644 --- a/test/stokes/stokes_quadrilateral.mini +++ b/test/stokes/stokes_quadrilateral.mini @@ -14,4 +14,3 @@ extension = vtu numerical_jacobian = 1, 0 | expand num exact_solution_expression = g compare_l2errorsquared = 1e-11 -diagonal_jacobian_bug_workaround = 1