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
41078b5d
Commit
41078b5d
authored
6 years ago
by
Marcel Koch
Browse files
Options
Downloads
Patches
Plain Diff
small renaming
parent
ce941233
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/dune/perftool/blockstructured/geometry.py
+15
-14
15 additions, 14 deletions
python/dune/perftool/blockstructured/geometry.py
with
15 additions
and
14 deletions
python/dune/perftool/blockstructured/geometry.py
+
15
−
14
View file @
41078b5d
...
...
@@ -62,7 +62,6 @@ def compute_jacobian_2d(name):
)
def
define_jacobian_matrix
(
name
):
temporary_variable
(
name
,
shape_impl
=
(
'
fm
'
,),
shape
=
(
world_dimension
(),
world_dimension
()))
if
world_dimension
()
==
2
:
...
...
@@ -77,24 +76,26 @@ def name_jacobian_matrix():
return
name
def
pymbolic_
compute_determinant
(
matrix
):
def
compute_determinant
(
name
,
matrix
):
dim
=
world_dimension
()
matrix_entry
=
[[
prim
.
Subscript
(
prim
.
Variable
(
matrix
),
(
i
,
j
))
for
j
in
range
(
dim
)]
for
i
in
range
(
dim
)]
expr_determinant
=
prim
.
Sum
((
prim
.
Product
((
matrix_entry
[
0
][
0
],
matrix_entry
[
1
][
1
])),
-
1
*
prim
.
Product
((
matrix_entry
[
1
][
0
],
matrix_entry
[
0
][
1
]))))
return
expr_determinant
if
dim
==
2
:
matrix_entry
=
[[
prim
.
Subscript
(
prim
.
Variable
(
matrix
),
(
i
,
j
))
for
j
in
range
(
dim
)]
for
i
in
range
(
dim
)]
expr_determinant
=
prim
.
Sum
((
prim
.
Product
((
matrix_entry
[
0
][
0
],
matrix_entry
[
1
][
1
])),
-
1
*
prim
.
Product
((
matrix_entry
[
1
][
0
],
matrix_entry
[
0
][
1
]))))
instruction
(
expression
=
expr_determinant
,
assignee
=
prim
.
Variable
(
name
),
within_inames
=
frozenset
(
sub_element_inames
()
+
get_backend
(
interface
=
"
quad_inames
"
)()),
within_inames_is_final
=
True
,
depends_on
=
frozenset
({
Writes
(
matrix
)})
)
else
:
raise
NotImplementedError
()
def
define_jacobian_determinant
(
name
):
temporary_variable
(
name
,
shape
=
())
jacobian
=
name_jacobian_matrix
()
expr_determinant
=
pymbolic_compute_determinant
(
jacobian
)
return
instruction
(
expression
=
expr_determinant
,
assignee
=
prim
.
Variable
(
name
),
within_inames
=
frozenset
(
sub_element_inames
()
+
get_backend
(
interface
=
"
quad_inames
"
)()),
within_inames_is_final
=
True
,
depends_on
=
frozenset
({
Writes
(
jacobian
)})
)
compute_determinant
(
name
,
jacobian
)
def
define_jacobian_determinant_inverse
(
name
):
...
...
@@ -137,7 +138,7 @@ def name_jacobian_determinant_abs():
return
name
# scale determinant according to the order of the blockstructur
e
# scale determinant according to the order of the blockstructur
ing
def
pymbolic_jacobian_determinant
():
if
get_form_option
(
"
constant_transformation_matrix
"
):
from
dune.perftool.pdelab.geometry
import
name_jacobian_determinant
...
...
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