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

Go to the source code of this file.

Functions

void BamgTriangulateUsage (void)
 
 WRAPPER (BamgTriangulate_python)
 

Function Documentation

◆ BamgTriangulateUsage()

void BamgTriangulateUsage ( void  )

Definition at line 6 of file BamgTriangulate.cpp.

6  {/*{{{*/
7  _printf0_("BAMGTRIANGULATE - Delaunay Triangulation of a list of points");
8  _printf0_("\n");
9  _printf0_(" Usage:\n");
10  _printf0_(" index=BamgTriangulate(x,y);\n");
11  _printf0_(" index: index of the triangulation\n");
12  _printf0_(" x,y: coordinates of the nodes\n");
13  _printf0_("\n");
14 }/*}}}*/

◆ WRAPPER()

WRAPPER ( BamgTriangulate_python  )

Definition at line 15 of file BamgTriangulate.cpp.

15  {
16 
17  /*input: */
18  double* x=NULL;
19  double* y=NULL;
20  int x_cols;
21  int y_rows,y_cols;
22  int nods;
23 
24  /*Output*/
25  int* index=NULL;
26  int nels;
27 
28  /*Intermediary*/
29  int verbose=0;
30 
31  /*Boot module: */
32  MODULEBOOT();
33 
34  /*checks on arguments on the matlab side: */
35  /* CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&BamgTriangulateUsage); */
36  CHECKARGUMENTS(NLHS,NRHS,&BamgTriangulateUsage);
37 
38  /*Input datasets: */
39  if (verbose) _printf_("Fetching inputs\n");
40  FetchData(&x,&nods,&x_cols,XHANDLE);
41  FetchData(&y,&y_rows,&y_cols,YHANDLE);
42 
43  /*Check inputs*/
44  if(y_rows!=nods) _error_("x and y do not have the same length");
45  if(x_cols>1 || y_cols>1) _error_("x and y should have only one column");
46  if(nods<3) _error_("At least 3 points are required");
47 
48  /* Run core computations: */
49  if (verbose) _printf_("Call core\n");
50  BamgTriangulatex(&index,&nels,x,y,nods);
51 
52  /*Write output*/
53  WriteData(INDEX,index,nels,3);
54 
55  /*Clean up*/
56  xDelete<int>(index);
57  xDelete<double>(x);
58  xDelete<double>(y);
59 
60  /*end module: */
61  MODULEEND();
62 }
_printf0_
#define _printf0_(StreamArgs)
Definition: Print.h:29
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
BamgTriangulateUsage
void BamgTriangulateUsage(void)
Definition: BamgTriangulate.cpp:6
BamgTriangulatex
int BamgTriangulatex(int **pindex, int *pnels, double *x, double *y, int nods)
Definition: BamgTriangulatex.cpp:14
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