Skip to content

Removal of Fortran API variadic functions #297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b029d2d
updated github actions from macos-12 to macos-latest
corentin-prigent Feb 4, 2025
f33b923
Modified error threshold for unitary test of 2D matrix reduction - Th…
corentin-prigent Feb 7, 2025
9aa3139
attempt at CI on macos 13 (intel chip)
corentin-prigent Feb 14, 2025
6778284
Added new function to initialize mesh from Fortran without using vari…
corentin-prigent Feb 26, 2025
4ed77fd
modified perl script for proper definition of some macros in fortran:…
corentin-prigent Feb 26, 2025
ff02eaa
Added new function MMG2D_FREE_ALL_F for Fortran API
corentin-prigent Feb 26, 2025
1a1827b
modified mmg2d library tests and examples to fit new API
corentin-prigent Feb 26, 2025
0fc55a9
Modified max error threshold in test_met3d
corentin-prigent Feb 26, 2025
75add43
removed useless line
corentin-prigent Feb 27, 2025
8027223
new API fortran functions for mmg2d
corentin-prigent Feb 27, 2025
4052ec5
Replaced all variadic fortran functions in mmg2d
corentin-prigent Feb 27, 2025
4117e9e
removed mmg3d variadic functions in Fortran
corentin-prigent Feb 27, 2025
64f11b0
modified mmg3d libexamples in Fortran to match new API
corentin-prigent Feb 27, 2025
7bf53b8
Replaced all variadic fortran functions in mmgs
corentin-prigent Feb 27, 2025
b87120d
modified mmgs libexamples in Fortran to match new API
corentin-prigent Feb 27, 2025
49ad2c3
fixed missing initialization
corentin-prigent Feb 28, 2025
fad9574
fixed missing initialization
corentin-prigent Feb 28, 2025
911760b
typo
corentin-prigent Feb 28, 2025
6447374
removed FORTRAN_VARIADIC macro
corentin-prigent Feb 28, 2025
5c72c96
bypass coverage failure
corentin-prigent Feb 28, 2025
676957b
Added return value to mmg2d init_mesh and free_all
corentin-prigent Feb 28, 2025
db3940a
Modified libexamples and testing to new mmg2d functions with return v…
corentin-prigent Feb 28, 2025
e9cd217
Added return value to mmgs init_mesh and free_all
corentin-prigent Feb 28, 2025
135ec53
Modified libexamples and testing to new mmgs functions with return va…
corentin-prigent Feb 28, 2025
5d56ebd
modified prototypes of mmg2d_free_names and mmg2d_free_structures to …
corentin-prigent Mar 4, 2025
ff1fa09
modified prototypes of mmgs_free_names and mmgs_free_structures to ha…
corentin-prigent Mar 4, 2025
4a89f38
modified prototypes of mmg3d_init_mesh, mmg3d_free_names, mmg3d_free_…
corentin-prigent Mar 4, 2025
b646410
modified mmg3d libexamples to match new API
corentin-prigent Mar 4, 2025
8da5f23
Some documentation
corentin-prigent Mar 6, 2025
ef5c33b
small mistake
corentin-prigent Mar 6, 2025
e4e171c
modified genheader.c
corentin-prigent Mar 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/main-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04,macos-12]
os: [ubuntu-20.04,macos-13]
pattern: [on,off]
pointmap: [off]
scotch: [on,off]
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
vtk: off
int: int32_t

- os: macos-12
- os: macos-latest
pattern: off
pointmap: on
scotch: on
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
vtk: on
int: int64_t

- os: macos-12
- os: macos-latest
pattern: off
pointmap: off
scotch: off
Expand Down Expand Up @@ -383,7 +383,7 @@ jobs:
if: inputs.code_coverage == true
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
fail_ci_if_error: false
root_dir: .
verbose: true
env:
Expand Down
14 changes: 8 additions & 6 deletions cmake/testing/code/mmg2d_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ PROGRAM main

mmgMesh = 0
mmgSol = 0
CALL MMG2D_Init_mesh(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppMet,mmgSol, &
MMG5_ARG_end)
CALL MMG2D_Init_mesh((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppMet,LOC(mmgSol), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(100)

call loadmesh(mmgMesh,trim(filein),by_array)

Expand All @@ -76,9 +77,10 @@ PROGRAM main
call writemesh(mmgMesh,trim(fileout),by_array)

!> 3) Free the MMG2D structures
CALL MMG2D_Free_all(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppMet,mmgSol, &
MMG5_ARG_end)
CALL MMG2D_Free_all((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppMet,LOC(mmgSol), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(103)

END PROGRAM main

Expand Down
42 changes: 24 additions & 18 deletions libexamples/mmg/adaptation_example0_fortran/main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ PROGRAM main
mmgMesh = 0
mmgSol = 0

CALL MMG2D_Init_mesh(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppMet,mmgSol, &
MMG5_ARG_end)
CALL MMG2D_Init_mesh((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppMet,LOC(mmgSol), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(101)

!> 2) Build mesh in MMG5 format
!! Two solutions: just use the MMG2D_loadMesh function that will read a .mesh(b)
Expand Down Expand Up @@ -106,9 +107,10 @@ PROGRAM main
ENDIF

!> 3) Free the MMG2D5 structures
CALL MMG2D_Free_all(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppMet,mmgSol, &
MMG5_ARG_end)
CALL MMG2D_Free_all((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppMet,LOC(mmgSol), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(108)

!> ================== surface remeshing using the mmgs library

Expand All @@ -124,9 +126,10 @@ PROGRAM main
mmgMesh = 0
mmgSol = 0

CALL MMGS_Init_mesh(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppMet,mmgSol, &
MMG5_ARG_end)
CALL MMGS_Init_mesh((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppMet,LOC(mmgSol), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(101)

!> 2) Build mesh in MMG5 format
!! Two solutions: just use the MMGS_loadMesh function that will read a .mesh(b)
Expand Down Expand Up @@ -184,9 +187,10 @@ PROGRAM main
ENDIF

!> 3) Free the MMGS5 structures
CALL MMGS_Free_all(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppMet,mmgSol, &
MMG5_ARG_end)
CALL MMGS_Free_all((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppMet,LOC(mmgSol), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(106)

!> ================== 3d remeshing using the mmg3d library

Expand All @@ -202,9 +206,10 @@ PROGRAM main
mmgMesh = 0
mmgSol = 0

CALL MMG3D_Init_mesh(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppMet,mmgSol, &
MMG5_ARG_end)
CALL MMG3D_Init_mesh((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppMet,LOC(mmgSol), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(101)

!> 2) Build mesh in MMG5 format
!! Two solutions: just use the MMG3D_loadMesh function that will read a .mesh(b)
Expand Down Expand Up @@ -262,8 +267,9 @@ PROGRAM main


!> 3) Free the MMG3D5 structures
CALL MMG3D_Free_all(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppMet,mmgSol, &
MMG5_ARG_end)
CALL MMG3D_Free_all((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppMet,LOC(mmgSol), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(108)

END PROGRAM main
18 changes: 10 additions & 8 deletions libexamples/mmg2d/IsosurfDiscretization_lsAndMetric/main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ PROGRAM main
mmgLs = 0
mmgMet = 0

CALL MMG2D_Init_mesh(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppLs,mmgLs, &
MMG5_ARG_ppMet,mmgMet, &
MMG5_ARG_end)
CALL MMG2D_Init_mesh((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppLs,LOC(mmgLs), &
MMG5_ARG_ppMet,LOC(mmgMet), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(100)

!!------------------- Level set discretization option ---------------------
! Ask for level set discretization: note that it is important to do this step
Expand Down Expand Up @@ -177,9 +178,10 @@ PROGRAM main
ENDIF

!> 3) Free the MMG2D5 structures
CALL MMG2D_Free_all(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppLs,mmgLs, &
MMG5_ARG_ppMet,mmgMet, &
MMG5_ARG_end)
CALL MMG2D_Free_all((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppLs,LOC(mmgLs), &
MMG5_ARG_ppMet,LOC(mmgMet), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(108)

END PROGRAM
18 changes: 10 additions & 8 deletions libexamples/mmg2d/IsosurfDiscretization_lsAndMetric/main_hsiz.F90
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ PROGRAM main
mmgLs = 0
mmgMet = 0

CALL MMG2D_Init_mesh(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppLs,mmgLs, &
MMG5_ARG_ppMet,mmgMet, &
MMG5_ARG_end)
CALL MMG2D_Init_mesh((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppLs,LOC(mmgLs), &
MMG5_ARG_ppMet,LOC(mmgMet), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(100)

!!------------------- Level set discretization option ---------------------
! Ask for level set discretization: note that it is important to do this step
Expand Down Expand Up @@ -150,9 +151,10 @@ PROGRAM main
ENDIF

!> 3) Free the MMG2D5 structures
CALL MMG2D_Free_all(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppLs,mmgLs, &
MMG5_ARG_ppMet,mmgMet, &
MMG5_ARG_end)
CALL MMG2D_Free_all((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppLs,LOC(mmgLs), &
MMG5_ARG_ppMet,LOC(mmgMet), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(108)

END PROGRAM
18 changes: 10 additions & 8 deletions libexamples/mmg2d/IsosurfDiscretization_lsAndMetric/main_optim.F90
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ PROGRAM main
mmgLs = 0
mmgMet = 0

CALL MMG2D_Init_mesh(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppLs,mmgLs, &
MMG5_ARG_ppMet,mmgMet, &
MMG5_ARG_end)
CALL MMG2D_Init_mesh((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppLs,LOC(mmgLs), &
MMG5_ARG_ppMet,LOC(mmgMet), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(100)

!!------------------- Level set discretization option ---------------------
! Ask for level set discretization: note that it is important to do this step
Expand Down Expand Up @@ -154,9 +155,10 @@ PROGRAM main
ENDIF

!> 3) Free the MMG2D5 structures
CALL MMG2D_Free_all(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppLs,mmgLs, &
MMG5_ARG_ppMet,mmgMet, &
MMG5_ARG_end)
CALL MMG2D_Free_all((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppLs,LOC(mmgLs), &
MMG5_ARG_ppMet,LOC(mmgMet), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(108)

END PROGRAM
14 changes: 8 additions & 6 deletions libexamples/mmg2d/IsosurfDiscretization_lsOnly/main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ PROGRAM main
mmgMesh = 0
mmgLs = 0

CALL MMG2D_Init_mesh(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppLs,mmgLs, &
MMG5_ARG_end)
CALL MMG2D_Init_mesh((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppLs,LOC(mmgLs), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(100)

!!------------------- Level set discretization option ---------------------
! Ask for level set discretization: note that it is important to do this step
Expand Down Expand Up @@ -140,8 +141,9 @@ PROGRAM main
ENDIF

!> 3) Free the MMG2D5 structures
CALL MMG2D_Free_all(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppLs,mmgLs, &
MMG5_ARG_end)
CALL MMG2D_Free_all((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppLs,LOC(mmgLs), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(107)

END PROGRAM
14 changes: 8 additions & 6 deletions libexamples/mmg2d/IsosurfDiscretization_lsOnly/main_hsiz.F90
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ PROGRAM main
mmgMesh = 0
mmgLs = 0

CALL MMG2D_Init_mesh(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppLs,mmgLs, &
MMG5_ARG_end)
CALL MMG2D_Init_mesh((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppLs,LOC(mmgLs), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(100)

!!------------------- Level set discretization option ---------------------
! Ask for level set discretization: note that it is important to do this step
Expand Down Expand Up @@ -144,8 +145,9 @@ PROGRAM main
ENDIF

!> 3) Free the MMG2D5 structures
CALL MMG2D_Free_all(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppLs,mmgLs, &
MMG5_ARG_end)
CALL MMG2D_Free_all((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppLs,LOC(mmgLs), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(107)

END PROGRAM
14 changes: 8 additions & 6 deletions libexamples/mmg2d/IsosurfDiscretization_lsOnly/main_optim.F90
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ PROGRAM main
mmgMesh = 0
mmgLs = 0

CALL MMG2D_Init_mesh(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppLs,mmgLs, &
MMG5_ARG_end)
CALL MMG2D_Init_mesh((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppLs,LOC(mmgLs), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(100)

!!------------------- Level set discretization option ---------------------
! Ask for level set discretization: note that it is important to do this step
Expand Down Expand Up @@ -148,8 +149,9 @@ PROGRAM main
ENDIF

!> 3) Free the MMG2D5 structures
CALL MMG2D_Free_all(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppLs,mmgLs, &
MMG5_ARG_end)
CALL MMG2D_Free_all((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppLs,LOC(mmgLs), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(107)

END PROGRAM
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ PROGRAM main
mmgMesh = 0
mmgSol = 0

CALL MMG2D_Init_mesh(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppMet,mmgSol, &
MMG5_ARG_end)
CALL MMG2D_Init_mesh((/ MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppMet,LOC(mmgSol), &
MMG5_ARG_end /),ier)
IF ( ier == 0 ) CALL EXIT(101)

!> 2) Build mesh in MMG5 format
!! Two solutions: just use the MMG2D_loadMesh function that will read a .mesh(b)
Expand Down Expand Up @@ -102,8 +103,9 @@ PROGRAM main
IF ( ier /= 1 ) CALL EXIT(107)

!> 3) Free the MMG2D5 structures
CALL MMG2D_Free_all(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppMet,mmgSol, &
MMG5_ARG_end)
CALL MMG2D_Free_all((/ MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppMet,LOC(mmgSol), &
MMG5_ARG_end /),ier)
IF ( ier == 0 ) CALL EXIT(108)

END PROGRAM main
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ PROGRAM main

mmgMesh = 0
mmgSol = 0
CALL MMG2D_Init_mesh(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppMet,mmgSol, &
MMG5_ARG_end)

CALL MMG2D_Init_mesh((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppMet,LOC(mmgSol), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(100)

!> 2) Build mesh in MMG5 format
!! Two solutions: just use the MMG2D_loadMesh function that will read a .mesh(b)
Expand Down Expand Up @@ -301,8 +303,9 @@ PROGRAM main
CLOSE(inm)

!> 3) Free the MMG2D structures
CALL MMG2D_Free_all(MMG5_ARG_start, &
MMG5_ARG_ppMesh,mmgMesh,MMG5_ARG_ppMet,mmgSol, &
MMG5_ARG_end)
CALL MMG2D_Free_all((/MMG5_ARG_start, &
MMG5_ARG_ppMesh,LOC(mmgMesh),MMG5_ARG_ppMet,LOC(mmgSol), &
MMG5_ARG_end/),ier)
IF ( ier == 0 ) CALL EXIT(116)

END PROGRAM main
Loading
Loading