Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-curvedgrid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
iwr
dune-curvedgrid
Commits
69621836
Commit
69621836
authored
3 years ago
by
Praetorius, Simon
Browse files
Options
Downloads
Patches
Plain Diff
Test geometry.normalGradients
parent
dc2452c0
No related branches found
No related tags found
1 merge request
!12
Test geometry.normalGradients
Pipeline
#6350
failed
3 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/curvedgrid/test/convergence.hh
+10
-38
10 additions, 38 deletions
dune/curvedgrid/test/convergence.hh
with
10 additions
and
38 deletions
dune/curvedgrid/test/convergence.hh
+
10
−
38
View file @
69621836
...
...
@@ -78,50 +78,22 @@ template <int order=2, class Grid, class Projection>
typename
Grid
::
ctype
curvature_error
(
const
Grid
&
grid
,
const
Projection
&
projection
,
int
quad_order
=
8
)
{
std
::
cout
<<
" curvature_error..."
<<
std
::
endl
;
using
GlobalCoordinate
=
typename
Grid
::
template
Codim
<
0
>
::
Entity
::
Geometry
::
GlobalCoordinate
;
using
QuadProvider
=
Dune
::
QuadratureRules
<
typename
Grid
::
ctype
,
2
>
;
using
FiniteElementType
=
Dune
::
PkLocalFiniteElement
<
typename
Grid
::
ctype
,
typename
Grid
::
ctype
,
2
,
order
+
4
>
;
FiniteElementType
fe
;
using
LBTraits
=
typename
FiniteElementType
::
Traits
::
LocalBasisType
::
Traits
;
std
::
vector
<
typename
LBTraits
::
JacobianType
>
shapeGradients
;
std
::
vector
<
GlobalCoordinate
>
gradients
;
std
::
vector
<
GlobalCoordinate
>
normals
;
typename
Grid
::
ctype
dist
=
0
;
for
(
const
auto
&
element
:
elements
(
grid
.
leafGridView
()))
{
auto
geometry
=
element
.
geometry
();
const
auto
&
localBasis
=
fe
.
localBasis
();
{
// get coefficients of normal vectors
const
auto
&
localInterpolation
=
fe
.
localInterpolation
();
auto
n
=
[
&
](
const
auto
&
local
)
->
GlobalCoordinate
{
auto
x
=
geometry
.
impl
().
normal
(
local
);
return
x
;
};
localInterpolation
.
interpolate
(
n
,
normals
);
}
shapeGradients
.
resize
(
localBasis
.
size
());
gradients
.
resize
(
localBasis
.
size
());
auto
geometry
=
element
.
geometry
().
impl
();
const
auto
&
quadRule
=
QuadProvider
::
rule
(
element
.
type
(),
quad_order
);
for
(
const
auto
&
qp
:
quadRule
)
{
auto
jInvT
=
geometry
.
jacobianInverseTransposed
(
qp
.
position
());
localBasis
.
evaluateJacobian
(
qp
.
position
(),
shapeGradients
);
for
(
std
::
size_t
i
=
0
;
i
<
gradients
.
size
();
++
i
)
jInvT
.
mv
(
shapeGradients
[
i
][
0
],
gradients
[
i
]);
typename
Grid
::
ctype
H
=
0
;
for
(
std
::
size_t
i
=
0
;
i
<
gradients
.
size
();
++
i
)
H
+=
normals
[
i
].
dot
(
gradients
[
i
]);
auto
H_exact
=
projection
.
mean_curvature
(
geometry
.
global
(
qp
.
position
()));
dist
+=
std
::
abs
(
H
/
2
-
H_exact
)
*
qp
.
weight
()
*
geometry
.
integrationElement
(
qp
.
position
());
for
(
const
auto
&
qp
:
quadRule
)
{
auto
H
=
geometry
.
normalGradient
(
qp
.
position
());
typename
Grid
::
ctype
trH
=
0
;
for
(
int
i
=
0
;
i
<
H
.
N
();
++
i
)
trH
+=
H
[
i
][
i
];
auto
trH_exact
=
projection
.
mean_curvature
(
geometry
.
global
(
qp
.
position
()));
dist
+=
std
::
abs
(
trH
/
2
-
trH_exact
)
*
qp
.
weight
()
*
geometry
.
integrationElement
(
qp
.
position
());
}
}
...
...
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