On 7/16/21 1:39 PM, shahab.g...@gmail.com wrote:

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<Tensor<1, dim>> output;
, and in this vector I've stored the output parameter in each cell using cell->global_active_cell_index().

Yes, this doesn't work. Just create Vector<double> objects for each component of the tensor and put things in there.

(Alternatively, if you like a challenge: Write a class derived from DataPostprocessorTensor in which you just ignore whatever it gets as output, and instead proceed to use as output whatever you query from your std::vector<Tensor<1,dim>> using the cell the evaluate_* function gets as argument in the input object.)

Best
 W.


--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/fb9da1d9-bcb1-1c32-df69-82ba03de8a39%40colostate.edu.

Reply via email to