Ice Sheet System Model  4.18
Code documentation
Functions
ContourToNodes.cpp File Reference
#include "./ContourToNodes.h"

Go to the source code of this file.

Functions

void ContourToNodesUsage (void)
 
 WRAPPER (ContourToNodes_python)
 

Function Documentation

◆ ContourToNodesUsage()

void ContourToNodesUsage ( void  )

Definition at line 7 of file ContourToNodes.cpp.

7  {/*{{{*/
8  _printf_(" usage:\n");
9  _printf_(" [flags]=ContourToNodes(x,y,contourname,edgevalue);\n");
10  _printf_(" where:\n");
11  _printf_(" x,y: list of nodes.\n");
12  _printf_(" contourname: name of .exp file containing the contours, or resulting structure from call to expread.\n");
13  _printf_(" edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons.\n");
14  _printf_(" flags: vector of flags (0 or 1), of size nods.\n");
15  _printf_("\n");
16 }/*}}}*/

◆ WRAPPER()

WRAPPER ( ContourToNodes_python  )

Definition at line 17 of file ContourToNodes.cpp.

17  {
18 
19  /* input: */
20  int edgevalue,dim1,dim2,test1,test2;
21  double *x = NULL;
22  double *y = NULL;
23  char *contourname = NULL;
24  Contours *contours = NULL;
25 
26  /* output: */
27  double *flags = NULL;
28 
29  /*Boot module: */
30  MODULEBOOT();
31 
32  /*checks on arguments on the matlab side: */
33  CHECKARGUMENTS(NLHS,NRHS,&ContourToNodesUsage);
34 
35  /*Fetch inputs: */
36  FetchData(&x,&dim1,&dim2,XHANDLE);
37  FetchData(&y,&test1,&test2,YHANDLE);
38  FetchData(&edgevalue,EDGEVALUE);
39  FetchData(&contours,CONTOUR);
40 
41  /*Some sanity checks*/
42  if(dim1<1) _error_("x is empty");
43  if(dim2<1) _error_("x is empty");
44  if(test1!=dim1) _error_("x ans y do not have the same size");
45  if(test2!=dim2) _error_("x ans y do not have the same size");
46 
47  /*Run x layer */
48  ContourToNodesx(&flags,x,y,dim1*dim2,contours,edgevalue);
49 
50  /* output: */
51  WriteData(FLAGS,flags,dim1,dim2);
52 
53  /*Clean up*/
54  xDelete<double>(x);
55  xDelete<double>(y);
56  xDelete<char>(contourname);
57  delete contours;
58  xDelete<double>(flags);
59 
60  /*end module: */
61  MODULEEND();
62 }
WriteData
void WriteData(IssmPDouble **pmatrix, int *pnel, int *matrix, int M, int N)
Definition: WriteJavascriptData.cpp:16
_printf_
#define _printf_(StreamArgs)
Definition: Print.h:22
NRHS
#define NRHS
Definition: BamgConvertMesh.h:52
Contours
Declaration of Contours class.
Definition: Contours.h:10
ContourToNodesUsage
void ContourToNodesUsage(void)
Definition: ContourToNodes.cpp:7
ContourToNodesx
int ContourToNodesx(IssmPDouble **pflags, double *x, double *y, int nods, Contour< IssmPDouble > **contours, int numcontours, int edgevalue)
Definition: ContourToNodesx.cpp:6
FetchData
void FetchData(char **pstring, char *stringin)
Definition: FetchJavascriptData.cpp:16
NLHS
#define NLHS
Definition: BamgConvertMesh.h:50
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49