Skip to content
Snippets Groups Projects
Commit 629c5ac6 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

[!280] Avoid visiting No-op integrals

Merge branch 'feature/avoid-visiting-noop-integrals' into 'master'

ref:dominic/dune-perftool I have a case where visiting has a side effect that
I want to avoid. Also spares work.

See merge request [dominic/dune-perftool!280]

  [dominic/dune-perftool!280]: gitlab.dune-project.org/dominic/dune-perftool/merge_requests/280
parents d4581f21 38c62d75
No related branches found
No related tags found
No related merge requests found
......@@ -401,9 +401,6 @@ def generate_accumulation_instruction(expr, visitor):
accumvar = name_accumulation_variable(test_lfs.get_restriction() + ansatz_lfs.get_restriction())
predicates = boundary_predicates(visitor.measure, visitor.subdomain_id)
if False in predicates:
return
rank = 1 if ansatz_lfs.lfs is None else 2
from dune.perftool.pdelab.argument import PDELabAccumulationFunction
......@@ -448,6 +445,11 @@ def visit_integral(integral):
measure = integral.integral_type()
subdomain_id = integral.subdomain_id()
# Avoid even visiting the integral, if it is noop
predicates = boundary_predicates(measure, subdomain_id)
if False in predicates:
return
# Start the visiting process!
visitor = get_visitor(measure, subdomain_id)
visitor.accumulate(integrand)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment