Thank you so much for your reply. So in dealii we can't read a mesh with hanging nodes? Is there any other way to read an adaptively refined mesh? Since the refinement happend inside dealii, I think it should have the ability to output and recover the mesh correctly.
在 2018年4月30日星期一 UTC+8下午9:59:16,Luca Heltai写道: > > The problem is that you cannot read a mesh with hanging nodes. If you have > a mesh with hanging nodes, all faces with a hanging node are actually > boundary faces, so in your picture, all faces that are between a refined > and an unrefined cells, are actually boundary faces, i.e., they are > topologically separated (it is as if you had two different lines there). > > If you count the faces, you’ll have 16 refined faces (8 left, 8 right), > plus 8 coarse faces (4 left and 4 right) that counts up to 24. > > Don’t read meshes with hanging nodes. Deal.II does not know how to treat > those hanging nodes, and will simply treat those as boundary faces, with id > = 0 (which is the default boundary id). > > L. > > > On 30 Apr 2018, at 15:53, zeng <[email protected] <javascript:>> wrote: > > > > hi all, I tried to create a mesh as follws: > > 1. Generate the initial mesh using gmsh. Use 1, 2, 3 as > boundary_indicator to denote three diffenrent boundary. Then I got the > initial square.msh file. It looks like this: > > > > > > > > > > > > > > > > > > 2. Read the mesh into dealii. Refine those cells with boundary indicator > 3 and output to square_refined0.msh. When output this refined mesh, I used > flags to keep the boundary indicators. so the boundary faces still have > correct boundary_indicators after refinement. > > > > > > > > My problem is: > > > > When I use the following code to test the resulting mesh > square_refined0.msh. The result shows that there are 24 faces whose > boundary_id is 0 in the triangulation. Since from the initial mesh, I only > set boundary_ids to 1,2,3. Why the resulting mesh have boundary_id 0? Is > this a bug? > > > > > > > > > > > > My code is like: > > > > void test_square(){ > > > > Triangulation<2> triangulation; > > > > GridIn<2> gridin; > > > > gridin.attach_triangulation(triangulation); > > > > std::ifstream f("square_good_refined0.msh"); > > > > gridin.read_msh(f); > > > > int i=0; > > > > typename Triangulation<2>::active_cell_iterator > > > > cell = triangulation.begin_active(), > > > > endc = triangulation.end(); > > > > for(; cell!=endc; cell++) > > > > for(unsigned int face = 0; face<GeometryInfo<2>::faces_per_cell; > face++){ > > > > if(cell->face(face)->boundary_id()==0) > > > > i ++; > > > > } > > > > std::cout<<"number of boundary_id=0 faces "<<i<<std::endl; > > > > } > > > > > > -- > > 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 [email protected] <javascript:>. > > For more options, visit https://groups.google.com/d/optout. > > <TEST.cc><square_refined0.msh><square.msh> > > -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
