How to extract values from indexed object?

I used split function to split a function u_n into three different parts named as n, p and V as the example of “A system of advection–diffusion–reaction equations”. I would like to extract the values of the p part. I tried to use p.vector().get_local() to extract the values, but I got an error message ‘Indexed’ object has no attribute ‘vector’. How could I get the values?

1 Like

You Need to create a deepcopy, see: Access to the velocity field components - #2 by dokken

It works! Thank you!