AMGX icon indicating copy to clipboard operation
AMGX copied to clipboard

How to call AMGX using Fortran?

Open ZiwuZheng opened this issue 11 months ago • 1 comments

Hi, I want to use AMGX to build a module in Fortran to solve the Poisson equation. How can I use AMGX in Fortran? Is there any example for reference?

ZiwuZheng avatar Dec 19 '24 02:12 ZiwuZheng

You'll have to either build an interface for each AMGX function or build a singular wrapper that calls all the C functions. An example of such a wrapper can be found in ElmerCSC/elmerfem:

  • wrapper: https://github.com/ElmerCSC/elmerfem/blob/4f69f075e81e01a061b7b0042f7c14a3d4a438d3/fem/src/amgx.c#L12
  • interface to the wrapper: https://github.com/ElmerCSC/elmerfem/blob/4f69f075e81e01a061b7b0042f7c14a3d4a438d3/fem/src/SolverUtils.F90#L15161

loicreynier avatar Mar 19 '25 15:03 loicreynier