[deal.II] Re: How to implement GridGenerator::channel_with_cylinder?

2019-01-16 Thread David Wells
Hi Nick,

I think the following would work:

1. Create a triangulation via GridGenerator::plate_with_a_hole.
2. Create a second Triangulation via GridGenerator::hyper_ball. If you are 
working in 3D then you will have to extrude this. Use GridTools::transform 
to recenter this Triangulation in the center of the hole in the first 
Triangulation. Loop across the cells and set all the material ids.
3. Use GridGenerator::merge_triangulations to combine the two 
Triangulations: this should preserve the material ids.

deal.II 9.0 will not copy manifold ids; however, the current 9.1 prerelease 
will. You will have to verify, however, that the common lines (or quads and 
lines in 3D) of the two Triangulations have the same manifold ids before 
merging. It should be possible to use a PolarManifold or 
CylindricalManifold to place new points on the circle (even though it is in 
the interior).

I think Jean-Paul wrote some code to do this at some point; I am not sure 
what happened to it. Ultimately, since this just involves merging two 
Triangulations, it should not be hard to get something working on your own.

Let me know if this works!

Best,
David Wells

On Tuesday, January 15, 2019 at 10:11:07 PM UTC-5, nboyc...@gmail.com wrote:
>
> Does anybody have an example of how to fill out the hole and assign to it 
> different material ID?
>
> Thank you,
> Nick.
>
> On Wednesday, December 19, 2018 at 12:07:16 PM UTC-5, Daniel Arndt wrote:
>>
>> Chucui,
>>
>> the mesh you are showing degenerates close to the midpoint. This isvery 
>> likely not what you wan't.
>> For the inner part something like shown in 
>> https://www.dealii.org/developer/doxygen/deal.II/classTransfiniteInterpolationManifold.html
>> would be a good idea.
>> Then for the middle part GridGenerator::hyper_cube_with_cylindrical_hole (
>> https://www.dealii.org/9.0.0/doxygen/deal.II/namespaceGridGenerator.html#add14cab546d033c1eaacc9234c64ebcd
>> )
>> should work, you just have to make sure that the vertices align when 
>> merging the two meshes via 
>> GridGenerator::merge_triangulations (
>> https://www.dealii.org/developer/doxygen/deal.II/namespaceGridGenerator.html#a7cd88e7eacd46697dee80ad2b8438d54
>> ).
>> Make sure too choose copy_manifold_ids if you are using a developer 
>> version or set the manifold ids after creating and merging the whole mesh.
>> Finally, for the outer part you would just merge some 
>> GridGenerator::subdivided_hyper_rectangle (
>> https://www.dealii.org/developer/doxygen/deal.II/namespaceGridGenerator.html#ac76417d7404b75cf53c732f456e6e971
>> ).
>> Again make sure that the verices align and make sure the manifold ids are 
>> correct after merging all the meshes.
>>
>> Best,
>> Daniel
>>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Re: How to implement GridGenerator::channel_with_cylinder?

2019-01-15 Thread nboychenko1
Does anybody have an example of how to fill out the hole and assign to it 
different material ID?

Thank you,
Nick.

On Wednesday, December 19, 2018 at 12:07:16 PM UTC-5, Daniel Arndt wrote:
>
> Chucui,
>
> the mesh you are showing degenerates close to the midpoint. This isvery 
> likely not what you wan't.
> For the inner part something like shown in 
> https://www.dealii.org/developer/doxygen/deal.II/classTransfiniteInterpolationManifold.html
> would be a good idea.
> Then for the middle part GridGenerator::hyper_cube_with_cylindrical_hole (
> https://www.dealii.org/9.0.0/doxygen/deal.II/namespaceGridGenerator.html#add14cab546d033c1eaacc9234c64ebcd
> )
> should work, you just have to make sure that the vertices align when 
> merging the two meshes via 
> GridGenerator::merge_triangulations (
> https://www.dealii.org/developer/doxygen/deal.II/namespaceGridGenerator.html#a7cd88e7eacd46697dee80ad2b8438d54
> ).
> Make sure too choose copy_manifold_ids if you are using a developer 
> version or set the manifold ids after creating and merging the whole mesh.
> Finally, for the outer part you would just merge some 
> GridGenerator::subdivided_hyper_rectangle (
> https://www.dealii.org/developer/doxygen/deal.II/namespaceGridGenerator.html#ac76417d7404b75cf53c732f456e6e971
> ).
> Again make sure that the verices align and make sure the manifold ids are 
> correct after merging all the meshes.
>
> Best,
> Daniel
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Re: How to implement GridGenerator::channel_with_cylinder?

2018-12-19 Thread Daniel Arndt
Chucui,

the mesh you are showing degenerates close to the midpoint. This isvery 
likely not what you wan't.
For the inner part something like shown in 
https://www.dealii.org/developer/doxygen/deal.II/classTransfiniteInterpolationManifold.html
would be a good idea.
Then for the middle part GridGenerator::hyper_cube_with_cylindrical_hole 
(https://www.dealii.org/9.0.0/doxygen/deal.II/namespaceGridGenerator.html#add14cab546d033c1eaacc9234c64ebcd)
should work, you just have to make sure that the vertices align when 
merging the two meshes via 
GridGenerator::merge_triangulations 
(https://www.dealii.org/developer/doxygen/deal.II/namespaceGridGenerator.html#a7cd88e7eacd46697dee80ad2b8438d54).
Make sure too choose copy_manifold_ids if you are using a developer version 
or set the manifold ids after creating and merging the whole mesh.
Finally, for the outer part you would just merge some 
GridGenerator::subdivided_hyper_rectangle 
(https://www.dealii.org/developer/doxygen/deal.II/namespaceGridGenerator.html#ac76417d7404b75cf53c732f456e6e971).
Again make sure that the verices align and make sure the manifold ids are 
correct after merging all the meshes.

Best,
Daniel

-- 
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.
For more options, visit https://groups.google.com/d/optout.