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 int Initialize ( std::vector< std::string > &  componentInterfaceNames,
double  finalTime,
double  timeStep 
)
inlinevirtual

Definition at line 254 of file FsiCouplingPar.H.

References couplingbase::componentAgents, fluidsAgent, fluidsInterfaceName, fluidsWinFnameHDF, openfoamagentpar::Initialize(), elmeragentpar::Initialize(), probNdeId, probProcId, probSolverName, runMode, setsProb, simoutInterfaceName, simpalInterfaceName, simulationFinalTime, simulationTime, simulationTimeStep, structuresAgent, structuresInterfaceName, structuresWinFnameHDF, surfUtilInterfaceName, transferAgent, transferInterfaceName, verblevel, and writeWin().

255  {
256 
257  FunctionEntry("Initialize");
258  std::stringstream outString;
259  outString << "Final Time = " << finalTime << std::endl;
260  outString << "Time Step = " << timeStep << std::endl;
261  StdOut(outString.str(),0,true);
262  outString.clear();
263  outString.str("");
264 
265  if(componentInterfaceNames.size() < 2)
266  return(1);
267 
268  fluidsInterfaceName = componentInterfaceNames[0];
269  structuresInterfaceName = componentInterfaceNames[1];
270  transferInterfaceName = componentInterfaceNames[2];
271  surfUtilInterfaceName = componentInterfaceNames[3];
272  simpalInterfaceName = componentInterfaceNames[4];
273  simoutInterfaceName = componentInterfaceNames[5];
274 
277  transferAgent = new transferagentpar(transferInterfaceName, (this->Communicator()).GetCommunicator(),
278  verblevel);
279 
280  // Initialize the fluids module and writing the window
281  if(runMode != 2)
283  Communicator().Barrier();
284  writeWin((const char *)fluidsInterfaceName.c_str(), "0", fluidsWinFnameHDF);
285  Communicator().Barrier();
286 
287 
288  // Initialize the structures module and writing the window
289  if(runMode != 1)
291  writeWin((const char *)structuresInterfaceName.c_str(), "0", structuresWinFnameHDF);
292  Communicator().Barrier();
293 
294  // accessing a dataitem for fast debugging
295  /*
296  double* Disps;
297  int stride, cap;
298  COM_get_array((structuresInterfaceName+".Displacements").c_str(), structuresAgent->PaneID(),
299  &Disps, &stride, &cap);
300  for (int i=0; i<stride*cap; i++)
301  std::cout << "Rank " << Rank()
302  << "Item = " << Disps[i]
303  << std::endl;
304  */
305 
306  // Initialize the transfer module's common refinement
307  if(runMode == 0) {
310  //TestTransfer();
311  }
312 
313  // setting up probe for the solver
314  // only implementd for fluids solver
315  COM_set_array((fluidsInterfaceName+".setsProb").c_str(),0,&setsProb);
316  if(setsProb){
317  std::string newDataItemName(probSolverName+".probProcId");
318  COM_set_array(newDataItemName.c_str(),0,&probProcId);
319  newDataItemName = probSolverName+".probNdeId";
320  COM_set_array(newDataItemName.c_str(),0,&probNdeId);
321  }
322 
323  componentAgents.resize(2);
326 
327  simulationTime = 0; // ? (restart)
328  simulationFinalTime = finalTime;
329  simulationTimeStep = timeStep;
330 
331  //DumpSolution();
332 
333 
334  FunctionExit("Initialize");
335  return(0);
336 
337  };
std::string fluidsWinFnameHDF
transferagentpar * transferAgent
double simulationTimeStep
solidagentpar * structuresAgent
std::string fluidsInterfaceName
virtual int Initialize(const std::string interfaceName, int verblevel=1)
virtual int Initialize(const std::string &interfaceName, int verblevel=1)
Definition: ElmerParAgent.H:10
std::string structuresInterfaceName
SolverUtils::TransferObjectPar transferagentpar
std::vector< impact::orchestrator::agentbase * > componentAgents
Definition: Orchestrator.H:44
virtual void writeWin(const char *winName, std::string timeMark, std::string &wFnameHdf)
std::string transferInterfaceName
openfoamagentpar fluidagentpar
double simulationTime
elmeragentpar solidagentpar
std::string simpalInterfaceName
fluidagentpar * fluidsAgent
std::string probSolverName
std::string simoutInterfaceName
std::string surfUtilInterfaceName
double simulationFinalTime
std::string structuresWinFnameHDF

Here is the call graph for this function: