This commit is contained in:
@@ -138,6 +138,76 @@ int femlite_apply_sph_nodal_forces(int num_force_nodes,
|
||||
const int *node_ids,
|
||||
const double *forces);
|
||||
int femlite_get_sph_force_summary(double *total_force);
|
||||
int femlite_clear_coupling_loads(void);
|
||||
int femlite_get_coupling_surface_count(int *num_facets, int *max_face_nodes);
|
||||
int femlite_get_coupling_surface_count_for_name(const char *surface_name,
|
||||
int *num_facets,
|
||||
int *max_face_nodes);
|
||||
int femlite_get_coupling_surface_facets(int num_facets,
|
||||
int max_face_nodes,
|
||||
int *facet_id,
|
||||
int *elem_id,
|
||||
int *face_id,
|
||||
int *facet_nnode,
|
||||
int *facet_conn,
|
||||
double *x,
|
||||
double *vnod,
|
||||
double *normal,
|
||||
double *area);
|
||||
int femlite_get_coupling_surface_facets_ex(int num_facets,
|
||||
int max_face_nodes,
|
||||
int *facet_id,
|
||||
int *surface_id,
|
||||
int *elem_id,
|
||||
int *face_id,
|
||||
int *facet_nnode,
|
||||
int *facet_conn,
|
||||
double *x,
|
||||
double *vnod,
|
||||
double *normal,
|
||||
double *area,
|
||||
int *material_id,
|
||||
int *section_id,
|
||||
int *valid_flags,
|
||||
double *shell_thickness,
|
||||
double *mass_per_area);
|
||||
int femlite_get_coupling_surface_facets_ex_for_name(
|
||||
const char *surface_name,
|
||||
int num_facets,
|
||||
int max_face_nodes,
|
||||
int *facet_id,
|
||||
int *surface_id,
|
||||
int *elem_id,
|
||||
int *face_id,
|
||||
int *facet_nnode,
|
||||
int *facet_conn,
|
||||
double *x,
|
||||
double *vnod,
|
||||
double *normal,
|
||||
double *area,
|
||||
int *material_id,
|
||||
int *section_id,
|
||||
int *valid_flags,
|
||||
double *shell_thickness,
|
||||
double *mass_per_area);
|
||||
int femlite_apply_coupling_nodal_forces(int num_loads,
|
||||
const int *node_ids,
|
||||
const double *forces,
|
||||
const int *source_ids,
|
||||
const int *load_mode,
|
||||
const int *valid_flags);
|
||||
int femlite_get_coupling_load_diagnostics(double *total_force,
|
||||
double *total_moment,
|
||||
int *accepted_count,
|
||||
int *rejected_nonfinite,
|
||||
int *rejected_unknown_node,
|
||||
int *rejected_capacity);
|
||||
int femlite_get_coupling_source_load_diagnostics(int source_id,
|
||||
double *total_force,
|
||||
double *total_moment,
|
||||
int *accepted_count);
|
||||
int femlite_write_coupling_reports(const char *load_report,
|
||||
const char *surface_report);
|
||||
int femlite_get_boundary_facet_count(int *num_facets, int *max_face_nodes);
|
||||
int femlite_get_boundary_facets(int num_facets,
|
||||
int max_face_nodes,
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
#ifndef FEMLITE_CCLITE_IPC_H
|
||||
#define FEMLITE_CCLITE_IPC_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define FEMLITE_CCL_IPC_SUCCESS 0
|
||||
#define FEMLITE_CCL_IPC_ERR_INPUT 1000
|
||||
#define FEMLITE_CCL_IPC_ERR_UNSUPPORTED 1001
|
||||
#define FEMLITE_CCL_IPC_ERR_OPEN 1002
|
||||
#define FEMLITE_CCL_IPC_ERR_MAP 1003
|
||||
#define FEMLITE_CCL_IPC_ERR_TIMEOUT 1004
|
||||
#define FEMLITE_CCL_IPC_ERR_WAIT 1005
|
||||
#define FEMLITE_CCL_IPC_ERR_SIGNAL 1006
|
||||
#define FEMLITE_CCL_IPC_ERR_CAPACITY 1007
|
||||
|
||||
#define FEMLITE_CCL_IPC_VERSION 1
|
||||
|
||||
#define FEMLITE_CCL_CMD_INIT 1
|
||||
#define FEMLITE_CCL_CMD_READ_INPUT 2
|
||||
#define FEMLITE_CCL_CMD_BUILD_MODEL 3
|
||||
#define FEMLITE_CCL_CMD_EXPORT_IFACE 4
|
||||
#define FEMLITE_CCL_CMD_IMPORT_LOADS 5
|
||||
#define FEMLITE_CCL_CMD_ADVANCE 6
|
||||
#define FEMLITE_CCL_CMD_WRITE_OUTPUT 7
|
||||
#define FEMLITE_CCL_CMD_STOP 8
|
||||
|
||||
#define FEMLITE_CCL_STATE_CREATED 0
|
||||
#define FEMLITE_CCL_STATE_READY 1
|
||||
#define FEMLITE_CCL_STATE_RUNNING 2
|
||||
#define FEMLITE_CCL_STATE_DONE 3
|
||||
#define FEMLITE_CCL_STATE_ERROR -1
|
||||
|
||||
#define FEMLITE_CCL_BACKEND_MOCK 1
|
||||
#define FEMLITE_CCL_BACKEND_WINDOWS_IPC 2
|
||||
|
||||
typedef struct femlite_cclite_command_block {
|
||||
int32_t version;
|
||||
int32_t seq;
|
||||
int32_t ack_seq;
|
||||
int32_t command_id;
|
||||
int32_t step_id;
|
||||
int32_t substep_id;
|
||||
int32_t iteration_id;
|
||||
int32_t worker_state;
|
||||
int32_t error_code;
|
||||
} femlite_cclite_command_block;
|
||||
|
||||
typedef struct femlite_cclite_map {
|
||||
void *handle;
|
||||
void *view;
|
||||
size_t size;
|
||||
int32_t last_native_error;
|
||||
} femlite_cclite_map;
|
||||
|
||||
typedef struct femlite_cclite_event {
|
||||
void *handle;
|
||||
int32_t last_native_error;
|
||||
} femlite_cclite_event;
|
||||
|
||||
typedef struct femlite_cclite_transport {
|
||||
int32_t backend;
|
||||
femlite_cclite_map command_map;
|
||||
femlite_cclite_event command_event;
|
||||
femlite_cclite_event done_event;
|
||||
femlite_cclite_command_block mock_command;
|
||||
femlite_cclite_command_block mock_done;
|
||||
int32_t has_mock_command;
|
||||
int32_t has_mock_done;
|
||||
} femlite_cclite_transport;
|
||||
|
||||
size_t femlite_cclite_command_block_size(void);
|
||||
void femlite_cclite_init_command_block(femlite_cclite_command_block *block);
|
||||
|
||||
int femlite_cclite_format_name(const char *prefix, const char *suffix,
|
||||
char *out_name, size_t out_capacity);
|
||||
|
||||
int femlite_cclite_open_shared_memory(const char *name, size_t min_size,
|
||||
femlite_cclite_map *map);
|
||||
int femlite_cclite_close_shared_memory(femlite_cclite_map *map);
|
||||
|
||||
int femlite_cclite_open_event(const char *name, femlite_cclite_event *event);
|
||||
int femlite_cclite_close_event(femlite_cclite_event *event);
|
||||
int femlite_cclite_wait_event(femlite_cclite_event *event,
|
||||
unsigned int timeout_ms);
|
||||
int femlite_cclite_signal_event(femlite_cclite_event *event);
|
||||
|
||||
int femlite_cclite_wait_command(femlite_cclite_event *command_event,
|
||||
femlite_cclite_map *command_map,
|
||||
unsigned int timeout_ms,
|
||||
femlite_cclite_command_block *out_block);
|
||||
int femlite_cclite_write_done(femlite_cclite_event *done_event,
|
||||
femlite_cclite_map *command_map,
|
||||
const femlite_cclite_command_block *block);
|
||||
|
||||
int femlite_cclite_transport_init_mock(femlite_cclite_transport *transport);
|
||||
int femlite_cclite_transport_open_windows(const char *prefix,
|
||||
femlite_cclite_transport *transport);
|
||||
int femlite_cclite_transport_close(femlite_cclite_transport *transport);
|
||||
int femlite_cclite_transport_mock_push(
|
||||
femlite_cclite_transport *transport,
|
||||
const femlite_cclite_command_block *block);
|
||||
int femlite_cclite_transport_mock_get_done(
|
||||
femlite_cclite_transport *transport,
|
||||
femlite_cclite_command_block *block);
|
||||
int femlite_cclite_transport_receive(femlite_cclite_transport *transport,
|
||||
unsigned int timeout_ms,
|
||||
femlite_cclite_command_block *out_block);
|
||||
int femlite_cclite_transport_complete(
|
||||
femlite_cclite_transport *transport,
|
||||
const femlite_cclite_command_block *block);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user