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
531e4287
There was a problem fetching the pipeline summary.
Commit
531e4287
authored
7 years ago
by
Sander, Oliver
Browse files
Options
Downloads
Patches
Plain Diff
Stop using leafbegin/leafend
And some other Dune 2.4 stuff.
parent
f9d68b85
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/gfe/geodesicfefunctionadaptor.hh
+13
-29
13 additions, 29 deletions
dune/gfe/geodesicfefunctionadaptor.hh
with
13 additions
and
29 deletions
dune/gfe/geodesicfefunctionadaptor.hh
+
13
−
29
View file @
531e4287
...
...
@@ -19,9 +19,6 @@ static void geodesicFEFunctionAdaptor(GridType& grid, std::vector<TargetSpace>&
assert
(
x
.
size
()
==
grid
.
size
(
dim
));
typedef
typename
GridType
::
template
Codim
<
0
>
::
LeafIterator
ElementIterator
;
typedef
typename
GridType
::
template
Codim
<
dim
>
::
LeafIterator
VertexIterator
;
// /////////////////////////////////////////////////////
// Save leaf p1 data in a map
// /////////////////////////////////////////////////////
...
...
@@ -31,11 +28,8 @@ static void geodesicFEFunctionAdaptor(GridType& grid, std::vector<TargetSpace>&
std
::
map
<
typename
GridType
::
Traits
::
LocalIdSet
::
IdType
,
TargetSpace
>
dofMap
;
VertexIterator
vIt
=
grid
.
template
leafbegin
<
dim
>();
VertexIterator
vEndIt
=
grid
.
template
leafend
<
dim
>();
for
(;
vIt
!=
vEndIt
;
++
vIt
)
dofMap
.
insert
(
std
::
make_pair
(
idSet
.
id
(
*
vIt
),
x
[
indexSet
.
index
(
*
vIt
)]));
for
(
const
auto
&
vertex
:
vertices
(
grid
.
leafGridView
()))
dofMap
.
insert
(
std
::
make_pair
(
idSet
.
id
(
vertex
),
x
[
indexSet
.
index
(
vertex
)]));
...
...
@@ -53,46 +47,36 @@ static void geodesicFEFunctionAdaptor(GridType& grid, std::vector<TargetSpace>&
P1NodalBasis
<
typename
GridType
::
LeafGridView
>
p1Basis
(
grid
.
leafGridView
());
x
.
resize
(
grid
.
size
(
dim
));
ElementIterator
eIt
=
grid
.
template
leafbegin
<
0
>();
ElementIterator
eEndIt
=
grid
.
template
leafend
<
0
>();
for
(;
eIt
!=
eEndIt
;
++
eIt
)
{
for
(
const
auto
&
element
:
elements
(
grid
.
leafGridView
()))
{
// Set up a local gfe function on the father element
#if DUNE_VERSION_NEWER(DUNE_GRID,2,4)
size_t
nFatherDofs
=
eIt
->
father
()
->
subEntities
(
dim
);
#else
size_t
nFatherDofs
=
eIt
->
father
()
->
template
count
<
dim
>();
#endif
size_t
nFatherDofs
=
element
.
father
().
subEntities
(
dim
);
std
::
vector
<
TargetSpace
>
coefficients
(
nFatherDofs
);
for
(
int
i
=
0
;
i
<
nFatherDofs
;
i
++
)
coefficients
[
i
]
=
dofMap
.
find
(
idSet
.
subId
(
*
eIt
->
father
(),
i
,
dim
))
->
second
;
coefficients
[
i
]
=
dofMap
.
find
(
idSet
.
subId
(
element
.
father
(),
i
,
dim
))
->
second
;
typedef
typename
P1NodalBasis
<
typename
GridType
::
LeafGridView
>::
LocalFiniteElement
LocalFiniteElement
;
LocalGeodesicFEFunction
<
dim
,
double
,
LocalFiniteElement
,
TargetSpace
>
fatherFunction
(
p1Basis
.
getLocalFiniteElement
(
*
eI
t
),
LocalGeodesicFEFunction
<
dim
,
double
,
LocalFiniteElement
,
TargetSpace
>
fatherFunction
(
p1Basis
.
getLocalFiniteElement
(
elemen
t
),
coefficients
);
// The embedding of this element into the father geometry
const
typename
GridType
::
template
Codim
<
0
>
::
LocalGeometry
&
geometryInFather
=
eIt
->
geometryInFather
();
const
auto
&
geometryInFather
=
element
.
geometryInFather
();
size_t
nDofs
=
element
.
subEntities
(
dim
);
#if DUNE_VERSION_NEWER(DUNE_GRID,2,4)
size_t
nDofs
=
eIt
->
subEntities
(
dim
);
#else
size_t
nDofs
=
eIt
->
template
count
<
dim
>();
#endif
for
(
int
i
=
0
;
i
<
nDofs
;
i
++
)
{
if
(
dofMap
.
find
(
idSet
.
subId
(
*
eI
t
,
i
,
dim
))
!=
dofMap
.
end
())
{
if
(
dofMap
.
find
(
idSet
.
subId
(
elemen
t
,
i
,
dim
))
!=
dofMap
.
end
())
{
// If the vertex exists on the coarser level we take the value from there.
// That should be faster and more accurate than interpolating
x
[
indexSet
.
subIndex
(
*
eI
t
,
i
,
dim
)]
=
dofMap
[
idSet
.
subId
(
*
eI
t
,
i
,
dim
)];
x
[
indexSet
.
subIndex
(
elemen
t
,
i
,
dim
)]
=
dofMap
[
idSet
.
subId
(
elemen
t
,
i
,
dim
)];
}
else
{
// Interpolate
x
[
indexSet
.
subIndex
(
*
eI
t
,
i
,
dim
)]
=
fatherFunction
.
evaluate
(
geometryInFather
.
corner
(
i
));
x
[
indexSet
.
subIndex
(
elemen
t
,
i
,
dim
)]
=
fatherFunction
.
evaluate
(
geometryInFather
.
corner
(
i
));
}
...
...
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