On 6/6/23 15:46, Tao Jin wrote:

However, the above copy_to() function only works when the tensor dimension is less or equal to 3, that is,
Tensor<2, dim>, dim <=3.
When dim is larger than 3, I have to use for loops to copy each matrix entry into the rank-2 tensor.

What happens for dim>3? You only say "it only works when", but you don't describe what goes wrong if dim>3?


I know that it is typical to set dim as 2 or 3. However, does it make sense to make FullMatrix::copy_to() work for a general rank-2 tensor?

I see no reason why this should not work. The function is implemented in the full_matrix.h file, so I believe it should just work if you call the function on tensors that are larger than 3x3.

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/94437b6a-de3e-e0f1-a137-1834ce33b772%40colostate.edu.

Reply via email to