Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-codegen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Christian Heinigk
dune-codegen
Commits
82fecff9
Commit
82fecff9
authored
8 years ago
by
René Heß
Browse files
Options
Downloads
Patches
Plain Diff
Use estimade degrees from metadata
parent
6b465802
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
patches/ufl/ufl.patch
+0
-30
0 additions, 30 deletions
patches/ufl/ufl.patch
python/dune/perftool/pdelab/localoperator.py
+5
-2
5 additions, 2 deletions
python/dune/perftool/pdelab/localoperator.py
python/dune/perftool/pdelab/quadrature.py
+1
-3
1 addition, 3 deletions
python/dune/perftool/pdelab/quadrature.py
with
6 additions
and
35 deletions
patches/ufl/ufl.patch
deleted
100644 → 0
+
0
−
30
View file @
6b465802
From 7f4831b0b8220365ca4427922fcbeba07e934b5f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20He=C3=9F?= <rene.hess@iwr.uni-heidelberg.de>
Date: Fri, 7 Oct 2016 14:34:38 +0200
Subject: [PATCH] Function view degree estimation for ReferenceValue
---
ufl/algorithms/estimate_degrees.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/ufl/algorithms/estimate_degrees.py b/ufl/algorithms/estimate_degrees.py
index caa9f19..d2d4e69 100644
--- a/ufl/algorithms/estimate_degrees.py
+++ b/ufl/algorithms/estimate_degrees.py
@@ -76,7 +76,12 @@
class SumDegreeEstimator(MultiFunction):
def function_view(self, v, a, i):
# TODO How would the element_replace_map interfere with the function_view class?
from ufl.functionview import select_subelement
- return select_subelement(v.ufl_operands[0].ufl_element(), v.ufl_operands[1]).degree()
+ from ufl.referencevalue import ReferenceValue
+ if isinstance(v.ufl_operands[0], ReferenceValue):
+ return select_subelement(v.ufl_operands[0].ufl_operands[0].ufl_element(), v.ufl_operands[1]).degree()
+ else:
+ return select_subelement(v.ufl_operands[0].ufl_element(), v.ufl_operands[1]).degree()
+
def _reduce_degree(self, v, f):
"""Reduces the estimated degree by one; used when derivatives
--
2.9.3
This diff is collapsed.
Click to expand it.
python/dune/perftool/pdelab/localoperator.py
+
5
−
2
View file @
82fecff9
...
...
@@ -429,7 +429,8 @@ def generate_localoperator_kernels(formdata, data):
include_file
(
'
dune/pdelab/localoperator/flags.hh
'
,
filetag
=
"
operatorfile
"
)
include_file
(
'
dune/pdelab/localoperator/pattern.hh
'
,
filetag
=
"
operatorfile
"
)
# Trigger this one once early on to avoid wrong stuff happening
# Trigger this one once early on to assure that template
# parameters are set in the right order
localoperator_basename
(
formdata
,
data
)
lop_template_ansatz_gfs
()
lop_template_test_gfs
()
...
...
@@ -443,11 +444,13 @@ def generate_localoperator_kernels(formdata, data):
from
dune.perftool.pdelab.parameter
import
name_paramclass
name_paramclass
()
# Add right base classes for stationary/instationary operators
base_class
(
'
Dune::PDELab::LocalOperatorDefaultFlags
'
,
classtag
=
"
operator
"
)
from
dune.perftool.pdelab.driver
import
is_stationary
if
not
is_stationary
():
rf
=
lop_template_range_field
()
base_class
(
'
Dune::PDELab::InstationaryLocalOperatorDefaultMethods<{}>
'
.
format
(
rf
),
classtag
=
"
operator
"
)
base_class
(
'
Dune::PDELab::InstationaryLocalOperatorDefaultMethods<{}>
'
.
format
(
rf
),
classtag
=
"
operator
"
)
# Create set time method in parameter class
from
dune.perftool.pdelab.parameter
import
define_set_time_method
...
...
This diff is collapsed.
Click to expand it.
python/dune/perftool/pdelab/quadrature.py
+
1
−
3
View file @
82fecff9
from
ufl.algorithms
import
estimate_total_polynomial_degree
from
dune.perftool
import
Restriction
from
dune.perftool.generation
import
(
cached
,
domain
,
...
...
@@ -81,7 +79,7 @@ def estimate_quadrature_order():
integrals
=
form
.
integrals_by_type
(
integral_type
)
polynomial_degree
=
0
for
i
in
integrals
:
polynomial_degree
=
max
(
polynomial_degree
,
estimate
_total
_polynomial_degree
(
i
)
)
polynomial_degree
=
max
(
polynomial_degree
,
i
.
metadata
()[
'
estimate
d
_polynomial_degree
'
]
)
# Note: In PDELab quadrature order m means that integration of
# polynomials of degree m is exact.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment