MCPcopy Create free account
hub / github.com/SimVascular/SimVascular / Math_compute_womersley

Function Math_compute_womersley

Code/Source/PythonAPI/Math_PyModule.cxx:257–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255");
256
257static PyObject *
258Math_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

Callers

nothing calls this directly

Calls 5

GetPointsFromListFunction · 0.85
argsErrorMethod · 0.80
compute_v_womersleyMethod · 0.80
errorMethod · 0.80
deleteArrayMethod · 0.45

Tested by

no test coverage detected