I am facing a problem when trying to use standard user routines :
cs_user_extra_operations.c. : code_saturne stops at the compilation stage. Note that the routine is as provided by code_saturne, i.e empty.
Additional tests have been made with the cs_user_head_losses.c routine. In that case the standard routine is compiled but not called by the code during the CFD model solving process. In deed no change on the results are observed. Moreover, adding this line
bft_printf(" I AM HERE");
outside of the cell loop has no effect
The problem appears with code_saturne 6.0.2 as well as 6.0.4.
code_saturne has been installed on a fresh installation of ubuntu 18.04 LTS
code_saturne seems to complain due to C reading. At the installation step the C compiler is left by default:
compC /usr/bin/cc
mpiCompC /usr/bin/mpicc
Thanks in advance for your help.
Compilation error message
/home/user/Desktop/saturne/newCases/45/RESU/20200709-1200/src/cs_meg_boundary_function.c: In function ‘cs_meg_boundary_function’:
/home/user/Desktop/saturne/newCases/45/RESU/20200709-1200/src/cs_meg_boundary_function.c:49:17: warning: unused variable ‘f_id’ [-Wunused-variable]
cs_lnum_t f_id = zone->elt_ids[e_id];
^~~~
/home/user/Desktop/saturne/newCases/45/RESU/20200709-1200/src/cs_meg_initialization.c: In function ‘cs_meg_initialization’:
/home/user/Desktop/saturne/newCases/45/RESU/20200709-1200/src/cs_meg_initialization.c:47:17: warning: unused variable ‘c_id’ [-Wunused-variable]
cs_lnum_t c_id = zone->elt_ids[e_id];
^~~~
/home/user/Desktop/saturne/newCases/45/RESU/20200709-1200/src/cs_user_extra_operations.c:111:1: error: conflicting types for ‘cs_user_extra_operations’
cs_user_extra_operations(void)
^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/user/Desktop/saturne/newCases/45/RESU/20200709-1200/src/cs_user_extra_operations.c:68:0:
/home/user/Code_Saturne/6.0.2/code_saturne-6.0.2/arch/Linux_x86_64/include/code_saturne/cs_prototypes.h:330:1: note: previous declaration of ‘cs_user_extra_operations’ was here
cs_user_extra_operations(cs_domain_t *domain);
Could you post your user files ? It seems you may have tried to use a file from an older version of the code (in which the "domain" argument did not exist ?
Also, did you compile the code in all cases or do you have an Ubunti code_saturne package installed ? The Ubuntu package may be buggy (https://bugs.launchpad.net/ubuntu/+sour ... ug/1672585), so you need to remove it if you hve that installed.
Thank you for your quick answer. Please find attached a test case. This test case has not been built from an old case.
code_saturne has been compiled from source (using the python script).
Thank you for your answer. In deed, using newer version of the routine make things easier. The compiler is now ok but routines are still not called during the CFD process (printf test).
Would you recommend to change Lunix distribution ? If it's the case what would be the best (free) distribution from your point of view ?
Could you try with version 6.0.4 instead of 6.0.2 first (there is a modification intended to help with this).
Also, could you post the output of "ldd" on the cs_solver file present in the execution directory during the computation (removed at the end, unless you use "initialize only" on the run setup in the GUI and start the code manually) ?
I just remembered there is one last thing to check:
if you prepare the case and run in "initialize only" mode (same as for ldd) and check the "run_solver" script (with any text editor), you will either have a line containing the full path of cs_solver, or "./cs_solver".
In the first case, that would mean the script uses the wring executable (I have seen it in only one case, but in this case, the solution is quite different/simple). If you have "./cs_solver", it really means there is an issue with the user functions (though you may double -check, as the "print" statements might appear in the "listing" file or the terminal).
If this still fails, any other distribution should do, though I am most familiar with Debian and Arch besides Ubuntu (Debian at work, Arch at home), and have some experience with Red Hat or CentOS.
Checking again the previous logs, did you test placing "bft_printf" in another file/function such as cs_user_parameters ?
Note that for cs_user_head_losses, the function is called once for each zone defined as having head losses (in the gui or in cs_user_zones). So if you did not define appropriate zones, and tag them for head losses, the behavior might be normal.