Exemplo n.º 1
0
from ctypes import CDLL, c_int, c_double, POINTER
import numpy as np
from config import get_library_path

library = CDLL(get_library_path("petsc"))

c_int_p = POINTER(c_int)
c_double_p = POINTER(c_double)

init_petsc = library.init_petsc
init_petsc.res_type = c_int

finalize_petsc = library.finalize_petsc
finalize_petsc.res_type = c_int

init_petsc()

_solve_petsc_coo = library.solve_petsc_coo
_solve_petsc_coo.restype = c_int
_solve_petsc_coo.argtypes = [
    c_double_p,
    c_int_p,
    c_int_p,
    c_int,
    c_double_p,
    c_double_p,
    c_int,
    c_double,
    c_double,
    c_double,
    c_int,
Exemplo n.º 2
0
from ctypes import CDLL, c_int, c_double, POINTER
import numpy as np
from config import get_library_path

library = CDLL(get_library_path("mumps"))

c_int_p = POINTER(c_int)
c_double_p = POINTER(c_double)

init_mpi = library.init_mpi
init_mpi.restype = c_int

init_mpi()

finalize_mpi = library.finalize_mpi
finalize_mpi.restype = c_int

_solve_mumps_coo = library.solve_mumps_coo
_solve_mumps_coo.restype = c_int
_solve_mumps_coo.argtypes = [
    c_double_p,
    c_int_p,
    c_int_p,
    c_int,
    c_double_p,
    c_int,
    c_int,
    c_int,
]

Exemplo n.º 3
0
from ctypes import CDLL, c_int, c_double, POINTER
import numpy as np
from config import get_library_path

library = CDLL(get_library_path("amgcl"))

c_int_p = POINTER(c_int)
c_double_p = POINTER(c_double)

_solve_amgcl_csr = library.solve_amgcl_csr
_solve_amgcl_csr.restype = c_int
_solve_amgcl_csr.argtypes = [
    c_double_p,
    c_int_p,
    c_int_p,
    c_int,
    c_double_p,
    c_double_p,
    c_int,
    c_double,
    c_double,
    c_int,
]


def solve_amgcl_csr(
    csr_values,
    csr_indices,
    csr_indptr,
    b,
    x=None,
Exemplo n.º 4
0
from ctypes import CDLL, c_int, c_double, POINTER
import numpy as np
from config import get_library_path

library = CDLL(get_library_path("eigen"))

c_int_p = POINTER(c_int)
c_double_p = POINTER(c_double)

_solve_eigen_icholt_coo = library.solve_eigen_icholt_coo
_solve_eigen_icholt_coo.restype = c_int
_solve_eigen_icholt_coo.argtypes = [
    c_double_p,
    c_int_p,
    c_int_p,
    c_int,
    c_double_p,
    c_double_p,
    c_int,
    c_double,
    c_double,
]

_solve_eigen_cholesky_coo = library.solve_eigen_cholesky_coo
_solve_eigen_cholesky_coo.restype = c_int
_solve_eigen_cholesky_coo.argtypes = [
    c_double_p,
    c_int_p,
    c_int_p,
    c_int,
    c_double_p,