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
int init ( int  argc,
char *  argv[] 
)

Get the handle for the initialize function and call it

Definition at line 35 of file ElmerFSI/trunk/src/SolverModuleDriver.C.

References changeLoads, Conn, connCorrect, ConnSize, Coord, coord_handle, coordData, CoordSize, Disp, DispSize, isFSI, isNum, Loads, LoadsSize, runs, ss, tNext, usage(), and var.

Referenced by main().

35  {
36 
37  COM_init( &argc, &argv);
38 
39  std::cout << "SoverModuleDriver:init: After COM_init" << std::endl;
40 
41  isNum = isFSI = changeLoads = false;
42  Disp = NULL;
43  DispSize = 0;
44  Coord = NULL;
45  Conn = NULL;
46  coord_handle = -1;
47  CoordSize=0;
48  coordData = false;
49  connCorrect = true;
50  ConnSize = 0;
51  Loads = NULL;
52  LoadsSize = 0;
53 
54  std::string arg;
55 
56  if(argc > 1){
57  for(int i=1; i < argc; i++){
58  ss.clear();
59  ss.str("");
60  ss << argv[i];
61  if(ss.str() == "-com-mpi")
62  continue;
63  if(ss.str() == "-fsi"){
64  isFSI = true;
65  continue;
66  }
67  if(ss.str() == "-loads"){
68  changeLoads = true;
69  continue;
70  }
71  for(int j=0; j < ss.str().size(); j++){
72  if(!isdigit(ss.str()[j]) && ss.str()[j] != 'e'
73  && ss.str()[j] != 'E' && ss.str()[j] != '-'
74  && ss.str()[j] != '.')
75  usage(argv[0]);
76  }
77  ss >> var;
78  tNext.push_back(var);
79  }
80  }
81  else
82  usage(argv[0]);
83 
84  for(int i=1; i < tNext.size(); i++){
85  if(tNext[i] <= tNext[i-1])
86  usage(argv[0]);
87  }
88 
89  COM_LOAD_MODULE_STATIC_DYNAMIC( ElmerCSC, "Window1");
90 
92  int init_handle = COM_get_function_handle("Window1.Initialize");
93  bool init_func = (init_handle > 0);
94  int verb=3;
95  runs = 0;
96  if(init_func){
97  COM_call_function(init_handle, &runs, &verb);
98  }
99 
100  return 0;
101 }
std::stringstream ss
std::vector< double > tNext

Here is the call graph for this function:

Here is the caller graph for this function: