From 4fdac04aa6b228f7939d75579594eb38ab226d98 Mon Sep 17 00:00:00 2001 From: Marcel Koch <marcel.koch@uni-muenster.de> Date: Thu, 13 Jul 2017 15:33:17 +0200 Subject: [PATCH] Removes unnecessary Class --- .../perftool/blockstructured/accumulation.py | 17 ----------------- python/dune/perftool/pdelab/localoperator.py | 19 ++++++++----------- 2 files changed, 8 insertions(+), 28 deletions(-) delete mode 100644 python/dune/perftool/blockstructured/accumulation.py diff --git a/python/dune/perftool/blockstructured/accumulation.py b/python/dune/perftool/blockstructured/accumulation.py deleted file mode 100644 index 30629bc5..00000000 --- a/python/dune/perftool/blockstructured/accumulation.py +++ /dev/null @@ -1,17 +0,0 @@ -from dune.perftool.pdelab.localoperator import (AccumulationSpace) -from dune.perftool.blockstructured.tools import micro_index_to_macro_index - - -class BlockstructuredAccumulationSpace(AccumulationSpace): - def __init__(self, - lfs=None, - index=None, - restriction=None, - element=None, - ): - AccumulationSpace.__init__(self, - lfs=lfs, - index=micro_index_to_macro_index(index), - restriction=restriction, - element=element, - ) \ No newline at end of file diff --git a/python/dune/perftool/pdelab/localoperator.py b/python/dune/perftool/pdelab/localoperator.py index 20110f20..dfc8e5d2 100644 --- a/python/dune/perftool/pdelab/localoperator.py +++ b/python/dune/perftool/pdelab/localoperator.py @@ -185,6 +185,7 @@ def class_type_from_cache(classtag): return basename, basename + tparam_str +@backend(interface="AccumulationSpace") class AccumulationSpace(Record): def __init__(self, lfs=None, @@ -245,23 +246,19 @@ def determine_accumulation_space(expr, number, measure, idims=None): iname, = get_backend("lfs_inames", selector=option_switch("blockstructured"))(subel, ma.restriction, count=number) lfsi = Variable(iname) + if get_option("blockstructured"): + from dune.perftool.blockstructured.tools import micro_index_to_macro_index + lfsi =micro_index_to_macro_index(lfsi) # If the LFS is not yet a pymbolic expression, make it one from pymbolic.primitives import Expression if not isinstance(lfs, Expression): lfs = Variable(lfs) - if get_option("blockstructured"): - from dune.perftool.blockstructured.accumulation import BlockstructuredAccumulationSpace - return BlockstructuredAccumulationSpace(lfs=lfs, - index=lfsi, - restriction=ma.restriction, - ) - else: - return AccumulationSpace(lfs=lfs, - index=lfsi, - restriction=ma.restriction, - ) + return AccumulationSpace(lfs=lfs, + index=lfsi, + restriction=ma.restriction, + ) def boundary_predicates(expr, measure, subdomain_id, visitor): -- GitLab