103 std::stringstream outString;
104 double *fluidCoordinates = NULL;
105 double *solidCoordinates = NULL;
108 COM_get_array(fluidsCoordinateName.c_str(),
fluidsAgent->
PaneID(),&fluidCoordinates);
112 if(!fluidCoordinates || !solidCoordinates){
113 outString <<
"FSICoupling::TestTransfer:Error: Failed to get coordinate arrays. Exiting."
115 StdOut(outString.str(),0,
true);
120 double tolerance = 1e-12;
124 outString <<
"BEFORE TRANSFER: " << std::endl;
125 for(
int i = 0; i < numberFluidNodes;i++){
126 outString <<
"F(" << fluidCoordArray[i*3] <<
"," << fluidCoordArray[i*3+1] <<
","
127 << fluidCoordArray[i*3+2] <<
")" << std::endl;
129 for(
int i = 0; i < numberSolidNodes;i++){
130 outString <<
"S(" << structCoordArray[i*3] <<
"," << structCoordArray[i*3+1] <<
","
131 << structCoordArray[i*3+2] <<
")" << std::endl;
133 StdOut(outString.str(),3,
true);
138 outString <<
"FLUIDS AFTER TRANSFER: " << std::endl;
139 for(
int i = 0; i < numberFluidNodes;i++){
140 double diff1 = std::abs(fluidCoordinates[i*3] - fluidCoordArray[i*3]);
141 double diff2 = std::abs(fluidCoordinates[i*3+1] - fluidCoordArray[i*3+1]);
142 double diff3 = std::abs(fluidCoordinates[i*3+2] - fluidCoordArray[i*3+2]);
143 double diff = std::sqrt(diff1*diff1 + diff2*diff2 + diff3*diff3);
144 if(diff > maxdiff) maxdiff = diff;
145 if(diff > tolerance){
146 outString <<
"FSICoupling::TestTransfer: Coordinate transfer tolerance exceeded for node " << i+1
147 <<
" (" << diff <<
")" << std::endl
148 <<
"(" << fluidCoordinates[i*3] <<
"," << fluidCoordinates[i*3+1] <<
"," << fluidCoordinates[i*3+2]
149 <<
") : (" << fluidCoordArray[i*3] <<
"," << fluidCoordArray[i*3+1] <<
"," << fluidCoordArray[i*3+2]
153 outString <<
"FSICoupling::TestTransfer: Maximum transferred (s->f) coordinate difference: " << maxdiff << std::endl;
154 StdOut(outString.str(),3,
true);
const std::vector< double > & Coordinates() const
transferagentpar * transferAgent
solidagentpar * structuresAgent
std::string fluidsInterfaceName
std::string structuresInterfaceName
const std::vector< double > & Coordinates() const
fluidagentpar * fluidsAgent