| 152 | |
| 153 | |
| 154 | void* OPS_NDGetStrain() |
| 155 | { |
| 156 | int tag = 0; |
| 157 | int size = 6; |
| 158 | |
| 159 | int numdata = 1; |
| 160 | if (OPS_GetIntInput(&numdata, &tag) < 0) return 0; |
| 161 | |
| 162 | NDMaterial* mat = OPS_getNDMaterial(tag); |
| 163 | |
| 164 | if (mat == NULL) |
| 165 | { |
| 166 | opserr << "OPS_NDGetStrain - material with tag " << tag << " does not exist" << endln; |
| 167 | return 0; |
| 168 | } |
| 169 | |
| 170 | const Vector &strain = mat->getStrain(); |
| 171 | |
| 172 | std::vector<double> values(size); |
| 173 | for (int i = 0; i < 6; i++) { |
| 174 | values[i] = strain(i); |
| 175 | } |
| 176 | if (OPS_SetDoubleOutput(&size, &values[0], false) < 0) { |
| 177 | opserr << "WARNING OPS_NDGetStress - failed to set double inputs\n"; |
| 178 | return 0; |
| 179 | } |
| 180 | |
| 181 | |
| 182 | return 0; |
| 183 | } |
| 184 | |
| 185 | |
| 186 |
nothing calls this directly
no test coverage detected