i-RIC/iriclib_v4

API improvement to make the functions clear from names

Closed this issue · 1 comments

Currently, functions of cg_iRIC_Write_Sol_Time() and cg_iRIC_Write_Sol_Iteration() that iRIClib provide are different from those assumed from names. They output values of time or iteration, but it also creates new CGNS files (result/Solution1.cgn etc).

To make the functions of APIs more clear, add cg_iRIC_Write_Sol_Start(), that creates result/Solution1.cgn etc., and change the implementation of cg_iRIC_Write_Sol_Time() and cg_iRIC_Write_Sol_Iteration() so that they just implement the functions that can be assumed from name: just outputting time or iteration.

To make the API looks natural, rename cg_iRIC_Flush() to cg_iRIC_Write_Sol_End(), so that it will be clear to user that it should be called at the position that all function calls for outputting are finished.

After the improvement, the code to output calculation result will be like below (in FORTRAN):

call cg_iric_write_sol_start(fid)
call cg_iric_write_sol_time(fid, time)

(calls to cg_iric_write_sol_node_integer etc., to output values)

call cg_iric_write_sol_end(fid)

Hi Scott,

Thank you for your quick review and merging the pull request!

Thanks,
Keisuke