I replaced all the files in step-49, while still crashed during debugging this is my code, I don't know why.
#include <deal.II/grid/tria.h> #include <deal.II/grid/tria_accessor.h> #include <deal.II/grid/tria_iterator.h> #include <deal.II/grid/grid_generator.h> #include <deal.II/grid/grid_tools.h> #include <deal.II/grid/manifold_lib.h> #include <deal.II/grid/grid_out.h> #include <deal.II/grid/grid_in.h> #include <iostream> #include <fstream> #include <map> using namespace dealii; template <int dim> void print_mesh_info(const Triangulation<dim>& triangulation, const std::string& filename) { std::cout << "Mesh info:" << std::endl << " dimension: " << dim << std::endl << " no. of cells: " << triangulation.n_active_cells() << std::endl; { std::map<types::boundary_id, unsigned int> boundary_count; for (const auto& face : triangulation.active_face_iterators()) if (face->at_boundary()) boundary_count[face->boundary_id()]++; std::cout << " boundary indicators: "; for (const std::pair<const types::boundary_id, unsigned int>& pair : boundary_count) { std::cout << pair.first << "(" << pair.second << " times) "; } std::cout << std::endl; } std::ofstream out(filename); GridOut grid_out; grid_out.write_vtu(triangulation, out); std::cout << " written to " << filename << std::endl << std::endl; } void grid_1() { Triangulation<2> triangulation; GridIn<2> gridin; gridin.attach_triangulation(triangulation); std::ifstream f("example.msh"); gridin.read_msh(f); print_mesh_info(triangulation, "grid-1.vtu"); } int main() { try { grid_1(); } catch (std::exception& exc) { std::cerr << std::endl << std::endl << "----------------------------------------------------" << std::endl; std::cerr << "Exception on processing: " << std::endl << exc.what() << std::endl << "Aborting!" << std::endl << "----------------------------------------------------" << std::endl; return 1; } catch (...) { std::cerr << std::endl << std::endl << "----------------------------------------------------" << std::endl; std::cerr << "Unknown exception!" << std::endl << "Aborting!" << std::endl << "----------------------------------------------------" << std::endl; return 1; } } 在2020年10月29日星期四 UTC+8 下午11:24:51<Wolfgang Bangerth> 写道: > > Nick, > > > I try to run step-49 on my native windows, while debug error. > > I find that the error emerges on that > > void grid_1() > > { > > Triangulation<2> triangulation; > > > > GridIn<2> gridin; > > gridin.attach_triangulation(triangulation); > > std::ifstream f("example.msh"); > > gridin.read_msh(f); > > > > print_mesh_info(triangulation, "grid-1.vtu"); > > } > > > > I don't know why my debug error and I find the error maybe that > > gridin.read_msh(f); > > > > If anyone else khow why please tell me. > We forgot to include two files in the 9.2 release, see > https://github.com/dealii/dealii/issues/10798 > https://github.com/dealii/dealii/pull/10813 > You need the example.msh file from here: > https://github.com/dealii/dealii/tree/master/examples/step-49 > > Best > W. > > -- > ------------------------------------------------------------------------ > Wolfgang Bangerth email: bang...@colostate.edu > www: http://www.math.colostate.edu/~bangerth/ > > -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/53757edf-5dae-41b2-be82-79ca9bf482cfn%40googlegroups.com.
#include <deal.II/grid/tria.h> #include <deal.II/grid/tria_accessor.h> #include <deal.II/grid/tria_iterator.h> #include <deal.II/grid/grid_generator.h> #include <deal.II/grid/grid_tools.h> #include <deal.II/grid/manifold_lib.h> #include <deal.II/grid/grid_out.h> #include <deal.II/grid/grid_in.h> #include <iostream> #include <fstream> #include <map> using namespace dealii; template <int dim> void print_mesh_info(const Triangulation<dim>& triangulation, const std::string& filename) { std::cout << "Mesh info:" << std::endl << " dimension: " << dim << std::endl << " no. of cells: " << triangulation.n_active_cells() << std::endl; { std::map<types::boundary_id, unsigned int> boundary_count; for (const auto& face : triangulation.active_face_iterators()) if (face->at_boundary()) boundary_count[face->boundary_id()]++; std::cout << " boundary indicators: "; for (const std::pair<const types::boundary_id, unsigned int>& pair : boundary_count) { std::cout << pair.first << "(" << pair.second << " times) "; } std::cout << std::endl; } std::ofstream out(filename); GridOut grid_out; grid_out.write_vtu(triangulation, out); std::cout << " written to " << filename << std::endl << std::endl; } void grid_1() { Triangulation<2> triangulation; GridIn<2> gridin; gridin.attach_triangulation(triangulation); std::ifstream f("example.msh"); gridin.read_msh(f); print_mesh_info(triangulation, "grid-1.vtu"); } int main() { try { grid_1(); } catch (std::exception& exc) { std::cerr << std::endl << std::endl << "----------------------------------------------------" << std::endl; std::cerr << "Exception on processing: " << std::endl << exc.what() << std::endl << "Aborting!" << std::endl << "----------------------------------------------------" << std::endl; return 1; } catch (...) { std::cerr << std::endl << std::endl << "----------------------------------------------------" << std::endl; std::cerr << "Unknown exception!" << std::endl << "Aborting!" << std::endl << "----------------------------------------------------" << std::endl; return 1; } }