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
adab8c1d
Commit
adab8c1d
authored
6 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[examples.adaptive-interpolation] update
parent
0ae7a0d3
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
examples/adaptive-interpolation.cc
+3
-4
3 additions, 4 deletions
examples/adaptive-interpolation.cc
with
3 additions
and
4 deletions
examples/adaptive-interpolation.cc
+
3
−
4
View file @
adab8c1d
...
@@ -135,7 +135,7 @@ int main(int argc, char* argv[])
...
@@ -135,7 +135,7 @@ int main(int argc, char* argv[])
// fake solution to demonstrate restriction/prolongation
// fake solution to demonstrate restriction/prolongation
auto
fv_space
=
GDT
::
make_finite_volume_space
<
1
>
(
grid_view
);
auto
fv_space
=
GDT
::
make_finite_volume_space
<
1
>
(
grid_view
);
auto
current_solution
=
GDT
::
make_discrete_function
<
V
>
(
fv_space
);
auto
current_solution
=
GDT
::
make_discrete_function
<
V
>
(
fv_space
);
GDT
::
interpolat
e
(
cosh
,
current_solution
);
GDT
::
default_
interpolat
ion
(
cosh
,
current_solution
);
// the main adaptation loop
// the main adaptation loop
auto
helper
=
make_adaptation_helper
(
grid
,
fv_space
,
current_solution
);
auto
helper
=
make_adaptation_helper
(
grid
,
fv_space
,
current_solution
);
...
@@ -143,7 +143,6 @@ int main(int argc, char* argv[])
...
@@ -143,7 +143,6 @@ int main(int argc, char* argv[])
size_t
counter
=
0
;
size_t
counter
=
0
;
while
(
true
)
{
while
(
true
)
{
logger
.
info
()
<<
"step "
<<
counter
<<
", space has "
<<
fv_space
.
mapper
().
size
()
<<
" DoFs"
<<
std
::
endl
;
logger
.
info
()
<<
"step "
<<
counter
<<
", space has "
<<
fv_space
.
mapper
().
size
()
<<
" DoFs"
<<
std
::
endl
;
current_solution
.
visualize
(
"interpolated_function_"
+
XT
::
Common
::
to_string
(
counter
));
// compute local L^2 errors
// compute local L^2 errors
const
auto
local_errors
=
compute_local_l2_norms
(
current_solution
-
cosh
.
as_grid_function
(
grid_view
),
grid_view
);
const
auto
local_errors
=
compute_local_l2_norms
(
current_solution
-
cosh
.
as_grid_function
(
grid_view
),
grid_view
);
...
@@ -166,7 +165,7 @@ int main(int argc, char* argv[])
...
@@ -166,7 +165,7 @@ int main(int argc, char* argv[])
helper
.
post_adapt
();
helper
.
post_adapt
();
// now that the grid is adapted, interpolate the function on the new grid
// now that the grid is adapted, interpolate the function on the new grid
GDT
::
interpolat
e
(
cosh
,
current_solution
);
GDT
::
default_
interpolat
ion
(
cosh
,
current_solution
);
++
counter
;
++
counter
;
}
}
...
@@ -175,7 +174,7 @@ int main(int argc, char* argv[])
...
@@ -175,7 +174,7 @@ int main(int argc, char* argv[])
for
(
auto
&&
element
:
elements
(
grid_view
))
for
(
auto
&&
element
:
elements
(
grid_view
))
min_h
=
std
::
min
(
min_h
,
XT
::
Grid
::
diameter
(
element
));
min_h
=
std
::
min
(
min_h
,
XT
::
Grid
::
diameter
(
element
));
logger
.
info
()
<<
"
\n
A uniformly refine
ment
grid of similar accuracy would have roughly required "
logger
.
info
()
<<
"
\n
A uniformly refine
d
grid of similar accuracy would have roughly required "
<<
int
(
domain_length
/
min_h
)
<<
" DoFs"
<<
std
::
endl
;
<<
int
(
domain_length
/
min_h
)
<<
" DoFs"
<<
std
::
endl
;
}
catch
(
Exception
&
e
)
{
}
catch
(
Exception
&
e
)
{
...
...
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