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
590aaf64
Commit
590aaf64
authored
10 years ago
by
Oliver Sander
Committed by
sander
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove the GlobalP2Mapper class -- it is in a separate file now
[[Imported from SVN: r9915]]
parent
3a5dcd86
No related branches found
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
dune/gfe/parallel/globalindex.hh
+0
-112
0 additions, 112 deletions
dune/gfe/parallel/globalindex.hh
with
0 additions
and
112 deletions
dune/gfe/parallel/globalindex.hh
+
0
−
112
View file @
590aaf64
...
...
@@ -346,116 +346,4 @@ protected:
IndexMap
globalLocalMap_
;
};
namespace
Dune
{
template
<
class
GridView
>
class
GlobalP2Mapper
{
public:
typedef
std
::
map
<
int
,
int
>
IndexMap
;
GlobalP2Mapper
(
const
GridView
&
gridView
)
:
gridView_
(
gridView
)
{
static_assert
(
GridView
::
dimension
==
2
,
"Only implemented for two-dimensional grids"
);
P2BasisMapper
<
GridView
>
p2Mapper
(
gridView
);
GlobalUniqueIndex
<
GridView
,
2
>
globalVertexIndex
(
gridView
);
GlobalUniqueIndex
<
GridView
,
1
>
globalEdgeIndex
(
gridView
);
GlobalUniqueIndex
<
GridView
,
0
>
globalElementIndex
(
gridView
);
// total number of degrees of freedom
nGlobalEntity_
=
globalVertexIndex
.
nGlobalEntity
()
+
globalEdgeIndex
.
nGlobalEntity
()
+
globalElementIndex
.
nGlobalEntity
();
nOwnedLocalEntity_
=
globalVertexIndex
.
nOwnedLocalEntity
()
+
globalEdgeIndex
.
nOwnedLocalEntity
()
+
globalElementIndex
.
nOwnedLocalEntity
();
// Determine
for
(
auto
it
=
gridView
.
template
begin
<
0
>();
it
!=
gridView
.
template
end
<
0
>();
++
it
)
{
// Loop over all vertices
#if DUNE_VERSION_NEWER(DUNE_GRID,2,4)
for
(
size_t
i
=
0
;
i
<
it
->
subEntities
(
2
);
i
++
)
#else
for
(
size_t
i
=
0
;
i
<
it
->
template
count
<
2
>();
i
++
)
#endif
{
//int localIndex = globalVertexIndex.localIndex (*it->template subEntity<2>(i));
int
localIndex
=
p2Mapper
.
map
(
*
it
,
i
,
2
);
int
globalIndex
=
globalVertexIndex
.
globalIndex
(
*
it
->
template
subEntity
<
2
>(
i
));
localGlobalMap_
[
localIndex
]
=
globalIndex
;
globalLocalMap_
[
globalIndex
]
=
localIndex
;
}
// Loop over all edges
#if DUNE_VERSION_NEWER(DUNE_GRID,2,4)
for
(
size_t
i
=
0
;
i
<
it
->
subEntities
(
1
);
i
++
)
#else
for
(
size_t
i
=
0
;
i
<
it
->
template
count
<
1
>();
i
++
)
#endif
{
//int localIndex = globalEdgeIndex.localIndex (*it->template subEntity<1>(i)) + gridView.size(2);
int
localIndex
=
p2Mapper
.
map
(
*
it
,
i
,
1
);
int
globalIndex
=
globalEdgeIndex
.
globalIndex
(
*
it
->
template
subEntity
<
1
>(
i
))
+
globalVertexIndex
.
nGlobalEntity
();
localGlobalMap_
[
localIndex
]
=
globalIndex
;
globalLocalMap_
[
globalIndex
]
=
localIndex
;
}
// One element degree of freedom for quadrilaterals
if
(
not
it
->
type
().
isQuadrilateral
())
DUNE_THROW
(
Dune
::
NotImplemented
,
"for non-quadrilaterals"
);
if
(
it
->
type
().
isQuadrilateral
())
{
//int localIndex = globalEdgeIndex.localIndex (*it->template subEntity<1>(i)) + gridView.size(2);
int
localIndex
=
p2Mapper
.
map
(
*
it
,
0
,
0
);
int
globalIndex
=
globalElementIndex
.
globalIndex
(
*
it
->
template
subEntity
<
0
>(
0
))
+
globalEdgeIndex
.
nGlobalEntity
()
+
globalVertexIndex
.
nGlobalEntity
();
localGlobalMap_
[
localIndex
]
=
globalIndex
;
globalLocalMap_
[
globalIndex
]
=
localIndex
;
}
}
}
/** \brief Given a local index, retrieve its index globally unique over all processes. */
int
globalIndex
(
const
int
&
localIndex
)
const
{
return
localGlobalMap_
.
find
(
localIndex
)
->
second
;
}
int
localIndex
(
const
int
&
globalIndex
)
const
{
return
globalLocalMap_
.
find
(
globalIndex
)
->
second
;
}
unsigned
int
nGlobalEntity
()
const
{
return
nGlobalEntity_
;
}
unsigned
int
nOwnedLocalEntity
()
const
{
return
nOwnedLocalEntity_
;
}
const
GridView
&
getGridView
()
const
{
return
gridView_
;
}
const
GridView
gridView_
;
IndexMap
localGlobalMap_
;
IndexMap
globalLocalMap_
;
size_t
nOwnedLocalEntity_
;
size_t
nGlobalEntity_
;
};
}
#endif
/* GLOBALUNIQUEINDEX_HH_ */
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