Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hyteg
hyteg
Commits
015d4a1e
Commit
015d4a1e
authored
Oct 13, 2021
by
Marcel Koch
Browse files
use unordered_map for primitive storage
parent
fabdf3a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hyteg/primitivestorage/PrimitiveStorage.hpp
View file @
015d4a1e
...
...
@@ -107,17 +107,18 @@ inline std::ostream& operator<<(std::ostream &os, const MigrationInfo & migratio
return
os
;
}
class
PrimitiveStorage
:
private
walberla
::
NonCopyable
{
public:
typedef
std
::
map
<
PrimitiveID
::
IDType
,
std
::
shared_ptr
<
Primitive
>
>
PrimitiveMap
;
typedef
std
::
map
<
PrimitiveID
::
IDType
,
std
::
shared_ptr
<
Vertex
>
>
VertexMap
;
typedef
std
::
map
<
PrimitiveID
::
IDType
,
std
::
shared_ptr
<
Edge
>
>
EdgeMap
;
typedef
std
::
map
<
PrimitiveID
::
IDType
,
std
::
shared_ptr
<
Face
>
>
FaceMap
;
typedef
std
::
map
<
PrimitiveID
::
IDType
,
std
::
shared_ptr
<
Cell
>
>
CellMap
;
explicit
PrimitiveStorage
(
const
SetupPrimitiveStorage
&
setupStorage
,
const
uint_t
&
additionalHaloDepth
=
0
);
template
<
typename
P
>
using
GenericPrimitiveMap
=
std
::
unordered_map
<
PrimitiveID
::
IDType
,
std
::
shared_ptr
<
P
>
>
;
typedef
GenericPrimitiveMap
<
Primitive
>
PrimitiveMap
;
typedef
GenericPrimitiveMap
<
Vertex
>
VertexMap
;
typedef
GenericPrimitiveMap
<
Edge
>
EdgeMap
;
typedef
GenericPrimitiveMap
<
Face
>
FaceMap
;
typedef
GenericPrimitiveMap
<
Cell
>
CellMap
;
explicit
PrimitiveStorage
(
const
SetupPrimitiveStorage
&
setupStorage
,
const
uint_t
&
additionalHaloDepth
=
0
);
PrimitiveStorage
(
const
SetupPrimitiveStorage
&
setupStorage
,
const
std
::
shared_ptr
<
walberla
::
WcTimingTree
>&
timingTree
,
const
uint_t
&
additionalHaloDepth
=
0
);
...
...
@@ -568,10 +569,10 @@ class PrimitiveStorage : private walberla::NonCopyable
typename
PrimitiveType
,
typename
DataHandlingType
,
typename
=
typename
std
::
enable_if
<
std
::
is_base_of
<
Primitive
,
PrimitiveType
>
::
value
>::
type
>
inline
void
addPrimitiveData
(
const
std
::
shared_ptr
<
DataHandlingType
>&
dataHandling
,
const
std
::
string
&
identifier
,
const
std
::
map
<
PrimitiveID
::
IDType
,
std
::
shared_ptr
<
PrimitiveType
>
>&
primitives
,
const
PrimitiveDataID
<
DataType
,
PrimitiveType
>&
dataID
);
inline
void
addPrimitiveData
(
const
std
::
shared_ptr
<
DataHandlingType
>&
dataHandling
,
const
std
::
string
&
identifier
,
const
GenericPrimitiveMap
<
PrimitiveType
>
&
primitives
,
const
PrimitiveDataID
<
DataType
,
PrimitiveType
>&
dataID
);
VertexMap
vertices_
;
EdgeMap
edges_
;
...
...
@@ -764,8 +765,8 @@ template < typename DataType, typename PrimitiveType, typename DataHandlingType,
inline
void
PrimitiveStorage
::
addPrimitiveData
(
const
std
::
shared_ptr
<
DataHandlingType
>&
dataHandling
,
const
std
::
string
&
identifier
,
// TODO remark: identifier not used in this function
const
std
::
map
<
PrimitiveID
::
IDType
,
std
::
shared_ptr
<
PrimitiveType
>
>&
primitives
,
const
PrimitiveDataID
<
DataType
,
PrimitiveType
>&
dataID
)
const
GenericPrimitiveMap
<
PrimitiveType
>
&
primitives
,
const
PrimitiveDataID
<
DataType
,
PrimitiveType
>&
dataID
)
{
#ifndef NDEBUG
for
(
auto
it
=
primitives
.
begin
();
it
!=
primitives
.
end
();
it
++
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment