This is a static copy of a profile report

Home

meshdomain (1 call, 0.019 sec)
Generated 04-Aug-2014 13:05:14 using cpu time.
function in file /gdata/projects/atl/FV_Matlab_Framework_JingPJH/trunk/Src/Util/meshdomain.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
Bottom_Gravity_Current_Setup6script1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
37
[XU YU] = meshgrid(xu, yu);
10.006 s33.3%
36
[XP YP] = meshgrid(xp, yp);
10.006 s33.3%
30
yp = fliplr(linspace(ylim(1) +...
10.006 s33.3%
38
[XV YV] = meshgrid(xv, yv);
10 s0%
34
yv = fliplr(linspace(ylim(1) +...
10 s0%
All other lines  0.000 s0.0%
Totals  0.019 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
meshgridfunction30.013 s66.7%
fliplrfunction30 s0%
linspacefunction60 s0%
Self time (built-ins, overhead, etc.)  0.006 s33.3%
Totals  0.019 s100% 
Code Analyzer results
Line numberMessage
36Best practice is to separate output variables with commas.
37Best practice is to separate output variables with commas.
38Best practice is to separate output variables with commas.
Coverage results
Show coverage for parent directory
Total lines in function38
Non-code lines (comments, blank lines)27
Code lines (lines that can run)11
Code lines that did run11
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
time 
calls 
 line
   1 
function [XP, YP, XU, YU, XV, YV, dx, dy] = meshdomain(app, xlim, ylim)
   2 
% function [XP, YP, XU, YU, XV, YV, dx, dy] = meshdomain(app, xlim, ylim)
   3 
% 
   4 
% This function meshes the domain.
   5 
%
   6 
% INPUTS:
   7 
%       app:    The application data-structure. Should contain the fields
   8 
%                Nx and Ny for the number of x and y control volumes. 
   9 
%       xlim:   Array giving the limits of the domain in the x-direction.
  10 
%                xlim = [min(x), max(x)]
  11 
%       ylim:   Array giving the limits of the domain in the y-direction.
  12 
%                ylim = [min(y), max(y)]
  13 
%       
  14 
% OUTPUTS:
  15 
%       XP:     X-coordinate matrix for the Pressure/Tracer grid
  16 
%       YP:     Y-coordinate matrix for the Pressure/Tracer grid
  17 
%       XU:     X-coordinate matrix for the u-velocity grid
  18 
%       YU:     Y-coordinate matrix for the u-velocity grid
  19 
%       XV:     X-coordinate matrix for the v-velocity grid
  20 
%       YV:     Y-coordinate matrix for the v-velocity grid
  21 
%       dx:     Control volume size in the x-direction
  22 
%       dy:     Control volume size in the y-direction
  23 
%
  24 
% Written by:   Matt Ueckermann
  25 

      1 
  26 
dx = abs(xlim(2) - xlim(1))./(app.Nx); 
      1 
  27 
dy = abs(ylim(2) - ylim(1))./(app.Ny);  
  28 

      1 
  29 
xp = linspace(xlim(1) + dx / 2, xlim(2) - dx / 2, app.Nx); 
< 0.01 
      1 
  30 
yp = fliplr(linspace(ylim(1) + dy / 2, ylim(2) - dy / 2, app.Ny)); 
      1 
  31 
xu = linspace(xlim(1) + dx, xlim(2) - dx, app.Nx - 1); 
      1 
  32 
yu = fliplr(linspace(ylim(1) + dy / 2, ylim(2) - dy / 2, app.Ny)); 
      1 
  33 
xv = linspace(xlim(1) + dx / 2, xlim(2) - dx / 2, app.Nx); 
      1 
  34 
yv = fliplr(linspace(ylim(1) + dy, ylim(2) - dy, app.Ny - 1)); 
  35 

< 0.01 
      1 
  36 
[XP YP] = meshgrid(xp, yp); 
< 0.01 
      1 
  37 
[XU YU] = meshgrid(xu, yu); 
      1 
  38 
[XV YV] = meshgrid(xv, yv);