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 updateSolution ( )

Definition at line 214 of file SolverModuleDriverParallel.C.

References SolverModuleDriver::Disp, SolverModuleDriver::isFSI, SolverModuleDriver::Loads, SolverModuleDriver::locDisp, SolverModuleDriver::locLoads, SolverModuleDriver::locPress, SolverModuleDriver::myPaneId, SolverModuleDriver::myRank, SolverModuleDriver::nDisp, SolverModuleDriver::nLoads, SolverModuleDriver::nPress, SolverModuleDriver::Press, SolverModuleDriver::typeDisp, SolverModuleDriver::typeLoads, and SolverModuleDriver::typePress.

Referenced by COM::parallelProgram(), and SolverModuleDriver::vtkDump().

214  {
215  // only for FSI problems
216  if (!isFSI)
217  return(0);
218  char getDataItemLoc;
219  COM_Type getDataItemType;
220  std::string getDataItemUnits;
221  // get displacements
222  std::string name;
223  int myDataItemType;
224  name = "ELMModule.Displacements";
225  COM_get_dataitem(name, &getDataItemLoc, &getDataItemType,
226  &nDisp, &getDataItemUnits);
227  std::cout << "Rank #" << myRank
228  << ", ELMModuleDriver:main: Displacement Get DataItem"
229  << std::endl;
230  std::cout << "Rank #" << myRank
231  << ", ELMModuleDriver:main: getDataItemLoc: " << getDataItemLoc << std::endl;
232  std::cout << "Rank #" << myRank
233  << ", ELMModuleDriver:main: getDataItemType: " << getDataItemType << std::endl;
234  std::cout << "Rank #" << myRank
235  << ", ELMModuleDriver:main: arrayLength: " << nDisp << std::endl;
236  std::cout << "Rank #" << myRank
237  << ", ELMModuleDriver:main: getDataItemUnits: " << getDataItemUnits << std::endl;
238  // translate element (e) to cell (c)
239  char myDataItemLoc;
240  if (getDataItemLoc == 'e' || getDataItemLoc == 'E') {
241  locDisp = 'c';
242  } else if (getDataItemLoc == 'n' || getDataItemLoc == 'N') {
243  locDisp = 'n';
244  } else {
245  std::cout << "ELMModuleDriver:main: Unknown Data Item Location" << std::endl;
246  exit(1);
247  }
248  if (getDataItemType == COM_DOUBLE_PRECISION) {
249  typeDisp = 8;
250  } else {
251  std::cout << "ELMModuleDriver:main: Unknown Data Item Type" << std::endl;
252  exit(1);
253  }
254  // acquire dataitem from COM
255  COM_get_array("ELMModule.Displacements", myPaneId, &Disp);
256  // get loads
257  name = "ELMModule.Loads";
258  COM_get_dataitem(name, &getDataItemLoc, &getDataItemType,
259  &nLoads, &getDataItemUnits);
260  std::cout << "Rank #" << myRank
261  << ", ELMModuleDriver:main: Load Get DataItem"
262  << std::endl;
263  std::cout << "Rank #" << myRank
264  << ", ELMModuleDriver:main: getDataItemLoc: " << getDataItemLoc << std::endl;
265  std::cout << "Rank #" << myRank
266  << ", ELMModuleDriver:main: getDataItemType: " << getDataItemType << std::endl;
267  std::cout << "Rank #" << myRank
268  << ", ELMModuleDriver:main: arrayLength: " << nLoads << std::endl;
269  std::cout << "Rank #" << myRank
270  << ", ELMModuleDriver:main: getDataItemUnits: " << getDataItemUnits << std::endl;
271  // translate element (e) to cell (c)
272  if (getDataItemLoc == 'e' || getDataItemLoc == 'E') {
273  locLoads = 'c';
274  } else if (getDataItemLoc == 'n' || getDataItemLoc == 'N') {
275  locLoads = 'n';
276  } else {
277  std::cout << "ELMModuleDriver:main: Unknown Data Item Location" << std::endl;
278  exit(1);
279  }
280  if (getDataItemType == COM_DOUBLE_PRECISION) {
281  typeLoads = 8;
282  } else {
283  std::cout << "ELMModuleDriver:main: Unknown Data Item Type" << std::endl;
284  exit(1);
285  }
286  // acquire dataitem from COM
287  COM_get_array("ELMModule.Loads", myPaneId, &Loads);
288  // get pressures
289  name = "ELMModule.Pressures";
290  COM_get_dataitem(name, &getDataItemLoc, &getDataItemType,
291  &nPress, &getDataItemUnits);
292  std::cout << "Rank #" << myRank
293  << ", ELMModuleDriver:main: Pressures Get DataItem"
294  << std::endl;
295  std::cout << "Rank #" << myRank
296  << ", ELMModuleDriver:main: getDataItemLoc: " << getDataItemLoc << std::endl;
297  std::cout << "Rank #" << myRank
298  << ", ELMModuleDriver:main: getDataItemType: " << getDataItemType << std::endl;
299  std::cout << "Rank #" << myRank
300  << ", ELMModuleDriver:main: arrayLength: " << nPress << std::endl;
301  std::cout << "Rank #" << myRank
302  << ", ELMModuleDriver:main: getDataItemUnits: " << getDataItemUnits << std::endl;
303  // translate element (e) to cell (c)
304  if (getDataItemLoc == 'e' || getDataItemLoc == 'E') {
305  locPress = 'c';
306  } else {
307  std::cout << "ELMModuleDriver:main: Unknown Data Item Location" << std::endl;
308  exit(1);
309  }
310  if (getDataItemType == COM_DOUBLE_PRECISION) {
311  typePress = 8;
312  } else {
313  std::cout << "ELMModuleDriver:main: Unknown Data Item Type" << std::endl;
314  exit(1);
315  }
316  COM_get_array(name.c_str(), myPaneId, &Press);
317 
318  }

Here is the caller graph for this function: