diff --git a/python/dune/perftool/ufl/transformations/argument_elimination.py b/python/dune/perftool/ufl/transformations/argument_elimination.py index 70cc660c692cb6508f4343d9a62786e08407f47d..4bb6c80e693a8f757d8ed3939baee52cef30c634 100644 --- a/python/dune/perftool/ufl/transformations/argument_elimination.py +++ b/python/dune/perftool/ufl/transformations/argument_elimination.py @@ -1,9 +1,22 @@ +""" +Define an UFL MultiFunction that removes the modified arguments from +a given UFL expression(, which represents one accumumlation term). + +Examples: +e1=e2*v => (e2, (v, )) +e1=e2*v*w => (e2, (v, w)) + +Note that in PDELab, only test functions are arguments! +Trial functions are coefficients instead. +""" from __future__ import absolute_import from ufl.algorithms import MultiFunction class EliminateArguments(MultiFunction): - """ Application scope: Take a valid accumulation term and remove the modified argument from it! """ + """ This MultiFunction processes the expression bottom up and replaces + all modified argument by None and eliminates all None-Terms afterwards. + """ call = MultiFunction.__call__ def __call__(self, o): diff --git a/python/dune/perftool/ufl/transformations/extract_accumulation_terms.py b/python/dune/perftool/ufl/transformations/extract_accumulation_terms.py index c869f2e64ee86e9ec16276c652fd79223f9497cb..7f64f65b4e241c3bd2f85f25b558a522bc22e0b2 100644 --- a/python/dune/perftool/ufl/transformations/extract_accumulation_terms.py +++ b/python/dune/perftool/ufl/transformations/extract_accumulation_terms.py @@ -1,3 +1,8 @@ +""" +This module defines an UFL transformation, that takes a UFL expression +and transforms it into a sum of terms that all contain the correct number +of test function terms (which is equal to the form rank). +""" from __future__ import absolute_import from ufl.algorithms import MultiFunction