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
28e6b457
Commit
28e6b457
authored
7 years ago
by
Dominic Kempf
Browse files
Options
Downloads
Patches
Plain Diff
Also implement jacobian determinants on an operator level
parent
81fc7bcd
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/pdelab/geometry.py
+41
-11
41 additions, 11 deletions
python/dune/perftool/pdelab/geometry.py
with
41 additions
and
11 deletions
python/dune/perftool/pdelab/geometry.py
+
41
−
11
View file @
28e6b457
...
...
@@ -350,7 +350,7 @@ def define_jacobian_inverse_transposed(name, restriction):
)
@backend
(
interface
=
"
defin
e_jit
"
,
name
=
"
default
"
)
@backend
(
interface
=
"
nam
e_jit
"
,
name
=
"
default
"
)
def
name_jacobian_inverse_transposed
(
restriction
):
name
=
restricted_name
(
"
jit
"
,
restriction
)
define_jacobian_inverse_transposed
(
name
,
restriction
)
...
...
@@ -364,18 +364,27 @@ def pymbolic_jacobian_inverse_transposed(i, j, restriction):
return
prim
.
Subscript
(
prim
.
Variable
(
name
),
(
j
,
i
))
@preamble
(
kernel
=
"
operator
"
)
def
define_constant_jacobian_determinant_eval
(
name
):
from
dune.perftool.pdelab.localoperator
import
name_ansatz_gfs_constructor_param
,
lop_template_range_field
gfs
=
name_ansatz_gfs_constructor_param
()
rft
=
lop_template_range_field
()
return
"
{} = {}.gridView().template begin<0>()->geometry().integrationElement(Dune::FieldVector<{}, {}>());
"
.
format
(
name
,
gfs
,
rft
,
world_dimension
())
@class_member
(
classtag
=
"
operator
"
)
def
_define_constant_jacobian_determinant
(
name
):
define_constant_jacobian_determinant_eval
(
name
)
from
dune.perftool.pdelab.localoperator
import
lop_template_ansatz_gfs
gfst
=
lop_template_ansatz_gfs
()
return
"
typename {}::Traits::GridView::template Codim<0>::Geometry::ctype {};
"
.
format
(
gfst
,
name
)
@backend
(
interface
=
"
detjac
"
,
name
=
"
constant_transformation_matrix
"
)
@preamble
def
define_constant_jacobian_determinant
(
name
):
geo
=
name_geometry
()
pos
=
name_localcenter
()
valuearg
(
name
,
dtype
=
np
.
float64
)
return
"
auto {} = {}.integrationElement({});
"
.
format
(
name
,
geo
,
pos
,
)
_define_constant_jacobian_determinant
(
name
)
@backend
(
interface
=
"
detjac
"
,
name
=
"
default
"
)
...
...
@@ -394,6 +403,27 @@ def define_jacobian_determinant(name):
)
@backend
(
interface
=
"
fdetjac
"
,
name
=
"
constant_transformation_matrix
"
)
@preamble
def
define_facet_jacobian_determinant
(
name
):
# NB: This might be optimized to store *d* values on the operator level
# We don't do that right now for laziness.
geo
=
name_geometry
()
pos
=
name_localcenter
()
valuearg
(
name
,
dtype
=
np
.
float64
)
return
"
auto {} = {}.integrationElement({});
"
.
format
(
name
,
geo
,
pos
,
)
@backend
(
interface
=
"
fdetjac
"
,
name
=
"
default
"
)
def
define_facet_jacobian_determinant
(
name
):
return
define_jacobian_determinant
(
name
)
def
name_jacobian_determinant
():
name
=
'
detjac
'
get_backend
(
interface
=
"
detjac
"
,
selector
=
option_switch
(
"
constant_transformation_matrix
"
))(
name
)
...
...
@@ -406,7 +436,7 @@ def pymbolic_jacobian_determinant():
def
name_facet_jacobian_determinant
():
name
=
'
fdetjac
'
get_backend
(
interface
=
"
detjac
"
,
selector
=
option_switch
(
"
constant_transformation_matrix
"
))(
name
)
get_backend
(
interface
=
"
f
detjac
"
,
selector
=
option_switch
(
"
constant_transformation_matrix
"
))(
name
)
return
name
...
...
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