:py:mod:`wolfhece.tools2d_dll` ============================== .. py:module:: wolfhece.tools2d_dll Module Contents --------------- .. py:class:: Tools2DFortran(fn_simul: str | pathlib.Path, debugmode: bool = False, path_to_dll: pathlib.Path = None) Fortran routines/functions available in "2d_cpu_tools.f90" in Wolf_OO Ref : https://docs.python.org/3/library/ctypes.html et https://gcc.gnu.org/onlinedocs/gfortran/Interoperability-with-C.html Ref : https://stackoverflow.com/questions/59330863/cant-import-dll-module-in-python .. py:method:: _list_exported_functions() Fortran routines/functions available in .. py:method:: _r2D_init() Alias for the Fortran function r2D_init. subroutine r2D_init(ptr_path, len_path) bind(C, name="r2d_init") !DEC$ ATTRIBUTES DLLEXPORT :: r2d_init type(c_ptr), value, intent(in) :: ptr_path integer(c_int), value, intent(in) :: len_path end subroutine .. py:method:: r2D_get_number_of_blocks() Alias for the Fortran function r2D_nbblocks. function r2D_nbblocks() result(nb_blocks) bind(C, name="r2D_nbblocks") !DEC$ ATTRIBUTES DLLEXPORT :: r2D_nbblocks integer(c_int) :: nb_blocks end function .. py:method:: r2D_get_header_one_block(which_block: int) Alias for the Fortran function r2D_header_block. function r2D_header_block(nbx, nby, dx,dy,ox,oy,tx,ty,which_block) result(ret) bind(C, name="r2D_header_block") !DEC$ ATTRIBUTES DLLEXPORT :: r2D_header_block !DEC$ attributes REFERENCE :: nbx, nby !DEC$ attributes REFERENCE :: dx, dy, ox, oy, tx, ty !DEC$ attributes VALUE :: which_block integer(c_int) :: nbx,nby, ret double precision :: ox,oy,tx,ty,dx,dy integer(c_int), intent(in) :: which_block end function .. py:method:: _r2D_get_header_block_python(which_block: int) -> wolfhece.wolf_array.header_wolf Return a header_wolf object with the header of the block number which_block. .. py:method:: r2D_get_header_allblocks() .. py:method:: r2D_get_shape(which_block: int) Alias for the Fortran function r2D_getsizes. subroutine r2D_getsizes(nbx,nby,which_block) bind(C, name="r2D_getsizes") !DEC$ ATTRIBUTES DLLEXPORT :: r2D_getsizes integer(c_int), intent(out) :: nbx,nby integer(c_int), intent(in) :: which_block end subroutine .. py:method:: r2D_get_number_of_results() Alias for the Fortran function r2D_getnbresults. function r2D_getnbresults() result(nb) bind(C, name="r2D_getnbresults") !DEC$ ATTRIBUTES DLLEXPORT :: r2D_getnbresults integer(c_int) :: nb end function .. py:method:: r2D_get_one_result(which: int, which_block: int) Alias for the Fortran function r2D_getresults. subroutine r2D_getresults(which,nbx,nby,waterdepth,qx,qy,which_block) bind(C, name="r2D_getresults") !DEC$ ATTRIBUTES DLLEXPORT :: r2D_getresults integer(c_int), intent(in) :: nbx,nby,which integer(c_int), intent(in) :: which_block real, dimension(nbx,nby), intent(out) :: waterdepth,qx,qy end subroutine .. py:method:: r2D_get_one_turbulent_result(which: int, which_block: int) Alias for the Fortran function r2D_getturbresults. subroutine r2D_getturbresults(which,nbx,nby,k,e,which_block) bind(C, name="r2D_getturbresults") !DEC$ ATTRIBUTES DLLEXPORT :: r2D_getturbresults integer(c_int), intent(in) :: nbx,nby,which integer(c_int), intent(in) :: which_block real, dimension(nbx,nby), intent(out) :: k,e end subroutine .. py:method:: r2D_get_times_steps() Alias for the Fortran function get_times_steps. subroutine get_times_steps(times, steps, nb) bind(C, name="get_times_steps") !DEC$ ATTRIBUTES DLLEXPORT :: r2D_gettimes_steps integer(c_int), intent(in) :: nb real, dimension(nb), intent(out) :: times integer, dimension(nb), intent(out) :: steps end subroutine .. py:method:: r2D_create_convergence_border(vec: str = '', simtype: int = 0, res: str = '', cutcell: str = '') Alias for the Fortran function get_conv_border. subroutine get_conv_border(ptr_fnsim, ptr_fnvec, simul_type, ptr_fnres, ptr_fncut, len_fnsim, len_fnvec, len_fnres, len_fncut) bind(C, name="get_conv_border") !DEC$ ATTRIBUTES DLLEXPORT :: r2D_get_conv_border type(c_ptr), value, intent(in) :: ptr_fnsim, ptr_fnvec, ptr_fnres, ptr_fncut integer(c_int), value, intent(in) :: len_fnsim, len_fnvec, len_fnres, len_fncut end subroutine