diff --git a/src/dune-microstructure.cc b/src/dune-microstructure.cc index 4d9563159b37e74326569d99605c3fd7c9706d4e..0b1a20b04230378933fa4b27236695e215b53912 100644 --- a/src/dune-microstructure.cc +++ b/src/dune-microstructure.cc @@ -65,7 +65,6 @@ using namespace MatrixOperations; ////////////////////////////////////////////////////////////////////// // Helper functions for Table-Output ////////////////////////////////////////////////////////////////////// - /*! Center-aligns string within a field of width w. Pads with blank spaces to enforce alignment. */ std::string center(const std::string s, const int w) { @@ -1516,20 +1515,22 @@ int main(int argc, char *argv[]) ////////////////////////////////////////////////////////////////////////////////////////////// // Write result to VTK file ////////////////////////////////////////////////////////////////////////////////////////////// + std::string VTKOutputName = "CellProblem-result"; + VTKWriter<GridView> vtkWriter(gridView_CE); vtkWriter.addVertexData( correctorFunction_1, - VTK::FieldInfo("corrector phi_1", VTK::FieldInfo::Type::vector, dim)); //TODO FOR EACH LEVEL! + VTK::FieldInfo("Corrector phi_1 level"+ std::to_string(level) , VTK::FieldInfo::Type::vector, dim)); vtkWriter.addVertexData( correctorFunction_2, - VTK::FieldInfo("corrector phi_2", VTK::FieldInfo::Type::vector, dim)); + VTK::FieldInfo("Corrector phi_2 level"+ std::to_string(level) , VTK::FieldInfo::Type::vector, dim)); vtkWriter.addVertexData( correctorFunction_3, - VTK::FieldInfo("corrector phi_3", VTK::FieldInfo::Type::vector, dim)); - vtkWriter.write("CellProblem-result"); - std::cout << "wrote data to file: CellProblem-result" << std::endl; // better with string for output name.. - + VTK::FieldInfo("Corrector phi_3 level"+ std::to_string(level) , VTK::FieldInfo::Type::vector, dim)); + vtkWriter.write( VTKOutputName + "-level"+ std::to_string(level)); + std::cout << "wrote data to file: " + VTKOutputName + "-level" + std::to_string(level) << std::endl; + levelCounter++; } // Level-Loop End @@ -1592,7 +1593,6 @@ int main(int argc, char *argv[]) { std::visit([tableWidth](auto&& arg){std::cout << center(prd(arg,5,1),tableWidth) << " | ";}, v); std::visit([tableWidth, &log](auto&& arg){log << center(prd(arg,5,1),tableWidth) << " & ";}, v); - StorageCount2++; if(StorageCount2 % 7 == 0 ) { @@ -1602,6 +1602,5 @@ int main(int argc, char *argv[]) } - log.close(); }