diff --git a/python/dune/perftool/options.py b/python/dune/perftool/options.py index 0e1e8f585bce0c99b60addbe3809030251682ee8..ffd4551d13211626afe379a606ef894efb384743 100644 --- a/python/dune/perftool/options.py +++ b/python/dune/perftool/options.py @@ -61,6 +61,7 @@ class PerftoolOptionsArray(ImmutableRecord): vectorize_greedy = PerftoolOption(default=False, helpstr="the heuristic currently in use (to produce paper numbers)") turn_off_diagonal_jacobian = PerftoolOption(default=False, helpstr="Do not use diagonal_jacobian transformation on the ufl tree and cast result of jacobianInverseTransposed into a FieldMatrix.") architecture = PerftoolOption(default="haswell", helpstr="The architecture to optimize for. Possible values: haswell|knl") + grid_offset = PerftoolOption(default=False, helpstr="Set to true if you want a yasp grid where the lower left corner is not in the origin.") # Arguments that are mainly to be set by logic depending on other options max_vector_width = PerftoolOption(default=256, helpstr=None) diff --git a/python/dune/perftool/pdelab/driver/gridfunctionspace.py b/python/dune/perftool/pdelab/driver/gridfunctionspace.py index f10938ec892b6f9770e75e5af2c14778d5cb46db..d0dac27d5f1182507aa955b9fc32ea46b77ac33f 100644 --- a/python/dune/perftool/pdelab/driver/gridfunctionspace.py +++ b/python/dune/perftool/pdelab/driver/gridfunctionspace.py @@ -60,7 +60,10 @@ def typedef_grid(name): set_option('constant_transformation_matrix', True) range_type = type_range() - gridt = "Dune::YaspGrid<{0}, Dune::EquidistantCoordinates<{1}, {0}>>".format(dim, range_type) + if get_option("grid_offset"): + gridt = "Dune::YaspGrid<{0}, Dune::EquidistantOffsetCoordinates<{1}, {0}>>".format(dim, range_type) + else: + gridt = "Dune::YaspGrid<{0}, Dune::EquidistantCoordinates<{1}, {0}>>".format(dim, range_type) include_file("dune/grid/yaspgrid.hh", filetag="driver") else: if isSimplical(get_trial_element().cell()):