223 std::stringstream outString;
224 int stride = 0, solidStride = 0, solidLoadStride = 0;
225 int cap = 0, solidCap = 0, solidLoadCap = 0;
226 double *pressures = NULL, *solidPressures = NULL, *solidLoads = NULL;
230 int isize = cap*stride;
232 for(
int i = 0;i < isize;i++){
233 std::cout <<
"Pressure(" << i <<
") = " << pressures[i] << std::endl;
242 if(solidFaceLoadsHandle < 0){
243 outString <<
"Error: (TransferPressuresToStructures)" << std::endl
244 <<
" No handle for FaceLoads with structure solver" << std::endl;
245 StdOut(outString.str(),0,
true);
251 if(solidPressuresHandle < 0){
252 outString <<
"Error: (TransferPressuresToStructures)" << std::endl
253 <<
" No handle for Pressures with structure solver" << std::endl;
254 StdOut(outString.str(),0,
true);
263 &solidStride,&solidCap);
264 int solidIsize = solidCap*solidStride;
266 for(
int i = 0;i < solidIsize;i++){
269 outString << std::setprecision(15) <<
"solidPressure(" << i <<
") = " << solidPressures[i] << std::endl;
271 StdOut(outString.str(),3,
true);
276 std::string funcName;
278 int faceNormalsHandle = COM_get_function_handle(funcName.c_str());
279 if(faceNormalsHandle < 0){
280 outString <<
"Error: (TransferPressuresToStructures)" << std::endl
281 <<
" No handle for compute_element_normals function " << std::endl;
282 StdOut(outString.str(),0,
true);
288 int mulHandle = COM_get_function_handle(funcName.c_str());
290 outString <<
"Error: (TransferPressuresToStructures)" << std::endl
291 <<
" No handle for simpal multiply function " << std::endl;
292 StdOut(outString.str(),0,
true);
298 int negHandle = COM_get_function_handle(funcName.c_str());
300 outString <<
"Error: (TransferPressuresToStructures)" << std::endl
301 <<
" No handle for simpal negate function " << std::endl;
302 StdOut(outString.str(),0,
true);
313 COM_call_function(faceNormalsHandle, &solidFaceLoadsHandle, &normalize);
316 COM_call_function(mulHandle, &solidFaceLoadsHandle, &solidPressuresHandle,
317 &solidFaceLoadsHandle);
318 COM_call_function(negHandle, &solidFaceLoadsHandle, &solidFaceLoadsHandle);
328 structuresTransferAgent->Transfer(
"FaceLoads",
"Loads");
332 &solidLoadStride,&solidLoadCap);
333 int solidLoadsize = solidLoadCap*solidLoadStride;
334 for(
int i = 0;i < solidLoadsize;i++){
335 std::cout << std::setprecision(15) <<
"solidLoads(" << i <<
") = " << solidLoads[i] << std::endl;
340 if(fluidFaceNormalsHandle < 0){
341 outString <<
"Error: (TransferPressuresToStructures)" << std::endl
342 <<
" No handle for FaceNormals with fluids solver" << std::endl;
343 StdOut(outString.str(),0,
true);
349 COM_call_function(faceNormalsHandle, &fluidFaceNormalsHandle, &normalize);
350 double *fluidFaceNormals = NULL;
351 COM_get_array((
fluidsInterfaceName+
".normals").c_str(),101,&fluidFaceNormals,&stride,&cap);
354 outString <<
"stride = " << stride << std::endl;
355 std::vector<double> sums (stride, 0.0);
356 outString <<
"Driver: fluid face normals:" << std::endl;
357 for(
int i=0; i < cap; i++){
358 for(
int j=0; j < stride; j++){
359 outString << fluidFaceNormals[stride*i + j] <<
" ";
360 sums[j] += fluidFaceNormals[stride*i + j];
362 outString << std::endl;
364 outString <<
"sums: ";
365 for(
int i=0; i < sums.size(); i++)
366 outString << sums[i] <<
" ";
367 outString << std::endl;
368 StdOut(outString.str(),3,
true);
SolverUtils::TransferObject transferagent
transferagent * transferAgent
std::string simpalInterfaceName
std::string structuresInterfaceName
std::string surfUtilInterfaceName
std::string fluidsInterfaceName