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
Aland, Sebastian
amdis
Commits
e14c659f
Commit
e14c659f
authored
Jan 12, 2016
by
Siqi Ling
Browse files
negociate with Florian for Volke
parent
d9ef20ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/io/Arh3Reader.h
View file @
e14c659f
...
...
@@ -24,7 +24,7 @@ namespace AMDiS { namespace io {
namespace
Arh3Reader
{
const
uint8_t
MAJOR
=
3
;
const
uint8_t
MINOR
=
0
;
const
uint8_t
MINOR
=
1
;
const
uint8_t
PARH_MAJOR
=
1
;
const
uint8_t
PARH_MINOR
=
0
;
const
uint8_t
TARH_MAJOR
=
1
;
...
...
AMDiS/src/io/detail/Arh3Reader.cc
View file @
e14c659f
...
...
@@ -31,11 +31,11 @@ namespace AMDiS { namespace io {
(
"Cannot read Arh format: this file is not
\"
%s
\"
format.
\n
"
,
id
.
c_str
());
TEST_EXIT
(
major
==
major_
)
(
"Cannot read Arh format: Arh
2
Reader major version is %i, the file major version is %i.
\n
"
,
(
"Cannot read Arh format: Arh
3
Reader major version is %i, the file major version is %i.
\n
"
,
major
,
major_
);
TEST_EXIT
(
minor
>=
minor_
)
(
"Cannot read Arh format: ArhReader minor version is %i is smaller than the file minor version %i.
\n
"
,
(
"Cannot read Arh format: Arh
3
Reader minor version is %i is smaller than the file minor version %i.
\n
"
,
minor
,
minor_
);
}
...
...
@@ -252,10 +252,10 @@ namespace AMDiS { namespace io {
TEST_EXIT
(
cps
==
Cpsformat
::
ZLIB
||
cps
==
Cpsformat
::
BZIP2
||
cps
==
Cpsformat
::
NONE
)
(
"Cannot read Arh
2
file. Currently only support zlib and bzip2 compression.
\n
"
);
(
"Cannot read Arh
3
file. Currently only support zlib and bzip2 compression.
\n
"
);
#else
TEST_EXIT
(
cps
==
Cpsformat
::
NONE
)
(
"HAVE_COMPRESSION OFF. Cannot read compressed Arh
2
file.
\n
"
);
(
"HAVE_COMPRESSION OFF. Cannot read compressed Arh
3
file.
\n
"
);
#endif
TEST_EXIT
(
dow
==
(
unsigned
)
mesh
->
getGeo
(
WORLD
))
...
...
@@ -266,7 +266,6 @@ namespace AMDiS { namespace io {
(
"File %s has %d vector(s), which is less than the number of DOFVectors %i in vecs!
\n
"
,
filename
.
c_str
(),
nValueVectors
,
vecs
.
size
());
vector
<
int
>
vecsNameLen
;
vector
<
string
>
vecsName
;
vector
<
int
>
filesNameLen
;
...
...
@@ -276,7 +275,7 @@ namespace AMDiS { namespace io {
vector
<
string
>
dataformat
;
vector
<
int
>
macroElIndex
(
nMacroElements
);
vector
<
pair
<
int
,
int
>
>
macroElSize
(
nMacroElements
);
// pos, uncompressed size
int
fileSize
=
0
;
int
fileSize
=
0
,
feSpacesNamesLen
=
0
,
valueNamesLen
=
0
;
vector
<
vector
<
int
>
>
feSpaceDOFs
;
vector
<
string
>
AFEDfileName
(
nFeSpaces
);
...
...
@@ -299,6 +298,7 @@ namespace AMDiS { namespace io {
uint32_t
tmpInt
=
0
;
file
.
read
(
reinterpret_cast
<
char
*>
(
&
tmpInt
),
4
);
file
.
read
(
&
AFEDfileName
[
i
][
0
],
tmpInt
);
feSpacesNamesLen
+=
tmpInt
;
for
(
int
j
=
0
;
j
<
4
;
j
++
)
{
file
.
read
(
reinterpret_cast
<
char
*>
(
&
perDOFs
[
j
]),
4
);
...
...
@@ -311,7 +311,7 @@ namespace AMDiS { namespace io {
string
tmpString
(
""
);
uint32_t
tmpInt
=
0
;
file
.
read
(
reinterpret_cast
<
char
*>
(
&
tmpInt
),
4
);
v
ecs
NameLen
.
push_back
(
tmpInt
)
;
v
alue
Name
s
Len
+=
tmpInt
;
tmpString
.
resize
(
tmpInt
,
' '
);
file
.
read
(
&
tmpString
[
0
],
tmpInt
);
//
vecsName
.
push_back
(
tmpString
);
...
...
@@ -323,15 +323,26 @@ namespace AMDiS { namespace io {
dataformat
.
push_back
(
tmpString
);
}
int
headerLen_
=
34
+
nMacroElements
*
12
+
12
+
feSpacesNamesLen
+
nFeSpaces
*
20
+
valueNamesLen
+
nValueVectors
*
12
;
TEST_EXIT_DBG
(
headerLen_
<=
headerLen
)
(
"Header length (without macro file name) is already larger than the header specified in the file.
\n
"
);
// Read macroFile_nl //TODO
uint32_t
macroFile_nl
=
0
;
file
.
read
(
reinterpret_cast
<
char
*>
(
&
macroFile_nl
),
4
);
if
(
macroFile_nl
>
0
)
{
string
tmpString
(
""
);
tmpString
.
resize
(
macroFile_nl
,
' '
);
file
.
read
(
&
tmpString
[
0
],
macroFile_nl
);
if
(
headerLen_
<
headerLen
)
{
uint32_t
macroFile_nl
=
0
;
file
.
read
(
reinterpret_cast
<
char
*>
(
&
macroFile_nl
),
4
);
if
(
macroFile_nl
>
0
)
{
string
tmpString
(
""
);
tmpString
.
resize
(
macroFile_nl
,
' '
);
file
.
read
(
&
tmpString
[
0
],
macroFile_nl
);
}
}
//================header is over==================//
// Adjust and check vecs
...
...
@@ -679,10 +690,10 @@ namespace AMDiS { namespace io {
TEST_EXIT
(
cps
==
Cpsformat
::
ZLIB
||
cps
==
Cpsformat
::
BZIP2
||
cps
==
Cpsformat
::
NONE
)
(
"Cannot read Arh
2
file. Currently only support zlib and bzip2 compression.
\n
"
);
(
"Cannot read Arh
3
file. Currently only support zlib and bzip2 compression.
\n
"
);
#else
TEST_EXIT
(
cps
==
Cpsformat
::
NONE
)
(
"HAVE_COMPRESSION OFF. Cannot read compressed Arh
2
file.
\n
"
);
(
"HAVE_COMPRESSION OFF. Cannot read compressed Arh
3
file.
\n
"
);
#endif
vector
<
int
>
macroElIndex
(
nMacroElements
);
...
...
AMDiS/src/io/detail/Arh3Writer.cc
View file @
e14c659f
...
...
@@ -300,13 +300,16 @@ namespace AMDiS { namespace io {
map
<
const
FiniteElemSpace
*
,
string
>
AFEDfileName
;
uint32_t
valueNamesLen
=
0
,
f
ile
NamesLen
=
0
;
uint32_t
valueNamesLen
=
0
,
f
eSpaces
NamesLen
=
0
;
for
(
size_t
i
=
0
;
i
<
vecs
.
size
();
i
++
)
valueNamesLen
+=
vecs
[
i
]
->
getName
().
length
();
// TODO AFEDfileName
map
<
const
FiniteElemSpace
*
,
vector
<
int
>
>::
iterator
feSpaceIt
;
for
(
feSpaceIt
=
feSpaces
.
begin
();
feSpaceIt
!=
feSpaces
.
end
();
feSpaceIt
++
)
for
(
feSpaceIt
=
feSpaces
.
begin
();
feSpaceIt
!=
feSpaces
.
end
();
feSpaceIt
++
)
{
AFEDfileName
.
insert
(
make_pair
(
feSpaceIt
->
first
,
string
()));
feSpacesNamesLen
+=
0
;
}
uint32_t
nValueVectors
=
vecs
.
size
();
uint32_t
nFeSpaces
=
feSpaces
.
size
();
...
...
@@ -343,7 +346,7 @@ namespace AMDiS { namespace io {
uint32_t
dim
=
mesh
->
getDim
();
uint32_t
headerLen
=
34
+
//fixed part of header
nMacroElements
*
12
+
12
+
//macroElemnts table
f
ile
NamesLen
+
//feSpaces table
f
eSpaces
NamesLen
+
//feSpaces table
nFeSpaces
*
20
+
//feSpaces table
valueNamesLen
+
//value vector table
nValueVectors
*
12
+
//also value vector table
...
...
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