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
14c751a9
Commit
14c751a9
authored
6 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[test.stationary...] add eta_NC estimate from ESV2007
parent
33344e10
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
dune/gdt/test/stationary-eocstudies/base.hh
+3
-1
3 additions, 1 deletion
dune/gdt/test/stationary-eocstudies/base.hh
dune/gdt/test/stationary-eocstudies/diffusion-ipdg.hh
+50
-3
50 additions, 3 deletions
dune/gdt/test/stationary-eocstudies/diffusion-ipdg.hh
with
53 additions
and
4 deletions
dune/gdt/test/stationary-eocstudies/base.hh
+
3
−
1
View file @
14c751a9
...
...
@@ -214,7 +214,9 @@ public:
const
auto
&
current_space
=
*
current_space_
;
Timer
timer
;
auto
solution_on_current_grid
=
solve
(
current_space
);
current_data_
[
"quantity"
][
"time to solution (s)"
]
=
timer
.
elapsed
();
// only set time if this did not happen in solve()
if
(
current_data_
[
"quantity"
].
count
(
"time to solution (s)"
)
==
0
)
current_data_
[
"quantity"
][
"time to solution (s)"
]
=
timer
.
elapsed
();
// visualize
visualize_
(
make_discrete_function
(
current_space
,
solution_on_current_grid
),
"solution_on_refinement_"
+
XT
::
Common
::
to_string
(
refinement_level
));
...
...
This diff is collapsed.
Click to expand it.
dune/gdt/test/stationary-eocstudies/diffusion-ipdg.hh
+
50
−
3
View file @
14c751a9
...
...
@@ -16,16 +16,18 @@
#include
<dune/xt/grid/layers.hh>
#include
<dune/xt/functions/interfaces/grid-function.hh>
#include
<dune/gdt/functionals/vector-based.hh>
#include
<dune/gdt/local/functionals/integrals.hh>
#include
<dune/gdt/local/bilinear-forms/integrals.hh>
#include
<dune/gdt/local/integrands/elliptic-ipdg.hh>
#include
<dune/gdt/local/integrands/elliptic.hh>
#include
<dune/gdt/local/integrands/product.hh>
#include
<dune/gdt/local/integrands/conversion.hh>
#include
<dune/gdt/functionals/vector-based.hh>
#include
<dune/gdt/operators/matrix-based.hh>
#include
<dune/gdt/operators/lincomb.hh>
#include
<dune/gdt/norms.hh>
#include
<dune/gdt/operators/constant.hh>
#include
<dune/gdt/operators/lincomb.hh>
#include
<dune/gdt/operators/matrix-based.hh>
#include
<dune/gdt/operators/oswald-interpolation.hh>
#include
<dune/gdt/spaces/l2/discontinuous-lagrange.hh>
#include
<dune/gdt/spaces/l2/finite-volume.hh>
#include
<dune/gdt/spaces/h1/continuous-lagrange.hh>
...
...
@@ -82,6 +84,50 @@ protected:
virtual
const
FF
&
force
()
const
=
0
;
virtual
std
::
vector
<
std
::
string
>
norms
()
const
override
{
auto
nrms
=
BaseType
::
norms
();
nrms
.
push_back
(
"eta_NC"
);
return
nrms
;
}
virtual
std
::
map
<
std
::
string
,
std
::
map
<
std
::
string
,
double
>>
compute
(
const
size_t
refinement_level
,
const
std
::
vector
<
std
::
string
>&
actual_norms
,
const
std
::
vector
<
std
::
pair
<
std
::
string
,
std
::
string
>>&
actual_estimates
,
const
std
::
vector
<
std
::
string
>&
actual_quantities
)
override
{
auto
&
self
=
*
this
;
// compute the quantities/norms/estimates we known about and remove them from the todos
// store the data in current_data_, BaseType::compute will return that
auto
remaining_norms
=
actual_norms
;
auto
remaining_estimates
=
actual_estimates
;
auto
remaining_quantities
=
actual_quantities
;
for
(
auto
norm_it
=
remaining_norms
.
begin
();
norm_it
!=
remaining_norms
.
end
();
/*Do not increment here ...*/
)
{
const
auto
norm_id
=
*
norm_it
;
if
(
norm_id
==
"eta_NC"
)
{
norm_it
=
remaining_norms
.
erase
(
norm_it
);
// ... but rather here ...
if
(
self
.
current_refinement_
!=
refinement_level
)
self
.
discretization_info
(
refinement_level
);
DUNE_THROW_IF
(
!
self
.
current_space_
,
InvalidStateException
,
""
);
// compute current solution
const
auto
&
current_space
=
*
self
.
current_space_
;
Timer
timer
;
const
auto
solution
=
make_discrete_function
(
current_space
,
self
.
solve
(
current_space
));
// only set time if this did not happen in solve()
if
(
self
.
current_data_
[
"quantity"
].
count
(
"time to solution (s)"
)
==
0
)
self
.
current_data_
[
"quantity"
][
"time to solution (s)"
]
=
timer
.
elapsed
();
// compute estimate
const
auto
h1_interpolation
=
apply_oswald_interpolation
(
solution
,
current_space
,
boundary_info
());
self
.
current_data_
[
"norm"
][
norm_id
]
=
elliptic_norm
(
current_space
.
grid_view
(),
diffusion_factor
(),
diffusion_tensor
(),
solution
-
h1_interpolation
);
}
else
++
norm_it
;
// ... or finally here.
}
// norms
// let the Base compute the rest
return
BaseType
::
compute
(
refinement_level
,
remaining_norms
,
remaining_estimates
,
remaining_quantities
);
}
// ... compute(...)
virtual
std
::
unique_ptr
<
S
>
make_space
(
const
GP
&
current_grid
)
override
{
if
(
space_type_
==
"fv"
)
...
...
@@ -122,6 +168,7 @@ protected:
rhs_func
.
append
(
LocalElementIntegralFunctional
<
E
>
(
local_binary_to_unary_element_integrand
(
LocalElementProductIntegrand
<
E
>
(),
force
())));
// ... add Dirichlet here
// (if we add something here, the oswald interpolation in compute() needs to be adapted accordingly!)
// ... add Neumann here
// assemble everything in one grid walk
lhs_op
->
append
(
rhs_func
);
...
...
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