diff --git a/src/parcsr_ls/_hypre_parcsr_ls.h b/src/parcsr_ls/_hypre_parcsr_ls.h index 74190f0db..b853f3dc2 100644 --- a/src/parcsr_ls/_hypre_parcsr_ls.h +++ b/src/parcsr_ls/_hypre_parcsr_ls.h @@ -1129,6 +1129,9 @@ typedef struct typedef struct hypre_ParILUData_struct { + /* Base solver data structure */ + hypre_Solver base; + /* General data */ HYPRE_Int global_solver; hypre_ParCSRMatrix *matA; diff --git a/src/parcsr_ls/par_ilu.c b/src/parcsr_ls/par_ilu.c index 4dd295eab..584234970 100644 --- a/src/parcsr_ls/par_ilu.c +++ b/src/parcsr_ls/par_ilu.c @@ -20,9 +20,16 @@ void * hypre_ILUCreate( void ) { - hypre_ParILUData *ilu_data; + hypre_ParILUData *ilu_data; + hypre_Solver *base; ilu_data = hypre_CTAlloc(hypre_ParILUData, 1, HYPRE_MEMORY_HOST); + base = (hypre_Solver*) ilu_data; + + /* Set base solver function pointers */ + hypre_SolverSetup(base) = (HYPRE_PtrToSolverFcn) HYPRE_ILUSetup; + hypre_SolverSolve(base) = (HYPRE_PtrToSolverFcn) HYPRE_ILUSolve; + hypre_SolverDestroy(base) = (HYPRE_PtrToDestroyFcn) HYPRE_ILUDestroy; #if defined(HYPRE_USING_GPU) hypre_ParILUDataAperm(ilu_data) = NULL; diff --git a/src/parcsr_ls/par_ilu.h b/src/parcsr_ls/par_ilu.h index e152e4907..487a946e5 100644 --- a/src/parcsr_ls/par_ilu.h +++ b/src/parcsr_ls/par_ilu.h @@ -14,6 +14,9 @@ typedef struct hypre_ParILUData_struct { + /* Base solver data structure */ + hypre_Solver base; + /* General data */ HYPRE_Int global_solver; hypre_ParCSRMatrix *matA;