398 std::stringstream outString;
399 double *fluidCoordinates = NULL;
400 double *solidCoordinates = NULL;
403 COM_get_array(fluidsCoordinateName.c_str(),
fluidsAgent->
PaneID(),&fluidCoordinates);
407 if(!fluidCoordinates || !solidCoordinates){
408 outString <<
"FSICoupling::TestTransfer:Error: Failed to get coordinate arrays. Exiting."
410 StdOut(outString.str(),0,
true);
415 double tolerance = 1e-12;
419 outString <<
"BEFORE TRANSFER: " << std::endl;
420 for(
int i = 0; i < numberFluidNodes;i++){
421 outString <<
"F(" << fluidCoordArray[i*3] <<
"," << fluidCoordArray[i*3+1] <<
","
422 << fluidCoordArray[i*3+2] <<
")" << std::endl;
424 for(
int i = 0; i < numberSolidNodes;i++){
425 outString <<
"S(" << structCoordArray[i*3] <<
"," << structCoordArray[i*3+1] <<
","
426 << structCoordArray[i*3+2] <<
")" << std::endl;
428 StdOut(outString.str(),3,
true);
432 outString <<
"FLUIDS AFTER TRANSFER: " << std::endl;
433 for(
int i = 0; i < numberFluidNodes;i++){
434 double diff1 = std::abs(fluidCoordinates[i*3] - fluidCoordArray[i*3]);
435 double diff2 = std::abs(fluidCoordinates[i*3+1] - fluidCoordArray[i*3+1]);
436 double diff3 = std::abs(fluidCoordinates[i*3+2] - fluidCoordArray[i*3+2]);
437 double diff = std::sqrt(diff1*diff1 + diff2*diff2 + diff3*diff3);
438 if(diff > maxdiff) maxdiff = diff;
439 if(diff > tolerance){
440 outString <<
"FSICoupling::TestTransfer: Coordinate transfer tolerance exceeded for node " << i+1
441 <<
" (" << diff <<
")" << std::endl
442 <<
"(" << fluidCoordinates[i*3] <<
"," << fluidCoordinates[i*3+1] <<
"," << fluidCoordinates[i*3+2]
443 <<
") : (" << fluidCoordArray[i*3] <<
"," << fluidCoordArray[i*3+1] <<
"," << fluidCoordArray[i*3+2]
447 outString <<
"FSICoupling::TestTransfer: Maximum transferred (s->f) coordinate difference: " << maxdiff << std::endl;
448 StdOut(outString.str(),3,
true);
solidagent * structuresAgent
transferagent * transferAgent
std::string structuresInterfaceName
const std::vector< double > & Coordinates() const
std::string fluidsInterfaceName
const std::vector< double > & Coordinates() const