| 416 | } |
| 417 | |
| 418 | Response* |
| 419 | Element::setResponse(const char **argv, int argc, OPS_Stream &output) |
| 420 | { |
| 421 | Response *theResponse = 0; |
| 422 | |
| 423 | output.tag("ElementOutput"); |
| 424 | output.attr("eleType",this->getClassType()); |
| 425 | output.attr("eleTag",this->getTag()); |
| 426 | int numNodes = this->getNumExternalNodes(); |
| 427 | const ID &nodes = this->getExternalNodes(); |
| 428 | static char nodeData[32]; |
| 429 | |
| 430 | for (int i=0; i<numNodes; i++) { |
| 431 | sprintf(nodeData,"node%d",i+1); |
| 432 | output.attr(nodeData,nodes(i)); |
| 433 | } |
| 434 | |
| 435 | if (strcmp(argv[0],"force") == 0 || strcmp(argv[0],"forces") == 0 || |
| 436 | strcmp(argv[0],"globalForce") == 0 || strcmp(argv[0],"globalForces") == 0) { |
| 437 | const Vector &force = this->getResistingForce(); |
| 438 | int size = force.Size(); |
| 439 | for (int i=0; i<size; i++) { |
| 440 | sprintf(nodeData,"P%d",i+1); |
| 441 | output.tag("ResponseType",nodeData); |
| 442 | } |
| 443 | // Using "strange" numbers to avoid conflicts with Element subclasses |
| 444 | theResponse = new ElementResponse(this, 111111, this->getResistingForce()); |
| 445 | } |
| 446 | |
| 447 | else if (strcmp(argv[0],"dampingForce") == 0 || strcmp(argv[0],"dampingForces") == 0) { |
| 448 | const Vector &force = this->getResistingForce(); |
| 449 | int size = force.Size(); |
| 450 | for (int i=0; i<size; i++) { |
| 451 | sprintf(nodeData,"P%d",i+1); |
| 452 | output.tag("ResponseType",nodeData); |
| 453 | } |
| 454 | theResponse = new ElementResponse(this, 222222, this->getResistingForce()); |
| 455 | } |
| 456 | |
| 457 | else if (strcmp(argv[0],"dynamicForce") == 0 || strcmp(argv[0],"dynamicForces") == 0) { |
| 458 | const Vector &force = this->getResistingForce(); |
| 459 | int size = force.Size(); |
| 460 | for (int i=0; i<size; i++) { |
| 461 | sprintf(nodeData,"P%d",i+1); |
| 462 | output.tag("ResponseType",nodeData); |
| 463 | } |
| 464 | theResponse = new ElementResponse(this, 333333, this->getResistingForce()); |
| 465 | } |
| 466 | |
| 467 | else if (strcmp(argv[0],"inertialForce") == 0 || strcmp(argv[0],"inertialForces") == 0) { |
| 468 | const Vector &force = this->getResistingForce(); |
| 469 | int size = force.Size(); |
| 470 | for (int i=0; i<size; i++) { |
| 471 | sprintf(nodeData,"P%d",i+1); |
| 472 | output.tag("ResponseType",nodeData); |
| 473 | } |
| 474 | theResponse = new ElementResponse(this, 444444, this->getResistingForce()); |
| 475 | } |
nothing calls this directly
no test coverage detected