103 lines
4.6 KiB
C
103 lines
4.6 KiB
C
#ifndef SPHLITE_C_API_H
|
|
#define SPHLITE_C_API_H
|
|
|
|
#ifdef _WIN32
|
|
# ifdef SPHLITE_BUILD_SHARED
|
|
# define SPHLITE_API __declspec(dllexport)
|
|
# else
|
|
# define SPHLITE_API
|
|
# endif
|
|
#else
|
|
# define SPHLITE_API
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define SPHLITE_PHASE_WATER 1
|
|
#define SPHLITE_PHASE_GAS 2
|
|
#define SPHLITE_PHASE_EXPLOSIVE 3
|
|
#define SPHLITE_PHASE_SOLID 4
|
|
#define SPHLITE_PHASE_SHELL 5
|
|
#define SPHLITE_PHASE_BOUNDARY 6
|
|
#define SPHLITE_PHASE_COUPLING 7
|
|
#define SPHLITE_PHASE_SOLID_FAILED 8
|
|
#define SPHLITE_PHASE_SHELL_FAILED 9
|
|
|
|
#define SPHLITE_STATUS_ACTIVE 0
|
|
#define SPHLITE_STATUS_INACTIVE 1
|
|
#define SPHLITE_STATUS_FAILED 2
|
|
#define SPHLITE_STATUS_RESERVED 3
|
|
|
|
SPHLITE_API int sphlite_initialize(void);
|
|
SPHLITE_API int sphlite_finalize(void);
|
|
SPHLITE_API int sphlite_get_version(int *major, int *minor, int *patch);
|
|
SPHLITE_API int sphlite_get_last_error(int *code, char *message, int message_capacity);
|
|
SPHLITE_API int sphlite_read_inp(const char *filename);
|
|
SPHLITE_API int sphlite_build_model(void);
|
|
SPHLITE_API int sphlite_estimate_stable_dt(double *dtcrit);
|
|
SPHLITE_API int sphlite_advance_explicit(double dt);
|
|
SPHLITE_API int sphlite_run_explicit(void);
|
|
SPHLITE_API int sphlite_get_current_time(double *time, int *step);
|
|
SPHLITE_API int sphlite_get_particle_count(int *count);
|
|
SPHLITE_API int sphlite_get_input_warning_count(int *count);
|
|
SPHLITE_API int sphlite_set_output_directory(const char *path);
|
|
SPHLITE_API int sphlite_set_output_interval(int interval);
|
|
SPHLITE_API int sphlite_write_output(int step, double time);
|
|
SPHLITE_API int sphlite_write_csv(const char *filename);
|
|
SPHLITE_API int sphlite_write_restart(const char *filename);
|
|
SPHLITE_API int sphlite_read_restart(const char *filename);
|
|
SPHLITE_API int sphlite_get_particle_state(int max_particles,
|
|
int *particle_id_ext,
|
|
int *phase,
|
|
int *status,
|
|
int *material_id,
|
|
int *section_id,
|
|
double *x,
|
|
double *v,
|
|
double *a,
|
|
double *rho,
|
|
double *pressure,
|
|
double *internal_energy,
|
|
double *temperature,
|
|
double *h,
|
|
int *count);
|
|
SPHLITE_API int sphlite_get_water_summary(double *mass,
|
|
double *momentum,
|
|
double *max_pressure,
|
|
double *min_density,
|
|
double *max_density);
|
|
SPHLITE_API int sphlite_get_water_dt_limits(double *dt_cfl,
|
|
double *dt_accel,
|
|
double *dt_viscous);
|
|
SPHLITE_API int sphlite_get_gas_summary(double *volume,
|
|
double *center,
|
|
double *mean_pressure,
|
|
double *max_pressure);
|
|
SPHLITE_API int sphlite_get_gas_bubble_metrics(double *equivalent_radius,
|
|
double *radius_rate,
|
|
double *center);
|
|
SPHLITE_API int sphlite_get_gas_dt_limits(double *dt_cfl,
|
|
double *dt_accel,
|
|
double *dtcrit);
|
|
SPHLITE_API int sphlite_get_gas_extended_summary(double *mass,
|
|
double *momentum,
|
|
double *density_range,
|
|
double *dt_limits);
|
|
SPHLITE_API int sphlite_get_gas_source_summary(double *mass_source,
|
|
double *momentum_source,
|
|
double *energy_source);
|
|
SPHLITE_API int sphlite_set_ignition_point(double x, double y, double z, double time);
|
|
SPHLITE_API int sphlite_get_explosive_summary(int *particle_count,
|
|
int *reacted_count,
|
|
double *lambda_range,
|
|
double *released_totals,
|
|
double *detonation_time_range);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|