Changeset 13634
- Timestamp:
- 10/12/12 10:45:13 (12 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 5 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/Makefile.am ¶
r13600 r13634 360 360 ./classes/objects/Options/GenericOption.h\ 361 361 ./classes/objects/Options/OptionUtilities.cpp\ 362 ./classes/objects/Options/OptionUtilities.h 363 362 ./classes/objects/Options/OptionUtilities.h\ 363 ./classes/RiftStruct.cpp\ 364 ./classes/RiftStruct.h 364 365 #}}} 365 366 #DAKOTA sources {{{ … … 848 849 ./modules/TriMeshx/TriMeshx.h\ 849 850 ./modules/TriMeshx/TriMeshx.cpp\ 851 ./modules/TriMeshProcessRiftsx/TriMeshProcessRiftsx.h\ 852 ./modules/TriMeshProcessRiftsx/TriMeshProcessRiftsx.cpp\ 850 853 ./modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h\ 851 854 ./modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp\ -
TabularUnified issm/trunk-jpl/src/c/classes/DofIndexing.cpp ¶
r13622 r13634 10 10 11 11 #include <stdio.h> 12 #include <string.h> 12 13 #include "./classes.h" 13 #include <string.h>14 14 #include "../EnumDefinitions/EnumDefinitions.h" 15 15 #include "../shared/shared.h" -
TabularUnified issm/trunk-jpl/src/c/classes/FemModel.h ¶
r13623 r13634 20 20 class Materials; 21 21 class Profiler; 22 class Elements; 22 23 /*}}}*/ 23 24 -
TabularUnified issm/trunk-jpl/src/c/classes/Update.h ¶
r13413 r13634 7 7 8 8 /*Headers:*/ 9 /*{{{*/10 9 #include "../shared/shared.h" 11 /*}}}*/ 10 class IoModel; 12 11 13 12 class Update{ -
TabularUnified issm/trunk-jpl/src/c/classes/classes.h ¶
r13623 r13634 32 32 #include "./AdolcEdf.h" 33 33 #include "./IssmComm.h" 34 #include "./RiftStruct.h" 34 35 35 36 #endif -
TabularUnified issm/trunk-jpl/src/c/classes/objects/Vertex.h ¶
r13623 r13634 9 9 /*{{{*/ 10 10 #include "../classes.h" 11 class IoModel;12 template <class doubletype> class Vector;13 class Parameters;14 11 #include "../../shared/Exceptions/exceptions.h" 15 12 #include "../../toolkits/toolkits.h" 16 13 #include "../../include/include.h" 17 14 template <class doubletype> class Vector; 15 class Parameters; 16 class IoModel; 18 17 /*}}}*/ 19 18 -
TabularUnified issm/trunk-jpl/src/c/modules/modules.h ¶
r13547 r13634 117 117 #include "./TriaSearchx/TriaSearchx.h" 118 118 #include "./TriMeshx/TriMeshx.h" 119 #include "./TriMeshProcessRiftsx/TriMeshProcessRiftsx.h" 119 120 #include "./ThicknessAbsMisfitx/ThicknessAbsMisfitx.h" 120 121 #include "./ThicknessAbsGradientx/ThicknessAbsGradientx.h" -
TabularUnified issm/trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp ¶
r13622 r13634 266 266 /*Reallocate segments: */ 267 267 segments =xReNew<double>(segments, nsegs*3,(nsegs+nriftsegs)*3); 268 segmentmarkerlist=xReNew<double>(segmentmarkerlist,nsegs *3,(nsegs+nriftsegs)*3);268 segmentmarkerlist=xReNew<double>(segmentmarkerlist,nsegs,(nsegs+nriftsegs)); 269 269 270 270 /*First, update the existing segments to the new nodes :*/ -
TabularUnified issm/trunk-jpl/src/c/shared/shared.h ¶
r13539 r13634 6 6 #define _SHARED_H_ 7 7 8 #include " Alloc/alloc.h"9 #include " Alloc/xNewDelete.h"10 #include " Bamg/shared.h"11 #include " Elements/elements.h"12 #include " Exceptions/exceptions.h"13 #include " Exp/exp.h"14 #include " Matrix/matrix.h"15 #include " MemOps/xMemCpy.h"16 #include " Numerics/numerics.h"17 #include " Sorting/sorting.h"18 #include " String/sharedstring.h"19 #include " Threads/issm_threads.h"20 #include " TriMesh/trimesh.h"21 #include " Wrapper/wrappershared.h"8 #include "./Alloc/alloc.h" 9 #include "./Alloc/xNewDelete.h" 10 #include "./Bamg/shared.h" 11 #include "./Elements/elements.h" 12 #include "./Exceptions/exceptions.h" 13 #include "./Exp/exp.h" 14 #include "./Matrix/matrix.h" 15 #include "./MemOps/xMemCpy.h" 16 #include "./Numerics/numerics.h" 17 #include "./Sorting/sorting.h" 18 #include "./String/sharedstring.h" 19 #include "./Threads/issm_threads.h" 20 #include "./TriMesh/trimesh.h" 21 #include "./Wrapper/wrappershared.h" 22 22 23 23 #endif -
TabularUnified issm/trunk-jpl/src/modules/TriMeshProcessRifts/TriMeshProcessRifts.cpp ¶
r13588 r13634 11 11 _printLine_(" index2,x2,y2,segments2,segmentmarkers2,rifts2 is the resulting triangulation where rifts have been processed."); 12 12 }/*}}}*/ 13 void TriMeshProcessRiftsx(double** pindex, int* pnel,double** px,double** py,int* pnods,double** psegments,double** psegmentmarkers,int *pnum_seg,14 int *pnumrifts, int **priftsnumsegments, double ***priftssegments,15 int **priftsnumpairs, double ***priftspairs, double **priftstips,16 double ***priftspenaltypairs, int **priftsnumpenaltypairs);17 13 WRAPPER(TriMeshProcessRifts){ 18 14 19 15 /* returned quantities: */ 20 int numrifts; 21 int *riftsnumsegments = NULL; 22 double **riftssegments = NULL; 23 int *riftsnumpairs = NULL; 24 double **riftspairs = NULL; 25 double *riftstips = NULL; 26 double **riftspenaltypairs = NULL; 27 int *riftsnumpenaltypairs = NULL; 16 RiftStruct *riftstruct = NULL; 28 17 29 18 /* input: */ … … 51 40 /*call x layer*/ 52 41 TriMeshProcessRiftsx(&index,&nel,&x,&y,&nods,&segments,&segmentmarkers,&num_seg, 53 & numrifts,&riftsnumsegments,&riftssegments,&riftsnumpairs,&riftspairs,&riftstips,&riftspenaltypairs,&riftsnumpenaltypairs);42 &riftstruct); 54 43 55 44 /*Output : */ … … 60 49 WriteData(SEGMENTMARKERSOUT,segmentmarkers,num_seg,1); 61 50 62 mxArray *pmxa_array= NULL;63 mxArray *pmxa_array2= NULL;64 mxArray *pmxa_array3= NULL;51 mxArray *pmxa_array = NULL; 52 mxArray *pmxa_array2 = NULL; 53 mxArray *pmxa_array3 = NULL; 65 54 const char *fnames[10]; 66 55 mwSize ndim = 2; 67 56 mwSize dimensions[2] = {1,1}; 68 57 double *pair = NULL; 69 70 58 71 59 /*Create a structure rifts where if i is a rift number, we have the following fields rifts(i).segments and rifts(i).numsegs: */ … … 81 69 fnames[9] = "state"; 82 70 83 dimensions[0]= numrifts;84 pmxa_array=mxCreateStructArray( 71 dimensions[0]=riftstruct->numrifts; 72 pmxa_array=mxCreateStructArray(ndim,dimensions,10,fnames); 85 73 86 for(int i=0;i< numrifts;i++){74 for(int i=0;i<riftstruct->numrifts;i++){ 87 75 88 76 /*Segments: */ 89 WriteData(&pmxa_array3,rifts segments[i],riftsnumsegments[i],3);77 WriteData(&pmxa_array3,riftstruct->riftssegments[i],riftstruct->riftsnumsegments[i],3); 90 78 mxSetField(pmxa_array,i,"segments",pmxa_array3); 91 mxSetField(pmxa_array,i,"numsegs",mxCreateDoubleScalar((double)rifts numsegments[i]));79 mxSetField(pmxa_array,i,"numsegs",mxCreateDoubleScalar((double)riftstruct->riftsnumsegments[i])); 92 80 93 81 /*Element pairs: */ 94 WriteData(&pmxa_array3,rifts pairs[i],riftsnumpairs[i],2);82 WriteData(&pmxa_array3,riftstruct->riftspairs[i],riftstruct->riftsnumpairs[i],2); 95 83 mxSetField(pmxa_array,i,"pairs",pmxa_array3); 96 84 … … 99 87 mxSetM(pmxa_array2,1); 100 88 pair=(double*)mxMalloc(2*sizeof(double)); 101 pair[0]=*(riftst ips+2*i+0);102 pair[1]=*(riftst ips+2*i+1);89 pair[0]=*(riftstruct->riftstips+2*i+0); 90 pair[1]=*(riftstruct->riftstips+2*i+1); 103 91 mxSetN(pmxa_array2,2); 104 92 mxSetPr(pmxa_array2,pair); … … 106 94 107 95 /*Penalty pairs: */ 108 WriteData(&pmxa_array3,rifts penaltypairs[i],riftsnumpenaltypairs[i],7);96 WriteData(&pmxa_array3,riftstruct->riftspenaltypairs[i],riftstruct->riftsnumpenaltypairs[i],7); 109 97 mxSetField(pmxa_array,i,"penaltypairs",pmxa_array3); 110 98 … … 116 104 117 105 /*State: */ 118 double *state=(double*)mxMalloc(riftsnumpenaltypairs[i]*sizeof(double));119 for(int j=0;j<riftsnumpenaltypairs[i];j++) state[j]=FreeEnum;120 106 pmxa_array2= mxCreateDoubleMatrix(0,0,mxREAL); 121 107 mxSetM(pmxa_array2,1); 122 mxSetN(pmxa_array2,rifts numpenaltypairs[i]);123 mxSetPr(pmxa_array2, state);108 mxSetN(pmxa_array2,riftstruct->riftsnumpenaltypairs[i]); 109 mxSetPr(pmxa_array2,riftstruct->state[i]); 124 110 mexCallMATLAB( 1, &pmxa_array3, 1, &pmxa_array2, "transpose"); 125 111 … … 132 118 MODULEEND(); 133 119 } 134 void TriMeshProcessRiftsx(double** pindex, int* pnel,double** px,double** py,int* pnods,double** psegments,double** psegmentmarkers,int *pnum_seg,135 int *pnumrifts, int **priftsnumsegments, double ***priftssegments,136 int **priftsnumpairs, double ***priftspairs, double **priftstips,137 double ***priftspenaltypairs, int **priftsnumpenaltypairs){138 139 /*Output*/140 int numrifts,numrifts0;141 int *riftsnumsegments = NULL;142 double **riftssegments = NULL;143 int *riftsnumpairs = NULL;144 double **riftspairs = NULL;145 double *riftstips = NULL;146 double **riftspenaltypairs = NULL;147 int *riftsnumpenaltypairs = NULL;148 149 /*Recover initial mesh*/150 int nel = *pnel;151 double *index = *pindex;152 double *x = *px;153 double *y = *py;154 int nods = *pnods;155 double *segments = *psegments;156 double *segmentmarkers = *psegmentmarkers;157 int num_seg = *pnum_seg;158 159 /*Intermediary*/160 int riftflag;161 162 /*First, do some fixing on the existing mesh: we do not want any element belonging entirely to the segment list (ie:163 *all the nodes of this element belong to the segments (tends to happen when there are corners: */164 RemoveCornersFromRifts(&index,&nel,&x,&y,&nods,segments,segmentmarkers,num_seg);165 166 /*Figure out if we have rifts, and how many: */167 IsRiftPresent(&riftflag,&numrifts0,segmentmarkers,num_seg);168 169 if(!riftflag) _error_("No rift present in mesh");170 171 /*Split mesh*/172 SplitMeshForRifts(&nel,&index,&nods,&x,&y,&num_seg,&segments,&segmentmarkers);173 174 /*Order segments so that their normals point outside the domain: */175 OrderSegments(&segments,num_seg, index,nel);176 177 /*We do not want to output segments mixed with rift segments: wring out the rifts from the segments, using the178 *segmentmarkerlist:*/179 SplitRiftSegments(&segments,&segmentmarkers,&num_seg,&numrifts,&riftsnumsegments,&riftssegments,numrifts0,nods,nel);180 181 /*Using rift segments, associate rift faces in pairs, each pair face representing opposite flanks of the rifts facing one another directly: */182 PairRiftElements(&riftsnumpairs,&riftspairs,numrifts,riftsnumsegments,riftssegments,x,y);183 184 /*Order rifts so that they start from one tip, go to the other tip, and back: */185 OrderRifts(&riftstips,riftssegments,riftspairs,numrifts,riftsnumsegments,x,y,nods,nel);186 187 /*Create penalty pairs, used by Imp: */188 PenaltyPairs(&riftspenaltypairs,&riftsnumpenaltypairs,numrifts,riftssegments,riftsnumsegments,riftspairs,riftstips,x,y);189 190 /*Assign output pointers for mesh*/191 *pnel = nel;192 *pindex = index;193 *px = x;194 *py = y;195 *pnods = nods;196 *psegments = segments;197 *psegmentmarkers = segmentmarkers;198 *pnum_seg = num_seg;199 200 /*Assign output pointers for rifts*/201 *pnumrifts = numrifts;202 *priftsnumsegments = riftsnumsegments;203 *priftssegments = riftssegments;204 *priftsnumpairs = riftsnumpairs;205 *priftspairs = riftspairs;206 *priftstips = riftstips;207 *priftspenaltypairs = riftspenaltypairs;208 *priftsnumpenaltypairs = riftsnumpenaltypairs;209 }
Note:
See TracChangeset
for help on using the changeset viewer.