Page 1 of 1

postprocessing without subroutine usnpst

Posted: Tue Apr 15, 2014 11:19 am
by zeph67
Hello,

I am using Code_Saturne 3.0

In former versions, imposing arbitrary values of ntcabs or ttcabs (for postprocessing outputs) was possible with usnpst.F

Now, as I understand, the function cs_user_postprocess_activate of routine cs_user_postprocess.c seems to handle that.

The problem is that I don't understand the way it works.
For example, if I'd like to activate for ntcabs=145,317 and 982, how would I do ??

Thanks in advance.

Re: postprocessing without subroutine usnpst

Posted: Tue Apr 15, 2014 1:40 pm
by Yvan Fournier
Hello,

The cs_user_postprocess_activate routine should contain an example, which is similar to that of the old routine. ntcabs is replaced by nt_cur_abs, and ttcabs by t_cur_abs (longer versions of the same).

The only additional difference is that you can specify a writer to activate (when using multiple outputs), or activate all. If in doubt, you probably don't need fine grained control, so just activate all writers, using id 0 (ids < 0 are for automatic writers, > 0 for user-defiend writers).

Best regards,

Yvan

Re: postprocessing without subroutine usnpst

Posted: Tue Apr 15, 2014 2:53 pm
by Brian Angel
Hello,

I see that Yvan has just posted but I've posted this as well. When comparing previous and current versions:

ntcabs = nt_cur_abs = current time step number
ttcabs = t_cur_abs = current physical time

So, in the function cs_user_postprocess_activate you could, for example, code the following:

if (nt_cur_abs == 145)
{
your C coding here;
}

Please remember to remove or comment out the "if (false)" statement.

Best regards,

Brian Angel.

Re: postprocessing without subroutine usnpst

Posted: Tue Apr 15, 2014 3:53 pm
by zeph67
Thank you both for your fast and precise answers. Things are clearer to me now.

Best regards.