I think David solution is more along the lines of Shahab original question 
(at least from my understanding) :).


On Friday, 1 May 2020 09:46:58 UTC-4, David Wells wrote:
>
> Hi Shahab,
>
> You are right that vertices themselves don't store any information - this 
> is an implementation detail of deal.II (points do not store any topological 
> information in a Triangulation, unlike lines, quadrilaterals, or hexahedra).
>
> Just to check: when you write 'vertices', are you looking for information 
> about the degrees of freedom on the boundary, or are you interested in the 
> getting a list of the Point<spacedim> objects that are on the boundary? 
> What Bruno describes will do the former. If you want to do the later then 
> something like this will work:
>
> Triangulation<dim, spacedim> triangulation;
>
> // do something to set up the triangulation
>
> std::set<Point<spacedim>> boundary_vertices;
> for (const auto &face : triangulation.active_face_iterators())
>   if (face->at_boundary())
>     for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face; ++v)
>       boundary_vertices.insert(face->vertex(v));
>
> You could also store Point<spacedim> *> objects if you want to manipulate 
> the points once you have all of them.
>
> Does this answer your question? Please post again if you still need help 
> figuring this out!
>     
> Best,
> David
>
>
> On Thu, Apr 30, 2020 at 11:28 PM Bruno Blais <blais...@gmail.com 
> <javascript:>> wrote:
>
>> Dear Shahab,
>> I think the best solution (I might be wrong) is to loop through the 
>> boundary faces and acquire the DOF indices that lie on a boundary face. You 
>> could then store them in an std::map or a similar structure that prevents 
>> data duplication.
>>
>>
>> You can create a vector and store the dof indices of a face in a 
>> following fashion that I believe should work.
>> Assuming you already have a vector such as:
>> std::vector<types::global_dof_index> face_dofs;
>>
>>
>>
>>
>> In the loops within the cell then the faces, assuming you are at a face 
>> *face* and that you have a FiniteElement fe, you can do:
>> face_dofs.resize(fe.dofs_per_face);
>> face->get_dof_indices(face_dofs, cell->active_fe_index());
>>
>> This will gather all the dofs indices of that given face. If that face is 
>> a boundary face it means you have gathered all of its dofs location.
>> I hope that points you in the right direction and helps you!
>> Best
>> Bruno
>>
>>
>>
>>
>> On Thursday, 30 April 2020 23:05:31 UTC-4, Shahab Golshan wrote:
>>>
>>> Dear all,
>>> I want to find all the vertices located on boundaries. It seems the 
>>> function at_boundary() does not work for vertices (points). Do you have any 
>>> suggestions how to obtain all the vertices located on the boundaries?
>>> Best,
>>> Shahab
>>>
>> -- 
>> 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 dea...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/389defa8-9b6b-467e-a2f4-3d77abee31f0%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/dealii/389defa8-9b6b-467e-a2f4-3d77abee31f0%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/ab8072ea-0d41-4577-a346-2bebfe4a7611%40googlegroups.com.

Reply via email to