Changeset 5797
- Timestamp:
- 09/14/10 08:49:27 (15 years ago)
- Location:
- issm/trunk/src/c/objects/Gauss
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk/src/c/objects/Gauss/GaussPenta.cpp ¶
r5724 r5797 92 92 GaussLegendreLinear(&seg_coords,&seg_weights,numgauss); 93 93 94 /*Allocate Gauss Tria fields*/94 /*Allocate GaussPenta fields*/ 95 95 coords1=(double*)xmalloc(numgauss*sizeof(double)); 96 96 coords2=(double*)xmalloc(numgauss*sizeof(double)); … … 121 121 } 122 122 else{ 123 ISSMERROR(" Tria not supported yet");123 ISSMERROR("Penta not supported yet"); 124 124 } 125 125 … … 152 152 else{ 153 153 ISSMERROR("Tria not supported yet"); 154 } 155 156 } 157 /*}}}*/ 158 /*FUNCTION GaussPenta::GaussPenta(int index1, int index2, int index3, int index4,int order_horiz,int order_vert){{{1*/ 159 GaussPenta::GaussPenta(int index1, int index2, int index3, int index4,int order_horiz,int order_vert){ 160 161 /*Intermediaties*/ 162 double *seg_horiz_coords = NULL; 163 double *seg_horiz_weights = NULL; 164 double *seg_vert_coords = NULL; 165 double *seg_vert_weights = NULL; 166 int i,j; 167 168 /*get the gauss points using the product of two line rules*/ 169 GaussLegendreLinear(&seg_horiz_coords,&seg_horiz_weights,order_horiz); 170 GaussLegendreLinear(&seg_vert_coords, &seg_vert_weights, order_vert); 171 172 /*Allocate GaussPenta fields*/ 173 numgauss=order_horiz*order_vert; 174 coords1=(double*)xmalloc(numgauss*sizeof(double)); 175 coords2=(double*)xmalloc(numgauss*sizeof(double)); 176 coords3=(double*)xmalloc(numgauss*sizeof(double)); 177 coords4=(double*)xmalloc(numgauss*sizeof(double)); 178 weights=(double*)xmalloc(numgauss*sizeof(double)); 179 180 /*Quads: get the gauss points using the product of two line rules */ 181 if(index1==0 && index2==1 && index3==3 && index4==4){ 182 for(i=0;i<order_horiz;i++){ 183 for(j=0;j<order_vert;j++){ 184 coords1[i*order_horiz+j]= 0.5*(1-seg_horiz_coords[i]); 185 coords2[i*order_horiz+j]=1-0.5*(1-seg_horiz_coords[i]); 186 coords3[i*order_horiz+j]=0.0; 187 coords4[i*order_horiz+j]=seg_vert_coords[j]; 188 weights[i*order_horiz+j]=seg_horiz_weights[i]*seg_vert_weights[j]; 189 } 190 } 191 } 192 else if(index1==1 && index2==2 && index3==4 && index4==5){ 193 for(i=0;i<order_horiz;i++){ 194 for(j=0;j<order_vert;j++){ 195 coords1[i*order_horiz+j]=0.0; 196 coords2[i*order_horiz+j]= 0.5*(1-seg_horiz_coords[i]); 197 coords3[i*order_horiz+j]=1-0.5*(1-seg_horiz_coords[i]); 198 coords4[i*order_horiz+j]=seg_vert_coords[j]; 199 weights[i*order_horiz+j]=seg_horiz_weights[i]*seg_vert_weights[j]; 200 } 201 } 202 } 203 else if(index1==2 && index2==0 && index3==5 && index4==3){ 204 for(i=0;i<order_horiz;i++){ 205 for(j=0;j<order_vert;j++){ 206 coords1[i*order_horiz+j]=1-0.5*(1-seg_horiz_coords[i]); 207 coords2[i*order_horiz+j]=0.0; 208 coords3[i*order_horiz+j]= 0.5*(1-seg_horiz_coords[i]); 209 coords4[i*order_horiz+j]=seg_vert_coords[j]; 210 weights[i*order_horiz+j]=seg_horiz_weights[i]*seg_vert_weights[j]; 211 } 212 } 213 } 214 else{ 215 ISSMERROR("Tria not supported yet (user provided indices %i %i %i %i)",index1,index2,index3,index4); 154 216 } 155 217 -
TabularUnified issm/trunk/src/c/objects/Gauss/GaussPenta.h ¶
r5724 r5797 36 36 GaussPenta(int index1, int index2,int order); 37 37 GaussPenta(int index1, int index2, int index3, int order); 38 GaussPenta(int index1, int index2, int index3, int index4,int order_horiz,int order_vert); 38 39 ~GaussPenta(); 39 40
Note:
See TracChangeset
for help on using the changeset viewer.