Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ag-ohlberger
dune-community
dune-xt
Commits
cea4ffb7
Unverified
Commit
cea4ffb7
authored
6 years ago
by
René Fritze
Browse files
Options
Downloads
Patches
Plain Diff
[py] fix boundaryinfo available for multiple types
parent
1ac78ba8
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/xt/grid/boundaryinfo.bindings.hh
+5
-3
5 additions, 3 deletions
python/dune/xt/grid/boundaryinfo.bindings.hh
python/dune/xt/grid/boundaryinfo.py
+19
-0
19 additions, 0 deletions
python/dune/xt/grid/boundaryinfo.py
with
24 additions
and
3 deletions
python/dune/xt/grid/boundaryinfo.bindings.hh
+
5
−
3
View file @
cea4ffb7
...
...
@@ -43,18 +43,20 @@ public:
static
void
bind
(
pybind11
::
module
&
m
)
{
using
namespace
pybind11
::
literals
;
const
auto
gridname
=
XT
::
Grid
::
bindings
::
grid_name
<
typename
GP
::
GridType
>::
value
();
try
{
// guard since we might not be the first to do so for this grid/intersection
m
.
def
(
std
::
string
(
"available_boundary_infos_on_"
+
layer_names
[
layer
]
+
"_layer"
).
c_str
(),
std
::
string
postfix
{
layer_names
[
layer
]
+
"_layer_"
+
gridname
};
m
.
def
((
std
::
string
(
"available_boundary_infos_on_"
)
+
postfix
)
.
c_str
(),
[](
const
GP
&
/*grid_provider*/
)
{
return
XT
::
Grid
::
BoundaryInfoFactory
<
I
>::
available
();
},
"grid_provider"
_a
);
m
.
def
(
std
::
string
(
"default_boundary_info_config_on_"
+
layer_names
[
layer
]
+
"_layer"
)
.
c_str
(),
m
.
def
(
(
std
::
string
(
"default_boundary_info_config_on_"
)
+
postfix
)
.
c_str
(),
[](
const
GP
&
/*grid_provider*/
,
const
std
::
string
&
type
)
{
return
XT
::
Grid
::
BoundaryInfoFactory
<
I
>::
default_config
(
type
);
},
"grid_provider"
_a
,
"type"
_a
);
m
.
def
(
std
::
string
(
"make_boundary_info_on_"
+
layer_names
[
layer
]
+
"_layer"
)
.
c_str
(),
m
.
def
(
(
std
::
string
(
"make_boundary_info_on_"
)
+
postfix
)
.
c_str
(),
[](
const
GP
&
/*grid_provider*/
,
const
Common
::
Configuration
&
cfg
)
{
return
XT
::
Grid
::
BoundaryInfoFactory
<
I
>::
create
(
cfg
).
release
();
},
...
...
This diff is collapsed.
Click to expand it.
python/dune/xt/grid/boundaryinfo.py
+
19
−
0
View file @
cea4ffb7
...
...
@@ -17,3 +17,22 @@ except ImportError as e:
if
os
.
environ
.
get
(
'
DXT_PYTHON_DEBUG
'
,
False
):
raise
e
logging
.
error
(
'
dune-xt-grid bindings not available
'
)
def
_meta_boundary
(
name
,
grid_provider
,
config
):
for
factory
in
[
globals
()[
s
]
for
s
in
globals
().
keys
()
if
s
.
startswith
(
name
)]:
try
:
return
factory
(
grid_provider
,
config
)
except
:
continue
raise
TypeError
(
'
no matching {} for boundaryinfo {}
'
.
format
(
name
,
grid_provider
.
__class__
))
def
make_boundary_info_on_dd_subdomain_boundary_layer
(
grid_provider
,
config
):
return
_meta_boundary
(
'
make_boundary_info_on_dd_subdomain_boundary_layer
'
,
grid_provider
,
config
)
def
make_boundary_info_on_dd_subdomain_layer
(
grid_provider
,
config
):
return
_meta_boundary
(
'
make_boundary_info_on_dd_subdomain_layer
'
,
grid_provider
,
config
)
def
make_boundary_info_on_leaf_layer
(
grid_provider
,
config
):
return
_meta_boundary
(
'
make_boundary_info_on_leaf_layer
'
,
grid_provider
,
config
)
\ No newline at end of file
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