Dear Judy, On Tue, Dec 7, 2021, at 11:45 CST, Judy Lee <reader.judy...@gmail.com> wrote:
> cell_x(i) += fe_values.shape_value(i, q_index) * x(i); Here, you are multiplying a scalar (fe_values.shape_value(i, q_index)) and a rank-1 tensor (x(i)), which results in a rank-1 tensor. The error message says that you cannot store this rank-1 tensor in cell_x(i), which is a scalar (vector<double>). I don't know whether this is what you want to do, but in 1D you can simply take the first value of your rank-1 tensor to transform the expression into a scalar: cell_x(i) += fe_values.shape_value(i, q_index) * x(i)[0]; However, this is not a good "dimension independent" approach, meaning the moment you try to solve in 2D or 3D you will have to modify your code. Best, Matthias -- 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/87ilw06yr0.fsf%4043-1.org.