Changeset 4568
- Timestamp:
- Jun 28, 2007, 5:28:24 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified anuga_core/source/anuga/abstract_2d_finite_volumes/util.py ¶
r4541 r4568 15 15 16 16 from anuga.utilities.numerical_tools import ensure_numeric 17 from Numeric import arange, choose 17 from Numeric import arange, choose, zeros, Float 18 18 19 19 from anuga.geospatial_data.geospatial_data import ensure_absolute … … 1482 1482 #print "triangles after", triangles 1483 1483 return verts, triangles 1484 1484 1485 1486 def get_centroid_values(x, triangles): 1487 """Compute centroid values from vertex values 1488 1489 x: Values at vertices of triangular mesh 1490 triangles: Nx3 integer array pointing to vertex information 1491 for each of the N triangels. Elements of triangles are 1492 indices into x 1493 """ 1494 1495 1496 xc = zeros(triangles.shape[0], Float) # Space for centroid info 1497 1498 for k in range(triangles.shape[0]): 1499 # Indices of vertices 1500 i0 = triangles[k][0] 1501 i1 = triangles[k][1] 1502 i2 = triangles[k][2] 1503 1504 xc[k] = (x[i0] + x[i1] + x[i2])/3 1505 1506 1507 return xc 1508 1509
Note: See TracChangeset
for help on using the changeset viewer.