| 89 | |
| 90 | |
| 91 | Response* FrictionModel::setResponse(const char **argv, int argc, |
| 92 | OPS_Stream &theOutputStream) |
| 93 | { |
| 94 | Response *theResponse = 0; |
| 95 | |
| 96 | theOutputStream.tag("FrictionModelOutput"); |
| 97 | theOutputStream.attr("frnMdlType", this->getClassType()); |
| 98 | theOutputStream.attr("frnMdlTag", this->getTag()); |
| 99 | |
| 100 | // normal force |
| 101 | if (strcmp(argv[0],"normalForce") == 0 || strcmp(argv[0],"N") == 0 || |
| 102 | strcmp(argv[0],"normalFrc") == 0) { |
| 103 | theOutputStream.tag("ResponseType", "N"); |
| 104 | return new FrictionResponse(this, 1, this->getNormalForce()); |
| 105 | } |
| 106 | // velocity |
| 107 | else if (strcmp(argv[0],"velocity") == 0 || strcmp(argv[0],"vel") == 0) { |
| 108 | theOutputStream.tag("ResponseType", "vel"); |
| 109 | return new FrictionResponse(this, 2, this->getVelocity()); |
| 110 | } |
| 111 | // friction force |
| 112 | else if (strcmp(argv[0],"frictionForce") == 0 || strcmp(argv[0],"Ff") == 0 || |
| 113 | strcmp(argv[0],"frnForce") == 0 || strcmp(argv[0],"frnFrc") == 0) { |
| 114 | theOutputStream.tag("ResponseType", "frnFrc"); |
| 115 | return new FrictionResponse(this, 3, this->getFrictionForce()); |
| 116 | } |
| 117 | // coefficient of friction |
| 118 | else if (strcmp(argv[0],"frictionCoeff") == 0 || strcmp(argv[0],"mu") == 0 || |
| 119 | strcmp(argv[0],"frnCoeff") == 0 || strcmp(argv[0],"COF") == 0) { |
| 120 | theOutputStream.tag("ResponseType", "COF"); |
| 121 | return new FrictionResponse(this, 4, this->getFrictionCoeff()); |
| 122 | } |
| 123 | |
| 124 | theOutputStream.endTag(); |
| 125 | return theResponse; |
| 126 | } |
| 127 | |
| 128 | |
| 129 | int FrictionModel::getResponse(int responseID, Information &info) |
nothing calls this directly
no test coverage detected