On 12/12/22 05:41, Abbas wrote:

I am solving a vector problem similar to step-8. I have aVector<double> solution with u_x and u_y at each dof. I would like to have another Vector<double> magnitude which stores the magnitude \sqrt(u_x^2+u_y^2) at each dof. Now it is clear that solution has double the size of magnitude. I need to extract the values of the magnitude vector for my weak form within the assembly loop not for post-processing.

Why do I need this? Well I don't actually want the magnitude exactly, but what I need is the maximum value of my magnitude when I iterate in time.

That sounds very much like you want to solve a nonlinear system -- for which step-15 shows you how to access this sort of information.

The point to note regarding step-15, though, is that it never actually creates a vector that stores what in your case is the magnitude. That's because the magnitude you show above is not actually a finite element field even though u_x and u_y are: Even though the latter are bilinear functions (assuming you are using a Q1 element), the magnitude is not a binlinear function. As a consequence, you don't want to compute it at each node and then interpolate it at quadrature points; rather, you want to compute it at each quadrature point from the original solutions u_x and u_y.

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 [email protected]
                           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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/de8bf7da-d265-16c9-c71c-71f3ff11f183%40colostate.edu.

Reply via email to