diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8edda25 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Auto-generated files +Cgismo.h \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index fd0f0c4..08ea229 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,25 +6,9 @@ project(gsCInterface LANGUAGES CXX) -include(CheckLanguage) -check_language(Fortran) -if(CMAKE_Fortran_COMPILER AND NOT NOFORTRAN) - enable_language(Fortran) - include(FortranCInterface) - FortranCInterface_VERIFY(CXX) -else() - message(STATUS "No Fortran support") -endif() - # Apply G+Smo config include(gsConfig) -if ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) -# set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -names lowercase") -elseif ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /names:lowercase") -endif() - ## Collect files aux_header_directory(${CMAKE_CURRENT_SOURCE_DIR}/src ${PROJECT_NAME}_H) aux_cpp_directory (${CMAKE_CURRENT_SOURCE_DIR}/src ${PROJECT_NAME}_CPP) @@ -39,8 +23,7 @@ endif() # Compile statically the extension add_library(${PROJECT_NAME} OBJECT ${${PROJECT_NAME}_H} - ${${PROJECT_NAME}_CPP} - src/Fgismo.F90 ) + ${${PROJECT_NAME}_CPP}) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_DEFINITIONS gismo_EXPORTS @@ -61,10 +44,6 @@ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/" add_gismo_executable(${CMAKE_CURRENT_SOURCE_DIR}/examples/basis_cexample.c) add_gismo_executable(${CMAKE_CURRENT_SOURCE_DIR}/examples/geometry_cexample.c) -if(CMAKE_Fortran_COMPILER AND NOT NOFORTRAN) - add_gismo_executable(${CMAKE_CURRENT_SOURCE_DIR}/examples/geometry_fexample.F90) -endif() - add_custom_target(C_plugins) # Add submodules to Cgismo.h diff --git a/src/Fgismo.F90 b/src/Fgismo.F90 deleted file mode 100644 index 88447b8..0000000 --- a/src/Fgismo.F90 +++ /dev/null @@ -1,747 +0,0 @@ - -module Fgismo - use, intrinsic :: iso_c_binding - implicit none - private - -# include "gismo.ifc" - - public t_gsvector - public t_gsvectorint - public t_gsmatrix - public t_gsfunctionset - public t_gsgeometry - public t_gsgeometrytransform - - ! functions from gsCVector.ifc: - public f_gsvector_create - public f_gsvector_create_rd - public f_gsvector_print - public f_gsvector_rows - public f_gsvector_cols - public f_gsvector_data - public f_gsvector_delete - public f_gsvector_update_data_ptr - - ! functions from gsCVectorInt.ifc: - public f_gsvectorint_create - public f_gsvectorint_create_rd - public f_gsvectorint_print - public f_gsvectorint_rows - public f_gsvectorint_cols - public f_gsvectorint_data - public f_gsvectorint_delete - public f_gsvectorint_update_data_ptr - - ! functions from gsCMatrix.ifc: - public f_gsmatrix_create - public f_gsmatrix_create_rc - public f_gsmatrix_create_rcd - public f_gsmatrix_print - public f_gsmatrix_rows - public f_gsmatrix_cols - public f_gsmatrix_data - public f_gsmatrix_delete - public f_gsmatrix_update_data_ptr - - ! functions from gsCFunctionSet.ifc: - public f_gsfunctionset_delete - public f_gsfunctionset_print - public f_gsfunctionset_domaindim - public f_gsfunctionset_eval_into - public f_gsfunctionset_deriv_into - - ! functions from gsCReadFile.ifc: - public f_gscreadfile - - ! functions from gsCGeometry.ifc: - public f_gsgeometry_delete - public f_gsgeometry_print - public f_gsgeometry_recoverpoints - public f_gsgeometry_recoverpointgrid - public f_gsgeometry_eval_into - public f_gsgeometry_deriv_into - - ! functions from gsCGeometryTransform.ifc: - public f_gsgeometrytransform_create - public f_gsgeometrytransform_delete - public f_gsgeometrytransform_print - public f_gsgeometrytransform_recoverpoints - public f_gsgeometrytransform_recoverpointgrid - public f_gsgeometrytransform_eval_into - public f_gsgeometrytransform_deriv_into - -!------------------------------------------------------------------------------------------------------------ - - type :: t_gsvector - type(C_PTR) :: c_vec ! C/C++ gsVector object - real(C_DOUBLE), dimension(:), pointer :: data => NULL() ! link to array in C/C++ gsVector - end type t_gsvector - -!------------------------------------------------------------------------------------------------------------ - - type :: t_gsvectorint - type(C_PTR) :: c_vec ! C/C++ gsVector object - real(C_INT), dimension(:), pointer :: data => NULL() ! link to array in C/C++ gsVector - end type t_gsvectorint - -!------------------------------------------------------------------------------------------------------------ - - type :: t_gsmatrix - type(C_PTR) :: c_mat ! C/C++ gsMatrix object - real(C_DOUBLE), dimension(:,:), pointer :: data => NULL() ! link to array in C/C++ gsMatrix - end type t_gsmatrix - -!------------------------------------------------------------------------------------------------------------ - - type :: t_gsfunctionset - type(C_PTR) :: c_fs ! C/C++ gsFunctionSet object - end type t_gsfunctionset - -!------------------------------------------------------------------------------------------------------------ - - type, extends(t_gsfunctionset) :: t_gsgeometry ! C/C++ gsGeometry object - end type t_gsgeometry - - ! define delete, print, eval_into --> functionset_delete, print, eval_into - interface f_gsgeometry_delete - module procedure f_gsfunctionset_delete - end interface - interface f_gsgeometry_print - module procedure f_gsfunctionset_print - end interface - interface f_gsgeometry_eval_into - module procedure f_gsfunctionset_eval_into - end interface - interface f_gsgeometry_deriv_into - module procedure f_gsfunctionset_deriv_into - end interface - -!------------------------------------------------------------------------------------------------------------ - - type, extends(t_gsgeometry) :: t_gsgeometrytransform ! C/C++ gsGeometryTransform object - end type t_gsgeometrytransform - - ! define delete, print, eval_into --> geometry_delete, print, eval_into - interface f_gsgeometrytransform_delete - module procedure f_gsfunctionset_delete - end interface - interface f_gsgeometrytransform_print - module procedure f_gsfunctionset_print - end interface - interface f_gsgeometrytransform_eval_into - module procedure f_gsfunctionset_eval_into - end interface - interface f_gsgeometrytransform_deriv_into - module procedure f_gsfunctionset_deriv_into - end interface - interface f_gsgeometrytransform_recoverpoints - module procedure f_gsgeometry_recoverpoints - end interface - interface f_gsgeometrytransform_recoverpointgrid - module procedure f_gsgeometry_recoverpointgrid - end interface - -!------------------------------------------------------------------------------------------------------------ - -contains - -!------------------------------------------------------------------------------------------------------------ -! wrap functions from gsCVector.ifc: -!------------------------------------------------------------------------------------------------------------ - -function f_gsvector_create() result(f_vec) -!--purpose: create empty gsvector object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvector_create -#endif - implicit none -!--function result: - type(t_gsvector) :: f_vec - - f_vec%c_vec = gsVector_create() - call f_gsvector_update_data_ptr( f_vec ) - -end function f_gsvector_create - -!------------------------------------------------------------------------------------------------------------ - -function f_gsvector_create_rd(nrows, data) result(f_vec) -!--purpose: create gsvector object from input data -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvector_create_rd -#endif - implicit none -!--function result: - type(t_gsvector) :: f_vec -!--function arguments: - integer(C_INT) :: nrows - real(C_DOUBLE), dimension(:) :: data - - f_vec%c_vec = gsVector_create_rd(nrows, data) - call f_gsvector_update_data_ptr( f_vec ) - -end function f_gsvector_create_rd - -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gsvector_print(f_vec) -!--purpose: print contents of gsvector object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvector_print -#endif - implicit none -!--subroutine arguments: - type(t_gsvector) :: f_vec - - call gsVector_print(f_vec%c_vec) -!-- write(*,*) ! flush stdout(?) -end subroutine f_gsvector_print - -!------------------------------------------------------------------------------------------------------------ - -function f_gsvector_rows(f_vec) result(nrows) -!--purpose: get number of rows from gsvector object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvector_rows -#endif - implicit none -!--function result: - integer(C_INT) :: nrows -!--function arguments: - type(t_gsvector) :: f_vec - - nrows = gsVector_rows(f_vec%c_vec) -end function f_gsvector_rows - -!------------------------------------------------------------------------------------------------------------ - -function f_gsvector_cols(f_vec) result(ncols) -!--purpose: get number of columns from gsvector object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvector_cols -#endif - implicit none -!--function result: - integer(C_INT) :: ncols -!--function arguments: - type(t_gsvector) :: f_vec - - ncols = gsVector_cols(f_vec%c_vec) -end function f_gsvector_cols - -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gsvector_update_data_ptr(f_vec) -!--purpose: reconnect f_vec%data after possible (re)allocation in C/C++ -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvector_update_data_ptr -#endif - implicit none -!--subroutine arguments: - type(t_gsvector) :: f_vec -!--local variables: - integer(C_INT) :: nrows - - nrows = gsVector_rows(f_vec%c_vec) - if (nrows.le.0) then - f_vec%data => NULL() - else - call C_F_POINTER( gsVector_data(f_vec%c_vec), f_vec%data, (/ nrows /)) - endif -end subroutine f_gsvector_update_data_ptr - -!------------------------------------------------------------------------------------------------------------ - -function f_gsvector_data(f_vec) result(f_data_ptr) -!--purpose: get pointer to data array of a gsvector object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvector_data -#endif - implicit none -!--function result: - real(C_DOUBLE), dimension(:), pointer :: f_data_ptr -!--function arguments: - type(t_gsvector) :: f_vec - - call f_gsvector_update_data_ptr(f_vec) - f_data_ptr => f_vec%data -end function f_gsvector_data - -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gsvector_delete(f_vec) -!--purpose: destroy a gsvector object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvector_delete -#endif -!--subroutine arguments: - type(t_gsvector) :: f_vec - - call gsVector_delete(f_vec%c_vec) - nullify(f_vec%data) -end subroutine f_gsvector_delete - -!------------------------------------------------------------------------------------------------------------ -! wrap functions from gsCVectorInt.ifc: -!------------------------------------------------------------------------------------------------------------ - -function f_gsvectorint_create() result(f_vec) -!--purpose: create empty vectorint object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvectorint_create -#endif - implicit none -!--function result: - type(t_gsvectorint) :: f_vec - - f_vec%c_vec = gsVectorInt_create() - call f_gsvectorint_update_data_ptr( f_vec ) - -end function f_gsvectorint_create - -!------------------------------------------------------------------------------------------------------------ - -function f_gsvectorint_create_rd(nrows, data) result(f_vec) -!--purpose: create vectorint object from input data -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvectorint_create_rd -#endif - implicit none -!--function result: - type(t_gsvectorint) :: f_vec -!--function arguments: - integer(C_INT) :: nrows - integer(C_INT), dimension(:) :: data - - f_vec%c_vec = gsVectorInt_create_rd(nrows, data) - call f_gsvectorint_update_data_ptr( f_vec ) - -end function f_gsvectorint_create_rd - -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gsvectorint_print(f_vec) -!--purpose: print contents of vectorint object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvectorint_print -#endif - implicit none -!--subroutine arguments: - type(t_gsvectorint) :: f_vec - - call gsVectorInt_print(f_vec%c_vec) -!-- write(*,*) ! flush stdout(?) -end subroutine f_gsvectorint_print - -!------------------------------------------------------------------------------------------------------------ - -function f_gsvectorint_rows(f_vec) result(nrows) -!--purpose: get number of rows from vectorint object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvectorint_rows -#endif - implicit none -!--function result: - integer(C_INT) :: nrows -!--function arguments: - type(t_gsvectorint) :: f_vec - - nrows = gsVectorInt_rows(f_vec%c_vec) -end function f_gsvectorint_rows - -!------------------------------------------------------------------------------------------------------------ - -function f_gsvectorint_cols(f_vec) result(ncols) -!--purpose: get number of columns from vectorint object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvectorint_cols -#endif - implicit none -!--function result: - integer(C_INT) :: ncols -!--function arguments: - type(t_gsvectorint) :: f_vec - - ncols = gsVectorInt_cols(f_vec%c_vec) -end function f_gsvectorint_cols - -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gsvectorint_update_data_ptr(f_vec) -!--purpose: reconnect f_vec%data after possible (re)allocation in C/C++ -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvectorint_update_data_ptr -#endif - implicit none -!--subroutine arguments: - type(t_gsvectorint) :: f_vec -!--local variables: - integer(C_INT) :: nrows - - nrows = gsVectorInt_rows(f_vec%c_vec) - if (nrows.le.0) then - f_vec%data => NULL() - else - call C_F_POINTER( gsVectorInt_data(f_vec%c_vec), f_vec%data, (/ nrows /)) - endif -end subroutine f_gsvectorint_update_data_ptr - -!------------------------------------------------------------------------------------------------------------ - -function f_gsvectorint_data(f_vec) result(f_data_ptr) -!--purpose: get pointer to data array of a vectorint object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvectorint_data -#endif - implicit none -!--function result: - real(C_INT), dimension(:), pointer :: f_data_ptr -!--function arguments: - type(t_gsvectorint) :: f_vec - - call f_gsvectorint_update_data_ptr(f_vec) - f_data_ptr => f_vec%data -end function f_gsvectorint_data - -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gsvectorint_delete(f_vec) -!--purpose: destroy a vectorint object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsvectorint_delete -#endif -!--subroutine arguments: - type(t_gsvectorint) :: f_vec - - call gsVectorInt_delete(f_vec%c_vec) - nullify(f_vec%data) -end subroutine f_gsvectorint_delete - -!------------------------------------------------------------------------------------------------------------ -! wrap functions from gsCMatrix.ifc: -!------------------------------------------------------------------------------------------------------------ - -function f_gsmatrix_create() result(f_mat) -!--purpose: create empty gsmatrix object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsmatrix_create -#endif - implicit none -!--function result: - type(t_gsmatrix) :: f_mat - - f_mat%c_mat = gsMatrix_create() - call f_gsmatrix_update_data_ptr( f_mat ) - -end function f_gsmatrix_create - -!------------------------------------------------------------------------------------------------------------ - -function f_gsmatrix_create_rc(nrows, ncols) result(f_mat) -!--purpose: create gsmatrix object with given size -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsmatrix_create_rc -#endif - implicit none -!--function result: - type(t_gsmatrix) :: f_mat -!--function arguments: - integer(C_INT) :: nrows, ncols - - f_mat%c_mat = gsMatrix_create_rc(nrows, ncols) - call f_gsmatrix_update_data_ptr( f_mat ) - -end function f_gsmatrix_create_rc - -!------------------------------------------------------------------------------------------------------------ - -function f_gsmatrix_create_rcd(nrows, ncols, data) result(f_mat) -!--purpose: create gsmatrix object from input data -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsmatrix_create_rcd -#endif - implicit none -!--function result: - type(t_gsmatrix) :: f_mat -!--function arguments: - integer(C_INT) :: nrows, ncols - real(C_DOUBLE), dimension(:,:) :: data - - f_mat%c_mat = gsMatrix_create_rcd(nrows, ncols, data) - call f_gsmatrix_update_data_ptr( f_mat ) - -end function f_gsmatrix_create_rcd - -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gsmatrix_print(f_mat) -!--purpose: print contents of gsmatrix object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsmatrix_print -#endif - implicit none -!--subroutine arguments: - type(t_gsmatrix) :: f_mat - - call gsMatrix_print(f_mat%c_mat) -!-- write(*,*) ! flush stdout(?) -end subroutine f_gsmatrix_print - -!------------------------------------------------------------------------------------------------------------ - -function f_gsmatrix_rows(f_mat) result(nrows) -!--purpose: get number of rows from gsmatrix object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsmatrix_rows -#endif - implicit none -!--function result: - integer(C_INT) :: nrows -!--function arguments: - type(t_gsmatrix) :: f_mat - - nrows = gsMatrix_rows(f_mat%c_mat) -end function f_gsmatrix_rows - -!------------------------------------------------------------------------------------------------------------ - -function f_gsmatrix_cols(f_mat) result(ncols) -!--purpose: get number of columns from gsmatrix object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsmatrix_cols -#endif - implicit none -!--function result: - integer(C_INT) :: ncols -!--function arguments: - type(t_gsmatrix) :: f_mat - - ncols = gsMatrix_cols(f_mat%c_mat) -end function f_gsmatrix_cols - -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gsmatrix_update_data_ptr(f_mat) -!--purpose: reconnect f_mat%data after possible (re)allocation in C/C++ -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsmatrix_update_data_ptr -#endif - implicit none -!--subroutine arguments: - type(t_gsmatrix) :: f_mat -!--local variables: - integer(C_INT) :: nrows, ncols - - nrows = gsMatrix_rows(f_mat%c_mat) - ncols = gsMatrix_cols(f_mat%c_mat) - if (nrows.le.0 .or. ncols.le.0) then - f_mat%data => NULL() - else - call C_F_POINTER( gsMatrix_data(f_mat%c_mat), f_mat%data, (/ nrows, ncols /)) - endif -end subroutine f_gsmatrix_update_data_ptr - -!------------------------------------------------------------------------------------------------------------ - -function f_gsmatrix_data(f_mat) result(f_data_ptr) -!--purpose: get pointer to data array of a gsmatrix object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsmatrix_data -#endif - implicit none -!--function result: - real(C_DOUBLE), dimension(:,:), pointer :: f_data_ptr -!--function arguments: - type(t_gsmatrix) :: f_mat - - call f_gsmatrix_update_data_ptr(f_mat) - f_data_ptr => f_mat%data -end function f_gsmatrix_data - -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gsmatrix_delete(f_mat) -!--purpose: destroy a gsmatrix object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsmatrix_delete -#endif -!--subroutine arguments: - type(t_gsmatrix) :: f_mat - - call gsMatrix_delete(f_mat%c_mat) - nullify(f_mat%data) -end subroutine f_gsmatrix_delete - -!------------------------------------------------------------------------------------------------------------ -! wrap functions of gsCFunctionSet.ifc: -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gsfunctionset_delete(f_fs) -!--purpose: destroy a gsfunctionset object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsfunctionset_delete -#endif -!--subroutine arguments: - class(t_gsfunctionset) :: f_fs - - call gsFunctionSet_delete(f_fs%c_fs) -end subroutine f_gsfunctionset_delete - -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gsfunctionset_print(f_fs) -!--purpose: print contents of a gsfunctionset object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsfunctionset_print -#endif -!--subroutine arguments: - class(t_gsfunctionset) :: f_fs - - call gsfunctionset_print(f_fs%c_fs) -end subroutine f_gsfunctionset_print - -!------------------------------------------------------------------------------------------------------------ - -function f_gsfunctionset_domaindim(f_fs) result(domdim) -!--purpose: get domain dimension of a gsfunctionset object -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsfunctionset_domaindim -#endif -!--function result: - integer(C_INT) :: domdim -!--function arguments: - class(t_gsfunctionset) :: f_fs - - domdim = gsfunctionset_domaindim(f_fs%c_fs) -end function f_gsfunctionset_domaindim - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT int gsFunctionSet_targetDim(gsCFunctionSet * fs); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCMatrix* gsFunctionSet_support(gsCFunctionSet * fs); - -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gsfunctionset_eval_into(f_fs, f_uv, f_result) -!--purpose: evaluate gsfunctionset object at parameter values uv into result matrix -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsfunctionset_eval_into -#endif -!--subroutine arguments: - class(t_gsfunctionset) :: f_fs - type(t_gsmatrix) :: f_uv, f_result - - call gsfunctionset_eval_into(f_fs%c_fs, f_uv%c_mat, f_result%c_mat ) - call f_gsmatrix_update_data_ptr( f_result ) -end subroutine f_gsfunctionset_eval_into - -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gsfunctionset_deriv_into(f_fs, f_uv, f_result) -!--purpose: evaluate derivatives for gsfunctionset object at parameter values uv into result matrix -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsfunctionset_deriv_into -#endif -!--subroutine arguments: - class(t_gsfunctionset) :: f_fs - type(t_gsmatrix) :: f_uv, f_result - - call gsfunctionset_deriv_into(f_fs%c_fs, f_uv%c_mat, f_result%c_mat ) - call f_gsmatrix_update_data_ptr( f_result ) -end subroutine f_gsfunctionset_deriv_into - -!------------------------------------------------------------------------------------------------------------ -! wrap functions of gsCReadFile.ifc: -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gscreadfile(filename, f_fs) -!--purpose: read a gsgeometry object from a file -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gscreadfile -#endif -!--subroutine arguments: - character(len=1,kind=C_CHAR) :: filename(*) - class(t_gsfunctionset) :: f_fs - - f_fs%c_fs = gsCReadFile(filename) -end subroutine f_gscreadfile - -!------------------------------------------------------------------------------------------------------------ -! wrap functions of gsCGeometry.ifc: -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gsgeometry_recoverpoints(f_geom, f_uv, f_xyz, k, accuracy) -!--purpose: invert coordinates (x,y), (x,z), or (y,z) to corresponding (u,v) and fill in missing coordinate -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsgeometry_recoverpoints -#endif -!--subroutine arguments: - type(t_gsgeometry) :: f_geom - type(t_gsmatrix) :: f_uv, f_xyz - integer(C_INT) :: k - real(C_DOUBLE) :: accuracy - - ! TODO: check initialization of f_uv and f_xyz - call gsGeometry_recoverPoints(f_geom%c_fs, f_uv%c_mat, f_xyz%c_mat, k, accuracy) - call f_gsmatrix_update_data_ptr( f_uv ) - call f_gsmatrix_update_data_ptr( f_xyz ) - -end subroutine f_gsgeometry_recoverpoints - -!------------------------------------------------------------------------------------------------------------ - -subroutine f_gsgeometry_recoverpointgrid(f_geom, xlow, xhig, npnt, f_xyz, f_uv, c, accuracy) -!--purpose: for a grid (xlow, xhig, npnt), invert coordinates (x,y), (x,z), or (y,z) (c=2, 1, 0) -! to corresponding (u,v) and fill in missing coordinate -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsgeometry_recoverpointgrid -#endif -!--subroutine arguments: - type(t_gsgeometry) :: f_geom - type(t_gsmatrix) :: f_xyz, f_uv - integer(C_INT) :: npnt(:), c - real(C_DOUBLE) :: xlow(:), xhig(:), accuracy -!--local variables: - type(t_gsvector) :: f_a, f_b - type(t_gsvectorint) :: f_sz - - f_a = f_gsvector_create_rd( size(xlow), xlow ) - f_b = f_gsvector_create_rd( size(xhig), xhig ) - f_sz = f_gsvectorint_create_rd( size(npnt), npnt ) - ! TODO: check initialization of f_uv and f_xyz - call gsGeometry_recoverPointgrid(f_geom%c_fs, f_a%c_vec, f_b%c_vec, f_sz%c_vec, f_xyz%c_mat, & - f_uv%c_mat, c, accuracy) - call f_gsmatrix_update_data_ptr( f_xyz ) - call f_gsmatrix_update_data_ptr( f_uv ) - call f_gsvector_delete( f_a ) - call f_gsvector_delete( f_b ) - call f_gsvectorint_delete( f_sz ) - -end subroutine f_gsgeometry_recoverpointgrid - -!------------------------------------------------------------------------------------------------------------ -! wrap functions of gsCGeometryTransform.ifc: -!------------------------------------------------------------------------------------------------------------ - -function f_gsgeometrytransform_create(f_geom, f_mat, f_vec) result(f_trnsf) -!--purpose: create gsgeometrytransform object from geometry + rot.matrix + transl.vector -#ifdef _WIN32 -!dec$ attributes dllexport :: f_gsgeometrytransform_create -#endif - implicit none -!--function result: - type(t_gsgeometry) :: f_trnsf -!--function arguments: - type(t_gsgeometry) :: f_geom - type(t_gsmatrix) :: f_mat - type(t_gsvector) :: f_vec - - f_trnsf%c_fs = gsGeometryTransform_create(f_geom%c_fs, f_mat%c_mat, f_vec%c_vec) - -end function f_gsgeometrytransform_create - -!------------------------------------------------------------------------------------------------------------ - -end module Fgismo diff --git a/src/gismo.ifc b/src/gismo.ifc deleted file mode 100644 index 6df6438..0000000 --- a/src/gismo.ifc +++ /dev/null @@ -1,79 +0,0 @@ -! @file Fgismo.ifc -! -! @brief Provide access to G+Smo functions for use in Fortran programs -! -! This file is part of the G+Smo library. -! -! This Source Code Form is subject to the terms of the Mozilla Public -! License, v. 2.0. If a copy of the MPL was not distributed with this -! file, You can obtain one at http://mozilla.org/MPL/2.0/. -! -! Author(s): E. Vollebregt -! - -!------------------------------------------------------------------------------------------------------------ - -! #include - -!------------------------------------------------------------------------------------------------------------ -! #include -! Structs for holding G+Smo objects -!------------------------------------------------------------------------------------------------------------ - -! type, bind(c) :: gsFMatrix -! type(C_PTR) :: ptr -! end type gsFMatrix - -! type, bind(c) :: gsFMatrixInt -! type(C_PTR) :: ptr -! end type gsFMatrixInt - -! type, bind(c) :: gsFVector -! type(C_PTR) :: ptr -! end type gsFVector - -! type, bind(c) :: gsFVectorInt -! type(C_PTR) :: ptr -! end type gsFVectorInt - -! type, bind(c) :: gsFFunctionSet -! type(C_PTR) :: ptr -! end type gsFFunctionSet - -! type, bind(c) :: gsFMultiPatch -! type(C_PTR) :: ptr -! end type gsFMultiPatch - -! type, bind(c) :: gsFBasis -! type(C_PTR) :: ptr -! end type gsFBasis - -! type, bind(c) :: gsFGeometry -! type(C_PTR) :: ptr -! end type gsFGeometry - -! type, bind(c) :: gsFGeometryTransform -! type(C_PTR) :: ptr -! end type gsFGeometryTransform - -! type, bind(c) :: gsFKnotVector -! type(C_PTR) :: ptr -! end type gsFKnotVector - -!------------------------------------------------------------------------------------------------------------ - - interface - -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include - - end interface diff --git a/src/gsCBasis.ifc b/src/gsCBasis.ifc deleted file mode 100644 index 8280647..0000000 --- a/src/gsCBasis.ifc +++ /dev/null @@ -1,56 +0,0 @@ - -!------------------------------------------------------------------------------------------------------------ -! #define gsBasis_print gsFunctionSet_print -! #define gsBasis_delete gsFunctionSet_delete - -! GISMO_EXPORT gsCBasis* gsBSplineBasis_create(gsCKnotVector* knots); - -! GISMO_EXPORT gsCBasis* gsTensorBSplineBasis2_create(gsCKnotVector* KV1, gsCKnotVector* KV2); -! GISMO_EXPORT gsCBasis* gsTensorBSplineBasis3_create(gsCKnotVector* KV1, gsCKnotVector* KV2, gsCKnotVector* KV3); -! GISMO_EXPORT gsCBasis* gsTensorBSplineBasis4_create(gsCKnotVector* KV1, gsCKnotVector* KV2, gsCKnotVector* KV3, gsCKnotVector* KV4); - -! GISMO_EXPORT gsCBasis* gsTHBSplineBasis1_create(gsCBasis* basis); -! GISMO_EXPORT gsCBasis* gsTHBSplineBasis2_create(gsCBasis* basis); -! GISMO_EXPORT gsCBasis* gsTHBSplineBasis3_create(gsCBasis* basis); -! GISMO_EXPORT gsCBasis* gsTHBSplineBasis4_create(gsCBasis* basis); - -! GISMO_EXPORT gsCBasis* gsHBSplineBasis1_create(gsCBasis* basis); -! GISMO_EXPORT gsCBasis* gsHBSplineBasis2_create(gsCBasis* basis); -! GISMO_EXPORT gsCBasis* gsHBSplineBasis3_create(gsCBasis* basis); -! GISMO_EXPORT gsCBasis* gsHBSplineBasis4_create(gsCBasis* basis); - -! Methods, gsBasis - -! GISMO_EXPORT void gsBasis_active_into(gsCBasis * b, gsCMatrix * u, gsCMatrixInt * result); - -! GISMO_EXPORT void gsBasis_evalSingle_into(gsCBasis * b, int i, gsCMatrix * u, gsCMatrix * result); -! GISMO_EXPORT void gsBasis_derivSingle_into(gsCBasis * b, int i, gsCMatrix * u, gsCMatrix * result); -! GISMO_EXPORT void gsBasis_deriv2Single_into(gsCBasis * b, int i, gsCMatrix * u, gsCMatrix * result); - -! GISMO_EXPORT gsCBasis * gsBasis_component(gsCBasis * b, int dir); -! GISMO_EXPORT int gsBasis_degree(gsCBasis * b, int dir); -! GISMO_EXPORT int gsBasis_numElements(gsCBasis * b); -! GISMO_EXPORT int gsBasis_dim(gsCBasis * b); -! GISMO_EXPORT int gsBasis_size(gsCBasis * b); -! GISMO_EXPORT gsCMatrix* gsBasis_support(gsCBasis * b, int i); -! -! GISMO_EXPORT void gsBasis_uniformRefine(gsCBasis * b, int numKnots, int mul, int dir); -! GISMO_EXPORT void gsBasis_refineElements(gsCBasis * b, int * boxData, int boxSize); -! GISMO_EXPORT void gsBasis_refine(gsCBasis * b, gsCMatrix * boxes, int refExt); - -! TODO: -! - DegreeElevate - -! Methods, Other - -! GISMO_EXPORT gsCKnotVector * gsBSplineBasis_knots(gsCBasis * b); -! GISMO_EXPORT gsCKnotVector * gsTensorBSplineBasis_knots(gsCBasis * b, int dir); - -! GISMO_EXPORT int gsHTensorBasis_numLevels(gsCBasis * b); -! GISMO_EXPORT int gsHTensorBasis_maxLevel(gsCBasis * b); -! GISMO_EXPORT int gsHTensorBasis_levelOf(gsCBasis * b, int i); -! GISMO_EXPORT int gsHTensorBasis_getLevelAtPoint(gsCBasis * b, gsCMatrix * Pt); -! GISMO_EXPORT gsCBasis * gsHTensorBasis_tensorLevel(gsCBasis * b, int l); -! GISMO_EXPORT void gsHTensorBasis_treeLeafSize(gsCBasis * b); -! GISMO_EXPORT void gsHTensorBasis_treePrintLeaves(gsCBasis * b); -!------------------------------------------------------------------------------------------------------------ diff --git a/src/gsCBoundaryConditions.cpp b/src/gsCBoundaryConditions.cpp index 12773bb..bb55877 100644 --- a/src/gsCBoundaryConditions.cpp +++ b/src/gsCBoundaryConditions.cpp @@ -23,7 +23,7 @@ GISMO_EXPORT void gsBoundaryConditions_addCondition(gsCBoundaryConditions * bc, bool parametric) { gismo::boxSide bside(side); - gsFunctionSet * f_ptr = RICAST_F(fun); + gismo::gsFunctionSet * f_ptr = RICAST_F(fun); RICAST_BC(bc)->addCondition(patch, bside, (gismo::condition_type::type)ctype, diff --git a/src/gsCFunctionSet.ifc b/src/gsCFunctionSet.ifc deleted file mode 100644 index c0fa5eb..0000000 --- a/src/gsCFunctionSet.ifc +++ /dev/null @@ -1,82 +0,0 @@ - - -#ifdef __cplusplus -} -#endif - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsFunctionSet_delete(gsCFunctionSet * ptr); - - subroutine gsFunctionSet_delete( fs ) bind(c,name='gsFunctionSet_delete') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsFunctionSet_delete -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: fs - end subroutine gsFunctionSet_delete - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsFunctionSet_print(gsCFunctionSet * fs); - - subroutine gsFunctionSet_print(fs) bind(c,name='gsFunctionSet_print') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsFunctionSet_print -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: fs - end subroutine gsFunctionSet_print - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT int gsFunctionSet_domainDim(gsCFunctionSet * fs); - - function gsFunctionSet_domainDim(fs) bind(c,name='gsFunctionSet_domainDim') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsFunctionSet_domainDim -#endif - use, intrinsic :: iso_c_binding - implicit none - integer :: gsFunctionSet_domainDim - type(C_PTR), value :: fs - end function gsFunctionSet_domainDim - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT int gsFunctionSet_targetDim(gsCFunctionSet * fs); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCMatrix* gsFunctionSet_support(gsCFunctionSet * fs); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsFunctionSet_eval_into(gsCFunctionSet * fs, -! gsCMatrix * u, -! gsCMatrix * result); - - subroutine gsFunctionSet_eval_into(fs, u, result) bind(c,name='gsFunctionSet_eval_into') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsFunctionSet_eval_into -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: fs - type(C_PTR), value :: u - type(C_PTR), value :: result - end subroutine gsFunctionSet_eval_into - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsFunctionSet_deriv_into(gsCFunctionSet * fs, -! gsCMatrix * u, -! gsCMatrix * result); - - subroutine gsFunctionSet_deriv_into(fs, u, result) bind(c,name='gsFunctionSet_deriv_into') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsFunctionSet_deriv_into -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: fs - type(C_PTR), value :: u - type(C_PTR), value :: result - end subroutine gsFunctionSet_deriv_into - -!------------------------------------------------------------------------------------------------------------ diff --git a/src/gsCGeometry.cpp b/src/gsCGeometry.cpp index 436171e..b21ec18 100644 --- a/src/gsCGeometry.cpp +++ b/src/gsCGeometry.cpp @@ -128,7 +128,7 @@ GISMO_EXPORT gsCGeometry* gsHBSpline4_create(gsCBasis* b, gsCMatrix * coefs) GISMO_EXPORT gsCGeometry* gsTensorBSpline2_slice(gsCGeometry * g, int direction, double parameter) { auto * g_ptr = reinterpret_cast< gismo::gsTensorBSpline<2,double>* >(g); - typedef typename gsTensorBSpline<2,double>::BoundaryGeometryType GeometryBdr; + typedef typename gismo::gsTensorBSpline<2,double>::BoundaryGeometryType GeometryBdr; GeometryBdr * bdr = new GeometryBdr(); g_ptr->slice(direction, parameter, *bdr); return RICAST_CG(bdr); @@ -163,7 +163,7 @@ GISMO_EXPORT void gsGeometry_recoverPointGrid(gsCGeometry * g, gsCVector * a, gs gsCVectorInt * sz, gsCMatrix * xyz, gsCMatrix * uv,int c, double accuracy) { - gsGridIterator git(*RICAST_V(a),*RICAST_V(b), *RICAST_Vi(sz)); + gismo::gsGridIterator git(*RICAST_V(a),*RICAST_V(b), *RICAST_Vi(sz)); RICAST_G(g)->recoverPointGrid(git,*RICAST_M(xyz), *RICAST_M(uv), c, accuracy); } @@ -175,7 +175,7 @@ GISMO_EXPORT void gsGeometry_invertPointGrid(gsCGeometry * g, gsCVector * a, gsC gsCVectorInt * sz, gsCMatrix * result, double accuracy) { - gsGridIterator git(*RICAST_V(a),*RICAST_V(b), *RICAST_Vi(sz)); + gismo::gsGridIterator git(*RICAST_V(a),*RICAST_V(b), *RICAST_Vi(sz)); RICAST_G(g)->invertPointGrid(git, *RICAST_M(result), accuracy,false); } @@ -183,8 +183,8 @@ GISMO_EXPORT void gsGeometry_normal_into(gsCGeometry * fs, gsCMatrix * u, gsCMatrix * result) { - gsMapData<> mapData; - mapData.flags = NEED_NORMAL ; + gismo::gsMapData<> mapData; + mapData.flags = gismo::NEED_NORMAL ; mapData.points = *RICAST_M(u); RICAST_G(fs)->computeMap(mapData); *RICAST_M(result) = mapData.normals; @@ -195,7 +195,7 @@ GISMO_EXPORT double gsGeometry_closestPointTo(gsCGeometry * fs, gsCMatrix * result, double accuracy) { - gsVector<> tmp; + gismo::gsVector<> tmp; double dist = RICAST_G(fs)->closestPointTo(*RICAST_V(pt),tmp,accuracy,false); *RICAST_M(result) = tmp; // gsDebugVar(*RICAST_M(result)); diff --git a/src/gsCGeometry.ifc b/src/gsCGeometry.ifc deleted file mode 100644 index e547703..0000000 --- a/src/gsCGeometry.ifc +++ /dev/null @@ -1,112 +0,0 @@ - -!------------------------------------------------------------------------------------------------------------ -! #define gsBSpline_delete gsFunctionSet_delete - -!------------------------------------------------------------------------------------------------------------ -! #define gsGeometry_print gsFunctionSet_print -! ---> GISMO_EXPORT void gsFunctionSet_print(gsCFunctionSet * ptr); - -!------------------------------------------------------------------------------------------------------------ -! #define gsGeometry_delete gsFunctionSet_delete -! ---> GISMO_EXPORT void gsFunctionSet_delete(gsCFunctionSet * ptr); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCGeometry* gsBSpline_create(gsCBasis* b, gsCMatrix * coef); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCGeometry* gsTensorBSpline2_create(gsCBasis* b, gsCMatrix * coef); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCGeometry* gsTensorBSpline3_create(gsCBasis* b, gsCMatrix * coef); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCGeometry* gsTensorBSpline4_create(gsCBasis* b, gsCMatrix * coef); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCGeometry* gsTHBSpline1_create(gsCBasis* b, gsCMatrix * coef); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCGeometry* gsTHBSpline2_create(gsCBasis* b, gsCMatrix * coef); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCGeometry* gsTHBSpline3_create(gsCBasis* b, gsCMatrix * coef); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCGeometry* gsTHBSpline4_create(gsCBasis* b, gsCMatrix * coef); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCGeometry* gsHBSpline1_create(gsCBasis* b, gsCMatrix * coef); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCGeometry* gsHBSpline2_create(gsCBasis* b, gsCMatrix * coef); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCGeometry* gsHBSpline3_create(gsCBasis* b, gsCMatrix * coef); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCGeometry* gsHBSpline4_create(gsCBasis* b, gsCMatrix * coef); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCBasis* gsGeometry_basis(gsCGeometry * g); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsGeometry_coefs_into(gsCGeometry * g, gsCMatrix * coef); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsGeometry_uniformRefine(gsCGeometry * b, int numKnots, int mul, int dir); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsGeometry_refineElements(gsCGeometry * b, int * boxData, int boxSize); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsGeometry_recoverPoints(gsCGeometry * g, gsCMatrix * uv, gsCMatrix * xyz, -! int k, double accuracy); - - subroutine gsGeometry_recoverPoints(g, uv, xyz, k, accuracy) bind(c,name='gsGeometry_recoverPoints') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsGeometry_recoverPoints -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: g, uv, xyz - integer(C_INT), value :: k - real(C_DOUBLE), value :: accuracy - end subroutine gsGeometry_recoverPoints - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsGeometry_recoverPointGrid(gsCGeometry * g, gsCVector * a, gsCVector * b, -! gsCVectorInt * sz, gsCMatrix * xyz, -! gsCMatrix * uv, int c, double accuracy); - - subroutine gsGeometry_recoverPointGrid(g, a, b, sz, xyz, uv, c, accuracy) & - bind(c,name='gsGeometry_recoverPointGrid') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsGeometry_recoverPointGrid -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: g, a, b, sz, xyz, uv - integer(C_INT), value :: c - real(C_DOUBLE), value :: accuracy - end subroutine gsGeometry_recoverPointGrid - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsGeometry_invertPointGrid(gsCGeometry * g, gsCVector * a, gsCVector * b, -! gsCVectorInt * sz, gsCMatrix * result, double accuracy); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsGeometry_invertPoints(gsCGeometry * g, gsCMatrix * points, gsCMatrix * result, -! double accuracy); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsGeometry_normal_into(gsCGeometry * fs, -! gsCMatrix * u, -! gsCMatrix * result); - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT double gsGeometry_closestPointTo(gsCGeometry * fs, -! gsCMatrix * pt, -! gsCMatrix * result, -! double accuracy); - -!------------------------------------------------------------------------------------------------------------ diff --git a/src/gsCGeometryTransform.ifc b/src/gsCGeometryTransform.ifc deleted file mode 100644 index 29fd367..0000000 --- a/src/gsCGeometryTransform.ifc +++ /dev/null @@ -1,19 +0,0 @@ - -! define gsGeometryTransofrm_print gsFunctionSet_print -! define gsGeometryTransofrm_delete gsFunctionSet_delete - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCGeometryTransform* gsGeometryTransform_create(gsCBasis * b, gsCMatrix * m, -! gsCVector * v); - - function gsGeometryTransform_create(b, m, v) bind(c,name='gsGeometryTransform_create') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsGeometryTransform_create -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR) :: gsGeometryTransform_create - type(C_PTR), value :: b, m, v - end function gsGeometryTransform_create - -!------------------------------------------------------------------------------------------------------------ diff --git a/src/gsCKnotVector.ifc b/src/gsCKnotVector.ifc deleted file mode 100644 index c1c5c6e..0000000 --- a/src/gsCKnotVector.ifc +++ /dev/null @@ -1,6 +0,0 @@ - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCKnotVector * gsKnotVector_create(double* knots, int size); -! GISMO_EXPORT void gsKnotVector_delete(gsCKnotVector * kv); -! GISMO_EXPORT void gsKnotVector_print(gsCKnotVector * kv); -!------------------------------------------------------------------------------------------------------------ diff --git a/src/gsCMatrix.ifc b/src/gsCMatrix.ifc deleted file mode 100644 index 06a99ce..0000000 --- a/src/gsCMatrix.ifc +++ /dev/null @@ -1,128 +0,0 @@ - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCMatrix * gsMatrix_create(void); - - function gsMatrix_create( ) bind(c,name='gsMatrix_create') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsMatrix_create -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR) :: gsMatrix_create - end function gsMatrix_create - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCMatrix * gsMatrix_create_rc (int rows, int cols); - - function gsMatrix_create_rc(rows, cols) bind(c,name='gsMatrix_create_rc') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsMatrix_create_rc -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR) :: gsMatrix_create_rc - integer(C_INT), value :: rows, cols - end function gsMatrix_create_rc - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCMatrix * gsMatrix_create_rcd(int rows, int cols, double * data); - - function gsMatrix_create_rcd(rows, cols, data ) bind(c,name='gsMatrix_create_rcd') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsMatrix_create_rcd -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR) :: gsMatrix_create_rcd - integer(C_INT), value :: rows, cols - real(C_DOUBLE) :: data(*) - end function gsMatrix_create_rcd - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsMatrix_delete(gsCMatrix * m); - - subroutine gsMatrix_delete(m) bind(c,name='gsMatrix_delete') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsMatrix_delete -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: m - end subroutine gsMatrix_delete - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsMatrix_print(gsCMatrix * m); - - subroutine gsMatrix_print(m) bind(c,name='gsMatrix_print') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsMatrix_print -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: m - end subroutine gsMatrix_print - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT double* gsMatrix_data(gsCMatrix * m); - - function gsMatrix_data(m) bind(c,name='gsMatrix_data') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsMatrix_data -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR) :: gsMatrix_data - type(C_PTR), value :: m - end function gsMatrix_data - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsMatrix_transposeInPlace(gsCMatrix * m); - - subroutine gsMatrix_transposeInPlace(m) bind(c,name='gsMatrix_transposeInPlace') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsMatrix_transposeInPlace -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: m - end subroutine gsMatrix_transposeInPlace - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT int gsMatrix_rows(gsCMatrix * m); - - function gsMatrix_rows(m) bind(c,name='gsMatrix_rows') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsMatrix_rows -#endif - use, intrinsic :: iso_c_binding - implicit none - integer(C_INT) :: gsMatrix_rows - type(C_PTR), value :: m - end function gsMatrix_rows - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT int gsMatrix_cols(gsCMatrix * m); - - function gsMatrix_cols(m) bind(c,name='gsMatrix_cols') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsMatrix_cols -#endif - use, intrinsic :: iso_c_binding - implicit none - integer(C_INT) :: gsMatrix_cols - type(C_PTR), value :: m - end function gsMatrix_cols - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsMatrix_setZero(gsCMatrix * m); - - subroutine gsMatrix_setZero(m) bind(c,name='gsMatrix_setZero') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsMatrix_setZero -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: m - end subroutine gsMatrix_setZero - -!------------------------------------------------------------------------------------------------------------ diff --git a/src/gsCMatrixInt.ifc b/src/gsCMatrixInt.ifc deleted file mode 100644 index a8cbfc6..0000000 --- a/src/gsCMatrixInt.ifc +++ /dev/null @@ -1,15 +0,0 @@ - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCMatrixInt * gsMatrixInt_create(void); -! GISMO_EXPORT gsCMatrixInt * gsMatrixInt_create_rc (int rows, int cols); -! GISMO_EXPORT gsCMatrixInt * gsMatrixInt_create_rcd(int rows, int cols, int * data); - -! GISMO_EXPORT void gsMatrixInt_delete(gsCMatrixInt * m); -! GISMO_EXPORT void gsMatrixInt_print(gsCMatrixInt * m); -! GISMO_EXPORT int* gsMatrixInt_data(gsCMatrixInt * m); - -! GISMO_EXPORT void gsMatrixInt_transposeInPlace(gsCMatrixInt * m); -! GISMO_EXPORT int gsMatrixInt_rows(gsCMatrixInt * m); -! GISMO_EXPORT int gsMatrixInt_cols(gsCMatrixInt * m); -! GISMO_EXPORT void gsMatrixInt_setZero(gsCMatrixInt * m); -!------------------------------------------------------------------------------------------------------------ diff --git a/src/gsCMultiPatch.ifc b/src/gsCMultiPatch.ifc deleted file mode 100644 index 0fc038a..0000000 --- a/src/gsCMultiPatch.ifc +++ /dev/null @@ -1,16 +0,0 @@ - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsFunctionSet_delete(gsCFunctionSet * ptr); - -! GISMO_EXPORT void gsFunctionSet_print(gsCFunctionSet * fs); -! GISMO_EXPORT int gsFunctionSet_domainDim(gsCFunctionSet * fs); -! GISMO_EXPORT int gsFunctionSet_targetDim(gsCFunctionSet * fs); - -! GISMO_EXPORT void gsFunctionSet_eval_into(gsCFunctionSet * fs, -! gsCMatrix * u, -! gsCMatrix * result); - -! GISMO_EXPORT void gsFunctionSet_deriv_into(gsCFunctionSet * fs, -! gsCMatrix * u, -! gsCMatrix * result); -!------------------------------------------------------------------------------------------------------------ diff --git a/src/gsCQuadRule.cpp b/src/gsCQuadRule.cpp index 9d589c1..00836ae 100644 --- a/src/gsCQuadRule.cpp +++ b/src/gsCQuadRule.cpp @@ -19,13 +19,13 @@ GISMO_EXPORT gsCQuadRule* gsQuadrature_get(gsCBasis * basis, gsCOptionList* opti GISMO_EXPORT gsCQuadRule* gsGaussRule_create(int d, int* numNodes, int digits) { std::vector nodes(numNodes, numNodes + d); - return reinterpret_cast(new gismo::gsGaussRule(gsAsVector(nodes), digits)); + return reinterpret_cast(new gismo::gsGaussRule(gismo::gsAsVector(nodes), digits)); } GISMO_EXPORT gsCQuadRule* gsLobattoRule_create(int d, int* numNodes, int digits) { std::vector nodes(numNodes, numNodes + d); - return reinterpret_cast(new gismo::gsLobattoRule(gsAsVector(nodes), digits)); + return reinterpret_cast(new gismo::gsLobattoRule(gismo::gsAsVector(nodes), digits)); } GISMO_EXPORT void gsQuadRule_delete(gsCQuadRule * qr) diff --git a/src/gsCReadFile.ifc b/src/gsCReadFile.ifc deleted file mode 100644 index 3c3fe29..0000000 --- a/src/gsCReadFile.ifc +++ /dev/null @@ -1,15 +0,0 @@ - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void* gsCReadFile(char* filename); - - function gsCReadFile(filename) bind(c,name='gsCReadFile') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsCReadFile -#endif - use, intrinsic :: iso_c_binding - implicit none - type(c_ptr) :: gsCReadFile - character(len=1,kind=C_CHAR) :: filename(*) - end function gsCReadFile - -!------------------------------------------------------------------------------------------------------------ diff --git a/src/gsCVector.ifc b/src/gsCVector.ifc deleted file mode 100644 index 257e7d0..0000000 --- a/src/gsCVector.ifc +++ /dev/null @@ -1,128 +0,0 @@ - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCVector * gsVector_create(void); - - function gsVector_create( ) bind(c,name='gsVector_create') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVector_create -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR) :: gsVector_create - end function gsVector_create - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCVector * gsVector_create_r (int rows); - - function gsVector_create_r(rows) bind(c,name='gsVector_create_r') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVector_create_r -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR) :: gsVector_create_r - integer(C_INT), value :: rows - end function gsVector_create_r - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCVector * gsVector_create_rd(int rows, double * data); - - function gsVector_create_rd(rows, data) bind(c,name='gsVector_create_rd') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVector_create_rd -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR) :: gsVector_create_rd - integer(C_INT), value :: rows - real(C_DOUBLE) :: data(*) - end function gsVector_create_rd - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsVector_delete(gsCVector * m); - - subroutine gsVector_delete(m) bind(c,name='gsVector_delete') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVector_delete -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: m - end subroutine gsVector_delete - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsVector_print(gsCVector * m); - - subroutine gsVector_print(m) bind(c,name='gsVector_print') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVector_print -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: m - end subroutine gsVector_print - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT double * gsVector_data(gsCVector * m); - - function gsVector_data(m) bind(c,name='gsVector_data') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVector_data -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR) :: gsVector_data - type(C_PTR), value :: m - end function gsVector_data - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsVector_transposeInPlace(gsCVector * m); - - subroutine gsVector_transposeInPlace(m) bind(c,name='gsVector_transposeInPlace') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVector_transposeInPlace -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: m - end subroutine gsVector_transposeInPlace - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT int gsVector_rows(gsCVector * m); - - function gsVector_rows(m) bind(c,name='gsVector_rows') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVector_rows -#endif - use, intrinsic :: iso_c_binding - implicit none - integer(C_INT) :: gsVector_rows - type(C_PTR), value :: m - end function gsVector_rows - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT int gsVector_cols(gsCVector * m); - - function gsVector_cols(m) bind(c,name='gsVector_cols') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVector_cols -#endif - use, intrinsic :: iso_c_binding - implicit none - integer(C_INT) :: gsVector_cols - type(C_PTR), value :: m - end function gsVector_cols - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsVector_setZero(gsCVector * m); - - subroutine gsVector_setZero(m) bind(c,name='gsVector_setZero') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVector_setZero -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: m - end subroutine gsVector_setZero - -!------------------------------------------------------------------------------------------------------------ diff --git a/src/gsCVectorInt.ifc b/src/gsCVectorInt.ifc deleted file mode 100644 index 723c726..0000000 --- a/src/gsCVectorInt.ifc +++ /dev/null @@ -1,128 +0,0 @@ - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCVectorInt * gsVectorInt_create(void); - - function gsVectorInt_create( ) bind(c,name='gsVectorInt_create') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVectorInt_create -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR) :: gsVectorInt_create - end function gsVectorInt_create - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCVectorInt * gsVectorInt_create_r (int rows); - - function gsVectorInt_create_r(rows) bind(c,name='gsVectorInt_create_r') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVectorInt_create_r -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR) :: gsVectorInt_create_r - integer(C_INT), value :: rows - end function gsVectorInt_create_r - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT gsCVectorInt * gsVectorInt_create_rd(int rows, int * data); - - function gsVectorInt_create_rd(rows, data) bind(c,name='gsVectorInt_create_rd') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVectorInt_create_rd -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR) :: gsVectorInt_create_rd - integer(C_INT), value :: rows - integer(C_INT) :: data(*) - end function gsVectorInt_create_rd - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsVectorInt_delete(gsCVectorInt * m); - - subroutine gsVectorInt_delete(m) bind(c,name='gsVectorInt_delete') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVectorInt_delete -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: m - end subroutine gsVectorInt_delete - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsVectorInt_print(gsCVectorInt * m); - - subroutine gsVectorInt_print(m) bind(c,name='gsVectorInt_print') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVectorInt_print -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: m - end subroutine gsVectorInt_print - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT int * gsVectorInt_data(gsCVectorInt * m); - - function gsVectorInt_data(m) bind(c,name='gsVectorInt_data') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVectorInt_data -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR) :: gsVectorInt_data - type(C_PTR), value :: m - end function gsVectorInt_data - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsVectorInt_transposeInPlace(gsCVectorInt * m); - - subroutine gsVectorInt_transposeInPlace(m) bind(c,name='gsVectorInt_transposeInPlace') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVectorInt_transposeInPlace -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: m - end subroutine gsVectorInt_transposeInPlace - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT int gsVectorInt_rows(gsCVectorInt * m); - - function gsVectorInt_rows(m) bind(c,name='gsVectorInt_rows') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVectorInt_rows -#endif - use, intrinsic :: iso_c_binding - implicit none - integer(C_INT) :: gsVectorInt_rows - type(C_PTR), value :: m - end function gsVectorInt_rows - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT int gsVectorInt_cols(gsCVectorInt * m); - - function gsVectorInt_cols(m) bind(c,name='gsVectorInt_cols') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVectorInt_cols -#endif - use, intrinsic :: iso_c_binding - implicit none - integer(C_INT) :: gsVectorInt_cols - type(C_PTR), value :: m - end function gsVectorInt_cols - -!------------------------------------------------------------------------------------------------------------ -! GISMO_EXPORT void gsVectorInt_setZero(gsCVectorInt * m); - - subroutine gsVectorInt_setZero(m) bind(c,name='gsVectorInt_setZero') -#ifdef _WIN32 - !dir$ attributes stdcall :: gsVectorInt_setZero -#endif - use, intrinsic :: iso_c_binding - implicit none - type(C_PTR), value :: m - end subroutine gsVectorInt_setZero - -!------------------------------------------------------------------------------------------------------------