Changeset 4682


Ignore:
Timestamp:
Aug 23, 2007, 5:57:53 PM (17 years ago)
Author:
ole
Message:

Work in progress towards a 'dry cell' and 'still water' exclusion algorithm.
It works for the validation examples and they seem to run a lot faster.
7 unit tests fail, so they need to be looked at in detail.

The functionality is commented out, so it won't affect any runs - yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/shallow_water_ext.c

    r4681 r4682  
    11911191  // normal a Float numeric array of length 2.
    11921192
     1193  // FIXME(Ole): I don't think this is used anymore
    11931194
    11941195  PyObject *Q, *Normal;
     
    13041305    *xmom_explicit_update,
    13051306    *ymom_explicit_update,
    1306     *already_computed_flux,//tracks whether the flux across an edge has already been computed
     1307    *already_computed_flux, //Tracks whether the flux across an edge has already been computed
    13071308    *max_speed_array; //Keeps track of max speeds for each triangle
    13081309
    13091310  // Local variables
    1310   double timestep, max_speed, epsilon, g, H0, length;
     1311  double timestep, max_speed, epsilon, g, H0, length, area;
    13111312  double normal[2], ql[3], qr[3], zl, zr;
    13121313  double edgeflux[3]; // Work array for summing up fluxes
    13131314
    1314   int number_of_elements, k, i, m, n;
     1315  int number_of_elements, k, i, j, m, n, computation_needed;
    13151316  int ki, nm=0, ki2; // Index shorthands
    13161317  static long call=1; // Static local variable flagging already computed flux
     
    13911392      }
    13921393     
     1394     
     1395      // Check if flux calculation is necessary across this edge
     1396      // FIXME (Ole): Work in progress!
     1397      computation_needed = 0;
     1398      //for (j=0; j<3; j++) {     
     1399      //if (ql[j] != qr[j]) computation_needed = 1;
     1400      //}
     1401     
     1402      //if (computation_needed == 0) {
     1403        //printf("flux exemption identified\n");
     1404       
     1405        //((long *) already_computed_flux -> data)[ki] = call; // #k Done       
     1406        //if (n>=0)
     1407        //  ((long *) already_computed_flux -> data)[nm] = call; // #n Done
     1408       
     1409        //max_speed = 0.0;
     1410        //continue;
     1411      //}
     1412     
     1413
     1414     
     1415           
    13931416      // Outward pointing normal vector (domain.normals[k, 2*i:2*i+2])
    13941417      ki2 = 2*ki; //k*6 + i*2
     
    14411464    // Normalise triangle k by area and store for when all conserved
    14421465    // quantities get updated
    1443     ((double *) stage_explicit_update -> data)[k] /= ((double *) areas -> data)[k];
    1444     ((double *) xmom_explicit_update -> data)[k] /= ((double *) areas -> data)[k];
    1445     ((double *) ymom_explicit_update -> data)[k] /= ((double *) areas -> data)[k];
     1466    area = ((double *) areas -> data)[k];
     1467    ((double *) stage_explicit_update -> data)[k] /= area;
     1468    ((double *) xmom_explicit_update -> data)[k] /= area;
     1469    ((double *) ymom_explicit_update -> data)[k] /= area;
    14461470   
    14471471   
Note: See TracChangeset for help on using the changeset viewer.