postprocessing without subroutine usnpst

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
zeph67
Posts: 53
Joined: Tue Oct 23, 2012 5:54 pm

postprocessing without subroutine usnpst

Post 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.
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: postprocessing without subroutine usnpst

Post 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
Brian Angel

Re: postprocessing without subroutine usnpst

Post 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.
zeph67
Posts: 53
Joined: Tue Oct 23, 2012 5:54 pm

Re: postprocessing without subroutine usnpst

Post by zeph67 »

Thank you both for your fast and precise answers. Things are clearer to me now.

Best regards.
Post Reply