Changeset 14965
- Timestamp:
- 05/08/13 11:09:11 (12 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/Container/DataSet.h
r14957 r14965 5 5 #include <cstring> 6 6 #include "../classes/objects/Contour.h" 7 #include "../shared/Exp/exp.h" 7 8 8 9 /*forward declarations */ -
issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp
r14656 r14965 10 10 #include "./ContourToMeshx.h" 11 11 12 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) {12 int ContourToMeshx(double** pin_nod,double** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) { 13 13 14 14 /*Contour:*/ 15 double* in_nod_serial;16 15 double value; 17 16 … … 24 23 25 24 /*output: */ 26 IssmSeqVec<double>* in_nod=NULL;27 IssmSeqVec<double>* in_elem=NULL;28 in_nod = new IssmSeqVec<double>(nods);29 in_elem = new IssmSeqVec<double>(nel);25 double* in_nod; 26 double* in_elem; 27 in_nod = xNew<double>(nods); 28 in_elem = xNew<double>(nel); 30 29 31 30 /*initialize thread parameters: */ … … 40 39 LaunchThread(ContourToMeshxt,(void*)&gate,num); 41 40 42 /*Assemble in_nod: */43 in_nod->Assemble();44 45 /*Get in_nod serialised for next operation: */46 in_nod_serial=in_nod->ToMPISerial();47 48 41 /*Take care of the case where an element interpolation has been requested: */ 49 42 if ((strcmp(interptype,"element")==0) || (strcmp(interptype,"element and node")==0)){ 50 43 for(int n=0;n<nel;n++){ 51 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) ){52 value=1; in_elem ->SetValue(n,value,INS_VAL);44 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) ){ 45 value=1; in_elem[n]=value; 53 46 } 54 47 } 55 48 } 56 57 /*Assemble vectors: */58 in_elem->Assemble();59 49 60 50 /*Assign output pointers: */ … … 62 52 *pin_elem=in_elem; 63 53 64 /*Free ressources:*/65 xDelete<double>(in_nod_serial);66 67 54 return 1; 68 55 } -
issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h
r14656 r14965 15 15 int nods; 16 16 int edgevalue; 17 IssmSeqVec<double> *in_nod;17 double* in_nod; 18 18 double *x; 19 19 double *y; … … 22 22 23 23 /* local prototypes: */ 24 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);24 int ContourToMeshx(double** pin_nods,double** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue); 25 25 26 26 void* ContourToMeshxt(void* vContourToMeshxThreadStruct); -
issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp
r14656 r14965 33 33 double* x=NULL; 34 34 double* y=NULL; 35 IssmSeqVec<double>* in_nod=NULL;35 double* in_nod=NULL; 36 36 37 37 /*recover handle and gate: */ -
issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp
r14656 r14965 4 4 #include "./ContourToNodesx.h" 5 5 6 int ContourToNodesx(Issm SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue){6 int ContourToNodesx(IssmPDouble** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue){ 7 7 8 8 int i; … … 15 15 16 16 /*output: */ 17 Issm SeqVec<IssmPDouble>* flags=NULL;18 flags= new IssmSeqVec<IssmPDouble>(nods);17 IssmPDouble* flags=NULL; 18 flags=xNew<IssmPDouble>(nods); 19 19 20 20 /*Loop through all contours: */ … … 27 27 } 28 28 29 /*Assemble vector: */30 flags->Assemble();31 32 29 /*Assign output pointers: */ 33 30 *pflags=flags; … … 35 32 } 36 33 37 int ContourToNodesx(Issm SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){34 int ContourToNodesx(IssmPDouble** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){ 38 35 39 36 /*Contour:*/ … … 43 40 44 41 /*output: */ 45 Issm SeqVec<IssmPDouble>* flags=NULL;46 flags= new IssmSeqVec<IssmPDouble>(nods);42 IssmPDouble* flags=NULL; 43 flags=xNew<IssmPDouble>(nods); 47 44 48 45 /*Loop through all contours: */ … … 54 51 } 55 52 56 /*Assemble vector: */57 flags->Assemble();58 59 53 /*Assign output pointers: */ 60 54 *pflags=flags; -
issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h
r14656 r14965 10 10 11 11 /* local prototypes: */ 12 int ContourToNodesx(Issm SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue);13 int ContourToNodesx(Issm SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);12 int ContourToNodesx(IssmPDouble** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue); 13 int ContourToNodesx(IssmPDouble** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue); 14 14 15 15 #endif /* _CONTOURTONODESX_H */ -
issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp
r14917 r14965 25 25 26 26 /*contours: */ 27 IssmSeqVec<IssmPDouble> *vec_incontour = NULL;28 27 double *incontour = NULL; 29 28 … … 77 76 /*Build indices of contour: */ 78 77 if(numcontours){ 79 ContourToNodesx( &vec_incontour,x_prime,y_prime,nods_prime,contours,numcontours,1); 80 incontour=vec_incontour->ToMPISerial(); 78 ContourToNodesx( &incontour,x_prime,y_prime,nods_prime,contours,numcontours,1); 81 79 } 82 80 else{ -
issm/trunk-jpl/src/c/shared/Exp/exp.h
r14953 r14965 8 8 #include <cstring> 9 9 #include "../Numerics/recast.h" 10 #include "../../toolkits/toolkits.h" 10 #include "../Exceptions/exceptions.h" 11 #include "../MemOps/MemOps.h" 11 12 12 13 int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue); … … 14 15 int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue); 15 16 16 template <class doubletype> int IsInPoly( IssmSeqVec<doubletype>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){ /*{{{*/17 template <class doubletype> int IsInPoly(doubletype* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){ /*{{{*/ 17 18 18 19 int i; … … 36 37 37 38 //Get current value of value[i] -> do not change it if != 0 38 in->GetValue(&value,i);39 value=in[i]; 39 40 if (reCast<bool,doubletype>(value)){ 40 41 /*this vertex already is inside one of the contours, continue*/ … … 50 51 value=pnpoly(numvertices,xc,yc,x0,y0,edgevalue); 51 52 } 52 in ->SetValue(i,value,INS_VAL);53 in[i]=value; 53 54 } 54 55 return 1; -
issm/trunk-jpl/src/c/shared/io/Disk/WriteLockFile.cpp
r14950 r14965 2 2 * \brief 3 3 */ 4 #include <stdio.h> 5 #include "../../shared.h" 4 #include "../../Exceptions/exceptions.h" 5 #include "../Comm/Comm.h" 6 #include "../Print/Print.h" 6 7 7 8 void WriteLockFile(char* filename){ -
issm/trunk-jpl/src/c/shared/shared.h
r14960 r14965 11 11 #include "./Enum/Enum.h" 12 12 #include "./Exceptions/exceptions.h" 13 #include "./io/io.h" 13 14 #include "./Exp/exp.h" 14 15 #include "./Matrix/matrix.h" -
issm/trunk-jpl/src/c/toolkits/mpi/patches/DetermineLocalSize.cpp
r14915 r14965 6 6 #include <math.h> 7 7 #include "../../../shared/shared.h" 8 #include "../../../shared/Numerics/types.h"9 8 10 9 int DetermineLocalSize(int global_size,COMM comm){ -
issm/trunk-jpl/src/wrappers/ContourToMesh/ContourToMesh.cpp
r14656 r14965 40 40 41 41 /* output: */ 42 IssmSeqVec<double>*in_nod = NULL;43 IssmSeqVec<double>*in_elem = NULL;42 double *in_nod = NULL; 43 double *in_elem = NULL; 44 44 45 45 /*Boot module: */ … … 72 72 /* output: */ 73 73 if (strcmp(interptype,"node")==0){ 74 WriteData(PLHS0,in_nod );74 WriteData(PLHS0,in_nod,nods); 75 75 WriteData(PLHS1); 76 76 } 77 77 else if (strcmp(interptype,"element")==0){ 78 WriteData(PLHS0,in_elem );78 WriteData(PLHS0,in_elem,nel); 79 79 WriteData(PLHS1); 80 80 } 81 81 else if (strcmp(interptype,"element and node")==0){ 82 WriteData(PLHS0,in_nod );83 WriteData(PLHS1,in_elem );82 WriteData(PLHS0,in_nod,nods); 83 WriteData(PLHS1,in_elem,nel); 84 84 } 85 85 else _error_("wrong interpolation type"); -
issm/trunk-jpl/src/wrappers/ContourToMesh/ContourToMesh.h
r14950 r14965 25 25 #include "../../c/shared/shared.h" 26 26 #include "../../c/shared/io/io.h" 27 #include "../../c/ EnumDefinitions/EnumDefinitions.h"27 #include "../../c/shared/Enum/Enum.h" 28 28 29 29 #undef __FUNCT__ -
issm/trunk-jpl/src/wrappers/ContourToNodes/ContourToNodes.cpp
r14656 r14965 25 25 26 26 /* output: */ 27 IssmSeqVec<double>*flags = NULL;27 double *flags = NULL; 28 28 29 29 /*Boot module: */ … … 43 43 44 44 /* output: */ 45 WriteData(FLAGS,flags );45 WriteData(FLAGS,flags,nods); 46 46 47 47 /*end module: */ -
issm/trunk-jpl/src/wrappers/EdgeDetection/EdgeDetection.h
r14950 r14965 25 25 #include "../../c/shared/shared.h" 26 26 #include "../../c/shared/io/io.h" 27 #include "../../c/ EnumDefinitions/EnumDefinitions.h"27 #include "../../c/shared/Enum/Enum.h" 28 28 29 29 #undef __FUNCT__ -
issm/trunk-jpl/src/wrappers/ElementConnectivity/ElementConnectivity.h
r14950 r14965 25 25 #include "../../c/shared/shared.h" 26 26 #include "../../c/shared/io/io.h" 27 #include "../../c/ EnumDefinitions/EnumDefinitions.h"27 #include "../../c/shared/Enum/Enum.h" 28 28 29 29 #undef __FUNCT__ -
issm/trunk-jpl/src/wrappers/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.h
r14950 r14965 25 25 #include "../../c/shared/shared.h" 26 26 #include "../../c/shared/io/io.h" 27 #include "../../c/ EnumDefinitions/EnumDefinitions.h"27 #include "../../c/shared/Enum/Enum.h" 28 28 29 29 #undef __FUNCT__ -
issm/trunk-jpl/src/wrappers/NodeConnectivity/NodeConnectivity.h
r14950 r14965 28 28 #include "../../c/shared/shared.h" 29 29 #include "../../c/shared/io/io.h" 30 #include "../../c/ EnumDefinitions/EnumDefinitions.h"30 #include "../../c/shared/Enum/Enum.h" 31 31 32 32 #ifdef _HAVE_MATLAB_MODULES_ -
issm/trunk-jpl/src/wrappers/TriMesh/TriMesh.h
r14950 r14965 25 25 #include "../../c/shared/shared.h" 26 26 #include "../../c/shared/io/io.h" 27 #include "../../c/ EnumDefinitions/EnumDefinitions.h"27 #include "../../c/shared/Enum/Enum.h" 28 28 29 29 #undef __FUNCT__ -
issm/trunk-jpl/src/wrappers/python/io/WritePythonData.cpp
r14917 r14965 15 15 #include "../../c/Container/Container.h" 16 16 #include "../../c/shared/shared.h" 17 #include "../../c/ EnumDefinitions/EnumDefinitions.h"17 #include "../../c/shared/Enum/Enum.h" 18 18 19 19 /*Primitive data types*/
Note:
See TracChangeset
for help on using the changeset viewer.