Changeset 8968
- Timestamp:
- Sep 9, 2013, 9:01:13 PM (11 years ago)
- Location:
- trunk/anuga_core/source/anuga
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/neighbour_mesh.py
r8809 r8968 1038 1038 1039 1039 1040 def statistics(self ):1040 def statistics(self, nbins=10): 1041 1041 """Output statistics about mesh 1042 1042 """ … … 1051 1051 1052 1052 #Setup 10 bins for area histogram 1053 #print "nbins",nbins 1053 1054 bins = create_bins(areas, 10) 1055 #print "size bins",bins 1054 1056 #m = max(areas) 1055 1057 #bins = arange(0., m, m/10) … … 1081 1083 N = len(areas) 1082 1084 if N > 10: 1083 str += ' Percentiles ( 10%):\n'1085 str += ' Percentiles (%g percent):\n' % (100/nbins) 1084 1086 areas = areas.tolist() 1085 1087 areas.sort() -
trunk/anuga_core/source/anuga/operators/run_collect_max_stage_operator.py
r8962 r8968 32 32 33 33 domain.set_name() # based on script name 34 35 print domain.mesh.statistics(nbins=50) 34 36 35 37 #------------------------------------------------------------------------------ -
trunk/anuga_core/source/anuga/utilities/util_ext.h
r8813 r8968 28 28 #define P_ERROR_BUFFER_SIZE 65 29 29 30 31 // check that numpy array objects are C contiguous memory 32 #define CHECK_C_CONTIG(varname) if (!PyArray_ISCONTIGUOUS(varname)) { \ 33 char msg[1024]; \ 34 sprintf(msg, \ 35 "%s(): file %s, line %d: " \ 36 "'%s' object is not C contiguous memory", \ 37 __func__, __FILE__, __LINE__, #varname); \ 38 PyErr_SetString(PyExc_RuntimeError, msg); \ 39 return NULL; \ 40 } 41 42 43 44 45 46 47 30 48 void report_python_error(const char *location, const char *msg) 31 49 { … … 303 321 return NULL; 304 322 } 305 323 324 325 CHECK_C_CONTIG(B); 326 A = B; 306 327 //Convert to consecutive array 307 A = (PyArrayObject*) PyArray_ContiguousFromObject((PyObject*) B,308 B -> descr -> type, 0, 0); // New Reference309 310 Py_DECREF(B); //FIXME: Is this really needed??328 //A = (PyArrayObject*) PyArray_ContiguousFromObject((PyObject*) B, 329 // B -> descr -> type, 0, 0); // New Reference 330 331 //Py_DECREF(B); //FIXME: Is this really needed?? 311 332 312 333 if (!A) { … … 409 430 410 431 411 // check that numpy array objects are C contiguous memory 412 #define CHECK_C_CONTIG(varname) if (!PyArray_ISCONTIGUOUS(varname)) { \ 413 char msg[1024]; \ 414 sprintf(msg, \ 415 "%s(): file %s, line %d: " \ 416 "'%s' object is not C contiguous memory", \ 417 __func__, __FILE__, __LINE__, #varname); \ 418 PyErr_SetString(PyExc_RuntimeError, msg); \ 419 return NULL; \ 420 } 421 422 423 #endif 432 #endif /* ANUGA_UTIL_EXT_H */
Note: See TracChangeset
for help on using the changeset viewer.