Ice Sheet System Model  4.18
Code documentation
Functions
ContourToMeshxt.cpp File Reference

"thread" core code for interpolating values from a structured grid. More...

#include "./ContourToMeshx.h"

Go to the source code of this file.

Functions

void * ContourToMeshxt (void *vpthread_handle)
 

Detailed Description

"thread" core code for interpolating values from a structured grid.

Definition in file ContourToMeshxt.cpp.

Function Documentation

◆ ContourToMeshxt()

void* ContourToMeshxt ( void *  vpthread_handle)

Definition at line 13 of file ContourToMeshxt.cpp.

13  {
14 
15  /*gate variables :*/
16  ContourToMeshxThreadStruct *gate = NULL;
17  pthread_handle *handle = NULL;
18  int i,i1,i0;
19 
20  /*recover handle and gate: */
21  handle = (pthread_handle*)vpthread_handle;
22  gate = (ContourToMeshxThreadStruct*)handle->gate;
23  int my_thread = handle->id;
24  int num_threads = handle->num;
25 
26  /*recover parameters :*/
27  Contours* contours = gate->contours;
28  int nods = gate->nods;
29  int edgevalue = gate->edgevalue;
30  double *in_nod = gate->in_nod;
31  double *x = gate->x;
32  double *y = gate->y;
33 
34  /*distribute indices across threads :*/
35  PartitionRange(&i0,&i1,nods,num_threads,my_thread);
36 
37  /*Loop through all contours: */
38  for (i=0;i<contours->Size();i++){
39  Contour<double>* contour=(Contour<double>*)contours->GetObjectByOffset(i);
40  IsInPoly(in_nod,contour->x,contour->y,contour->nods,x,y,i0,i1,edgevalue);
41  }
42 
43  return NULL;
44 }
pthread_handle::id
int id
Definition: issm_threads.h:12
ContourToMeshxThreadStruct::contours
Contours * contours
Definition: ContourToMeshx.h:14
pthread_handle::num
int num
Definition: issm_threads.h:13
Contours
Declaration of Contours class.
Definition: Contours.h:10
Contour
Definition: Contour.h:15
ContourToMeshxThreadStruct
Definition: ContourToMeshx.h:12
pthread_handle
Definition: issm_threads.h:10
ContourToMeshxThreadStruct::edgevalue
int edgevalue
Definition: ContourToMeshx.h:16
ContourToMeshxThreadStruct::nods
int nods
Definition: ContourToMeshx.h:15
PartitionRange
void PartitionRange(int *pi0, int *pi1, int num_el, int num_threads, int my_thread)
Definition: PartitionRange.cpp:13
Contour::nods
int nods
Definition: Contour.h:20
ContourToMeshxThreadStruct::x
double * x
Definition: ContourToMeshx.h:18
ContourToMeshxThreadStruct::y
double * y
Definition: ContourToMeshx.h:19
Contour::y
doubletype * y
Definition: Contour.h:22
Contour::x
doubletype * x
Definition: Contour.h:21
pthread_handle::gate
void * gate
Definition: issm_threads.h:11
ContourToMeshxThreadStruct::in_nod
double * in_nod
Definition: ContourToMeshx.h:17
IsInPoly
int IsInPoly(doubletype *in, double *xc, double *yc, int numvertices, double *x, double *y, int i0, int i1, int edgevalue)
Definition: exp.h:17