source: issm/oecreview/Archive/14312-15392/ISSM-14964-14965.diff

Last change on this file was 15393, checked in by Mathieu Morlighem, 12 years ago

NEW: adding Archive/14312-15392 for oecreview

File size: 15.9 KB
RevLine 
[15393]1Index: ../trunk-jpl/src/c/Container/DataSet.h
2===================================================================
3--- ../trunk-jpl/src/c/Container/DataSet.h (revision 14964)
4+++ ../trunk-jpl/src/c/Container/DataSet.h (revision 14965)
5@@ -4,6 +4,7 @@
6 #include <vector>
7 #include <cstring>
8 #include "../classes/objects/Contour.h"
9+#include "../shared/Exp/exp.h"
10
11 /*forward declarations */
12 class Object;
13Index: ../trunk-jpl/src/c/shared/io/Disk/WriteLockFile.cpp
14===================================================================
15--- ../trunk-jpl/src/c/shared/io/Disk/WriteLockFile.cpp (revision 14964)
16+++ ../trunk-jpl/src/c/shared/io/Disk/WriteLockFile.cpp (revision 14965)
17@@ -1,8 +1,9 @@
18 /*!\file: WriteLockFile.cpp
19 * \brief
20 */
21-#include <stdio.h>
22-#include "../../shared.h"
23+#include "../../Exceptions/exceptions.h"
24+#include "../Comm/Comm.h"
25+#include "../Print/Print.h"
26
27 void WriteLockFile(char* filename){
28
29Index: ../trunk-jpl/src/c/shared/Exp/exp.h
30===================================================================
31--- ../trunk-jpl/src/c/shared/Exp/exp.h (revision 14964)
32+++ ../trunk-jpl/src/c/shared/Exp/exp.h (revision 14965)
33@@ -7,13 +7,14 @@
34
35 #include <cstring>
36 #include "../Numerics/recast.h"
37-#include "../../toolkits/toolkits.h"
38+#include "../Exceptions/exceptions.h"
39+#include "../MemOps/MemOps.h"
40
41 int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue);
42 int ExpWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,char* domainname);
43 int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
44
45-template <class doubletype> int IsInPoly(IssmSeqVec<doubletype>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){ /*{{{*/
46+template <class doubletype> int IsInPoly(doubletype* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){ /*{{{*/
47
48 int i;
49 double x0,y0;
50@@ -35,7 +36,7 @@
51 for (i=i0;i<i1;i++){
52
53 //Get current value of value[i] -> do not change it if != 0
54- in->GetValue(&value,i);
55+ value=in[i];
56 if (reCast<bool,doubletype>(value)){
57 /*this vertex already is inside one of the contours, continue*/
58 continue;
59@@ -49,7 +50,7 @@
60 else{
61 value=pnpoly(numvertices,xc,yc,x0,y0,edgevalue);
62 }
63- in->SetValue(i,value,INS_VAL);
64+ in[i]=value;
65 }
66 return 1;
67 }/*}}}*/
68Index: ../trunk-jpl/src/c/shared/shared.h
69===================================================================
70--- ../trunk-jpl/src/c/shared/shared.h (revision 14964)
71+++ ../trunk-jpl/src/c/shared/shared.h (revision 14965)
72@@ -10,6 +10,7 @@
73 #include "./Elements/elements.h"
74 #include "./Enum/Enum.h"
75 #include "./Exceptions/exceptions.h"
76+#include "./io/io.h"
77 #include "./Exp/exp.h"
78 #include "./Matrix/matrix.h"
79 #include "./Numerics/numerics.h"
80Index: ../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp
81===================================================================
82--- ../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp (revision 14964)
83+++ ../trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp (revision 14965)
84@@ -24,7 +24,6 @@
85 double ymin,ymax;
86
87 /*contours: */
88- IssmSeqVec<IssmPDouble> *vec_incontour = NULL;
89 double *incontour = NULL;
90
91 /*threading: */
92@@ -76,8 +75,7 @@
93
94 /*Build indices of contour: */
95 if(numcontours){
96- ContourToNodesx( &vec_incontour,x_prime,y_prime,nods_prime,contours,numcontours,1);
97- incontour=vec_incontour->ToMPISerial();
98+ ContourToNodesx( &incontour,x_prime,y_prime,nods_prime,contours,numcontours,1);
99 }
100 else{
101 incontour=xNew<double>(nods_prime);
102Index: ../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h
103===================================================================
104--- ../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h (revision 14964)
105+++ ../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h (revision 14965)
106@@ -9,7 +9,7 @@
107 #include "../../classes/objects/objects.h"
108
109 /* local prototypes: */
110-int ContourToNodesx(IssmSeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue);
111-int ContourToNodesx(IssmSeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);
112+int ContourToNodesx(IssmPDouble** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue);
113+int ContourToNodesx(IssmPDouble** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);
114
115 #endif /* _CONTOURTONODESX_H */
116Index: ../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp
117===================================================================
118--- ../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp (revision 14964)
119+++ ../trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp (revision 14965)
120@@ -3,7 +3,7 @@
121
122 #include "./ContourToNodesx.h"
123
124-int ContourToNodesx(IssmSeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue){
125+int ContourToNodesx(IssmPDouble** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue){
126
127 int i;
128
129@@ -14,8 +14,8 @@
130 double* yc=NULL;
131
132 /*output: */
133- IssmSeqVec<IssmPDouble>* flags=NULL;
134- flags=new IssmSeqVec<IssmPDouble>(nods);
135+ IssmPDouble* flags=NULL;
136+ flags=xNew<IssmPDouble>(nods);
137
138 /*Loop through all contours: */
139 for (i=0;i<numcontours;i++){
140@@ -26,15 +26,12 @@
141 IsInPoly(flags,xc,yc,numnodes,x,y,0,nods,edgevalue);
142 }
143
144- /*Assemble vector: */
145- flags->Assemble();
146-
147 /*Assign output pointers: */
148 *pflags=flags;
149 return 1;
150 }
151
152-int ContourToNodesx(IssmSeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
153+int ContourToNodesx(IssmPDouble** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
154
155 /*Contour:*/
156 Contour<IssmPDouble>* contouri=NULL;
157@@ -42,8 +39,8 @@
158 double* yc=NULL;
159
160 /*output: */
161- IssmSeqVec<IssmPDouble>* flags=NULL;
162- flags=new IssmSeqVec<IssmPDouble>(nods);
163+ IssmPDouble* flags=NULL;
164+ flags=xNew<IssmPDouble>(nods);
165
166 /*Loop through all contours: */
167 if(contours){
168@@ -53,9 +50,6 @@
169 }
170 }
171
172- /*Assemble vector: */
173- flags->Assemble();
174-
175 /*Assign output pointers: */
176 *pflags=flags;
177 return 1;
178Index: ../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp
179===================================================================
180--- ../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp (revision 14964)
181+++ ../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp (revision 14965)
182@@ -9,10 +9,9 @@
183
184 #include "./ContourToMeshx.h"
185
186-int ContourToMeshx(IssmSeqVec<double>** pin_nod,IssmSeqVec<double>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {
187+int ContourToMeshx(double** pin_nod,double** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {
188
189 /*Contour:*/
190- double* in_nod_serial;
191 double value;
192
193 /*threading: */
194@@ -23,10 +22,10 @@
195 #endif
196
197 /*output: */
198- IssmSeqVec<double>* in_nod=NULL;
199- IssmSeqVec<double>* in_elem=NULL;
200- in_nod = new IssmSeqVec<double>(nods);
201- in_elem = new IssmSeqVec<double>(nel);
202+ double* in_nod;
203+ double* in_elem;
204+ in_nod = xNew<double>(nods);
205+ in_elem = xNew<double>(nel);
206
207 /*initialize thread parameters: */
208 gate.contours=contours;
209@@ -39,30 +38,18 @@
210 /*launch the thread manager with ContourToMeshxt as a core: */
211 LaunchThread(ContourToMeshxt,(void*)&gate,num);
212
213- /*Assemble in_nod: */
214- in_nod->Assemble();
215-
216- /*Get in_nod serialised for next operation: */
217- in_nod_serial=in_nod->ToMPISerial();
218-
219 /*Take care of the case where an element interpolation has been requested: */
220 if ((strcmp(interptype,"element")==0) || (strcmp(interptype,"element and node")==0)){
221 for(int n=0;n<nel;n++){
222- if ( (in_nod_serial[ (int)*(index+3*n+0) -1] == 1) && (in_nod_serial[ (int)*(index+3*n+1) -1] == 1) && (in_nod_serial[ (int)*(index+3*n+2) -1] == 1) ){
223- value=1; in_elem->SetValue(n,value,INS_VAL);
224+ 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) ){
225+ value=1; in_elem[n]=value;
226 }
227 }
228 }
229
230- /*Assemble vectors: */
231- in_elem->Assemble();
232-
233 /*Assign output pointers: */
234 *pin_nod=in_nod;
235 *pin_elem=in_elem;
236
237- /*Free ressources:*/
238- xDelete<double>(in_nod_serial);
239-
240 return 1;
241 }
242Index: ../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp
243===================================================================
244--- ../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp (revision 14964)
245+++ ../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp (revision 14965)
246@@ -32,7 +32,7 @@
247 int edgevalue;
248 double* x=NULL;
249 double* y=NULL;
250- IssmSeqVec<double>* in_nod=NULL;
251+ double* in_nod=NULL;
252
253 /*recover handle and gate: */
254 handle=(pthread_handle*)vpthread_handle;
255Index: ../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h
256===================================================================
257--- ../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h (revision 14964)
258+++ ../trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h (revision 14965)
259@@ -14,14 +14,14 @@
260 DataSet *contours;
261 int nods;
262 int edgevalue;
263- IssmSeqVec<double> *in_nod;
264+ double* in_nod;
265 double *x;
266 double *y;
267
268 } ContourToMeshxThreadStruct;
269
270 /* local prototypes: */
271-int ContourToMeshx(IssmSeqVec<double>** pin_nods,IssmSeqVec<double>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue);
272+int ContourToMeshx(double** pin_nods,double** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue);
273
274 void* ContourToMeshxt(void* vContourToMeshxThreadStruct);
275
276Index: ../trunk-jpl/src/c/toolkits/mpi/patches/DetermineLocalSize.cpp
277===================================================================
278--- ../trunk-jpl/src/c/toolkits/mpi/patches/DetermineLocalSize.cpp (revision 14964)
279+++ ../trunk-jpl/src/c/toolkits/mpi/patches/DetermineLocalSize.cpp (revision 14965)
280@@ -5,7 +5,6 @@
281 #include <stdio.h>
282 #include <math.h>
283 #include "../../../shared/shared.h"
284-#include "../../../shared/Numerics/types.h"
285
286 int DetermineLocalSize(int global_size,COMM comm){
287
288Index: ../trunk-jpl/src/wrappers/python/io/WritePythonData.cpp
289===================================================================
290--- ../trunk-jpl/src/wrappers/python/io/WritePythonData.cpp (revision 14964)
291+++ ../trunk-jpl/src/wrappers/python/io/WritePythonData.cpp (revision 14965)
292@@ -14,7 +14,7 @@
293 #include "./pythonio.h"
294 #include "../../c/Container/Container.h"
295 #include "../../c/shared/shared.h"
296-#include "../../c/EnumDefinitions/EnumDefinitions.h"
297+#include "../../c/shared/Enum/Enum.h"
298
299 /*Primitive data types*/
300 /*FUNCTION WriteData(PyObject* py_tuple,int index,int integer){{{*/
301Index: ../trunk-jpl/src/wrappers/NodeConnectivity/NodeConnectivity.h
302===================================================================
303--- ../trunk-jpl/src/wrappers/NodeConnectivity/NodeConnectivity.h (revision 14964)
304+++ ../trunk-jpl/src/wrappers/NodeConnectivity/NodeConnectivity.h (revision 14965)
305@@ -27,7 +27,7 @@
306 #include "../../c/Container/Container.h"
307 #include "../../c/shared/shared.h"
308 #include "../../c/shared/io/io.h"
309-#include "../../c/EnumDefinitions/EnumDefinitions.h"
310+#include "../../c/shared/Enum/Enum.h"
311
312 #ifdef _HAVE_MATLAB_MODULES_
313 /* serial input macros: */
314Index: ../trunk-jpl/src/wrappers/ContourToNodes/ContourToNodes.cpp
315===================================================================
316--- ../trunk-jpl/src/wrappers/ContourToNodes/ContourToNodes.cpp (revision 14964)
317+++ ../trunk-jpl/src/wrappers/ContourToNodes/ContourToNodes.cpp (revision 14965)
318@@ -24,7 +24,7 @@
319 DataSet *contours = NULL;
320
321 /* output: */
322- IssmSeqVec<double> *flags = NULL;
323+ double *flags = NULL;
324
325 /*Boot module: */
326 MODULEBOOT();
327@@ -42,7 +42,7 @@
328 ContourToNodesx(&flags,x,y,nods,contours,edgevalue);
329
330 /* output: */
331- WriteData(FLAGS,flags);
332+ WriteData(FLAGS,flags,nods);
333
334 /*end module: */
335 MODULEEND();
336Index: ../trunk-jpl/src/wrappers/EdgeDetection/EdgeDetection.h
337===================================================================
338--- ../trunk-jpl/src/wrappers/EdgeDetection/EdgeDetection.h (revision 14964)
339+++ ../trunk-jpl/src/wrappers/EdgeDetection/EdgeDetection.h (revision 14965)
340@@ -24,7 +24,7 @@
341 #include "../../c/Container/Container.h"
342 #include "../../c/shared/shared.h"
343 #include "../../c/shared/io/io.h"
344-#include "../../c/EnumDefinitions/EnumDefinitions.h"
345+#include "../../c/shared/Enum/Enum.h"
346
347 #undef __FUNCT__
348 #define __FUNCT__ "EdgeDetection"
349Index: ../trunk-jpl/src/wrappers/ElementConnectivity/ElementConnectivity.h
350===================================================================
351--- ../trunk-jpl/src/wrappers/ElementConnectivity/ElementConnectivity.h (revision 14964)
352+++ ../trunk-jpl/src/wrappers/ElementConnectivity/ElementConnectivity.h (revision 14965)
353@@ -24,7 +24,7 @@
354 #include "../../c/Container/Container.h"
355 #include "../../c/shared/shared.h"
356 #include "../../c/shared/io/io.h"
357-#include "../../c/EnumDefinitions/EnumDefinitions.h"
358+#include "../../c/shared/Enum/Enum.h"
359
360 #undef __FUNCT__
361 #define __FUNCT__ "ElementConnectivity"
362Index: ../trunk-jpl/src/wrappers/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
363===================================================================
364--- ../trunk-jpl/src/wrappers/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h (revision 14964)
365+++ ../trunk-jpl/src/wrappers/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h (revision 14965)
366@@ -24,7 +24,7 @@
367 #include "../../c/Container/Container.h"
368 #include "../../c/shared/shared.h"
369 #include "../../c/shared/io/io.h"
370-#include "../../c/EnumDefinitions/EnumDefinitions.h"
371+#include "../../c/shared/Enum/Enum.h"
372
373 #undef __FUNCT__
374 #define __FUNCT__ "InterpFromMeshToMesh2d"
375Index: ../trunk-jpl/src/wrappers/ContourToMesh/ContourToMesh.h
376===================================================================
377--- ../trunk-jpl/src/wrappers/ContourToMesh/ContourToMesh.h (revision 14964)
378+++ ../trunk-jpl/src/wrappers/ContourToMesh/ContourToMesh.h (revision 14965)
379@@ -24,7 +24,7 @@
380 #include "../../c/Container/Container.h"
381 #include "../../c/shared/shared.h"
382 #include "../../c/shared/io/io.h"
383-#include "../../c/EnumDefinitions/EnumDefinitions.h"
384+#include "../../c/shared/Enum/Enum.h"
385
386 #undef __FUNCT__
387 #define __FUNCT__ "ContourToMesh"
388Index: ../trunk-jpl/src/wrappers/ContourToMesh/ContourToMesh.cpp
389===================================================================
390--- ../trunk-jpl/src/wrappers/ContourToMesh/ContourToMesh.cpp (revision 14964)
391+++ ../trunk-jpl/src/wrappers/ContourToMesh/ContourToMesh.cpp (revision 14965)
392@@ -39,8 +39,8 @@
393 DataSet *contours = NULL;
394
395 /* output: */
396- IssmSeqVec<double> *in_nod = NULL;
397- IssmSeqVec<double> *in_elem = NULL;
398+ double *in_nod = NULL;
399+ double *in_elem = NULL;
400
401 /*Boot module: */
402 MODULEBOOT();
403@@ -71,16 +71,16 @@
404
405 /* output: */
406 if (strcmp(interptype,"node")==0){
407- WriteData(PLHS0,in_nod);
408+ WriteData(PLHS0,in_nod,nods);
409 WriteData(PLHS1);
410 }
411 else if (strcmp(interptype,"element")==0){
412- WriteData(PLHS0,in_elem);
413+ WriteData(PLHS0,in_elem,nel);
414 WriteData(PLHS1);
415 }
416 else if (strcmp(interptype,"element and node")==0){
417- WriteData(PLHS0,in_nod);
418- WriteData(PLHS1,in_elem);
419+ WriteData(PLHS0,in_nod,nods);
420+ WriteData(PLHS1,in_elem,nel);
421 }
422 else _error_("wrong interpolation type");
423
424Index: ../trunk-jpl/src/wrappers/TriMesh/TriMesh.h
425===================================================================
426--- ../trunk-jpl/src/wrappers/TriMesh/TriMesh.h (revision 14964)
427+++ ../trunk-jpl/src/wrappers/TriMesh/TriMesh.h (revision 14965)
428@@ -24,7 +24,7 @@
429 #include "../../c/Container/Container.h"
430 #include "../../c/shared/shared.h"
431 #include "../../c/shared/io/io.h"
432-#include "../../c/EnumDefinitions/EnumDefinitions.h"
433+#include "../../c/shared/Enum/Enum.h"
434
435 #undef __FUNCT__
436 #define __FUNCT__ "TriMesh"
Note: See TracBrowser for help on using the repository browser.