Hi Bob,

you should be able to create a `DoFAccessor` iterator object with your 
index in some way, and then call this particular function. Or you can 
iterate over all active cells, and then check for their index and store the 
corresponding dof indices in some container.

In general, I would advise you to use `CellId` objects 
<https://www.dealii.org/developer/doxygen/deal.II/classCellId.html> instead 
of pure integers to identify cells. In case you want to parallelize your 
code at some point, you will make your life a lot easier. You can also 
convert `CellId` objects easily into cell iterators using this function 
<https://www.dealii.org/developer/doxygen/deal.II/classTriangulation.html#a8e9110402bf44868c370b537e0be51e8>
.

Marc

On Tuesday, November 30, 2021 at 1:33:16 PM UTC-7 [email protected] wrote:

> Hi Marc,
>
> there's a problem: that function assumes that you do the usual 
> cell->get_dof_indices(local_to_global);
>
> In my case, I only have the integer number associated to that cell, say 
> 80, and I wanna know what are the DoFs associated to cell number 80 of my 
> triangulation. If it's not clear, I can add more context, even though I 
> don't think it's relevant.
>
> Best,
> Bob
>
> Il giorno martedì 30 novembre 2021 alle 21:11:39 UTC+1 [email protected] 
> ha scritto:
>
>> Hello Bob,
>>
>> I think the function DoFAccessor::get_dof_indices() 
>> <https://www.dealii.org/developer/doxygen/deal.II/classDoFAccessor.html#a9553dfc2e807a7bce21a950e938a3e9f>
>>  
>> is the one you are looking for.
>>
>> Its use is demonstrated in multiple tutorial programs, e.g. step-4 
>> <https://github.com/dealii/dealii/blob/93102df9ad155e27f2341c556dee73bb51010a35/examples/step-4/step-4.cc#L408>
>> .
>>
>> I hope this helps!
>> Marc
>>
>>
>> On Tuesday, November 30, 2021 at 12:36:33 PM UTC-7 [email protected] 
>> wrote:
>>
>>> Hi everyone,
>>>
>>> I'm in a strange situation at the moment. Basically, I have the number 
>>> of a cell in my triangulation, and I want to know the degrees of freedom 
>>> associated to that cell.
>>> Namely, given the integer number associated to the global cell, I'd like 
>>> to know the global numbers of the DoFs associated to that particular cell. 
>>>
>>> I looked up and down through the documentation, but I can't really find 
>>> a way to do this. 
>>> Of course, I have a DoFHandler attached to that triangulation, so as 
>>> long as there's a way to obtain the global indices, I'm fine with it.
>>>
>>> Best,
>>> Bob
>>>
>>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/255bac31-ec3e-4a1e-892d-a50f2b2f5849n%40googlegroups.com.

Reply via email to