34 #include "com_devel.hpp"
57 namespace IcoFoamMod {
73 if(other_window_handle > 0)
78 if(fortran_window_handle > 0)
88 char** argv = (
char**)(pargv);
90 icoFoamMain(argc, argv);
100 static void Load(
const std::string &name){
101 std::cout <<
"Loading IcoFoamModule with name " << name
105 COM_new_window(name, MPI_COMM_NULL);
107 std::string global_name(name+
".global");
108 COM_new_dataitem(global_name.c_str(),
'w',COM_VOID,1,
"");
109 COM_set_object(global_name.c_str(),0,module_pointer);
112 std::vector<COM_Type> types(13,COM_INT);
114 types[0] = COM_RAWDATA;
116 COM_set_member_function( (name+
".IcoFoamModuleFunction").c_str(),
118 global_name.c_str(),
"bii", &types[0]);
122 COM_window_init_done(name);
130 static void Unload(
const std::string &name){
131 std::cout <<
"Unloading IcoFoamModule with name " << name
134 std::string global_name(name+
".global");
135 COM_get_object(global_name.c_str(),0,&module_pointer);
136 COM_assertion_msg( module_pointer->validate_object()==0,
"Invalid object");
137 delete module_pointer;
138 COM_delete_window(std::string(name));
std::vector< int > dataArray
std::string other_window_name
Tracks this window name.
IcoFoamModule()
Default constructor.
void IcoFoamModule_unload_module(const char *name)
C/C++ bindings to unload IcoFoamModule.
std::string fortran_window_name
Tracks this external window's name.
int IcoFoamModuleFunction(int *pargc, void **pargv)
virtual ~IcoFoamModule()
Destructor.
void IcoFoamModule_load_module(const char *name)
C/C++ bindings to load IcoFoamModule.
static void Unload(const std::string &name)
Unloads the IcoFoamModule.
COM_EXTERN_MODULE(OpenFoamFSI)
static void Load(const std::string &name)
"Loads" IcoFoamModule
std::string my_window_name