| 255 | "); |
| 256 | |
| 257 | static PyObject * |
| 258 | Math_compute_womersley(PyObject *self, PyObject *args) |
| 259 | { |
| 260 | auto api = PyUtilApiFunction("Odddddd", PyRunTimeErr, __func__); |
| 261 | PyObject *termsArg; |
| 262 | double time = 0; |
| 263 | double viscosity = 0; |
| 264 | double omega = 0; |
| 265 | double density = 0; |
| 266 | double radmax = 0; |
| 267 | double radius = 0; |
| 268 | |
| 269 | if (!PyArg_ParseTuple(args, api.format, &termsArg, &time, &viscosity, &omega, &density, &radmax, &radius)) { |
| 270 | return api.argsError(); |
| 271 | } |
| 272 | |
| 273 | // TODO:DaveP] check other args. |
| 274 | |
| 275 | // Get an array of points from the pointsArgs list. |
| 276 | int dim = 2; |
| 277 | auto terms = GetPointsFromList(api, termsArg, dim, "terms"); |
| 278 | if (terms == nullptr) { |
| 279 | return nullptr; |
| 280 | } |
| 281 | int nlistterms = PyList_Size(termsArg); |
| 282 | |
| 283 | // Perform the womersley operation. |
| 284 | // |
| 285 | auto mathObj = cvMath(); |
| 286 | double velocity = 0; |
| 287 | if (mathObj.compute_v_womersley(terms, nlistterms, viscosity, density, omega, radmax, radius, time, &velocity) == SV_ERROR) { |
| 288 | mathObj.deleteArray(terms,nlistterms,dim); |
| 289 | api.error("Error calculating the womersley velocity."); |
| 290 | return nullptr; |
| 291 | } |
| 292 | |
| 293 | mathObj.deleteArray(terms,nlistterms,dim); |
| 294 | |
| 295 | return Py_BuildValue("d",velocity); |
| 296 | } |
| 297 | |
| 298 | //--------------------------- |
| 299 | // Math_linear_interpolate |
nothing calls this directly
no test coverage detected