Commit 81146d61 authored by Siqi Ling's avatar Siqi Ling
Browse files

back to version 2855

parent 2a48e331
...@@ -24,7 +24,7 @@ namespace AMDiS { namespace io { ...@@ -24,7 +24,7 @@ namespace AMDiS { namespace io {
namespace Arh2Reader namespace Arh2Reader
{ {
const uint8_t MAJOR = 2; const uint8_t MAJOR = 2;
const uint8_t MINOR = 1; const uint8_t MINOR = 0;
/** /**
* \brief Read MeshStructure, refine the mesh and read dof values to sysVec by order. * \brief Read MeshStructure, refine the mesh and read dof values to sysVec by order.
......
...@@ -16,7 +16,7 @@ namespace AMDiS { namespace io { ...@@ -16,7 +16,7 @@ namespace AMDiS { namespace io {
namespace Arh2Writer namespace Arh2Writer
{ {
const uint8_t MAJOR = 2; const uint8_t MAJOR = 2;
const uint8_t MINOR = 1; const uint8_t MINOR = 0;
/** /**
* \brief write the meshstructure and the dof values of DOFVectors in sysVec * \brief write the meshstructure and the dof values of DOFVectors in sysVec
......
...@@ -22,7 +22,7 @@ namespace AMDiS { namespace io { ...@@ -22,7 +22,7 @@ namespace AMDiS { namespace io {
namespace detail namespace detail
{ {
uint8_t firstRead(ifstream& file) void firstRead(ifstream& file)
{ {
FUNCNAME("Arh2Reader::detail::firstRead"); FUNCNAME("Arh2Reader::detail::firstRead");
...@@ -42,7 +42,6 @@ namespace AMDiS { namespace io { ...@@ -42,7 +42,6 @@ namespace AMDiS { namespace io {
TEST_EXIT(minor <= AMDiS::io::Arh2Reader::MINOR) 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", ("Cannot read Arh2 format: Arh2Reader minor version is %i is smaller than the file minor version %i.\n",
AMDiS::io::Arh2Reader::MINOR, minor); AMDiS::io::Arh2Reader::MINOR, minor);
return minor;
} }
void setDofValues(int macroElIndex, Mesh *mesh, void setDofValues(int macroElIndex, Mesh *mesh,
...@@ -225,7 +224,7 @@ namespace AMDiS { namespace io { ...@@ -225,7 +224,7 @@ namespace AMDiS { namespace io {
uint32_t dim = 0, dow = 0; uint32_t dim = 0, dow = 0;
// Read fixed header // Read fixed header
uint8_t minor = firstRead(file); firstRead(file);
file.read(reinterpret_cast<char*>(&headerLen), 4); file.read(reinterpret_cast<char*>(&headerLen), 4);
file.read(reinterpret_cast<char*>(&dow), 4); file.read(reinterpret_cast<char*>(&dow), 4);
...@@ -233,16 +232,7 @@ namespace AMDiS { namespace io { ...@@ -233,16 +232,7 @@ namespace AMDiS { namespace io {
file.read(reinterpret_cast<char*>(&nFeSpaces), 4); file.read(reinterpret_cast<char*>(&nFeSpaces), 4);
file.read(reinterpret_cast<char*>(&nValueVectors), 4); file.read(reinterpret_cast<char*>(&nValueVectors), 4);
file.read(reinterpret_cast<char*>(&nMacroElements), 4); file.read(reinterpret_cast<char*>(&nMacroElements), 4);
switch(minor) { file.read(const_cast<char*>(cps.data()), 4);
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 #ifdef HAVE_COMPRESSION
TEST_EXIT(cps == "null" || cps == "zlib") TEST_EXIT(cps == "null" || cps == "zlib")
......
...@@ -21,9 +21,8 @@ namespace AMDiS { namespace io { ...@@ -21,9 +21,8 @@ namespace AMDiS { namespace io {
* 1. the type of file is equal to "arh2". * 1. the type of file is equal to "arh2".
* 2. the major version of Arh2Reader is equal to the one in the file. * 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. * 3. the minor version of Arh2Reader is bigger than the one in the file.
* return: minor version
*/ */
uint8_t firstRead(std::ifstream& file); void firstRead(std::ifstream& file);
void setDofValues(int macroElIndex, Mesh *mesh, void setDofValues(int macroElIndex, Mesh *mesh,
std::vector<std::vector<double> >& values, std::vector<std::vector<double> >& values,
...@@ -71,4 +70,4 @@ namespace AMDiS { namespace io { ...@@ -71,4 +70,4 @@ namespace AMDiS { namespace io {
} // end namespace Arh2Reader } // end namespace Arh2Reader
} } // end namespace io, AMDiS } } // end namespace io, AMDiS
#endif #endif
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment