[deal.II] Writing outputs of type tensor in cells

2021-07-16 Thread shahab.g...@gmail.com
Dear All,

I have a parameter of type Tensor<1, dim> for each active cell in the 
triangulation. When I write this parameter as output, I face some 
difficulties:
1, Vectors in deal.II do not accept tensor elements.
2, add_data_vector does not work for std::vectors.
3, I tried using DataComponentInterpretation, but I am really confused in 
implementing it correctly.

I would appreciate it if you could send me an example of writing an output 
of type Tensor for each cell. Let's say I have a 
std::vector> output;
, and in this vector I've stored the output parameter in each cell using  
cell->global_active_cell_index(). 

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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/58aef5ba-eaa5-4a27-9ae8-64f56d742adbn%40googlegroups.com.


Re: [deal.II] How to add 2nd iterator to MeshWorker::mesh_loop ?

2021-07-16 Thread Sylvain Mathonnière
Adding the & did the trick indeed. Thank you. Thank you as well for the FAQ 
entry on this. I completely overlooked it...

Best,

Sylvain

El viernes, 16 de julio de 2021 a la(s) 07:22:25 UTC+2, Jean-Paul Pelteret 
escribió:

> To add to what Wolfgang has already said, there’s this entry in our FAQ on 
> this topic:
>
> https://github.com/dealii/dealii/wiki/Frequently-Asked-Questions#can-i-convert-triangulation-cell-iterators-to-dofhandler-cell-iterators
>
>
> On 15. Jul 2021, at 17:31, Wolfgang Bangerth  
> wrote:
>
> On 7/15/21 2:45 AM, Sylvain Mathonnière wrote:
>
> *typenameDoFHandler::active_cell_iteratorcell_2 
> (cell_1->get_triangulation(), 
> cell_1->level(), cell_1->index(), dof_handler_2);*
>
>
> The compiler error tells you that you need pointers, not references. So 
> this should work:
>
>  typename DoFHandler::active_cell_iterator
> cell_2 (_1->get_triangulation(), cell_1->level(), cell_1->index(),
> _handler_2);
>
> Best
> W.
>
> -- 
> 
> Wolfgang Bangerth  email: bang...@colostate.edu
>   www: http://www.math.colostate.edu/~bangerth/
>
> -- 
> 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+un...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/53c90809-04b1-c2f0-3d35-ec11726fa46f%40colostate.edu
> .
>
>
>

-- 
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/d664107d-cc5d-4f26-a543-86c16a6508fdn%40googlegroups.com.