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
c384e2fc
Commit
c384e2fc
authored
4 years ago
by
Lisa Julia Nebel
Browse files
Options
Downloads
Patches
Plain Diff
Remove vertexnormals.hh file - it is not needed anymore
parent
68f8cf14
No related branches found
No related tags found
1 merge request
!63
Feature/remove vertex normals
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/gfe/vertexnormals.hh
+0
-55
0 additions, 55 deletions
dune/gfe/vertexnormals.hh
with
0 additions
and
55 deletions
dune/gfe/vertexnormals.hh
deleted
100644 → 0
+
0
−
55
View file @
68f8cf14
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_GFE_VERTEXNORMALS_HH
#define DUNE_GFE_VERTEXNORMALS_HH
#include
<vector>
#include
<dune/common/fvector.hh>
#include
<dune/geometry/referenceelements.hh>
#include
<dune/matrix-vector/crossproduct.hh>
#include
<dune/gfe/unitvector.hh>
/** \brief Compute averaged vertex normals for a 2d-in-3d grid
*/
template
<
class
GridView
>
std
::
vector
<
UnitVector
<
typename
GridView
::
ctype
,
3
>
>
computeVertexNormals
(
const
GridView
&
gridView
)
{
const
auto
&
indexSet
=
gridView
.
indexSet
();
assert
(
GridView
::
dimension
==
2
);
std
::
vector
<
Dune
::
FieldVector
<
typename
GridView
::
ctype
,
3
>
>
unscaledNormals
(
indexSet
.
size
(
2
));
std
::
fill
(
unscaledNormals
.
begin
(),
unscaledNormals
.
end
(),
Dune
::
FieldVector
<
typename
GridView
::
ctype
,
3
>
(
0.0
));
for
(
const
auto
&
element
:
elements
(
gridView
))
{
for
(
std
::
size_t
i
=
0
;
i
<
element
.
subEntities
(
2
);
i
++
)
{
auto
cornerPos
=
Dune
::
ReferenceElements
<
double
,
2
>::
general
(
element
.
type
()).
position
(
i
,
2
);
auto
tangent
=
element
.
geometry
().
jacobianTransposed
(
cornerPos
);
auto
cornerNormal
=
Dune
::
MatrixVector
::
crossProduct
(
tangent
[
0
],
tangent
[
1
]);
cornerNormal
/=
cornerNormal
.
two_norm
();
unscaledNormals
[
indexSet
.
subIndex
(
element
,
i
,
2
)]
+=
cornerNormal
;
}
}
// Normalize
for
(
auto
&
normal
:
unscaledNormals
)
normal
/=
normal
.
two_norm
();
// Convert array of vectors to array of UnitVectors
std
::
vector
<
UnitVector
<
typename
GridView
::
ctype
,
3
>
>
result
(
indexSet
.
size
(
2
));
for
(
std
::
size_t
i
=
0
;
i
<
unscaledNormals
.
size
();
i
++
)
result
[
i
]
=
unscaledNormals
[
i
];
return
result
;
}
#endif
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