Commit 50a0e255 authored by Siqi Ling's avatar Siqi Ling

add one line comment and change the variable name in detail::arh2writer

parent 2497a645
......@@ -238,7 +238,7 @@ namespace AMDiS { namespace io {
map<const FiniteElemSpace*, vector<int> > sortedFeSpaces;
map<const FiniteElemSpace*, vector<int> >::iterator feSpaceIt;
vector<int> macrosPosVec;
vector<int> macroBlockSize;
DegreeOfFreedom globalDof;
size_t i = 0, j = 0;
......@@ -263,7 +263,7 @@ namespace AMDiS { namespace io {
if (elInfo->getLevel() == 0) {
if (macroElIndex != -1) {
elementStructure.commit();
macrosPosVec.push_back(writeMacroElement(file, elementStructure, values, sortedFeSpaces));
macroBlockSize.push_back(writeMacroElement(file, elementStructure, values, sortedFeSpaces));
}
elementStructure.clear();
......@@ -371,23 +371,23 @@ namespace AMDiS { namespace io {
// And write the last macro element to file.
TEST_EXIT_DBG(macroElIndex != -1)("Should not happen!\n");
elementStructure.commit();
macrosPosVec.push_back(writeMacroElement(file, elementStructure, values, sortedFeSpaces));
TEST_EXIT(macrosPosVec.size() == (unsigned)mesh->getNumberOfMacros())("Should not happen.\n");
macroBlockSize.push_back(writeMacroElement(file, elementStructure, values, sortedFeSpaces));
TEST_EXIT(macroBlockSize.size() == (unsigned)mesh->getNumberOfMacros())("Should not happen.\n");
//reset the macro positions in file
setMacrosPos(file, macrosPosVec);
setMacrosPos(file, macroBlockSize);
file.close();
MSG("ARH file written to: %s\n", filename.c_str());
}
void setMacrosPos(ofstream& file,
vector<int>& macrosPosVec)
vector<int>& macroBlockSize)
{
file.seekp(34);
for(size_t i = 0; i < macrosPosVec.size(); i++)
for(size_t i = 0; i < macroBlockSize.size(); i++)
{
long pos = file.tellp();
file.seekp(pos + 4);
file.write(reinterpret_cast<char*>(&macrosPosVec[i]), 4);
file.write(reinterpret_cast<char*>(&macroBlockSize[i]), 4);
}
}
......
......@@ -20,7 +20,7 @@ namespace AMDiS { namespace io {
DOFVector<double>* vec2 = nullptr,
bool writeParallel = true);
/*
/**
* \ingroup Output
*
* \brief
......@@ -49,6 +49,7 @@ namespace AMDiS { namespace io {
std::vector<DOFVector<double>*> vecs,
bool writeParallel);
///\return the size of the macro block in file
int writeMacroElement(std::ofstream &file,
MeshStructure &code,
std::vector<std::vector<double> >& values,
......
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