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
1a78e5aa
Commit
1a78e5aa
authored
6 years ago
by
Dominic Kempf
Browse files
Options
Downloads
Patches
Plain Diff
Implement FacetNormals in constraints and Powerconstraints with varying implementation
parent
46ab4811
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/driver/constraints.py
+7
-14
7 additions, 14 deletions
python/dune/perftool/pdelab/driver/constraints.py
python/dune/perftool/pdelab/driver/visitor.py
+4
-0
4 additions, 0 deletions
python/dune/perftool/pdelab/driver/visitor.py
with
11 additions
and
14 deletions
python/dune/perftool/pdelab/driver/constraints.py
+
7
−
14
View file @
1a78e5aa
from
dune.perftool.generation
import
(
global_context
,
from
dune.perftool.generation
import
(
get_counted_variable
,
global_context
,
include_file
,
preamble
,
)
...
...
@@ -52,12 +53,10 @@ def assemble_constraints(name):
def
name_bctype_function
(
element
,
is_dirichlet
):
if
isinstance
(
element
,
(
VectorElement
,
TensorElement
)):
subel
=
element
.
sub_elements
()[
0
]
child
=
name_bctype_function
(
subel
,
is_dirichlet
[:
subel
.
value_size
()])
name
=
"
{}_pow{}bctype
"
.
format
(
child
,
element
.
num_sub_elements
())
define_power_bctype_function
(
element
,
name
,
child
)
return
name
# Note: Previously, there was a separate code branch for VectorElement here,
# which was implemented through PDELabs Power constraints concept.
# However this completely fails if you have different constraints for
# the children of a VectorElement. We therefore omit this branch completely.
if
isinstance
(
element
,
MixedElement
):
k
=
0
childs
=
[]
...
...
@@ -69,7 +68,7 @@ def name_bctype_function(element, is_dirichlet):
return
name
else
:
assert
isinstance
(
element
,
(
FiniteElement
,
TensorProductElement
))
name
=
"
{}_bctype
"
.
format
(
FEM_name_mangling
(
element
).
lower
()
)
name
=
get_counted_variable
(
"
bctype
"
)
define_bctype_function
(
element
,
is_dirichlet
[
0
],
name
)
return
name
...
...
@@ -85,12 +84,6 @@ def define_bctype_function(element, is_dirichlet, name):
)
@preamble
(
section
=
"
constraints
"
)
def
define_power_bctype_function
(
element
,
name
,
subgfs
):
include_file
(
'
dune/pdelab/constraints/common/constraintsparameters.hh
'
,
filetag
=
'
driver
'
)
return
"
Dune::PDELab::PowerConstraintsParameters<decltype({}), {}> {}({});
"
.
format
(
subgfs
,
element
.
num_sub_elements
(),
name
,
subgfs
)
@preamble
(
section
=
"
constraints
"
)
def
define_composite_bctype_function
(
element
,
is_dirichlet
,
name
,
subgfs
):
include_file
(
'
dune/pdelab/constraints/common/constraintsparameters.hh
'
,
filetag
=
'
driver
'
)
...
...
This diff is collapsed.
Click to expand it.
python/dune/perftool/pdelab/driver/visitor.py
+
4
−
0
View file @
1a78e5aa
...
...
@@ -22,6 +22,10 @@ class DriverUFL2PymbolicVisitor(UFL2LoopyVisitor):
ret
=
self
.
_call
(
expr
,
False
)
return
set
(
self
.
preambles
),
ret
def
facet_normal
(
self
,
o
):
self
.
preambles
.
append
(
"
auto n=is.unitOuterNormal(xl);
"
)
return
prim
.
Variable
(
"
n
"
)
def
spatial_coordinate
(
self
,
o
):
self
.
preambles
.
append
(
"
auto x=is.geometry().global(xl);
"
)
return
prim
.
Variable
(
"
x
"
)
...
...
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