code-saturne / code_saturne

code_saturne public mirror
https://www.code-saturne.org
GNU General Public License v2.0
223 stars 82 forks source link

[trunk] - Last probe output gives t=0 #10

Closed mathrack closed 6 years ago

mathrack commented 6 years ago

Dear users, developers,

I have set some probes but the last output indicates a time of zero. Attached is the source code used. Last lines of a probe file are:

2.4999970e+04  1.6279829e-05  5.1123789e-05  5.6239926e-06  5.8274681e-07
2.4999980e+04  1.8933431e-05  5.2770401e-05  4.5013857e-06  6.1810132e-07
2.4999990e+04  2.2249430e-05  5.1205274e-05  3.6415957e-06  6.5100707e-07
0.0000000e+00  2.6026189e-05  4.6779131e-05  3.1253508e-06  6.8056081e-07

cs_user_postprocess.c.gz

Thanks, Cedric

EDIT: the issue was not observed on 5.0 but on https://github.com/code-saturne/code_saturne/commit/02f8dec5fafb5549fd55edd5bbf57a8826acd574

mathrack commented 6 years ago

After reviewing the code, this might be related to the line below in cs_user_postprocess_values?

const cs_time_step_t *ts_post = (ts->nt_cur == ts->nt_max) ? NULL : ts;
YvanFournier commented 6 years ago

Hello,

Yes, this is the error in your setup.

You should simply use ts instead of ts_post, as your definition of ts_post is NULL on the last time step, leading to the zero value you observe.