Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nektar
Nektar
Commits
a2e5a35a
Commit
a2e5a35a
authored
Aug 01, 2016
by
Dave Moxey
Browse files
Add similar data structures to ExpListHomogeneous1D
parent
0d7bfd44
Changes
2
Hide whitespace changes
Inline
Side-by-side
library/MultiRegions/ExpListHomogeneous1D.cpp
View file @
a2e5a35a
...
...
@@ -889,15 +889,17 @@ namespace Nektar
// Determine mapping from element ids to location in
// expansion list
map
<
int
,
int
>
ElmtID_to_ExpID
;
for
(
i
=
0
;
i
<
m_planes
[
0
]
->
GetExpSize
();
++
i
)
if
(
m_elmtToExpId
.
size
()
==
0
)
{
ElmtID_to_ExpID
[(
*
m_exp
)[
i
]
->
GetGeom
()
->
GetGlobalID
()]
=
i
;
for
(
i
=
0
;
i
<
m_planes
[
0
]
->
GetExpSize
();
++
i
)
{
m_elmtToExpId
[(
*
m_exp
)[
i
]
->
GetGeom
()
->
GetGlobalID
()]
=
i
;
}
}
for
(
i
=
0
;
i
<
fielddef
->
m_elementIDs
.
size
();
++
i
)
{
int
eid
=
ElmtID_to_
ExpI
D
[
fielddef
->
m_elementIDs
[
i
]];
int
eid
=
m_elmtTo
ExpI
d
[
fielddef
->
m_elementIDs
[
i
]];
int
datalen
=
(
*
m_exp
)[
eid
]
->
GetNcoeffs
();
for
(
n
=
0
;
n
<
m_planes
.
num_elements
();
++
n
)
...
...
@@ -946,13 +948,21 @@ namespace Nektar
int
modes_offset
=
0
;
int
planes_offset
=
0
;
Array
<
OneD
,
NekDouble
>
coeff_tmp
;
st
d
::
map
<
int
,
int
>::
iterator
it
;
boo
st
::
unordered_
map
<
int
,
int
>::
iterator
it
;
// Build map of plane IDs lying on this processor
.
std
::
map
<
in
t
,
int
>
homoZids
;
for
(
i
=
0
;
i
<
m_planes
.
num_elements
();
++
i
)
// Build map of plane IDs lying on this processor
and determine
//
map
p
in
g from element ids to location in expansion list.
if
(
m_zIdToPlane
.
size
()
==
0
)
{
homoZids
[
m_transposition
->
GetPlaneID
(
i
)]
=
i
;
for
(
i
=
0
;
i
<
m_planes
.
num_elements
();
++
i
)
{
m_zIdToPlane
[
m_transposition
->
GetPlaneID
(
i
)]
=
i
;
}
for
(
i
=
0
;
i
<
m_planes
[
0
]
->
GetExpSize
();
++
i
)
{
m_elmtToExpId
[(
*
m_exp
)[
i
]
->
GetGeom
()
->
GetGlobalID
()]
=
i
;
}
}
if
(
fielddef
->
m_numHomogeneousDir
)
...
...
@@ -965,14 +975,6 @@ namespace Nektar
nzmodes
=
1
;
fieldDefHomoZids
.
push_back
(
0
);
}
// Determine mapping from element ids to location in expansion list.
map
<
int
,
int
>
ElmtID_to_ExpID
;
for
(
i
=
0
;
i
<
m_planes
[
0
]
->
GetExpSize
();
++
i
)
{
ElmtID_to_ExpID
[(
*
m_exp
)[
i
]
->
GetGeom
()
->
GetGlobalID
()]
=
i
;
}
// calculate number of modes in the current partition
int
ncoeffs_per_plane
=
m_planes
[
0
]
->
GetNcoeffs
();
...
...
@@ -988,10 +990,10 @@ namespace Nektar
fielddef
->
m_numModes
,
modes_offset
);
it
=
ElmtID_to_
ExpI
D
.
find
(
fielddef
->
m_elementIDs
[
i
]);
it
=
m_elmtTo
ExpI
d
.
find
(
fielddef
->
m_elementIDs
[
i
]);
// ensure element is on this partition for parallel case.
if
(
it
==
ElmtID_to_
ExpI
D
.
end
())
if
(
it
==
m_elmtTo
ExpI
d
.
end
())
{
// increase offset for correct FieldData access
offset
+=
datalen
*
nzmodes
;
...
...
@@ -1006,10 +1008,10 @@ namespace Nektar
for
(
n
=
0
;
n
<
nzmodes
;
++
n
,
offset
+=
datalen
)
{
it
=
homoZids
.
find
(
fieldDefHomoZids
[
n
]);
it
=
m_zIdToPlane
.
find
(
fieldDefHomoZids
[
n
]);
// Check to make sure this mode number lies in this field.
if
(
it
==
homoZids
.
end
())
if
(
it
==
m_zIdToPlane
.
end
())
{
continue
;
}
...
...
library/MultiRegions/ExpListHomogeneous1D.h
View file @
a2e5a35a
...
...
@@ -151,6 +151,8 @@ namespace Nektar
NekDouble
m_lhom
;
///< Width of homogeneous direction
Homo1DBlockMatrixMapShPtr
m_homogeneous1DBlockMat
;
Array
<
OneD
,
ExpListSharedPtr
>
m_planes
;
boost
::
unordered_map
<
int
,
int
>
m_zIdToPlane
;
DNekBlkMatSharedPtr
GenHomogeneous1DBlockMatrix
(
Homogeneous1DMatType
mattype
,
CoeffState
coeffstate
=
eLocal
)
const
;
...
...
Dave Moxey
@dmoxey
mentioned in commit
b8ce201a
·
Aug 02, 2016
mentioned in commit
b8ce201a
mentioned in commit b8ce201a53d50c41986cad018ed31ee22c70fdd7
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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