Changeset 7097


Ignore:
Timestamp:
May 27, 2009, 12:57:54 PM (11 years ago)
Author:
ole
Message:

Played with inlining and profiled, but no speedup was achieved, so I rolled it back and commented.

File:
1 edited

Legend:

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

    r7034 r7097  
    2727
    2828// Computational function for rotation
    29 // FIXME: Perhaps inline this and profile
     29// Tried to inline, but no speedup was achieved 27th May 2009 (Ole)
     30// static inline int _rotate(double *q, double n1, double n2) {
    3031int _rotate(double *q, double n1, double n2) {
    3132  /*Rotate the momentum component q (q[1], q[2])
     
    168169// This is used by flux functions
    169170// Input parameters uh and h may be modified by this function.
    170 
    171 // FIXME: Perhaps inline this and profile
     171// Tried to inline, but no speedup was achieved 27th May 2009 (Ole)
     172//static inline double _compute_speed(double *uh,
    172173double _compute_speed(double *uh,
    173               double *h,
    174               double epsilon,
    175               double h0) {
     174                      double *h,
     175                      double epsilon,
     176                      double h0) {
    176177 
    177178  double u;
     
    280281  double h0 = H0*H0; // This ensures a good balance when h approaches H0.
    281282                     // But evidence suggests that h0 can be as little as
    282              // epsilon!
     283                     // epsilon!
    283284 
    284285  // Copy conserved quantities to protect from modification
     
    295296
    296297  z = 0.5*(z_left + z_right); // Average elevation values.
    297                             // Even though this will nominally allow for discontinuities
    298                             // in the elevation data, there is currently no numerical
    299                             // support for this so results may be strange near jumps in the bed.
     298                              // Even though this will nominally allow
     299                              // for discontinuities in the elevation data,
     300                              // there is currently no numerical support for
     301                              // this so results may be strange near
     302                              // jumps in the bed.
    300303
    301304  // Compute speeds in x-direction
Note: See TracChangeset for help on using the changeset viewer.