Changeset 4727
- Timestamp:
- Sep 11, 2007, 4:21:48 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/shallow_water_ext.c
r4726 r4727 37 37 double q1, q2; 38 38 39 // Shorthands40 q1 = q[1]; // uh momentum41 q2 = q[2]; // vh momentum42 43 // Rotate39 // Shorthands 40 q1 = q[1]; // uh momentum 41 q2 = q[2]; // vh momentum 42 43 // Rotate 44 44 q[1] = n1*q1 + n2*q2; 45 45 q[2] = -n2*q1 + n1*q2; … … 213 213 double s_min, s_max, soundspeed_left, soundspeed_right; 214 214 double denom, z; 215 216 // FIXME (Ole): Try making these static 217 double q_left_rotated[3], q_right_rotated[3]; 218 double flux_right[3], flux_left[3]; 215 216 // Workspace (allocate once, use many) 217 static double q_left_rotated[3], q_right_rotated[3], flux_right[3], flux_left[3]; 219 218 220 219 double h0 = H0*H0; // This ensures a good balance when h approaches H0. … … 1402 1401 1403 1402 // Local variables 1404 double max_speed, length, area; 1405 1406 // FIXME (Ole): Try making arrays static 1407 double normal[2], ql[3], qr[3], zl, zr; 1408 double edgeflux[3]; // Work array for summing up fluxes 1409 1403 double max_speed, length, area, zl, zr; 1410 1404 int k, i, m, n; 1411 1412 1405 int ki, nm=0, ki2; // Index shorthands 1406 1407 // Workspace (making them static actually made function slightly slower (Ole)) 1408 double ql[3], qr[3], edgeflux[3]; // Work array for summing up fluxes 1409 1413 1410 static long call=1; // Static local variable flagging already computed flux 1414 1411 … … 1440 1437 ql[1] = xmom_edge_values[ki]; 1441 1438 ql[2] = ymom_edge_values[ki]; 1442 zl = 1439 zl = bed_edge_values[ki]; 1443 1440 1444 1441 // Quantities at neighbour on nearest face … … 1484 1481 // Outward pointing normal vector (domain.normals[k, 2*i:2*i+2]) 1485 1482 ki2 = 2*ki; //k*6 + i*2 1486 normal[0] = normals[ki2];1487 normal[1] = normals[ki2+1];1488 1489 1483 1490 1484 // Edge flux computation (triangle k, edge i) 1491 1485 flux_function_central(ql, qr, zl, zr, 1492 normal [0], normal[1],1486 normals[ki2], normals[ki2+1], 1493 1487 epsilon, H0, g, 1494 1488 edgeflux, &max_speed);
Note: See TracChangeset
for help on using the changeset viewer.