Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Sander, Oliver
dune-gfe
Commits
b409f7f2
Commit
b409f7f2
authored
7 years ago
by
Sander, Oliver
Browse files
Options
Downloads
Patches
Plain Diff
Allow to partially control interpolation rule from the parameter file
parent
018fbf86
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/compute-disc-error.cc
+17
-7
17 additions, 7 deletions
src/compute-disc-error.cc
with
17 additions
and
7 deletions
src/compute-disc-error.cc
+
17
−
7
View file @
b409f7f2
...
...
@@ -45,7 +45,11 @@ void measureDiscreteEOC(const GridView gridView,
FEBasis
referenceFEBasis
(
referenceGridView
);
//typedef LocalGeodesicFEFunction<GridView::dimension, double, typename FEBasis::LocalView::Tree::FiniteElement, TargetSpace> LocalInterpolationRule;
//if (parameterSet["interpolationMethod"] != "geodesic")
// DUNE_THROW(Exception, "Inconsistent choice of interpolation method");
typedef
GFE
::
LocalProjectedFEFunction
<
GridView
::
dimension
,
double
,
typename
FEBasis
::
LocalView
::
Tree
::
FiniteElement
,
TargetSpace
>
LocalInterpolationRule
;
if
(
parameterSet
[
"interpolationMethod"
]
!=
"projected"
)
DUNE_THROW
(
Exception
,
"Inconsistent choice of interpolation method"
);
std
::
cout
<<
"Using local interpolation: "
<<
className
<
LocalInterpolationRule
>
()
<<
std
::
endl
;
//////////////////////////////////////////////////////////////////////////////////
...
...
@@ -199,10 +203,6 @@ void measureAnalyticalEOC(const GridView gridView,
typedef
Dune
::
Functions
::
PQkNodalBasis
<
GridView
,
order
>
FEBasis
;
FEBasis
feBasis
(
gridView
);
typedef
LocalGeodesicFEFunction
<
GridView
::
dimension
,
double
,
typename
FEBasis
::
LocalView
::
Tree
::
FiniteElement
,
TargetSpace
>
LocalInterpolationRule
;
//typedef GFE::LocalProjectedFEFunction<GridView::dimension, double, typename FEBasis::LocalView::Tree::FiniteElement, TargetSpace> LocalInterpolationRule;
std
::
cout
<<
"Using local interpolation: "
<<
className
<
LocalInterpolationRule
>
()
<<
std
::
endl
;
//////////////////////////////////////////////////////////////////////////////////
// Read the data whose error is to be measured
//////////////////////////////////////////////////////////////////////////////////
...
...
@@ -235,19 +235,29 @@ void measureAnalyticalEOC(const GridView gridView,
auto
referenceSolution
=
module
.
get
(
"fdf"
).
toC
<
std
::
shared_ptr
<
FBase
>>
();
// The numerical solution, as a grid function
GFE
::
EmbeddedGlobalGFEFunction
<
FEBasis
,
LocalInterpolationRule
,
TargetSpace
>
numericalSolution
(
feBasis
,
x
);
std
::
unique_ptr
<
VirtualGridViewFunction
<
GridView
,
typename
TargetSpace
::
CoordinateType
>
>
numericalSolution
;
if
(
parameterSet
[
"interpolationMethod"
]
==
"geodesic"
)
numericalSolution
=
std
::
make_unique
<
GFE
::
EmbeddedGlobalGFEFunction
<
FEBasis
,
LocalGeodesicFEFunction
<
dim
,
double
,
typename
FEBasis
::
LocalView
::
Tree
::
FiniteElement
,
TargetSpace
>
,
TargetSpace
>
>
(
feBasis
,
x
);
if
(
parameterSet
[
"interpolationMethod"
]
==
"projected"
)
numericalSolution
=
std
::
make_unique
<
GFE
::
EmbeddedGlobalGFEFunction
<
FEBasis
,
GFE
::
LocalProjectedFEFunction
<
dim
,
double
,
typename
FEBasis
::
LocalView
::
Tree
::
FiniteElement
,
TargetSpace
>
,
TargetSpace
>
>
(
feBasis
,
x
);
// QuadratureRule for the integral of the L^2 error
QuadratureRuleKey
quadKey
(
dim
,
6
);
// Compute the embedded L^2 error
double
l2Error
=
DiscretizationError
<
GridView
>::
computeL2Error
(
&
numericalSolution
,
double
l2Error
=
DiscretizationError
<
GridView
>::
computeL2Error
(
numericalSolution
.
get
()
,
referenceSolution
.
get
(),
quadKey
);
// Compute the embedded H^1 error
double
h1Error
=
DiscretizationError
<
GridView
>::
computeH1HalfNormDifferenceSquared
(
gridView
,
&
numericalSolution
,
numericalSolution
.
get
()
,
referenceSolution
.
get
(),
quadKey
);
...
...
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