Page 1 of 1

Gradient of user computed field

Posted: Wed Jun 01, 2016 9:45 am
by ArnauMiro
Hello,

I have a field I have computed in the subroutine usvpst. I would like to perform the gradient of such field. However, the field_gradient_scalar and the field_gradient_vector subroutines require a field ID to be inputed (instead of the values of the field). I have seen that user defined fields can be created but as far as I know they are transported, which I don't want. Just to compute the field in usvpst, perform the gradient and save it.

Is there a way to perform such operation?

Thanks for your help.

Kind regards,

Re: Gradient of user computed field

Posted: Thu Jun 02, 2016 10:40 pm
by Yvan Fournier
Hello,

For fields that do not represent resolved variables, the only solution for this is to use the "low level" functions, for which you need to define variable condition arrays...

Check src/alge/cs_gradient.h in the sources, or the Doxyhen documentation (not sure how far it goes into details) for examples.

Regards,

Yvan

Re: Gradient of user computed field

Posted: Tue Jun 07, 2016 12:07 pm
by ArnauMiro
Hello Yvan,

Thanks for your quick reply. I've taken a look at the cs_gradients.h file and it seems complicated to implement...

For the moment, I think I will use Paraview's filter implementation.

Thanks for your help.