[20545] | 1 | Index: ../trunk-jpl/src/c/modules/TriaSearchx/TriaSearchx.cpp
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/c/modules/TriaSearchx/TriaSearchx.cpp (revision 20502)
|
---|
| 4 | +++ ../trunk-jpl/src/c/modules/TriaSearchx/TriaSearchx.cpp (revision 20503)
|
---|
| 5 | @@ -1,49 +0,0 @@
|
---|
| 6 | -/*!\file TriaSearchx
|
---|
| 7 | - */
|
---|
| 8 | -
|
---|
| 9 | -#include "./TriaSearchx.h"
|
---|
| 10 | -
|
---|
| 11 | -#include "../../shared/shared.h"
|
---|
| 12 | -#include "../../toolkits/toolkits.h"
|
---|
| 13 | -#include "../../bamg/bamgobjects.h"
|
---|
| 14 | -
|
---|
| 15 | -using namespace bamg;
|
---|
| 16 | -using namespace std;
|
---|
| 17 | -
|
---|
| 18 | -void TriaSearchx(double** ptria,int* index,int nel, double* x, double* y, int nods,double* x0, double* y0,int numberofnodes){
|
---|
| 19 | -
|
---|
| 20 | - /*Output*/
|
---|
| 21 | - double* tria=NULL;
|
---|
| 22 | -
|
---|
| 23 | - /*allocate: */
|
---|
| 24 | - tria=xNew<double>(numberofnodes);
|
---|
| 25 | -
|
---|
| 26 | - /*Intermediary*/
|
---|
| 27 | - R2 r;
|
---|
| 28 | - I2 I;
|
---|
| 29 | - int i;
|
---|
| 30 | - Icoor2 dete[3];
|
---|
| 31 | -
|
---|
| 32 | - /* read background mesh */
|
---|
| 33 | - Mesh Th(index,x,y,nods,nel);
|
---|
| 34 | - Th.CreateSingleVertexToTriangleConnectivity();
|
---|
| 35 | -
|
---|
| 36 | - for(i=0;i<numberofnodes;i++){
|
---|
| 37 | -
|
---|
| 38 | - //Get current point coordinates
|
---|
| 39 | - r.x=x0[i]; r.y=y0[i];
|
---|
| 40 | -
|
---|
| 41 | - I=Th.R2ToI2(r);
|
---|
| 42 | -
|
---|
| 43 | - //Find triangle holding r/I
|
---|
| 44 | - Triangle &tb=*Th.TriangleFindFromCoord(I,dete);
|
---|
| 45 | -
|
---|
| 46 | - // internal point
|
---|
| 47 | - if (Th.GetId(tb)<nel)tria[i]=(double)Th.GetId(tb);
|
---|
| 48 | - //external point
|
---|
| 49 | - else tria[i]=NAN;
|
---|
| 50 | - }
|
---|
| 51 | -
|
---|
| 52 | - /*Assign output pointers:*/
|
---|
| 53 | - *ptria=tria;
|
---|
| 54 | -}
|
---|
| 55 | Index: ../trunk-jpl/src/c/modules/TriaSearchx/TriaSearchx.h
|
---|
| 56 | ===================================================================
|
---|
| 57 | --- ../trunk-jpl/src/c/modules/TriaSearchx/TriaSearchx.h (revision 20502)
|
---|
| 58 | +++ ../trunk-jpl/src/c/modules/TriaSearchx/TriaSearchx.h (revision 20503)
|
---|
| 59 | @@ -1,13 +0,0 @@
|
---|
| 60 | -/*!\file: TriaSearchx.h
|
---|
| 61 | - * \brief header file for Bamg module
|
---|
| 62 | - */
|
---|
| 63 | -
|
---|
| 64 | -#ifndef _TRIASEARCHX_H
|
---|
| 65 | -#define _TRIASEARCHX_H
|
---|
| 66 | -
|
---|
| 67 | -#include "../../classes/classes.h"
|
---|
| 68 | -
|
---|
| 69 | -/* local prototypes: */
|
---|
| 70 | -void TriaSearchx(double** ptria,int* index,int nel, double* x, double* y, int nods,double* x0, double* y0,int numberofnodes);
|
---|
| 71 | -
|
---|
| 72 | -#endif
|
---|
| 73 | Index: ../trunk-jpl/src/c/modules/modules.h
|
---|
| 74 | ===================================================================
|
---|
| 75 | --- ../trunk-jpl/src/c/modules/modules.h (revision 20502)
|
---|
| 76 | +++ ../trunk-jpl/src/c/modules/modules.h (revision 20503)
|
---|
| 77 | @@ -88,7 +88,6 @@
|
---|
| 78 | #include "./SystemMatricesx/SystemMatricesx.h"
|
---|
| 79 | #include "./SpcNodesx/SpcNodesx.h"
|
---|
| 80 | #include "./SurfaceAreax/SurfaceAreax.h"
|
---|
| 81 | -#include "./TriaSearchx/TriaSearchx.h"
|
---|
| 82 | #include "./TriMeshx/TriMeshx.h"
|
---|
| 83 | #include "./TriMeshProcessRiftsx/TriMeshProcessRiftsx.h"
|
---|
| 84 | #include "./ThicknessAbsMisfitx/ThicknessAbsMisfitx.h"
|
---|
| 85 | Index: ../trunk-jpl/src/c/Makefile.am
|
---|
| 86 | ===================================================================
|
---|
| 87 | --- ../trunk-jpl/src/c/Makefile.am (revision 20502)
|
---|
| 88 | +++ ../trunk-jpl/src/c/Makefile.am (revision 20503)
|
---|
| 89 | @@ -533,7 +533,6 @@
|
---|
| 90 | ./shared/TriMesh/OrderSegments.cpp\
|
---|
| 91 | ./shared/TriMesh/SplitMeshForRifts.cpp\
|
---|
| 92 | ./shared/TriMesh/TriMeshUtils.cpp\
|
---|
| 93 | - ./modules/TriaSearchx/TriaSearchx.cpp\
|
---|
| 94 | ./modules/TriMeshx/TriMeshx.cpp\
|
---|
| 95 | ./modules/TriMeshProcessRiftsx/TriMeshProcessRiftsx.cpp\
|
---|
| 96 | ./modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp\
|
---|
| 97 | Index: ../trunk-jpl/src/wrappers/TriaSearch/TriaSearch.h
|
---|
| 98 | ===================================================================
|
---|
| 99 | --- ../trunk-jpl/src/wrappers/TriaSearch/TriaSearch.h (revision 20502)
|
---|
| 100 | +++ ../trunk-jpl/src/wrappers/TriaSearch/TriaSearch.h (revision 20503)
|
---|
| 101 | @@ -1,56 +0,0 @@
|
---|
| 102 | -/*!\file TriaSearch.h
|
---|
| 103 | - */
|
---|
| 104 | -
|
---|
| 105 | -#ifndef _TRIASEARCH_H
|
---|
| 106 | -#define _TRIASEARCH_H
|
---|
| 107 | -
|
---|
| 108 | -#ifdef HAVE_CONFIG_H
|
---|
| 109 | - #include <config.h>
|
---|
| 110 | -#else
|
---|
| 111 | - #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
|
---|
| 112 | -#endif
|
---|
| 113 | -
|
---|
| 114 | -/*For python modules: needs to come before header files inclusion*/
|
---|
| 115 | -#ifdef _HAVE_PYTHON_
|
---|
| 116 | -#define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
|
---|
| 117 | -#endif
|
---|
| 118 | -
|
---|
| 119 | -#include "../bindings.h"
|
---|
| 120 | -#include "../../c/main/globals.h"
|
---|
| 121 | -#include "../../c/modules/modules.h"
|
---|
| 122 | -#include "../../c/shared/shared.h"
|
---|
| 123 | -
|
---|
| 124 | -#undef __FUNCT__
|
---|
| 125 | -#define __FUNCT__ "TriaSearch"
|
---|
| 126 | -
|
---|
| 127 | -#ifdef _HAVE_MATLAB_MODULES_
|
---|
| 128 | -/* serial input macros: */
|
---|
| 129 | -#define INDEXHANDLE prhs[0]
|
---|
| 130 | -#define XHANDLE prhs[1]
|
---|
| 131 | -#define YHANDLE prhs[2]
|
---|
| 132 | -#define X0HANDLE prhs[3]
|
---|
| 133 | -#define Y0HANDLE prhs[4]
|
---|
| 134 | -
|
---|
| 135 | -/* serial output macros: */
|
---|
| 136 | -#define TRIA (mxArray**)&plhs[0]
|
---|
| 137 | -#endif
|
---|
| 138 | -
|
---|
| 139 | -#ifdef _HAVE_PYTHON_MODULES_
|
---|
| 140 | -/* serial input macros: */
|
---|
| 141 | -#define INDEXHANDLE PyTuple _GetItem(args,0)
|
---|
| 142 | -#define XHANDLE PyTuple _GetItem(args,1)
|
---|
| 143 | -#define YHANDLE PyTuple _GetItem(args,2)
|
---|
| 144 | -#define X0HANDLE PyTuple _GetItem(args,3)
|
---|
| 145 | -#define Y0HANDLE PyTuple _GetItem(args,4)
|
---|
| 146 | -
|
---|
| 147 | -/* serial output macros: */
|
---|
| 148 | -#define TRIA output,0
|
---|
| 149 | -#endif
|
---|
| 150 | -
|
---|
| 151 | -/* serial arg counts: */
|
---|
| 152 | -#undef NLHS
|
---|
| 153 | -#define NLHS 1
|
---|
| 154 | -#undef NRHS
|
---|
| 155 | -#define NRHS 5
|
---|
| 156 | -
|
---|
| 157 | -#endif
|
---|
| 158 | Index: ../trunk-jpl/src/wrappers/TriaSearch/TriaSearch.cpp
|
---|
| 159 | ===================================================================
|
---|
| 160 | --- ../trunk-jpl/src/wrappers/TriaSearch/TriaSearch.cpp (revision 20502)
|
---|
| 161 | +++ ../trunk-jpl/src/wrappers/TriaSearch/TriaSearch.cpp (revision 20503)
|
---|
| 162 | @@ -1,68 +0,0 @@
|
---|
| 163 | -/*\file TriaSearch.c
|
---|
| 164 | - *\brief: TriaSearch module. See TriaSearchx for more details.
|
---|
| 165 | - */
|
---|
| 166 | -#include "./TriaSearch.h"
|
---|
| 167 | -
|
---|
| 168 | -void TriaSearchUsage(void){/*{{{*/
|
---|
| 169 | - _printf0_("TriaSearch- find triangle holding a point (x0,y0) in a mesh\n");
|
---|
| 170 | - _printf0_("\n");
|
---|
| 171 | - _printf0_(" Usage:\n");
|
---|
| 172 | - _printf0_(" tria=TriaSearch(index,x,y,x0,y0);\n");
|
---|
| 173 | - _printf0_(" index,x,y: mesh triangulatrion\n");
|
---|
| 174 | - _printf0_(" x0,y0: coordinates of the point for which we are trying to find a triangle\n");
|
---|
| 175 | - _printf0_(" x0,y0 can be an array of points\n");
|
---|
| 176 | - _printf0_("\n");
|
---|
| 177 | -}/*}}}*/
|
---|
| 178 | -WRAPPER(TriaSearch){
|
---|
| 179 | -
|
---|
| 180 | - int i;
|
---|
| 181 | -
|
---|
| 182 | - /*input: */
|
---|
| 183 | - int* index=NULL;
|
---|
| 184 | - int nel;
|
---|
| 185 | - int dummy;
|
---|
| 186 | -
|
---|
| 187 | - double* x=NULL;
|
---|
| 188 | - double* y=NULL;
|
---|
| 189 | - int nods;
|
---|
| 190 | -
|
---|
| 191 | - double* x0=NULL;
|
---|
| 192 | - double* y0=NULL;
|
---|
| 193 | - int numberofnodes;
|
---|
| 194 | -
|
---|
| 195 | - /* output: */
|
---|
| 196 | - double* tria=NULL;
|
---|
| 197 | -
|
---|
| 198 | - /*Boot module: */
|
---|
| 199 | - MODULEBOOT();
|
---|
| 200 | -
|
---|
| 201 | - /*checks on arguments on the matlab side: */
|
---|
| 202 | - CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&TriaSearchUsage);
|
---|
| 203 | -
|
---|
| 204 | - /*Input datasets: */
|
---|
| 205 | - FetchData(&index,&nel,&dummy,INDEXHANDLE);
|
---|
| 206 | - FetchData(&x,&nods,XHANDLE);
|
---|
| 207 | - FetchData(&y,&nods,YHANDLE);
|
---|
| 208 | - FetchData(&x0,&numberofnodes,X0HANDLE);
|
---|
| 209 | - FetchData(&y0,&numberofnodes,Y0HANDLE);
|
---|
| 210 | -
|
---|
| 211 | - /* Run core computations: */
|
---|
| 212 | - TriaSearchx(&tria,index,nel,x,y,nods,x0,y0,numberofnodes);
|
---|
| 213 | -
|
---|
| 214 | - /* c to matlab: */
|
---|
| 215 | - for(i=0;i<numberofnodes;i++)tria[i]++;
|
---|
| 216 | -
|
---|
| 217 | - /*Write data: */
|
---|
| 218 | - WriteData(TRIA,tria,numberofnodes);
|
---|
| 219 | -
|
---|
| 220 | - /*Cleanup*/
|
---|
| 221 | - xDelete<int>(index);
|
---|
| 222 | - xDelete<double>(x);
|
---|
| 223 | - xDelete<double>(y);
|
---|
| 224 | - xDelete<double>(x0);
|
---|
| 225 | - xDelete<double>(y0);
|
---|
| 226 | - xDelete<double>(tria);
|
---|
| 227 | -
|
---|
| 228 | - /*end module: */
|
---|
| 229 | - MODULEEND();
|
---|
| 230 | -}
|
---|
| 231 | Index: ../trunk-jpl/src/wrappers/matlab/Makefile.am
|
---|
| 232 | ===================================================================
|
---|
| 233 | --- ../trunk-jpl/src/wrappers/matlab/Makefile.am (revision 20502)
|
---|
| 234 | +++ ../trunk-jpl/src/wrappers/matlab/Makefile.am (revision 20503)
|
---|
| 235 | @@ -60,7 +60,6 @@
|
---|
| 236 | PointCloudFindNeighbors.la\
|
---|
| 237 | PropagateFlagsFromConnectivity.la\
|
---|
| 238 | StringToEnum.la\
|
---|
| 239 | - TriaSearch.la\
|
---|
| 240 | TriMesh.la\
|
---|
| 241 | TriMeshProcessRifts.la\
|
---|
| 242 | Scotch.la\
|
---|
| 243 | @@ -249,9 +248,6 @@
|
---|
| 244 | Shp2Kml_la_SOURCES = ../Shp2Kml/Shp2Kml.cpp
|
---|
| 245 | Shp2Kml_la_LIBADD = ${deps} $(SHAPELIBLIB) $(MPILIB) $(PETSCLIB) $(GSLLIB) $(PROJ4LIB)
|
---|
| 246 |
|
---|
| 247 | -TriaSearch_la_SOURCES = ../TriaSearch/TriaSearch.cpp
|
---|
| 248 | -TriaSearch_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(GSLLIB) $(PROJ4LIB)
|
---|
| 249 | -
|
---|
| 250 | TriMesh_la_SOURCES = ../TriMesh/TriMesh.cpp
|
---|
| 251 | TriMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(TRIANGLELIB) $(GSLLIB) $(PROJ4LIB)
|
---|
| 252 |
|
---|