ElmerFoamFSI  2.0
ElmerFoamFSI is fluid-solid interaction simulation application built up from OpenFOAM CFD and Elmer CSM coupled through the IMPACT multiphysics software integration infrastructure.
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros Groups Pages
virtual void Test__ElmerHandlesCheck ( ResultsType &  result)
inlinevirtual

Definition at line 383 of file ElmerFoamFSITest.H.

Referenced by TestingObject< ResultsType >::Process(), and TestingObject< ResultsType >::RunTest().

383  {
384  bool works, loadWorks, globWorks, initWorks, runWorks, finWorks, unloadWorks = false;
385 
386  std::cout << "Running Test__ElmerHandlesCheck" << std::endl;
387 
388  //Loading Elmer Module
389  std::cout << "Loading Elmer Module" << std::endl;
390  COM_LOAD_MODULE_STATIC_DYNAMIC(ElmerCSC,"ElmerModule");
391 
392  //Checking Elmer Module is indeed loaded.
393  int ElmerHandle = COM_get_window_handle("ElmerModule");
394  if(ElmerHandle <=0){
395  std::cout << "After loading, COM_get_window_handle(\"ElmerModule\") returns "
396  << ElmerHandle << std::endl;
397  std::cout << "Error : Could not get window handle." << std::endl;
398  }
399  else{
400  loadWorks = true;
401  std::cout << "Elmer Module Loaded." << std::endl;
402  }
403 
404  //Checking the registration of global data.
405  int globHandle = COM_get_dataitem_handle("ElmerModule.global");
406  if(globHandle <= 0){
407  std::cout << "After loading, COM_get_dataitem_handle(\"ElmerModule.global\") returns "
408  << globHandle << std::endl;
409  std::cout << "Error : Could not get the data item handle." << std::endl;
410  }
411  else{
412  globWorks = true;
413  std::cout << "Global data handle accessed." << std::endl;
414  }
415 
416  //Checking the ElmerModule function Initialize handle
417  int initHandle = COM_get_function_handle("ElmerModule.Initialize");
418  if(initHandle <= 0){
419  std::cout << "After loading, COM_get_function_handle(\"ElmerModule.Initialize\") returns "
420  << initHandle << std::endl;
421  std::cout << "Error : Could not get the Initialize function handle." << std::endl;
422  }
423  else{
424  initWorks = true;
425  std::cout << "Initialize function handle accessed." << std::endl;
426  }
427 
428  //Checking the ElmerModule function Run handle
429  int runHandle = COM_get_function_handle("ElmerModule.Run");
430  if(runHandle <= 0){
431  std::cout << "After loading, COM_get_function_handle(\"ElmerModule.Run\") returns "
432  << runHandle << std::endl;
433  std::cout << "Error : Could not get the Run function handle." << std::endl;
434  }
435  else{
436  runWorks = true;
437  std::cout << "Run function handle accessed." << std::endl;
438  }
439 
440  //Checking the ElmerModule function Finalize handle
441  int finHandle = COM_get_function_handle("ElmerModule.Finalize");
442  if(finHandle <= 0){
443  std::cout << "After loading, COM_get_function_handle(\"ElmerModule.Finalize\") returns "
444  << finHandle << std::endl;
445  std::cout << "Error : Could not get the Finalize function handle." << std::endl;
446  }
447  else{
448  finWorks = true;
449  std::cout << "Finalize function handle accessed." << std::endl;
450  }
451 
452  //Unloading Elmer Module
453  std::cout << "Unloading Elmer Module" << std::endl;
454  COM_UNLOAD_MODULE_STATIC_DYNAMIC(ElmerCSC, "ElmerModule");
455 
456  //Checking Elmer Module is indeed unloaded.
457  ElmerHandle = COM_get_window_handle("ElmerModule");
458  if(ElmerHandle > 0){
459  std::cout << "After unloading, COM_get_window_handle(\"ElmerModule\") returns "
460  << ElmerHandle << std::endl;
461  std::cout << "Error : Module was not properly unloaded." << std::endl;
462  }
463  else{
464  unloadWorks = true;
465  std::cout << "ElmerModule Unloaded." << std::endl;
466  }
467 
468  if(loadWorks & globWorks & initWorks & runWorks & finWorks & unloadWorks) works = true;
469  result.UpdateResult("ElmerHandlesCheck:Works",works);
470  }

Here is the caller graph for this function: