Changeset 2627


Ignore:
Timestamp:
11/06/09 16:25:27 (15 years ago)
Author:
Mathieu Morlighem
Message:

Better usage display

Location:
issm/trunk/src/mex
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/mex/ContourToMesh/ContourToMesh.cpp

    r2408 r2627  
    5353        /*checks on arguments on the matlab side: */
    5454        //CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ContourToMeshUsage); Cant' use it here, as we have variable  outputs.
    55         if((nlhs==0) && (nrhs!=NRHS)){
     55        if((nlhs!=1 && nlhs!=2) || (nrhs!=NRHS)){
    5656                ContourToMeshUsage();
    5757                throw ErrorException(__FUNCT__," usage. See above");
     
    119119void ContourToMeshUsage(void)
    120120{
    121         printf("   CONTOURTOMESH - Flag the elements or nodes inside a contour\n\n");
    122         printf("      index,x,y: delaunay triangulation.\n");
    123         printf("      contours: structure holding sets of vertices making open contours.\n");
    124         printf("      interptype: string definining type of interpolation ('element', or 'node').\n");
    125         printf("      edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons.\n");
    126         printf("      in_nod: vector of flags (0 or 1), of size nods if interptype is set to 'node' or 'element and node', \n");
    127         printf("              or of size 0 otherwise.\n");
    128         printf("      in_elem: vector of flags (0 or 1), of size nel if interptype is set to 'element' or 'element and node', \n");
    129         printf("               or of size 0 otherwise.\n\n");
     121        printf("CONTOURTOMESH - Flag the elements or nodes inside a contour\n");
     122        printf("\n");
    130123        printf("      Usage: \n");
    131124        printf("         [in_nod,in_elem]=ContourToMesh(index,x,y,contours,interptype,edgevalue)\n\n");
    132         printf("      Exemple: \n");
     125        printf("\n");
     126        printf("         index,x,y: mesh triangulation.\n");
     127        printf("         contours: structure holding sets of vertices making open contours.\n");
     128        printf("         interptype: string definining type of interpolation ('element', or 'node').\n");
     129        printf("         edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons.\n");
     130        printf("         in_nod: vector of flags (0 or 1), of size nods if interptype is set to 'node' or 'element and node', \n");
     131        printf("            or of size 0 otherwise.\n");
     132        printf("         in_elem: vector of flags (0 or 1), of size nel if interptype is set to 'element' or 'element and node', \n");
     133        printf("            or of size 0 otherwise.\n");
     134        printf("\n");
     135        printf("      Example: \n");
    133136        printf("         in_nod=ContourToMesh(md.elements,md.x,md.y,expread('Contour.exp',1),'node',1)\n");
    134137        printf("         in_elements=ContourToMesh(md.elements,md.x,md.y,expread('Contour.exp',1),'element',0)\n");
  • issm/trunk/src/mex/InterpFromGridToMesh/InterpFromGridToMesh.cpp

    r2333 r2627  
    7272void InterpFromGridToMeshUsage(void)
    7373{
    74         _printf_("   usage:\n");
    75         _printf_("   data_mesh=InterpFromGridToMesh(x,y,data,x_mesh,y_mesh,defult_value);\n\n");
    76         _printf_("   where:\n");
    77         _printf_("      x,y: coordinates of matrix data\n");
    78         _printf_("      data - matrix holding the data to be interpolated onto the mesh.\n");
    79         _printf_("      x_mesh,y_mesh: coordinates of the mesh grids onto which we interpolate.\n");
    80         _printf_("      default_value: default value if no interpolation is found.\n");
    81         _printf_("      data_mesh:  vector of mesh interpolated data.\n");
     74        _printf_("INTERPFROMGRIDTOMESH - interpolation from a grid onto a list of points\n");
     75        _printf_("\n");
     76        _printf_("   This function is a multi-threaded mex file that interpolates a field\n");
     77        _printf_("   defined on a grid onto a list of points\n");
     78        _printf_("\n");
     79        _printf_("   Usage:\n");
     80        _printf_("      data_mesh=InterpFromGridToMesh(x,y,data,x_mesh,y_mesh,default_value);\n");
     81        _printf_("\n");
     82        _printf_("      data: matrix holding the data to be interpolated onto the mesh.\n");
     83        _printf_("      x,y: coordinates of matrix data. (x and y must be in increasing order)\n");
     84        _printf_("      x_mesh,y_mesh: coordinates of the points onto which we interpolate.\n");
     85        _printf_("      default_value: default value if no data is found (holes).\n");
     86        _printf_("      data_mesh: vector of mesh interpolated data.\n");
     87        _printf_("\n");
     88        _printf_("   Example:\n");
     89        _printf_("      load('velocities.mat');\n");
     90        _printf_("      md.vx_obs=InterpFromGridToMesh(x_n,y_m,vx,md.x,md.y,0);\n");
    8291        _printf_("\n");
    8392}
  • issm/trunk/src/mex/InterpFromMeshToGrid/InterpFromMeshToGrid.cpp

    r2333 r2627  
    6464void InterpFromMeshToGridUsage(void)
    6565{
    66         _printf_("   usage:\n");
    67         _printf_("   [x_m,y_m,griddata]=InterpFromMeshToGrid(index,x,y,data,cornereast,cornernorth,xposting,yposting,nlines,ncols,default_value)\n");
     66        _printf_("INTERPFROMMESHTOGRID - interpolation of a data defined on a mesh onto a grid\n");
    6867        _printf_("\n");
    69         _printf_("   where:\n");
     68        _printf_("   This function is a multi-threaded mex file that interpolates a field\n");
     69        _printf_("   defined on a triangular mesh onto a regular grid\n");
    7070        _printf_("\n");
    71         _printf_("   index,x,y: delaunay triangulation defining the mesh.\n");
    72         _printf_("   meshdata: vertex values of data to be interpolated.\n");
    73         _printf_("   cornereast,cornernorth,posting,nlines,ncols: parameters that define the grid\n");
    74         _printf_("   default_value: value of points located out of the mesh.\n");
     71        _printf_("   Usage:\n");
     72        _printf_("      [x_m,y_m,griddata]=InterpFromMeshToGrid(index,x,y,data,cornereast,cornernorth,xposting,yposting,nlines,ncols,default_value)\n");
     73        _printf_("\n");
     74        _printf_("      index,x,y: delaunay triangulation defining the mesh.\n");
     75        _printf_("      meshdata: vertex values of data to be interpolated.\n");
     76        _printf_("      cornereast,cornernorth,posting,nlines,ncols: parameters that define the grid\n");
     77        _printf_("      default_value: value of points located out of the mesh.\n");
     78        _printf_("\n");
    7579}
  • issm/trunk/src/mex/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp

    r2333 r2627  
    9393void InterpFromMeshToMesh2dUsage(void)
    9494{
    95         _printf_("   usage:\n");
    96         _printf_("      data_prime=InterpFromMeshToMesh2d(index,x,y,data,x_prime,y_prime,default_value);\n\n");
    97         _printf_("   where:\n");
     95        _printf_("INTERPFROMMESHTOMESH2D - interpolation from a 2d triangular mesh onto a list of point\n");
     96        _printf_("\n");
     97        _printf_("   This function is a multi-threaded mex file that interpolates a field\n");
     98        _printf_("   defined on a triangular mesh onto a list of point\n");
     99        _printf_("\n");
     100        _printf_("   Usage:\n");
     101        _printf_("      data_prime=InterpFromMeshToMesh2d(index,x,y,data,x_prime,y_prime,default_value);\n");
     102        _printf_("\n");
     103        _printf_("      index: index of the mesh where data is defined\n");
    98104        _printf_("      x,y: coordinates of the nodes where data is defined\n");
    99         _printf_("      index: index of the mesh where data is defined\n");
    100         _printf_("      data - vector holding the data to be interpolated onto the points.\n");
    101         _printf_("      x_prime,y_prime: coordinates of the mesh grids onto which we interpolate.\n");
    102         _printf_("      default_value - default value if no interpolation is found.\n");
    103         _printf_("      data_prime:  vector of prime interpolated data.\n");
     105        _printf_("      data: matrix holding the data to be interpolated onto the mesh.\n");
     106        _printf_("      x_prime,y_prime: coordinates of the points onto which we interpolate.\n");
     107        _printf_("      default_value: default value if no data is found (holes).\n");
     108        _printf_("      data_prime: vector of mesh interpolated data.\n");
     109        _printf_("\n");
     110        _printf_("   Example:\n");
     111        _printf_("      load('temperature.mat');\n");
     112        _printf_("      md.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.x,md.y,253);\n");
    104113        _printf_("\n");
    105114}
  • issm/trunk/src/mex/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp

    r2333 r2627  
    9898void InterpFromMeshToMesh3dUsage(void)
    9999{
    100         _printf_("   usage:\n");
    101         _printf_("      data_prime=InterpFromMeshToMesh3d(index,x,y,z,data,x_prime,y_prime,z_prime,default_value);\n\n");
    102         _printf_("   where:\n");
     100        _printf_("INTERPFROMMESHTOMESH3D - interpolation from a 3d hexahedron mesh onto a list of point\n");
     101        _printf_("\n");
     102        _printf_("   This function is a multi-threaded mex file that interpolates a field\n");
     103        _printf_("   defined on a triangular mesh onto a list of point\n");
     104        _printf_("\n");
     105        _printf_("   Usage:\n");
     106        _printf_("      data_prime=InterpFromMeshToMesh3d(index,x,y,z,data,x_prime,y_prime,z_prime,default_value);\n");
     107        _printf_("\n");
     108        _printf_("      index: index of the mesh where data is defined\n");
    103109        _printf_("      x,y,z: coordinates of the nodes where data is defined\n");
    104         _printf_("      index: index of the mesh where data is defined\n");
    105         _printf_("      data - vector holding the data to be interpolated onto the points.\n");
    106         _printf_("      x_prime,y_prime,z_prime: coordinates of the mesh grids onto which we interpolate.\n");
    107         _printf_("      default_value - default value if no interpolation is found.\n");
    108         _printf_("      data_prime:  vector of prime interpolated data.\n");
     110        _printf_("      data: matrix holding the data to be interpolated onto the mesh.\n");
     111        _printf_("      x_prime,y_prime,z_prime: coordinates of the points onto which we interpolate.\n");
     112        _printf_("      default_value: default value if no data is found (holes).\n");
     113        _printf_("      data_prime: vector of mesh interpolated data.\n");
     114        _printf_("\n");
     115        _printf_("   Example:\n");
     116        _printf_("      load('temperature.mat');\n");
     117        _printf_("      md.temperature=InterpFromMeshToMesh3d(index,x,y,z,temperature,md.x,md.y,md.z,253);\n");
    109118        _printf_("\n");
    110119}
Note: See TracChangeset for help on using the changeset viewer.