Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gdt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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-gdt
Commits
39e6ebd3
Commit
39e6ebd3
authored
4 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[P|tools.adaptation] allow to keep track of refined elements
parent
b93f6f6f
No related branches found
No related tags found
No related merge requests found
Pipeline
#64893
failed
4 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/dune/gdt/tools/adaptation-helper.cc
+16
-10
16 additions, 10 deletions
python/dune/gdt/tools/adaptation-helper.cc
with
16 additions
and
10 deletions
python/dune/gdt/tools/adaptation-helper.cc
+
16
−
10
View file @
39e6ebd3
...
@@ -61,19 +61,11 @@ public:
...
@@ -61,19 +61,11 @@ public:
GDT
::
FiniteVolumeSpace
<
GV
,
r
,
rC
>
marker_indices
;
GDT
::
FiniteVolumeSpace
<
GV
,
r
,
rC
>
marker_indices
;
XT
::
LA
::
CommonDenseVector
<
size_t
>
markers
;
XT
::
LA
::
CommonDenseVector
<
size_t
>
markers
;
G
&
grid
()
// expose access for
mark()
below
G
&
grid
()
// expose access for
bindings
below
{
{
return
this
->
grid_
;
return
this
->
grid_
;
}
}
void
post_adapt
(
const
bool
post_adapt_grid
=
true
,
const
bool
clear
=
false
)
{
BaseType
::
post_adapt
(
post_adapt_grid
,
clear
);
this
->
marker_indices
.
update_after_adapt
();
this
->
markers
.
resize
(
this
->
marker_indices
.
mapper
().
size
());
this
->
markers
*=
0.
;
}
static
bound_type
bind
(
pybind11
::
module
&
m
,
static
bound_type
bind
(
pybind11
::
module
&
m
,
const
std
::
string
&
layer_id
=
""
,
const
std
::
string
&
layer_id
=
""
,
const
std
::
string
&
grid_id
=
XT
::
Grid
::
bindings
::
grid_name
<
G
>::
value
(),
const
std
::
string
&
grid_id
=
XT
::
Grid
::
bindings
::
grid_name
<
G
>::
value
(),
...
@@ -127,9 +119,23 @@ public:
...
@@ -127,9 +119,23 @@ public:
py
::
call_guard
<
py
::
gil_scoped_release
>
());
py
::
call_guard
<
py
::
gil_scoped_release
>
());
c
.
def
(
c
.
def
(
"post_adapt"
,
"post_adapt"
,
[](
type
&
self
,
const
bool
post_adapt_grid
,
const
bool
clear
)
{
self
.
post_adapt
(
post_adapt_grid
,
clear
);
},
[](
type
&
self
,
const
bool
post_adapt_grid
,
const
bool
clear
,
const
bool
indicate_new_elements
)
{
// we need to keep track of these elements before ...
self
.
marker_indices
.
update_after_adapt
();
self
.
markers
.
resize
(
self
.
marker_indices
.
mapper
().
size
());
self
.
markers
*=
0.
;
if
(
indicate_new_elements
)
{
auto
grid_view
=
self
.
grid
().
leafGridView
();
for
(
auto
&&
element
:
elements
(
grid_view
))
if
(
element
.
isNew
())
self
.
markers
[
self
.
marker_indices
.
mapper
().
global_index
(
element
,
size_t
(
0
))]
=
size_t
(
1
);
}
// ... possibly cleaning up the grid
self
.
post_adapt
(
post_adapt_grid
,
clear
);
},
"post_adapt_grid"
_a
=
true
,
"post_adapt_grid"
_a
=
true
,
"clear"
_a
=
false
,
"clear"
_a
=
false
,
"indicate_new_elements"
_a
=
false
,
py
::
call_guard
<
py
::
gil_scoped_release
>
());
py
::
call_guard
<
py
::
gil_scoped_release
>
());
const
auto
FactoryName
=
XT
::
Common
::
to_camel_case
(
class_id
);
const
auto
FactoryName
=
XT
::
Common
::
to_camel_case
(
class_id
);
...
...
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