Thanks a lot Marc, now it compiles. Without your help it wouldn't have been possible.
Best, Bob Il giorno martedì 30 novembre 2021 alle 23:37:36 UTC+1 mafe...@gmail.com ha scritto: > You can convert your Triangulation::cell_iterators into a > DoFHandler::cell_iterators. An example is shown here > <https://github.com/dealii/dealii/blob/73c87d96ef8db201186fe7d4c6f85a7be729e043/source/distributed/solution_transfer.cc#L355-L356> > . > > Marc > > On Tuesday, November 30, 2021 at 3:30:49 PM UTC-7 vef...@gmail.com wrote: > >> Thanks Marc for your answer. >> >> I should have given more context, as maybe in this particular case things >> can be simpler. I'm using compute_point_locations() >> <https://www.dealii.org/current/doxygen/deal.II/namespaceGridTools.html#a8e8bb9211264d2106758ac4d7184117e> >> and >> so in my code I have: >> >> *auto cmp = >> GridTools::compute_point_locations(*cache,fe_emb_values.get_quadrature_points()); >> >> //returns a tuple* >> *auto cells = std::get<0>(cmp); * >> >> the type of *cells *is *Triangulation< dim, spacedim >> >::active_cell_iterator. * >> >> In this particular case, is there any straightforward way to get the dofs >> indices for each cell in *cells*? Or should I follow one of those you >> gave me in your last answer? >> >> Best, >> Bob >> >> Il giorno martedì 30 novembre 2021 alle 22:51:30 UTC+1 mafe...@gmail.com >> ha scritto: >> >>> 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 vef...@gmail.com >>> 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 >>>> mafe...@gmail.com 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 vef...@gmail.com >>>>> 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 dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/264e175c-e25f-4af4-b722-b5378cb72972n%40googlegroups.com.