diff --git a/AMDiS/src/ElInfo2d.cc b/AMDiS/src/ElInfo2d.cc index c0979903d0bca9023fef15eb6e09e4551e38d356..e7e4d1f677843905fecb4218ad46655e770ff024 100644 --- a/AMDiS/src/ElInfo2d.cc +++ b/AMDiS/src/ElInfo2d.cc @@ -329,27 +329,8 @@ namespace AMDiS { if (nb->getNewCoord(-1)) { oppCoord_[1] = *(nb->getNewCoord()); } else { - WorldVector<double> d1; - for (int j=0; j<dow; j++) - d1[j] = - 0.5*(elinfo_old->oppCoord_[2][j] + - elinfo_old->coord_[1][j]); - oppCoord_[1].setMidpoint(elinfo_old->neighbourCoord_[2][0], elinfo_old->neighbourCoord_[2][2]); - - if (!(d1 == oppCoord_[1])) { - if ((elinfo_old->coord_[0][0] == 0.0) || - (elinfo_old->coord_[1][0] == 0.0) || - (elinfo_old->coord_[2][0] == 0.0) || - (elinfo_old->coord_[0][0] == 80.0) || - (elinfo_old->coord_[1][0] == 80.0) || - (elinfo_old->coord_[2][0] == 80.0)) { - - } else { - ERROR_EXIT("ja 4\n"); - } - } } neighbourCoord_[1][0] = elinfo_old->neighbourCoord_[2][0]; diff --git a/AMDiS/src/VtkWriter.cc b/AMDiS/src/VtkWriter.cc index 1827ed740391bb50019d793e60215ed92342a7bb..b77c9b1e131d7485d890a7479dfa349dd0f70380 100644 --- a/AMDiS/src/VtkWriter.cc +++ b/AMDiS/src/VtkWriter.cc @@ -17,12 +17,13 @@ namespace AMDiS { int nVertices = (*dc_)[0]->getNumberVertices(); int nElements = (*dc_)[0]->getNumberElements(); int vertices = (*dc_)[0]->getMesh()->getGeo(VERTEX); - int degree = (*dc_)[0]->getFeSpace()->getBasisFcts()->getDegree(); - int dim = (*dc_)[0]->getMesh()->getDim(); - if ((dim == 2) && (degree == 2)) { + if ((dim_ == 2) && (degree_ == 2)) { nVertices += (*dc_)[0]->getNumberInterpPoints(); nElements *= 4; + } else if ((dim_ == 2) && (degree_ == 3)) { + nVertices += (*dc_)[0]->getNumberInterpPoints(); + nElements *= 9; } ::std::ofstream file; @@ -36,11 +37,7 @@ namespace AMDiS { file << " <Points>" << ::std::endl; file << " <DataArray type=\"Float32\" NumberOfComponents=\"3\" format=\"ascii\">" << ::std::endl; - if ((dim == 2) && (degree == 2)) { - writeVertexCoords_dim2_degree2(file); - } else { - writeVertexCoords(file); - } + writeVertexCoords(file); file << " </DataArray>" << ::std::endl; file << " </Points>" << ::std::endl; @@ -73,7 +70,7 @@ namespace AMDiS { file << " </DataArray>" << ::std::endl; file << " <DataArray type=\"Int32\" Name=\"connectivity\">" << ::std::endl; - if ((dim == 2) && (degree == 2)) { + if ((dim_ == 2) && (degree_ == 2)) { writeConnectivity_dim2_degree2(file); } else { writeConnectivity(file); @@ -87,7 +84,7 @@ namespace AMDiS { file << " <DataArray type=\"Float32\" Name=\"value" << i << "\" format=\"ascii\">" << ::std::endl; - if ((dim == 2) && (degree == 2)) { + if ((dim_ == 2) && (degree_ == 2)) { writeVertexValues_dim2_degree2(file, i); } else { writeVertexValues(file, i); @@ -110,7 +107,6 @@ namespace AMDiS { void VtkWriter::writeVertexCoords(::std::ofstream &file) { DOFVector< ::std::list<VertexInfo> > *vertexInfos = (*dc_)[0]->getVertexInfos(); - DOFVector< ::std::list<VertexInfo> >::Iterator it(vertexInfos, USED_DOFS); int counter = 0; @@ -123,20 +119,16 @@ namespace AMDiS { writeCoord(file, it2->coords); } } - } - - void VtkWriter::writeVertexCoords_dim2_degree2(::std::ofstream &file) - { - writeVertexCoords(file); - - DOFVector< ::std::list< WorldVector<double> > > *interpPointCoords = (*dc_)[0]->getInterpPointCoords(); - DOFVector< ::std::list< WorldVector<double> > >::Iterator it(interpPointCoords, USED_DOFS); - - for (it.reset(); !it.end(); ++it) { - ::std::list< WorldVector<double> >::iterator it2; - for (it2 = it->begin(); it2 != it->end(); ++it2) { - writeCoord(file, *it2); + if ((dim_ == 2) && (degree_ > 1)) { + DOFVector< ::std::list< WorldVector<double> > > *interpPointCoords = (*dc_)[0]->getInterpPointCoords(); + DOFVector< ::std::list< WorldVector<double> > >::Iterator pointIt(interpPointCoords, USED_DOFS); + + for (pointIt.reset(); !pointIt.end(); ++pointIt) { + ::std::list< WorldVector<double> >::iterator it2; + for (it2 = pointIt->begin(); it2 != pointIt->end(); ++it2) { + writeCoord(file, *it2); + } } } } @@ -162,25 +154,19 @@ namespace AMDiS { } } } - } - - - void VtkWriter::writeVertexValues_dim2_degree2(::std::ofstream &file, int componentNo) - { - writeVertexValues(file, componentNo); - - DOFVector<int>::Iterator intPointIt((*dc_)[componentNo]->getInterpPointInd(), USED_DOFS); - DOFVector<double>::Iterator valueIt((*dc_)[componentNo]->getValues(), USED_DOFS); - DOFVector< ::std::list<WorldVector<double> > >::Iterator - coordIt((*dc_)[componentNo]->getInterpPointCoords(), USED_DOFS); - for (intPointIt.reset(), valueIt.reset(), coordIt.reset(); - !intPointIt.end(); - ++intPointIt, ++valueIt, ++coordIt) { - - if (*intPointIt >= 0) { - for (int i = 0; i < static_cast<int>(coordIt->size()); i++) { - file << " " << (fabs(*valueIt) < 1e-40 ? 0.0 : *valueIt) << ::std::endl; + if ((dim_ == 2) && (degree_ > 1)) { + DOFVector< ::std::list<WorldVector<double> > >::Iterator + interpCoordIt((*dc_)[componentNo]->getInterpPointCoords(), USED_DOFS); + + for (intPointIt.reset(), valueIt.reset(), interpCoordIt.reset(); + !intPointIt.end(); + ++intPointIt, ++valueIt, ++interpCoordIt) { + + if (*intPointIt >= 0) { + for (int i = 0; i < static_cast<int>(interpCoordIt->size()); i++) { + file << " " << (fabs(*valueIt) < 1e-40 ? 0.0 : *valueIt) << ::std::endl; + } } } } diff --git a/AMDiS/src/VtkWriter.h b/AMDiS/src/VtkWriter.h index 2ae4748219cb59d0ec04aa4854f1e3eda0dd7e00..b0b4ef5a6ecda8b556a05e2b51c959cdee74cbf5 100644 --- a/AMDiS/src/VtkWriter.h +++ b/AMDiS/src/VtkWriter.h @@ -24,6 +24,7 @@ #include <fstream> +#include "BasisFunction.h" #include "DataCollector.h" namespace AMDiS { @@ -38,6 +39,8 @@ namespace AMDiS { level_(level), traverseFlag_(traverseFlag) { + degree_ = (*dc_)[0]->getFeSpace()->getBasisFcts()->getDegree(); + dim_ = (*dc_)[0]->getMesh()->getDim(); }; @@ -60,12 +63,6 @@ namespace AMDiS { void writeVertexCoords(::std::ofstream &file); - /** \brief - * - */ - void writeVertexCoords_dim2_degree2(::std::ofstream &file); - - /** \brief * */ @@ -120,7 +117,17 @@ namespace AMDiS { */ Flag traverseFlag_; - + + /** \brief + * + */ + int degree_; + + + /** \brief + * + */ + int dim_; }; }