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

Go to the source code of this file.

Functions

int ContourToMeshx (double **pin_nod, double **pin_elem, double *index, double *x, double *y, Contours *contours, char *interptype, int nel, int nods, int edgevalue)
 

Function Documentation

◆ ContourToMeshx()

int ContourToMeshx ( double **  pin_nod,
double **  pin_elem,
double *  index,
double *  x,
double *  y,
Contours contours,
char *  interptype,
int  nel,
int  nods,
int  edgevalue 
)

Definition at line 12 of file ContourToMeshx.cpp.

12  {
13 
14  /*Contour:*/
15  double value;
16 
17  /*output: */
18  double* in_nod;
19  double* in_elem;
20  in_nod = xNewZeroInit<double>(nods);
21  in_elem = xNewZeroInit<double>(nel);
22 
23  /*initialize thread parameters: */
25  gate.contours = contours;
26  gate.nods = nods;
27  gate.edgevalue = edgevalue;
28  gate.in_nod = in_nod;
29  gate.x = x;
30  gate.y = y;
31 
32  /*launch the thread manager with ContourToMeshxt as a core: */
33  LaunchThread(ContourToMeshxt,(void*)&gate,_NUMTHREADS_);
34 
35  /*Take care of the case where an element interpolation has been requested: */
36  if ((strcmp(interptype,"element")==0) || (strcmp(interptype,"element and node")==0)){
37  for(int n=0;n<nel;n++){
38  if ( (in_nod[ (int)*(index+3*n+0) -1] == 1) && (in_nod[ (int)*(index+3*n+1) -1] == 1) && (in_nod[ (int)*(index+3*n+2) -1] == 1) ){
39  value=1.; in_elem[n]=value;
40  }
41  }
42  }
43 
44  /*Assign output pointers: */
45  *pin_nod=in_nod;
46  *pin_elem=in_elem;
47 
48  return 1;
49 }
ContourToMeshxt
void * ContourToMeshxt(void *vContourToMeshxThreadStruct)
Definition: ContourToMeshxt.cpp:13
ContourToMeshxThreadStruct::contours
Contours * contours
Definition: ContourToMeshx.h:14
LaunchThread
void LaunchThread(void *function(void *), void *gate, int num_threads)
Definition: LaunchThread.cpp:25
ContourToMeshxThreadStruct
Definition: ContourToMeshx.h:12
ContourToMeshxThreadStruct::edgevalue
int edgevalue
Definition: ContourToMeshx.h:16
ContourToMeshxThreadStruct::nods
int nods
Definition: ContourToMeshx.h:15
ContourToMeshxThreadStruct::x
double * x
Definition: ContourToMeshx.h:18
ContourToMeshxThreadStruct::y
double * y
Definition: ContourToMeshx.h:19
ContourToMeshxThreadStruct::in_nod
double * in_nod
Definition: ContourToMeshx.h:17