Controlling postprocessing of time-moment field

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
vgm567
Posts: 17
Joined: Tue Oct 14, 2014 3:51 pm

Controlling postprocessing of time-moment field

Post by vgm567 »

Hi,

I would like some help with being able to deactivate postprocessing of some time-moment fields that I create in the cs_user_time_moments function in the cs_user_parameters.c file.

I am aware that the general procedure is for e.g.

Code: Select all

call field_set_key_int(f_id, keyvis, 0)
in usipes subroutine
but when i use f_id = time_moment_field_id(1) for e,g, to get the field id I get the following error at run-time

Code: Select all

cs_time_moment_get_field: Assertion `moment_id >= 0 && moment_id < _n_moments' failed
I am using v4.2.0.
I guess this is because I am placing this call in the wrong place?
Please let me know how to set this correctly. Thanks for your help,

Regards,

V. Michael
Yvan Fournier
Posts: 4082
Joined: Mon Feb 20, 2012 3:25 pm

Re: Controlling postprocessing of time-moment field

Post by Yvan Fournier »

Hello,

As the time moment API (same as for fields) is 0 to n-1 based (and not 1 to n based), if you have a single time moment, its id is 0, not 1, so the correct call to get the field id should be:

Code: Select all

f_id = time_moment_field_id(0)
Best regards,

Yvan
vgm567
Posts: 17
Joined: Tue Oct 14, 2014 3:51 pm

Re: Controlling postprocessing of time-moment field

Post by vgm567 »

Hi Yvan,

Thanks a lot for your very quick reply and pointing out the correct numbering. Actually in my case I have several time-moments (hence I want to suppress post-processing some of them).

Please could you confirm whether usipes subroutine is the correct place to put call field_set_key_int for the time-moments? (The time-moment fields are defined in the cs_user_parameters.c file.)

Cheers

V. Michael
Yvan Fournier
Posts: 4082
Joined: Mon Feb 20, 2012 3:25 pm

Re: Controlling postprocessing of time-moment field

Post by Yvan Fournier »

Hello,

Yes, it is the correct place. I checked on version 5.0, not on 4.2, which is obsolete, so there might be a bug in the 4.2.0 version (I did not check version history, as I'm answering from my phone, but I do recall some issues at some point in time.


So I recommend upgrading to 5.0, or at least the latest in the 4.2 series if you do not want to change your user setup.

Regards,

Yvan
Post Reply