Hello,
thank You for the feedback.
My triangulation creation code is the following
//instance variable
parallel::distributed::Triangulation<dim> triangulation;
---------------------------
Point<3>
transformation3 (const Point<3> &in)
{
Point<3> out = in;
double tmp = out (0);
out (0) = out (2);
out (2) = 38. - tmp;
return out;
}
--------------------------------------------------
void
remove_cells_from_triangulation (const Triangulation<3> &
input_triangulation,
Triangulation<3> & result_triangulation)
{
std::set<Triangulation<3>::active_cell_iterator> cells_to_remove;
typename Triangulation<3>::active_cell_iterator cell =
input_triangulation.begin_active (), endc = input_triangulation.end
();
for (; cell != endc; ++cell)
{
Point<3> center = cell->center ();
if (center[2] > 22)
cells_to_remove.insert (cell);
}
GridGenerator::create_triangulation_with_removed_cells
(input_triangulation,
cells_to_remove,
result_triangulation);
}
-----------------------------------------
template<int dim>
void
SplitNS<dim>::grid_5 ()
{
const CylinderBoundary<3> boundary2 (0.917, 2);
Triangulation<3> tria1, tria, tria2, tria_out, tria_out_final,
tria_out_final_2, tria_out_final_3, tria_out_final_4;
Triangulation<3> tria3,tria3_help, tria3_final;
int number_axial_refinements=2;
GridGenerator::cylinder_shell (tria1, 19., 0.917, 3., 8,
std::pow(2,number_axial_refinements));
GridGenerator::cylinder (tria3, 0.917, 38.);
GridTools::transform (transformation3, tria3);
tria3.set_boundary (0, boundary2);
tria3.refine_global (1);
GridGenerator::flatten_triangulation (tria3, tria3_help);
tria3.clear();
tria3.copy_triangulation(tria3_help);
for (int i = 0; i < (number_axial_refinements-1); i++)
{
Triangulation<3>::active_cell_iterator cell_local =
tria3.begin_active (), endc_local = tria3.end ();
for (; cell_local != endc_local; ++cell_local)
{
{
cell_local->set_refine_flag (RefinementCase<dim>::cut_axis (0));
cell_local->set_refine_flag (RefinementCase<dim>::cut_axis (1));
}
}
tria3.execute_coarsening_and_refinement ();
}
GridGenerator::flatten_triangulation (tria3, tria3_final);
GridGenerator::merge_triangulations (tria1, tria3_final, tria);
Point<3> direction (0, 0, 1);
Point<3> p (0, 0, 0);
tria.set_all_manifold_ids (5);
const CylindricalManifold<3> manifold_description (direction, p);
tria.set_manifold (5, manifold_description);
tria.refine_global (1);
tria.refine_global (1);
remove_cells_from_triangulation (tria, tria_out);
GridGenerator::flatten_triangulation (tria_out, tria_out_final);
tria_out_final.set_manifold (5, manifold_description);
triangulation.copy_triangulation (tria_out_final);
Triangulation<3>::active_cell_iterator cell =
triangulation.begin_active (),
endc = triangulation.end ();
for (; cell != endc; ++cell)
{
for (unsigned int v = 0; v < GeometryInfo<3>::vertices_per_cell; ++v)
{
const double distance_from_the_centre = std::sqrt (
cell->vertex (v)[0] * cell->vertex (v)[0]
+ cell->vertex (v)[1] * cell->vertex (v)[1]);
if (distance_from_the_centre > 1.5)
{
cell->set_refine_flag ();
break;
}
}
}
triangulation.execute_coarsening_and_refinement ();
cell = triangulation.begin_active (), endc = triangulation.end ();
for (; cell != endc; ++cell)
{
for (unsigned int v = 0; v < GeometryInfo<3>::vertices_per_cell; ++v)
{
const double distance_from_the_centre = std::sqrt (
cell->vertex (v)[0] * cell->vertex (v)[0]
+ cell->vertex (v)[1] * cell->vertex (v)[1]);
if (distance_from_the_centre > 2.5)
{
cell->set_refine_flag ();
break;
}
}
}
triangulation.execute_coarsening_and_refinement ();
triangulation.refine_global (parameters.refinement);
//code for removing unsubscribing Manifold from like
tria.set_manifold (5);
//and for other helper triangulations variables including the variable
distributed ''triangualtion'
}
2017-03-10 23:05 GMT+01:00 Bruno Turcksin <[email protected]>:
> Marek,
>
> On Friday, March 10, 2017 at 4:28:21 PM UTC-5, Marek Čapek wrote:
>>
>>
>> Hello,
>>
>> I created tubular expansion geometry by
>> 1.creating cylindrical shell
>> 2.creating cylinder
>> 4.globally refining cylinder
>> 5.flattening the cylinder
>> 6. locally refining the cylinder shell to match the cylinder
>> 7. calling GridGenerator::merge_triangulations (tria_cylinder,
>> tria_cylinder_shell, tria);
>> 8. remove some cells from the resulting triangulation ->tria_out_final
>> 9. flatten in order to triangulation.copy_triangulation
>> (tria_out_final), i.e. copy into parallel::distributed::Triangulation
>>
> Could you send the code.
>
>
>>
>> I would like to understand the process of treatment of the interfaces
>> between merged triangulation, as
>> I will need for other computational geometries.
>> I am not very proficient in assigning the proper boundary description and
>> manifold, maybe from that springs
>> the problem. What is the proper use of the flatten_triangulation. I use
>> it for locally refined meshes in order
>> to be able to merge them.
>> I have run my code on similar geometry, where I have not locally refined
>> the cylinder shell before the merge.
>>
>> I have played with remove_duplicit_vertices as well, however without
>> effect.
>>
>
> This is strange. When you merge two triangulations, what basically happens
> is that the cells and the vertices are extracted and then a new
> triangulation is created. So I don't understand how the boundary could be
> exported. Are you sure that you have created a continuous triangulation and
> not a triangulation with two disjoint domains? It could look like the
> vertices between the two cylinders have been merged when in reality they
> haven't. You could check that by going on a cell at the interface between
> the two cylinders and ask for all its neighbors.
>
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
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.