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
2a48e331
Commit
2a48e331
authored
Jan 30, 2014
by
Siqi Ling
Browse files
arh2 file reader uses minor to backward compatible
parent
934e8243
Changes
4
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/io/Arh2Reader.h
View file @
2a48e331
...
...
@@ -24,7 +24,7 @@ namespace AMDiS { namespace io {
namespace
Arh2Reader
{
const
uint8_t
MAJOR
=
2
;
const
uint8_t
MINOR
=
0
;
const
uint8_t
MINOR
=
1
;
/**
* \brief Read MeshStructure, refine the mesh and read dof values to sysVec by order.
...
...
AMDiS/src/io/Arh2Writer.h
View file @
2a48e331
...
...
@@ -16,7 +16,7 @@ namespace AMDiS { namespace io {
namespace
Arh2Writer
{
const
uint8_t
MAJOR
=
2
;
const
uint8_t
MINOR
=
0
;
const
uint8_t
MINOR
=
1
;
/**
* \brief write the meshstructure and the dof values of DOFVectors in sysVec
...
...
AMDiS/src/io/detail/Arh2Reader.cc
View file @
2a48e331
...
...
@@ -22,7 +22,7 @@ namespace AMDiS { namespace io {
namespace
detail
{
void
firstRead
(
ifstream
&
file
)
uint8_t
firstRead
(
ifstream
&
file
)
{
FUNCNAME
(
"Arh2Reader::detail::firstRead"
);
...
...
@@ -42,6 +42,7 @@ namespace AMDiS { namespace io {
TEST_EXIT
(
minor
<=
AMDiS
::
io
::
Arh2Reader
::
MINOR
)
(
"Cannot read Arh2 format: Arh2Reader minor version is %i is smaller than the file minor version %i.
\n
"
,
AMDiS
::
io
::
Arh2Reader
::
MINOR
,
minor
);
return
minor
;
}
void
setDofValues
(
int
macroElIndex
,
Mesh
*
mesh
,
...
...
@@ -224,7 +225,7 @@ namespace AMDiS { namespace io {
uint32_t
dim
=
0
,
dow
=
0
;
// Read fixed header
firstRead
(
file
);
uint8_t
minor
=
firstRead
(
file
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
headerLen
),
4
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
dow
),
4
);
...
...
@@ -232,7 +233,16 @@ namespace AMDiS { namespace io {
file
.
read
(
reinterpret_cast
<
char
*>
(
&
nFeSpaces
),
4
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
nValueVectors
),
4
);
file
.
read
(
reinterpret_cast
<
char
*>
(
&
nMacroElements
),
4
);
file
.
read
(
const_cast
<
char
*>
(
cps
.
data
()),
4
);
switch
(
minor
)
{
case
0
:
cps
=
"null"
;
break
;
case
1
:
file
.
read
(
const_cast
<
char
*>
(
cps
.
data
()),
4
);
break
;
default:
ERROR_EXIT
(
"Should not happen.
\n
"
);
break
;
}
#ifdef HAVE_COMPRESSION
TEST_EXIT
(
cps
==
"null"
||
cps
==
"zlib"
)
...
...
AMDiS/src/io/detail/Arh2Reader.h
View file @
2a48e331
...
...
@@ -21,8 +21,9 @@ namespace AMDiS { namespace io {
* 1. the type of file is equal to "arh2".
* 2. the major version of Arh2Reader is equal to the one in the file.
* 3. the minor version of Arh2Reader is bigger than the one in the file.
* return: minor version
*/
void
firstRead
(
std
::
ifstream
&
file
);
uint8_t
firstRead
(
std
::
ifstream
&
file
);
void
setDofValues
(
int
macroElIndex
,
Mesh
*
mesh
,
std
::
vector
<
std
::
vector
<
double
>
>&
values
,
...
...
@@ -70,4 +71,4 @@ namespace AMDiS { namespace io {
}
// end namespace Arh2Reader
}
}
// end namespace io, AMDiS
#endif
\ No newline at end of file
#endif
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