Changeset 8813
- Timestamp:
- Apr 5, 2013, 5:35:50 PM (12 years ago)
- Location:
- trunk/anuga_core/source/anuga
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/shallow_water/shallow_water_domain.py
r8810 r8813 1034 1034 assert self.conserved_quantities[2] == 'ymomentum', msg 1035 1035 1036 1037 #@profile 1036 1038 def extrapolate_second_order_sw(self): 1037 1039 """Fast version of extrapolation from centroids to edges""" … … 1040 1042 extrapol2(self) 1041 1043 1042 1044 #@profile 1043 1045 def compute_fluxes(self): 1044 1046 """Compute fluxes and timestep suitable for all volumes in domain. … … 1082 1084 # Use standard flux calculation, but calc gravity 1083 1085 # as -g h grad(w) - sum midpoint edge pressure terms 1086 import objgraph 1087 #print 50*"=" 1088 #objgraph.show_most_common_types() 1089 #print objgraph.typestats(objgraph.get_leaking_objects()) 1090 #objgraph.show_growth() 1091 1084 1092 from shallow_water_ext import compute_fluxes_ext_central_structure 1085 1093 from shallow_water_ext import gravity_wb as gravity_wb_c 1086 1094 1087 1095 self.flux_timestep = compute_fluxes_ext_central_structure(self) 1096 1097 #print 50*"-" 1098 #objgraph.show_most_common_types() 1088 1099 gravity_wb_c(self) 1100 1101 #print 50*"-" 1102 #objgraph.show_most_common_types() 1089 1103 1090 1104 elif self.compute_fluxes_method == 'wb_3': -
trunk/anuga_core/source/anuga/shallow_water/shallow_water_ext.c
r8810 r8813 1926 1926 D.ymom_explicit_update[k] += -g * zy*avg_h; 1927 1927 } 1928 1928 1929 1929 1930 return Py_BuildValue(""); … … 2770 2771 beta_vh_dry = D->beta_vh_dry; 2771 2772 optimise_dry_cells = D->optimise_dry_cells; 2773 2772 2774 extrapolate_velocity_second_order = D->extrapolate_velocity_second_order; 2773 2775 … … 5482 5484 timestep = _compute_fluxes_central_structure(&D); 5483 5485 5484 5486 5485 5487 return Py_BuildValue("d", timestep); 5486 5488 } … … 5533 5535 // the explicit update arrays 5534 5536 timestep = _compute_fluxes_central_wb(&D); 5537 5535 5538 5536 5539 -
trunk/anuga_core/source/anuga/shallow_water/sw_domain.h
r8457 r8813 253 253 D->ymom_explicit_update = get_python_array_data_from_dict(quantities, "ymomentum", "explicit_update"); 254 254 255 256 Py_DECREF(quantities); 257 258 Py_DECREF(neighbours); 259 Py_DECREF(surrogate_neighbours); 260 Py_DECREF(neighbour_edges); 261 Py_DECREF(normals); 262 Py_DECREF(edgelengths); 263 Py_DECREF(radii); 264 Py_DECREF(areas); 265 Py_DECREF(tri_full_flag); 266 Py_DECREF(already_computed_flux); 267 Py_DECREF(vertex_coordinates); 268 Py_DECREF(edge_coordinates); 269 Py_DECREF(centroid_coordinates); 270 Py_DECREF(max_speed); 271 Py_DECREF(number_of_boundaries); 255 272 256 273 return D; -
trunk/anuga_core/source/anuga/test_all.py
r8779 r8813 33 33 34 34 # Directories that should not be searched for test files. 35 exclude_dirs = ['shallow_water_balanced' , # Special requirements35 exclude_dirs = ['shallow_water_balanced' , 'damage_modelling', # Special requirements 36 36 '.svn', # subversion 37 37 'props', 'wcprops', 'prop-base', 'text-base', 'tmp'] -
trunk/anuga_core/source/anuga/utilities/util_ext.h
r8377 r8813 293 293 */ 294 294 295 B = (PyArrayObject*) PyObject_GetAttrString(O, name); 295 B = (PyArrayObject*) PyObject_GetAttrString(O, name); // New Reference 296 296 297 297 //printf("B = %p\n",(void*)B); … … 306 306 //Convert to consecutive array 307 307 A = (PyArrayObject*) PyArray_ContiguousFromObject((PyObject*) B, 308 B -> descr -> type, 0, 0); 308 B -> descr -> type, 0, 0); // New Reference 309 309 310 310 Py_DECREF(B); //FIXME: Is this really needed?? … … 330 330 331 331 //Get double from attribute 332 TObject = PyObject_GetAttrString(O, name); 332 TObject = PyObject_GetAttrString(O, name); //New Reference 333 333 if (!TObject) { 334 334 snprintf(buf, BUFFER_SIZE, "util_ext.h: get_python_double could not obtain double %s.\n", name); … … 377 377 PyObject *Oout; 378 378 379 Oout = PyObject_GetAttrString(O, name); 379 Oout = PyObject_GetAttrString(O, name); // New Reference 380 380 if (!Oout) { 381 381 PyErr_SetString(PyExc_RuntimeError, "util_ext.h: get_python_object could not obtain object"); … … 391 391 PyObject *A; 392 392 PyArrayObject *B; 393 394 A = PyDict_GetItemString(O, name); 395 B = get_consecutive_array(A, array); 396 397 return (double *) B->data; 393 double *data; 394 395 A = PyDict_GetItemString(O, name); // Borrowed Reference 396 if (!A) { 397 PyErr_SetString(PyExc_RuntimeError, "util_ext.h: get_python_array_from_object could not obtain object"); 398 return NULL; 399 } 400 B = get_consecutive_array(A, array); // New Reference 401 402 403 data = (double *) B->data; 404 405 Py_DECREF(B); 406 407 return data; 398 408 } 399 409
Note: See TracChangeset
for help on using the changeset viewer.