If I understood correctly, you are trying to import a two-dimensional grid embedded in a three dimensional space. Does your code work if you use a Triangulation<2,3>?
The error you show indicates you are using a Triangulation<3>. Luca > Il giorno 7 mar 2024, alle ore 08:11, Wolfgang Bangerth > <bange...@colostate.edu> ha scritto: > > On 3/5/24 23:03, Yufei Fang wrote: >> " >> void run3D() >> { >> Triangulation<3> triangulation; >> GridIn<3> grid_in; >> grid_in.attach_triangulation(triangulation); >> std::ifstream input_file("../resource/3D.mphtxt"); >> grid_in.read_comsol_mphtxt(input_file); >> std::ofstream out("grid3D.vtk"); >> GridOut grid_out; >> grid_out.write_vtk(triangulation, out); >> std::cout << "Grid written to grid.vtk" << std::endl; >> } >> int main() >> { >> run3D(); >> } >> " >> the error is: >> " > > This looks reasonable. Can you send us the 3D.mphtxt file? > > >> 2. the tutorial said triangular and tetrahedral cannot be imported in >> dealii, but i can import triangular or tetrahedral element by >> gridin_COMSOL_mphtxt, is it controdicory? > > deal.II used to use only quadrilaterals and hexahedra until not so long ago, > so the statement about not supporting triangular and tetrahedral meshes was > correct. But it is no longer; can you point out where exactly you found this > statement? > > Best > W. > > -- > ------------------------------------------------------------------------ > Wolfgang Bangerth email: bange...@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/d85193f8-5cd8-4dca-bb96-faabacc0ee9c%40colostate.edu. -- 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/A7FF1712-EFAE-4062-A7F0-AF5F0455B122%40gmail.com.