/*\file InterpFromMeshToMesh2d.c *\brief: bamg module. */ #include "./InterpFromMeshToMesh2d.h" void InterpFromMeshToMesh2dUsage(void){/*{{{*/ _printf0_("INTERFROMMESHTOMESH2D - interpolation from a 2d triangular mesh onto a list of point\n"); _printf0_("\n"); _printf0_(" This function is a multi-threaded mex file that interpolates a field\n"); _printf0_(" defined on a Delaunay triangulation onto a list of point\n"); _printf0_("\n"); _printf0_(" Usage:\n"); _printf0_(" data_interp=InterpFromMeshToMesh2d(index,x,y,data,x_interp,y_interp);\n"); _printf0_(" or data_interp=InterpFromMeshToMesh2d(index,x,y,data,x_interp,y_interp,OPTIONS);\n"); _printf0_("\n"); _printf0_(" index : index of the mesh where data is defined (e.g. md.mesh.elements)\n"); _printf0_(" x,y : coordinates of the nodes where data is defined\n"); _printf0_(" data : matrix holding the data to be interpolated onto the mesh. (one column per field)\n"); _printf0_(" x_interp,y_interp : coordinates of the points onto which we interpolate.\n"); _printf0_(" data_interp : vector of mesh interpolated data.\n"); _printf0_(" Available options :\n"); _printf0_(" - 'default' : default value if point is outsite of triangulation (instead of linear interpolation)\n"); _printf0_("\n"); _printf0_(" Example:\n"); _printf0_(" load('temperature.mat');\n"); _printf0_(" md.initialization.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.mesh.x,md.mesh.y);\n"); _printf0_(" md.initialization.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.mesh.x,md.mesh.y,'default',253);\n"); _printf0_("\n"); }/*}}}*/ WRAPPER(InterpFromMeshToMesh2d_python){ /*Intermediaties*/ int *index = NULL; double *x_data = NULL; double *y_data = NULL; double *data = NULL; int nods_data,nels_data; int M_data,N_data; double *x_interp = NULL; double *y_interp = NULL; int N_interp; Options *options = NULL; double *data_interp = NULL; int test1,test2,test; /*Boot module: */ MODULEBOOT(); /*checks on output arguments on the matlab side: */ #ifdef _HAVE_MATLAB_MODULES_ if(nlhs!=NLHS){ InterpFromMeshToMesh2dUsage(); _error_("InterpFromMeshToMesh2dUsage usage error"); } #endif /*check on input arguments: */ if(nrhs(index); xDelete(x_data); xDelete(y_data); xDelete(data); xDelete(x_interp); xDelete(y_interp); xDelete(data_interp); delete options; MODULEEND(); }