diff options
Diffstat (limited to 'ell_grid_solve.h')
-rw-r--r-- | ell_grid_solve.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/ell_grid_solve.h b/ell_grid_solve.h index 6e59bf0..601eac9 100644 --- a/ell_grid_solve.h +++ b/ell_grid_solve.h @@ -53,14 +53,14 @@ enum EGSType { * solver_data is EGSRelaxContext * mg2di_egs_solve() does a single relaxation step */ - EGS_SOLVER_RELAXATION, + EGS_SOLVE_RELAXATION, /** * Solve the equation exactly by contructing a linear system and solving it with LAPACK. * * solver_data is EGSExactContext * mg2di_egs_solve() solves the discretized system exactly (up to roundoff error) */ - EGS_SOLVER_EXACT, + EGS_SOLVE_EXACT, }; typedef struct EGSInternal EGSInternal; @@ -97,15 +97,10 @@ typedef struct EGSExactContext { } EGSExactContext; typedef struct EGSContext { - enum EGSType solver_type; + EGSRelaxContext *relax; + EGSExactContext *exact; /** - * Solver type-specific data. - * - * Should be cast into the struct specified in documentation for this type. - */ - void *solver_data; - /** * Solver private data, not to be accessed in any way by the caller. */ EGSInternal *priv; @@ -210,7 +205,7 @@ typedef struct EGSContext { * * @return The solver context on success, NULL on failure. */ -EGSContext *mg2di_egs_alloc(enum EGSType solver_type, size_t domain_size[2]); +EGSContext *mg2di_egs_alloc(size_t domain_size[2]); /** * Initialize the solver for use, after all the required fields are filled by * the caller. @@ -233,6 +228,6 @@ void mg2di_egs_free(EGSContext **ctx); * * @return 0 on success, a negative error code on failure. */ -int mg2di_egs_solve(EGSContext *ctx, int export_res); +int mg2di_egs_solve(EGSContext *ctx, enum EGSType solve_type, int export_res); #endif /* MG2D_ELL_GRID_SOLVE_H */ |