Loading Unstructured_mesh/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataReader.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -33,6 +33,7 @@ class VTKMeshDataReader { for (unsigned int j = 0; j < Traits<T>::ttype::template getValue<Index>(data.at(i)).size(); j++){ for (unsigned int j = 0; j < Traits<T>::ttype::template getValue<Index>(data.at(i)).size(); j++){ ist >> value[j]; ist >> value[j]; } } DBGVAR(value); Traits<T>::ttype::template setValue<Index>(data.at(i), value); Traits<T>::ttype::template setValue<Index>(data.at(i), value); } } Loading Unstructured_mesh/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataWriter.h +29 −23 Original line number Original line Diff line number Diff line Loading @@ -35,20 +35,26 @@ class VTKMeshDataWriter { IndexType realIndex = 0; IndexType realIndex = 0; for (IndexType i = 0; i < writer.getNumberOfCells(); i++) { IndexType localIndex = 0; for(const std::pair<IndexType, IndexType>& key : writer.backwardCellIndexMapping) { auto iterator = writer.backwardCellIndexMapping.find(i); while (localIndex < key.first) { if (iterator == writer.backwardCellIndexMapping.end()){ for (unsigned int j = 0; j < Traits<T>::ttype::template getReference<Index>()->getValue(data.at(0)).size(); j++) { for (unsigned int j = 0; j < Traits<T>::ttype::template getReference<Index>()->getValue(data.at(0)).size(); j++) { ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex))[j] << ' '; ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex))[j] << ' '; } } realIndex++; realIndex++; } else { localIndex++; realIndex = iterator->second; } realIndex = key.second; localIndex++; for (unsigned int j = 0; j < Traits<T>::ttype::template getReference<Index>()->getValue(data.at(0)).size(); j++) { for (unsigned int j = 0; j < Traits<T>::ttype::template getReference<Index>()->getValue(data.at(0)).size(); j++) { ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex))[j] << ' '; ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex))[j] << ' '; } } } } while (realIndex < data.size() - 1) { for (unsigned int j = 0; j < Traits<T>::ttype::template getReference<Index>()->getValue(data.at(0)).size(); j++) { ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex))[j] << ' '; } realIndex++; } } } } Loading @@ -64,20 +70,20 @@ class VTKMeshDataWriter { ost << "SCALARS " << Traits<T>::ttype::template getName<Index>() << " double 1\nLOOKUP_TABLE default\n"; ost << "SCALARS " << Traits<T>::ttype::template getName<Index>() << " double 1\nLOOKUP_TABLE default\n"; IndexType realIndex = 0; IndexType realIndex = 0; for (IndexType i = 0; i < writer.getNumberOfCells(); i++) { IndexType localIndex = 0; for(const std::pair<IndexType, IndexType>& key : writer.backwardCellIndexMapping) { auto iterator = writer.backwardCellIndexMapping.find(i); while (localIndex < key.first) { if (iterator == writer.backwardCellIndexMapping.end()){ ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex)) << ' '; ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex)) << ' '; realIndex++; realIndex++; } else { localIndex++; } realIndex = iterator->second; realIndex = key.second; localIndex++; ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex)) << ' '; ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex)) << ' '; } } while (realIndex < data.size() - 1) { ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex)) << ' '; realIndex++; } } } } Loading Loading
Unstructured_mesh/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataReader.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -33,6 +33,7 @@ class VTKMeshDataReader { for (unsigned int j = 0; j < Traits<T>::ttype::template getValue<Index>(data.at(i)).size(); j++){ for (unsigned int j = 0; j < Traits<T>::ttype::template getValue<Index>(data.at(i)).size(); j++){ ist >> value[j]; ist >> value[j]; } } DBGVAR(value); Traits<T>::ttype::template setValue<Index>(data.at(i), value); Traits<T>::ttype::template setValue<Index>(data.at(i), value); } } Loading
Unstructured_mesh/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataWriter.h +29 −23 Original line number Original line Diff line number Diff line Loading @@ -35,20 +35,26 @@ class VTKMeshDataWriter { IndexType realIndex = 0; IndexType realIndex = 0; for (IndexType i = 0; i < writer.getNumberOfCells(); i++) { IndexType localIndex = 0; for(const std::pair<IndexType, IndexType>& key : writer.backwardCellIndexMapping) { auto iterator = writer.backwardCellIndexMapping.find(i); while (localIndex < key.first) { if (iterator == writer.backwardCellIndexMapping.end()){ for (unsigned int j = 0; j < Traits<T>::ttype::template getReference<Index>()->getValue(data.at(0)).size(); j++) { for (unsigned int j = 0; j < Traits<T>::ttype::template getReference<Index>()->getValue(data.at(0)).size(); j++) { ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex))[j] << ' '; ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex))[j] << ' '; } } realIndex++; realIndex++; } else { localIndex++; realIndex = iterator->second; } realIndex = key.second; localIndex++; for (unsigned int j = 0; j < Traits<T>::ttype::template getReference<Index>()->getValue(data.at(0)).size(); j++) { for (unsigned int j = 0; j < Traits<T>::ttype::template getReference<Index>()->getValue(data.at(0)).size(); j++) { ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex))[j] << ' '; ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex))[j] << ' '; } } } } while (realIndex < data.size() - 1) { for (unsigned int j = 0; j < Traits<T>::ttype::template getReference<Index>()->getValue(data.at(0)).size(); j++) { ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex))[j] << ' '; } realIndex++; } } } } Loading @@ -64,20 +70,20 @@ class VTKMeshDataWriter { ost << "SCALARS " << Traits<T>::ttype::template getName<Index>() << " double 1\nLOOKUP_TABLE default\n"; ost << "SCALARS " << Traits<T>::ttype::template getName<Index>() << " double 1\nLOOKUP_TABLE default\n"; IndexType realIndex = 0; IndexType realIndex = 0; for (IndexType i = 0; i < writer.getNumberOfCells(); i++) { IndexType localIndex = 0; for(const std::pair<IndexType, IndexType>& key : writer.backwardCellIndexMapping) { auto iterator = writer.backwardCellIndexMapping.find(i); while (localIndex < key.first) { if (iterator == writer.backwardCellIndexMapping.end()){ ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex)) << ' '; ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex)) << ' '; realIndex++; realIndex++; } else { localIndex++; } realIndex = iterator->second; realIndex = key.second; localIndex++; ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex)) << ' '; ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex)) << ' '; } } while (realIndex < data.size() - 1) { ost << Traits<T>::ttype::template getValue<Index>(data.at(realIndex)) << ' '; realIndex++; } } } } Loading