feat(nmNum): 接入 HX_NWTM 绘图接口并移除旧曲线库
- 使用 HX_NWTM_PLOT 生成双对数和半对数曲线 - 预初始化输出矩阵,修复打开数值解时的访问冲突 - 统一 HX_NWTM 接口调用锁并增加输入输出校验 - 移除 singlePhaseSolverDll 的代码及工程依赖 - 更新 HX_NWTM DLL、头文件和导入库develop
parent
78d5f934cd
commit
dfe628e19b
Binary file not shown.
@ -0,0 +1,128 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifdef ACCELWT_DLL_EXPORTS
|
||||
# define ACCELWT_API __declspec(dllexport)
|
||||
# else
|
||||
# define ACCELWT_API __declspec(dllimport)
|
||||
# endif
|
||||
#else
|
||||
# define ACCELWT_API
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum AccelWTStatus
|
||||
{
|
||||
ACCELWT_STATUS_SUCCESS = 0,
|
||||
ACCELWT_STATUS_INVALID_ARGUMENT = 1,
|
||||
ACCELWT_STATUS_CREATE_FAILED = 2,
|
||||
ACCELWT_STATUS_SETUP_FAILED = 3,
|
||||
ACCELWT_STATUS_SOLVE_FAILED = 4,
|
||||
ACCELWT_STATUS_NOT_CONVERGED = 5,
|
||||
ACCELWT_STATUS_UNSUPPORTED_BACKEND = 6
|
||||
};
|
||||
|
||||
typedef struct AccelWTSolveOptions
|
||||
{
|
||||
int max_iter;
|
||||
double rel_tol;
|
||||
double abs_tol;
|
||||
int ilu_jacobi_iters;
|
||||
int omp_threads;
|
||||
int use_initial_guess;
|
||||
} AccelWTSolveOptions;
|
||||
|
||||
typedef struct AccelWTSolveInfo
|
||||
{
|
||||
int iterations;
|
||||
double final_rel_residual;
|
||||
double setup_seconds;
|
||||
int status;
|
||||
} AccelWTSolveInfo;
|
||||
|
||||
typedef struct AccelWTDatasetOptions
|
||||
{
|
||||
const char *dataset_dir;
|
||||
int lagged_ilu_k;
|
||||
int lagged_ilu_max_iters;
|
||||
int solve_omp_threads;
|
||||
int host_residual_interval;
|
||||
int print_progress;
|
||||
} AccelWTDatasetOptions;
|
||||
|
||||
typedef struct AccelWTDatasetSummary
|
||||
{
|
||||
int num_steps;
|
||||
int total_solves;
|
||||
int early_exit_steps;
|
||||
int ilu_refresh_steps;
|
||||
int ilu_lagged_reuse_steps;
|
||||
int not_converged_steps;
|
||||
long long total_iterations;
|
||||
double time_read_t;
|
||||
double time_read_b;
|
||||
double time_read_a;
|
||||
double time_csr;
|
||||
double time_create;
|
||||
double time_prepare_step;
|
||||
double time_solve;
|
||||
double time_total;
|
||||
double avg_prepare_ms;
|
||||
double avg_solve_ms;
|
||||
int status;
|
||||
} AccelWTDatasetSummary;
|
||||
|
||||
ACCELWT_API const char *accelwt_backend_name(void);
|
||||
|
||||
ACCELWT_API void accelwt_default_options(AccelWTSolveOptions *options);
|
||||
|
||||
ACCELWT_API void accelwt_default_dataset_options(AccelWTDatasetOptions *options);
|
||||
|
||||
ACCELWT_API int accelwt_solve_csr(int n,
|
||||
int nnz,
|
||||
const int *row_ptr,
|
||||
const int *col_ind,
|
||||
const double *values,
|
||||
const double *b,
|
||||
double *x,
|
||||
const AccelWTSolveOptions *options,
|
||||
AccelWTSolveInfo *info);
|
||||
|
||||
ACCELWT_API int accelwt_solve_csr_cpu(int n,
|
||||
int nnz,
|
||||
const int *row_ptr,
|
||||
const int *col_ind,
|
||||
const double *values,
|
||||
const double *b,
|
||||
double *x,
|
||||
const AccelWTSolveOptions *options,
|
||||
AccelWTSolveInfo *info);
|
||||
|
||||
ACCELWT_API int accelwt_solve_csr_cuda(int n,
|
||||
int nnz,
|
||||
const int *row_ptr,
|
||||
const int *col_ind,
|
||||
const double *values,
|
||||
const double *b,
|
||||
double *x,
|
||||
const AccelWTSolveOptions *options,
|
||||
AccelWTSolveInfo *info);
|
||||
|
||||
ACCELWT_API int accelwt_solve_dataset_cpu(const char *dataset_dir,
|
||||
const AccelWTDatasetOptions *options,
|
||||
AccelWTDatasetSummary *summary);
|
||||
|
||||
ACCELWT_API int accelwt_solve_dataset_cuda(const char *dataset_dir,
|
||||
const AccelWTDatasetOptions *options,
|
||||
AccelWTDatasetSummary *summary);
|
||||
|
||||
ACCELWT_API int accelwt_solve_dataset(const char *dataset_dir,
|
||||
const AccelWTDatasetOptions *options,
|
||||
AccelWTDatasetSummary *summary);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue