#include <iostream>#include <fstream>#include <string>#include <sstream>#include <cstring>#include <vector>#include <set>#include <map>#include <regex>#include <iomanip>#include <limits>#include <dlfcn.h>#include <dirent.h>#include "cpp_python_funct.h"#include "cpp_python_sampling.h"#include "python_signal.h"Go to the source code of this file.
Typedefs | |
| typedef float | my_real |
Functions | |
| template<std::size_t N> | |
| std::string | element_parenthesis_to_underscore (const std::string &input, const std::array< const char *, N > &keywords) |
| std::string | node_parenthesis_to_underscore (const std::string &input) |
| std::string | parenthesis_to_underscore (const std::string &input) |
| void | extract_node_uid (const std::string &input) |
| void | extract_element_keywords (const std::string &input) |
| template<typename T> | |
| void | load_functions (T h, bool &python_initialized) |
| void | exit_with_message (const char *message) |
| void | check_error (int line_number) |
| void | python_signal_handler (int signum) |
| PyObject * | call_python_function_with_state (const char *func_name) |
| PyObject * | call_python_function (const char *func_name, double *args, int num_args) |
| void | call_python_function1D_vectors (const char *func_name, std::vector< double > &X, std::vector< double > &Y) |
| void | python_execute_code (const std::string &code) |
| std::string | extract_function_name (const std::string &signature) |
| bool | try_load_library (const std::string &path) |
| void | python_load_library () |
| void | cpp_python_initialize (int *ierror) |
| void | cpp_python_load_environment () |
| void | cpp_python_sync (void *pcontext) |
| void | cpp_python_finalize () |
| void | cpp_python_execute_code (const char *code) |
| void | cpp_python_initialize_global_variables () |
| void | cpp_python_register_function (char *name, char code[], int num_lines) |
| void | cpp_python_call_function (char *name, int num_args, double *args, int num_return, double *return_values) |
| void | cpp_python_call_function_with_state (char *name, double *return_values) |
| void | cpp_python_check_function (char *name, int *error) |
| void | cpp_python_update_reals (char *basename, int *uid, my_real *reals, int num_reals) |
| void | cpp_python_update_time (my_real TIME, my_real DT) |
| void | cpp_python_get_number_of_nodes (int *num_nodes) |
| void | cpp_python_get_nodes (int *nodes_uid_array) |
| void | cpp_python_create_node_mapping (int *itab, int *num_nodes) |
| void | cpp_python_update_sensors (int *types, int *uids, int *statuses, double *results, int *num_sensors) |
| void | cpp_python_update_active_node (int name_len, char *name, double *values) |
| void | cpp_python_update_active_node_ids (int id, int uid) |
| void | cpp_python_update_nodal_entity (int numnod, int name_len, char *name, my_real *values) |
| void | cpp_python_update_elemental_entity (char *name, double value, int uid) |
| void | cpp_python_get_number_elemental_entities (int *nb) |
| void | cpp_python_get_elemental_entity (int nb, char *name, int *uid) |
| void | cpp_python_sample_function (char *name, my_real *x, my_real *y, int n) |
| void | cpp_python_add_ints_to_dict (void *context_ptr, const char *name, int len_name, int *values, int nvalues) |
| void | cpp_python_add_doubles_to_dict (void *context_ptr, const char *name, int len_name, double *values, int nvalues) |
| void * | cpp_python_create_context () |
| void | cpp_python_free_context (void *context) |
Variables | |
| void * | handle = nullptr |
| PyObject * | pDict = nullptr |
| bool | python_initialized = false |
| bool | sync_enabled = false |
| std::set< int > | nodes_uid |
| std::map< int, int > | nodes_uid_to_local_id |
| KeywordPairs | element_variables |
| static PyObject * | persistent_dict = nullptr |
| static PyObject * | persistent_arg = nullptr |
| typedef float my_real |
Definition at line 49 of file cpp_python_funct.cpp.
| PyObject * call_python_function | ( | const char * | func_name, |
| double * | args, | ||
| int | num_args ) |
Definition at line 318 of file cpp_python_funct.cpp.
| void call_python_function1D_vectors | ( | const char * | func_name, |
| std::vector< double > & | X, | ||
| std::vector< double > & | Y ) |
Definition at line 372 of file cpp_python_funct.cpp.
| PyObject * call_python_function_with_state | ( | const char * | func_name | ) |
Definition at line 244 of file cpp_python_funct.cpp.
| void check_error | ( | int | line_number | ) |
Definition at line 205 of file cpp_python_funct.cpp.
| void cpp_python_add_doubles_to_dict | ( | void * | context_ptr, |
| const char * | name, | ||
| int | len_name, | ||
| double * | values, | ||
| int | nvalues ) |
Definition at line 1425 of file cpp_python_funct.cpp.
| void cpp_python_add_ints_to_dict | ( | void * | context_ptr, |
| const char * | name, | ||
| int | len_name, | ||
| int * | values, | ||
| int | nvalues ) |
Definition at line 1396 of file cpp_python_funct.cpp.
| void cpp_python_call_function | ( | char * | name, |
| int | num_args, | ||
| double * | args, | ||
| int | num_return, | ||
| double * | return_values ) |
Definition at line 912 of file cpp_python_funct.cpp.
| void cpp_python_call_function_with_state | ( | char * | name, |
| double * | return_values ) |
Definition at line 933 of file cpp_python_funct.cpp.
| void cpp_python_check_function | ( | char * | name, |
| int * | error ) |
Definition at line 951 of file cpp_python_funct.cpp.
| void * cpp_python_create_context | ( | ) |
Definition at line 1453 of file cpp_python_funct.cpp.
| void cpp_python_create_node_mapping | ( | int * | itab, |
| int * | num_nodes ) |
Definition at line 1072 of file cpp_python_funct.cpp.
| void cpp_python_execute_code | ( | const char * | code | ) |
Definition at line 773 of file cpp_python_funct.cpp.
| void cpp_python_finalize | ( | ) |
Definition at line 769 of file cpp_python_funct.cpp.
| void cpp_python_free_context | ( | void * | context | ) |
Definition at line 1463 of file cpp_python_funct.cpp.
| void cpp_python_get_elemental_entity | ( | int | nb, |
| char * | name, | ||
| int * | uid ) |
Definition at line 1331 of file cpp_python_funct.cpp.
| void cpp_python_get_nodes | ( | int * | nodes_uid_array | ) |
Definition at line 1058 of file cpp_python_funct.cpp.
| void cpp_python_get_number_elemental_entities | ( | int * | nb | ) |
Definition at line 1326 of file cpp_python_funct.cpp.
| void cpp_python_get_number_of_nodes | ( | int * | num_nodes | ) |
Definition at line 1044 of file cpp_python_funct.cpp.
| void cpp_python_initialize | ( | int * | ierror | ) |
Definition at line 636 of file cpp_python_funct.cpp.
| void cpp_python_initialize_global_variables | ( | ) |
Definition at line 780 of file cpp_python_funct.cpp.
| void cpp_python_load_environment | ( | ) |
Definition at line 689 of file cpp_python_funct.cpp.
| void cpp_python_register_function | ( | char * | name, |
| char | code[], | ||
| int | num_lines ) |
Definition at line 849 of file cpp_python_funct.cpp.
Definition at line 1349 of file cpp_python_funct.cpp.
| void cpp_python_sync | ( | void * | pcontext | ) |
Definition at line 703 of file cpp_python_funct.cpp.
| void cpp_python_update_active_node | ( | int | name_len, |
| char * | name, | ||
| double * | values ) |
Definition at line 1199 of file cpp_python_funct.cpp.
| void cpp_python_update_active_node_ids | ( | int | id, |
| int | uid ) |
Definition at line 1239 of file cpp_python_funct.cpp.
| void cpp_python_update_elemental_entity | ( | char * | name, |
| double | value, | ||
| int | uid ) |
Definition at line 1308 of file cpp_python_funct.cpp.
| void cpp_python_update_nodal_entity | ( | int | numnod, |
| int | name_len, | ||
| char * | name, | ||
| my_real * | values ) |
Definition at line 1257 of file cpp_python_funct.cpp.
| void cpp_python_update_reals | ( | char * | basename, |
| int * | uid, | ||
| my_real * | reals, | ||
| int | num_reals ) |
Definition at line 975 of file cpp_python_funct.cpp.
| void cpp_python_update_sensors | ( | int * | types, |
| int * | uids, | ||
| int * | statuses, | ||
| double * | results, | ||
| int * | num_sensors ) |
Definition at line 1102 of file cpp_python_funct.cpp.
Definition at line 1004 of file cpp_python_funct.cpp.
| std::string element_parenthesis_to_underscore | ( | const std::string & | input, |
| const std::array< const char *, N > & | keywords ) |
Definition at line 86 of file cpp_python_funct.cpp.
| void exit_with_message | ( | const char * | message | ) |
Definition at line 197 of file cpp_python_funct.cpp.
| void extract_element_keywords | ( | const std::string & | input | ) |
Definition at line 142 of file cpp_python_funct.cpp.
| std::string extract_function_name | ( | const std::string & | signature | ) |
Definition at line 410 of file cpp_python_funct.cpp.
| void extract_node_uid | ( | const std::string & | input | ) |
Definition at line 111 of file cpp_python_funct.cpp.
| void load_functions | ( | T | h, |
| bool & | python_initialized ) |
Definition at line 163 of file cpp_python_funct.cpp.
| std::string node_parenthesis_to_underscore | ( | const std::string & | input | ) |
Definition at line 97 of file cpp_python_funct.cpp.
| std::string parenthesis_to_underscore | ( | const std::string & | input | ) |
Definition at line 104 of file cpp_python_funct.cpp.
| void python_execute_code | ( | const std::string & | code | ) |
Definition at line 403 of file cpp_python_funct.cpp.
| void python_load_library | ( | ) |
Definition at line 551 of file cpp_python_funct.cpp.
| void python_signal_handler | ( | int | signum | ) |
Definition at line 230 of file cpp_python_funct.cpp.
| bool try_load_library | ( | const std::string & | path | ) |
Definition at line 529 of file cpp_python_funct.cpp.
| KeywordPairs element_variables |
Definition at line 80 of file cpp_python_funct.cpp.
| void* handle = nullptr |
Definition at line 67 of file cpp_python_funct.cpp.
| std::set<int> nodes_uid |
Definition at line 77 of file cpp_python_funct.cpp.
| std::map<int, int> nodes_uid_to_local_id |
Definition at line 79 of file cpp_python_funct.cpp.
| PyObject* pDict = nullptr |
Definition at line 71 of file cpp_python_funct.cpp.
|
static |
Definition at line 82 of file cpp_python_funct.cpp.
|
static |
Definition at line 81 of file cpp_python_funct.cpp.
| bool python_initialized = false |
Definition at line 72 of file cpp_python_funct.cpp.
| bool sync_enabled = false |
Definition at line 73 of file cpp_python_funct.cpp.