From cebdbb60471fd7bb7a56310074d4b423329b26ba Mon Sep 17 00:00:00 2001 From: Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de> Date: Fri, 15 Jan 2016 14:48:41 +0100 Subject: [PATCH] Remove the validity code It was nonsense, as it did everything done lateron anyway. --- python/dune/perftool/compile.py | 6 +---- python/dune/perftool/ufl/validity.py | 35 ---------------------------- 2 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 python/dune/perftool/ufl/validity.py diff --git a/python/dune/perftool/compile.py b/python/dune/perftool/compile.py index 33ee3d07..1df3417f 100644 --- a/python/dune/perftool/compile.py +++ b/python/dune/perftool/compile.py @@ -33,11 +33,7 @@ def read_ufl(uflfile): # We do not expect more than one form assert len(data.forms) == 1 - # TODO As validity is implemented right now, this is nonsense. - # Might as well formulate it as a try statement! -# from dune.perftool.ufl.validity import check_validity -# if not check_validity(form): - # apply some transformations unconditionally! + # apply some transformations unconditionally! from dune.perftool.ufl.transformations import transform_form from dune.perftool.ufl.transformations.splitarguments import split_arguments from dune.perftool.ufl.transformations.indexpushdown import pushdown_indexed diff --git a/python/dune/perftool/ufl/validity.py b/python/dune/perftool/ufl/validity.py deleted file mode 100644 index 92bee291..00000000 --- a/python/dune/perftool/ufl/validity.py +++ /dev/null @@ -1,35 +0,0 @@ -from __future__ import absolute_import -from ufl.algorithms import MultiFunction - - -def check_validity(uflexpr): - """ check an UFL expression (usually an integrand) for - compatibility with the dune-pdelab code generation tool chain. - - The assumptions made are the following: - - The expression is the sum of subtrees, where the number of test - function terms in such subtree is equal the rank of the entire expression. - """ - from ufl import Form - from ufl.classes import Expr - - def check(term): - try: - from dune.perftool.ufl.transformations.extract_accumulation_terms import split_into_accumulation_terms - split_into_accumulation_terms(term) - return True - except AssertionError: - from dune.perftool.ufl.transformations import print_expression - print_expression(term) - return False - - if isinstance(uflexpr, Form): - for integral in uflexpr.integrals(): - if not check(integral.integrand()): - return False - return True - - if isinstance(uflexpr, Expr): - return check(uflexpr) - - raise TypeError("Unknown object type in check_validity: {}".format(type(uflexpr))) -- GitLab