From 314eebf573efec8b8916deb74c4c04d3a09a571c Mon Sep 17 00:00:00 2001 From: Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de> Date: Tue, 16 Feb 2016 14:47:10 +0100 Subject: [PATCH] [doc] A bit of doc on ufl transformations --- .../ufl/transformations/argument_elimination.py | 15 ++++++++++++++- .../transformations/extract_accumulation_terms.py | 5 +++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/python/dune/perftool/ufl/transformations/argument_elimination.py b/python/dune/perftool/ufl/transformations/argument_elimination.py index 70cc660c..4bb6c80e 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 c869f2e6..7f64f65b 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 -- GitLab