Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Backofen, Rainer
amdis
Commits
0b04ba87
Commit
0b04ba87
authored
Nov 04, 2009
by
Thomas Witkowski
Browse files
Fixed serialization-deserialization problem for periodic boundaries.
parent
8ed65a89
Changes
1
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/Mesh.cc
View file @
0b04ba87
...
...
@@ -973,13 +973,17 @@ namespace AMDiS {
node
.
serialize
(
out
);
// write admins
// === Write admins. ===
int
size
=
static_cast
<
int
>
(
admin
.
size
());
SerUtil
::
serialize
(
out
,
size
);
for
(
int
i
=
0
;
i
<
size
;
i
++
)
admin
[
i
]
->
serialize
(
out
);
// write macroElements
// === Write macroElements. ===
size
=
static_cast
<
int
>
(
macroElements
.
size
());
SerUtil
::
serialize
(
out
,
size
);
for
(
int
i
=
0
;
i
<
size
;
i
++
)
...
...
@@ -988,6 +992,30 @@ namespace AMDiS {
SerUtil
::
serialize
(
out
,
elementIndex
);
SerUtil
::
serialize
(
out
,
initialized
);
// === Write periodic associations. ===
int
mapSize
=
periodicAssociations
.
size
();
SerUtil
::
serialize
(
out
,
mapSize
);
for
(
std
::
map
<
BoundaryType
,
VertexVector
*>::
iterator
it
=
periodicAssociations
.
begin
();
it
!=
periodicAssociations
.
end
();
++
it
)
{
BoundaryType
b
=
it
->
first
;
// Check which DOFAdmin is used for the current VertexVector we want to serialize.
int
ithAdmin
=
-
1
;
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
admin
.
size
());
i
++
)
{
if
(
admin
[
i
]
==
it
->
second
->
getAdmin
())
{
ithAdmin
=
i
;
break
;
}
}
TEST_EXIT
(
ithAdmin
>=
0
)
(
"No DOFAdmin found for serialization of periodic associations!
\n
"
);
SerUtil
::
serialize
(
out
,
b
);
SerUtil
::
serialize
(
out
,
ithAdmin
);
it
->
second
->
serialize
(
out
);
}
serializedDOFs
.
clear
();
}
...
...
@@ -1027,7 +1055,9 @@ namespace AMDiS {
node
.
deserialize
(
in
);
// read admins
// === Read admins. ===
int
size
;
SerUtil
::
deserialize
(
in
,
size
);
admin
.
resize
(
size
,
NULL
);
...
...
@@ -1092,6 +1122,22 @@ namespace AMDiS {
}
serializedDOFs
.
clear
();
/// === Read periodic assoications. ===
int
mapSize
=
0
;
SerUtil
::
deserialize
(
in
,
mapSize
);
for
(
int
i
=
0
;
i
<
mapSize
;
i
++
)
{
BoundaryType
b
=
0
;
int
ithAdmin
=
0
;
SerUtil
::
deserialize
(
in
,
b
);
SerUtil
::
deserialize
(
in
,
ithAdmin
);
VertexVector
*
tmpvec
=
new
VertexVector
(
admin
[
ithAdmin
],
""
);
tmpvec
->
deserialize
(
in
);
periodicAssociations
[
b
]
=
tmpvec
;
}
}
void
Mesh
::
initialize
()
...
...
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