read_msh()

53 views
Skip to first unread message

王艺康

unread,
Nov 28, 2024, 1:54:04 AM11/28/24
to deal.II User Group
I was reading a surface mesh with gmsh and drawing the body mesh based on the surface mesh, then was reading the mesh with read_msh(), but dealii reported an error


terminate called after throwing an instance of 'dealii::StandardExceptions::ExcGridHasInvalidCell'
  what():  
--------------------------------------------------------
An error occurred in line <992> of file </home/wangyikang/dealii-candi/tmp/unpack/deal.II-v9.5.1/source/grid/grid_tools.cc> in function
    std::size_t dealii::GridTools::invert_cells_with_negative_measure(const std::vector<dealii::Point<spacedim> >&, std::vector<dealii::CellData<dim> >&) [with int dim = 3; int spacedim = 3; std::size_t = long unsigned int]
The violated condition was:
    GridTools::cell_measure(all_vertices, vertices) > 0
Additional information:
    Something went wrong when making cell 10534. Read the docs and the
    source code for more information.

Stacktrace:
-----------
#0  /home/wangyikang/dealii-candi/tmp/build/deal.II-v9.5.1/lib/libdeal_II.g.so.9.5.1: unsigned long dealii::GridTools::invert_cells_with_negative_measure<3, 3>(std::vector<dealii::Point<3, double>, std::allocator<dealii::Point<3, double> > > const&, std::vector<dealii::CellData<3>, std::allocator<dealii::CellData<3> > >&)
#1  /home/wangyikang/dealii-candi/tmp/build/deal.II-v9.5.1/lib/libdeal_II.g.so.9.5.1:
#2  /home/wangyikang/dealii-candi/tmp/build/deal.II-v9.5.1/lib/libdeal_II.g.so.9.5.1: dealii::GridIn<3, 3>::read_msh(std::istream&)
#3  ./step-1: first_grid()
#4  ./step-1: main
--------------------------------------------------------

make[3]: *** [CMakeFiles/run.dir/build.make:71: CMakeFiles/run] 已中止 (核心已转储)
make[2]: *** [CMakeFiles/Makefile2:116:CMakeFiles/run.dir/all] 错误 2
make[1]: *** [CMakeFiles/Makefile2:123:CMakeFiles/run.dir/rule] 错误 2
make: *** [Makefile:137:run] 错误 2
1.msh

Wolfgang Bangerth

unread,
Dec 12, 2024, 2:02:29 PM12/12/24
to dea...@googlegroups.com
On 11/27/24 23:54, 王艺康 wrote:
> **
>
> I was reading a surface mesh with gmsh and drawing the body mesh based on the
> surface mesh, then was reading the mesh with read_msh(), but dealii reported
> an error

I was trying to figure out where this error comes from, but the code seems to
have substantially changed since the deal.II 9.5.1 version you are using. Can
you try again with the current 9.6 release and see whether that may have fixed
the issue?

What does confuse me is that you are using Triangulation<3,3> for a surface
mesh. Shouldn't you be using Triangulation<2,3> instead?

Best
W.
Reply all
Reply to author
Forward
0 new messages