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
c412ba7f
Commit
c412ba7f
authored
6 years ago
by
René Heß
Browse files
Options
Downloads
Patches
Plain Diff
Make quadrature_preamble a backend function
parent
6ccba85c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
python/dune/perftool/pdelab/geometry.py
+24
-22
24 additions, 22 deletions
python/dune/perftool/pdelab/geometry.py
python/dune/perftool/pdelab/quadrature.py
+1
-0
1 addition, 0 deletions
python/dune/perftool/pdelab/quadrature.py
with
25 additions
and
22 deletions
python/dune/perftool/pdelab/geometry.py
+
24
−
22
View file @
c412ba7f
...
...
@@ -204,14 +204,14 @@ def name_in_cell_geometry(restriction):
# TODO is it always necessary to add quadrature inames?
def
apply_in_cell_transformation
(
name
,
local
,
restriction
):
geo
=
name_in_cell_geometry
(
restriction
)
return
quadrature_preamble
(
"
{} = {}.global({});
"
.
format
(
name
,
geo
,
str
(
local
),
),
assignees
=
frozenset
({
name
}),
read_variables
=
frozenset
({
get_pymbolic_basename
(
local
)}),
depends_on
=
frozenset
({
Writes
(
get_pymbolic_basename
(
local
))}),
)
return
get_backend
(
"
quadrature_preamble
"
)
(
"
{} = {}.global({});
"
.
format
(
name
,
geo
,
str
(
local
),
),
assignees
=
frozenset
({
name
}),
read_variables
=
frozenset
({
get_pymbolic_basename
(
local
)}),
depends_on
=
frozenset
({
Writes
(
get_pymbolic_basename
(
local
))}),
)
def
pymbolic_in_cell_coordinates
(
local
,
restriction
):
...
...
@@ -339,14 +339,15 @@ def define_jacobian_inverse_transposed(name, restriction):
temporary_variable
(
name
,
decl_method
=
define_jacobian_inverse_transposed_temporary
(
restriction
),
shape
=
(
dim
,
dim
))
geo
=
name_cell_geometry
(
restriction
)
pos
=
get_backend
(
"
qp_in_cell
"
,
selector
=
option_switch
((
"
blockstructured
"
,
"
sumfact
"
)))(
restriction
)
return
quadrature_preamble
(
"
{} = {}.jacobianInverseTransposed({});
"
.
format
(
name
,
geo
,
str
(
pos
),
),
assignees
=
frozenset
({
name
}),
read_variables
=
frozenset
({
get_pymbolic_basename
(
pos
)}),
depends_on
=
frozenset
({
Writes
(
get_pymbolic_basename
(
pos
))}),
)
return
get_backend
(
"
quadrature_preamble
"
)(
"
{} = {}.jacobianInverseTransposed({});
"
.
format
(
name
,
geo
,
str
(
pos
),
),
assignees
=
frozenset
({
name
}),
read_variables
=
frozenset
({
get_pymbolic_basename
(
pos
)}),
depends_on
=
frozenset
({
Writes
(
get_pymbolic_basename
(
pos
))}),
)
@backend
(
interface
=
"
name_jit
"
,
name
=
"
default
"
)
...
...
@@ -390,16 +391,17 @@ def define_constant_jacobian_determinant(name):
def
define_jacobian_determinant
(
name
):
temporary_variable
(
name
,
shape
=
())
geo
=
name_geometry
()
pos
=
get_backend
(
"
quad_pos
"
,
selector
=
option_switch
(
"
blockstructured
"
))()
pos
=
get_backend
(
"
quad_pos
"
,
selector
=
option_switch
(
(
"
blockstructured
"
,
"
sumfact
"
)
))()
code
=
"
{} = {}.integrationElement({});
"
.
format
(
name
,
geo
,
str
(
pos
),
)
return
quadrature_preamble
(
code
,
assignees
=
frozenset
({
name
}),
read_variables
=
frozenset
({
get_pymbolic_basename
(
pos
)}),
depends_on
=
frozenset
({
Writes
(
get_pymbolic_basename
(
pos
))}),
)
return
get_backend
(
"
quadrature_preamble
"
)(
code
,
assignees
=
frozenset
({
name
}),
read_variables
=
frozenset
({
get_pymbolic_basename
(
pos
)}),
depends_on
=
frozenset
({
Writes
(
get_pymbolic_basename
(
pos
))}),
)
@backend
(
interface
=
"
fdetjac
"
,
name
=
"
constant_transformation_matrix
"
)
...
...
This diff is collapsed.
Click to expand it.
python/dune/perftool/pdelab/quadrature.py
+
1
−
0
View file @
c412ba7f
...
...
@@ -61,6 +61,7 @@ def quadrature_inames():
return
(
quadrature_iname
(),)
@backend
(
interface
=
"
quadrature_preamble
"
)
def
quadrature_preamble
(
code
,
**
kw
):
kw
[
'
tags
'
]
=
kw
.
get
(
'
tags
'
,
frozenset
({})).
union
(
frozenset
({
"
quad
"
}))
return
instruction
(
inames
=
get_backend
(
interface
=
"
quad_inames
"
)(),
code
=
code
,
**
kw
)
...
...
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