Changeset 4730


Ignore:
Timestamp:
Sep 12, 2007, 10:59:02 AM (17 years ago)
Author:
ole
Message:

Cosmetics

File:
1 edited

Legend:

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

    r4729 r4730  
    12591259
    12601260PyObject *extrapolate_second_order_sw(PyObject *self, PyObject *args) {
    1261   /*Compute the vertex values based on a linear reconstruction on each triangle
     1261  /*Compute the vertex values based on a linear reconstruction
     1262    on each triangle
     1263   
    12621264    These values are calculated as follows:
    1263     1) For each triangle not adjacent to a boundary, we consider the auxiliary triangle
    1264     formed by the centroids of its three neighbours.
    1265     2) For each conserved quantity, we integrate around the auxiliary triangle's boundary the product
    1266     of the quantity and the outward normal vector. Dividing by the triangle area gives (a,b), the average
    1267     of the vector (q_x,q_y) on the auxiliary triangle. We suppose that the linear reconstruction on the
    1268     original triangle has gradient (a,b).
    1269     3) Provisional vertex jumps dqv[0,1,2] are computed and these are then limited by calling the functions
    1270     find_qmin_and_qmax and limit_gradient
     1265    1) For each triangle not adjacent to a boundary, we consider the
     1266       auxiliary triangle formed by the centroids of its three
     1267       neighbours.
     1268    2) For each conserved quantity, we integrate around the auxiliary
     1269       triangle's boundary the product of the quantity and the outward
     1270       normal vector. Dividing by the triangle area gives (a,b), the
     1271       average of the vector (q_x,q_y) on the auxiliary triangle.
     1272       We suppose that the linear reconstruction on the original
     1273       triangle has gradient (a,b).
     1274    3) Provisional vertex jumps dqv[0,1,2] are computed and these are
     1275       then limited by calling the functions find_qmin_and_qmax and
     1276       limit_gradient
    12711277
    12721278    Python call:
     
    12831289
    12841290    Post conditions:
    1285             The vertices of each triangle have values from a limited linear reconstruction
     1291            The vertices of each triangle have values from a
     1292            limited linear reconstruction
    12861293            based on centroid values
    12871294
     
    13251332                        &optimise_dry_cells)) {                 
    13261333                       
    1327     PyErr_SetString(PyExc_RuntimeError, "Input arguments to extrapolate_second_order_sw failed");
     1334    PyErr_SetString(PyExc_RuntimeError,
     1335                    "Input arguments to extrapolate_second_order_sw failed");
    13281336    return NULL;
    13291337  }
    13301338
    1331   // FIXME (Ole): Investigate if it is quicker to obtain all input arguments using GetAttrString rather than ParseTuple.
    1332   // It certainly looked as if passing domain.epsilon is slowed things down
    1333  
    1334   // Get the safety factor beta_w, set in the config.py file. This is used in the limiting process
     1339  // Get the safety factor beta_w, set in the config.py file.
     1340  // This is used in the limiting process
     1341 
     1342 
    13351343  Tmp = PyObject_GetAttrString(domain, "beta_w");
    13361344  if (!Tmp) {
     
    13961404  epsilon = PyFloat_AsDouble(Tmp);
    13971405  Py_DECREF(Tmp); 
    1398 
     1406 
     1407 
    13991408  // Call underlying computational routine
    14001409  number_of_elements = stage_centroid_values -> dimensions[0]; 
     
    15111520  }
    15121521
    1513   // FIXME (Ole): Investigate if it is quicker to obtain all input arguments using GetAttrString rather than ParseTuple.
    1514   // It certainly looked as if passing domain.epsilon is slowed things down
    15151522 
    15161523  // Get the safety factor beta_w, set in the config.py file. This is used in the limiting process
     
    22532260                                     H0,
    22542261                                     g,
    2255                                      (long*) neighbours -> data,                                 
     2262                                     (long*) neighbours -> data,
    22562263                                     (long*) neighbour_edges -> data,
    22572264                                     (double*) normals -> data,
    22582265                                     (double*) edgelengths -> data,
    2259                                      (double*) radii  -> data,
    2260                                      (double*) areas  -> data,
     2266                                     (double*) radii -> data,
     2267                                     (double*) areas -> data,
    22612268                                     (long*) tri_full_flag -> data,
    22622269                                     (double*) stage_edge_values -> data,
     
    22672274                                     (double*) xmom_boundary_values -> data,
    22682275                                     (double*) ymom_boundary_values -> data,
    2269                                      (double*) stage_explicit_update -> data,                         
     2276                                     (double*) stage_explicit_update -> data,
    22702277                                     (double*) xmom_explicit_update -> data,
    22712278                                     (double*) ymom_explicit_update -> data,
     
    27822789  } 
    27832790         
     2791         
     2792  // FIXME (Ole): I tested this without GetAttrString and got time down
     2793  // marginally from 4.0s to 3.8s. Consider passing everything in
     2794  // through ParseTuple and profile.
     2795 
    27842796  // Pull out parameters
    27852797  Tmp = PyObject_GetAttrString(domain, "alpha_balance");
     
    28082820  tight_slope_limiters = PyInt_AsLong(Tmp);
    28092821  Py_DECREF(Tmp);
    2810    
    2811 
    2812  
     2822 
     2823 
     2824     
     2825  //alpha_balance = 2.0;
     2826  //H0 = 0.001;
     2827  //tight_slope_limiters = 1;
    28132828 
    28142829  N = wc -> dimensions[0];
Note: See TracChangeset for help on using the changeset viewer.