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
0591b2e2
Commit
0591b2e2
authored
11 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[examples.elliptic.discretizations] added hi error to CG
parent
50869b56
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/elliptic/discretizations.hh
+13
-3
13 additions, 3 deletions
examples/elliptic/discretizations.hh
with
13 additions
and
3 deletions
examples/elliptic/discretizations.hh
+
13
−
3
View file @
0591b2e2
...
@@ -89,16 +89,21 @@ public:
...
@@ -89,16 +89,21 @@ public:
{
{
using
namespace
Dune
;
using
namespace
Dune
;
using
namespace
Dune
::
GDT
;
using
namespace
Dune
::
GDT
;
// checks
static_assert
(
std
::
is_base_of
<
Stuff
::
LocalizableFunction
,
ReferenceSolutionType
>::
value
,
static_assert
(
std
::
is_base_of
<
Stuff
::
LocalizableFunction
,
ReferenceSolutionType
>::
value
,
"ReferenceSolutionType has to be derived from Stuff::LocalizableFunction!"
);
"ReferenceSolutionType has to be derived from Stuff::LocalizableFunction!"
);
static_assert
(
std
::
is_base_of
<
Stuff
::
LocalizableFunction
,
DiscreteSolutionType
>::
value
,
static_assert
(
std
::
is_base_of
<
Stuff
::
LocalizableFunction
,
DiscreteSolutionType
>::
value
,
"ReferenceSolutionType has to be derived from Stuff::LocalizableFunction!"
);
"ReferenceSolutionType has to be derived from Stuff::LocalizableFunction!"
);
// difference
typedef
DiscreteFunction
::
Difference
<
ReferenceSolutionType
,
DiscreteSolutionType
>
DifferenceType
;
typedef
DiscreteFunction
::
Difference
<
ReferenceSolutionType
,
DiscreteSolutionType
>
DifferenceType
;
const
DifferenceType
difference
(
referencec_solution
,
discrete_solution
);
const
DifferenceType
difference
(
referencec_solution
,
discrete_solution
);
// L2 error
ProductOperator
::
L2
<
GridPartType
>
l2_product_operator
(
grid_part_
);
ProductOperator
::
L2
<
GridPartType
>
l2_product_operator
(
grid_part_
);
const
RangeFieldType
l2_error
=
std
::
sqrt
(
l2_product_operator
.
apply2
(
difference
,
difference
));
const
RangeFieldType
l2_error
=
std
::
sqrt
(
l2_product_operator
.
apply2
(
difference
,
difference
));
return
{
l2_error
};
// H1 error
ProductOperator
::
H1
<
GridPartType
>
h1_product_operator
(
grid_part_
);
const
RangeFieldType
h1_error
=
std
::
sqrt
(
h1_product_operator
.
apply2
(
difference
,
difference
));
return
{
l2_error
,
h1_error
};
}
}
private
:
private
:
...
@@ -135,6 +140,11 @@ public:
...
@@ -135,6 +140,11 @@ public:
{
{
}
}
const
SpaceType
&
space
()
const
{
return
space_
;
}
std
::
shared_ptr
<
DiscreteFunctionType
>
solve
()
const
std
::
shared_ptr
<
DiscreteFunctionType
>
solve
()
const
{
{
using
namespace
Dune
;
using
namespace
Dune
;
...
@@ -164,7 +174,7 @@ public:
...
@@ -164,7 +174,7 @@ public:
// * dirichlet boundary values
// * dirichlet boundary values
DiscreteFunctionType
dirichlet_projection
(
space_
,
dirichlet_vector
,
"dirichlet"
);
DiscreteFunctionType
dirichlet_projection
(
space_
,
dirichlet_vector
,
"dirichlet"
);
typedef
Operator
::
Dirichlet
Projection
<
FunctionType
,
DiscreteFunctionType
>
DirichletProjectionOperatorType
;
typedef
Projection
Operator
::
Dirichlet
<
FunctionType
,
DiscreteFunctionType
>
DirichletProjectionOperatorType
;
const
DirichletProjectionOperatorType
dirichlet_projection_operator
(
BaseType
::
boundary_info
());
const
DirichletProjectionOperatorType
dirichlet_projection_operator
(
BaseType
::
boundary_info
());
dirichlet_projection_operator
.
apply
(
BaseType
::
dirichlet
(),
dirichlet_projection
);
dirichlet_projection_operator
.
apply
(
BaseType
::
dirichlet
(),
dirichlet_projection
);
...
...
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