Commit f9e40e6c authored by Thomas Witkowski's avatar Thomas Witkowski

Add some more debug functions.

parent 6d29ca9e
......@@ -46,7 +46,7 @@ namespace AMDiS {
file.read(reinterpret_cast<char*>(&nStructureCodes), 4);
file.read(reinterpret_cast<char*>(&codeSize), 4);
vector<unsigned long> structureCode(nStructureCodes);
vector<unsigned long int> structureCode(nStructureCodes);
file.read(reinterpret_cast<char*>(&(structureCode[0])), 8 * nStructureCodes);
MeshStructure elementStructure;
......
......@@ -557,6 +557,28 @@ namespace AMDiS {
}
void exportDofVectorByCoords(const DOFVector<double>* vec,
std::string filename)
{
DOFVector<WorldVector<double> > coords(vec->getFeSpace(), "dofCoords");
vec->getFeSpace()->getMesh()->getDofIndexCoords(vec->getFeSpace(), coords);
int dim = vec->getFeSpace()->getMesh()->getDim();
std::ofstream file;
file.open(filename.c_str());
file << vec->getUsedSize() << "\n";
DOFIterator<WorldVector<double> > it(&coords, USED_DOFS);
for (it.reset(); !it.end(); ++it) {
for (int i = 0; i < dim; i++)
file << (*it)[i] << " ";
file << (*vec)[it.getDOFIndex()] << "\n";
}
file.close();
}
void createSortedDofs(Mesh *mesh, ElementIdxToDofs &elMap)
{
FUNCNAME("debug::dbgCreateElementMap()");
......
......@@ -141,6 +141,9 @@ namespace AMDiS {
int getLocalNeighbourIndex(Mesh *mesh, int elIndex, int neighIndex);
void exportDofVectorByCoords(const DOFVector<double>* vec,
std::string filename);
/** \brief
* Traverse a mesh and store for each element all its vertex DOFs in local sorted
* order (by 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