[deal.II] Re: Simple merge_triangulation problem

2020-01-23 Thread Konrad Wiśniewski
Oh! Sorry for bothered you, problem lies somewhere else - this topic can be 
deleted!

-- 
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/9904bf3a-aa12-42df-8428-4fd7b6bd8bb2%40googlegroups.com.


[deal.II] Re: Simple merge_triangulation problem

2020-01-23 Thread Konrad Wiśniewski
The program is suddenly terminated with exit value -1 so, I guess it is 
segfault. It is very strange because the program works perfectly fine in 
case 1), and after I swap coordinates between cell1 and cell2 (to get the 
case 3) program just stop functioning.

W dniu czwartek, 23 stycznia 2020 15:06:48 UTC+1 użytkownik Bruno Turcksin 
napisał:
>
> Konrad,
>
> What does it mean you cannot merge the cells? Do you get the wrong 
> results? Does the code segfault? Do you get an error message?
>
> Best,
>
> Bruno
>

-- 
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/3ad806c3-ba16-4e27-81ea-e21689640501%40googlegroups.com.


[deal.II] Re: Simple merge_triangulation problem

2020-01-23 Thread Bruno Turcksin
Konrad,

What does it mean you cannot merge the cells? Do you get the wrong results? 
Does the code segfault? Do you get an error message?

Best,

Bruno

On Thursday, January 23, 2020 at 8:56:34 AM UTC-5, Konrad Wiśniewski wrote:
>
> Hi all!
>
> I've encountered a problem with very simple two-cells merging in 2D 
> (deal.ii v.9.0.0). 
> Lets say that I have two rectangular cells (for two different material) 
> and I want to merge it together and then refine those cells properly. 
> I don't have a problem with this when I want to merge cells when they are 
> side by side 1):
>
>
> but I cannot merge cells with this configuration 2):
>
> Or even in this configuration 3):
>
> I wonder why it is a case? It seems the most simple case for 
> merge_triangulation() function. Can anyone show me how merge second case 
> properly?
>
> This is my code with the simplest coordinates of vertices:
>
> //FIRST CELL
> static const Point<2> vertices_1[]
> = {
> Point<2>(0.0, 0.0),
> Point<2>(1.0, 0.0),
> Point<2>(0.0, 1.0),
> Point<2>(1.0, 1.0)
>   };
>  
> // Creating CellData and vertices list for this material (in 
> this case for only one cell):
> const unsigned int n_vertices = 4;
> const std::vector> vertices_list_2(&vertices_2[0], 
> &vertices_2[n_vertices]);
> static const int cell_vertices[] = {0,1,2,3};
> CellData cells_1;
>
> for(unsigned int j=0;j {
> cell_1.vertices[j] = cell_vertices[i][j];
> }
> cell_1.material_id = material_one_id;
>
> // Create triangulation: 
> Triangulationtemp_down_triangulation;
> temp_down_triangulation.create_triangulation(vertices_list_1,
> cell_1,SubCellData());
>
>
> //SECOND CELL
> static const Point<2> vertices_2[]
> = {
> Point<2>(0.0, 1.0),
> Point<2>(1.0, 1.0),
> Point<2>(0.0, 2.0),
> Point<2>(1.0, 2.0)
>   };
> // Creating CellData for second cell
> const std::vector> vertices_list_2(&vertices_2[0], 
> &vertices_2[n_vertices]);
> CellData cell_2;
>
> for(unsigned int j=0;j cell_2.vertices[j] = cell_vertices_2[i][j];
> }
> cell_2.material_id = material_two_id;
>
> Triangulationtemp_up_triangulation;
> temp_up_triangulation.create_triangulation(vertices_list_2, 
> cell_2, SubCellData());
>
> // MERGING...
> GridGenerator::merge_triangulations(temp_down_triangulation,
> temp_up_triangulation,
> final_triangulation);
>
>
>

-- 
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/3ce2d238-1d5a-48e5-a227-e0fba8cef004%40googlegroups.com.