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
8b75f1b1
Commit
8b75f1b1
authored
6 years ago
by
René Fritze
Committed by
René Milk
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[py] add a shorthand for walker making
parent
1a79a037
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
python/dune/xt/grid/__init__.py
+8
-0
8 additions, 0 deletions
python/dune/xt/grid/__init__.py
python/test/walker.py
+8
-0
8 additions, 0 deletions
python/test/walker.py
with
16 additions
and
0 deletions
python/dune/xt/grid/__init__.py
+
8
−
0
View file @
8b75f1b1
...
...
@@ -27,3 +27,11 @@ except ImportError as e:
HAVE_DUNE_ALUGRID
=
'
GridProvider__2d_simplex_aluconform
'
in
globals
()
def
make_walker
(
gridprovider
,
level
=
0
):
for
factory
in
[
globals
()[
s
]
for
s
in
globals
().
keys
()
if
s
.
startswith
(
'
make_walker_on_
'
)]:
try
:
return
factory
(
gridprovider
,
level
)
except
:
continue
raise
TypeError
(
'
no matching walker for gridview {}
'
.
format
(
gridprovider
.
__class__
))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
python/test/walker.py
+
8
−
0
View file @
8b75f1b1
...
...
@@ -38,6 +38,14 @@ def test_grid_provider(grid_provider):
assert
grid_provider
.
max_entity_diameter
()
>
0
assert
grid_provider
.
dim
>
0
def
test_walker
(
grid_provider
):
walker
=
xtg
.
make_walker
(
grid_provider
)
walker
.
walk
()
walker
.
clear
()
def
test_count
():
pass
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