Changeset 10524
- Timestamp:
- 11/08/11 11:23:34 (13 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r10523 r10524 5141 5141 5142 5142 /*Constants*/ 5143 const int numdofm=NDOF2*NUMVERTICES2D; 5144 const int numdofp=NDOF2*NUMVERTICES; 5145 const int numdoftotal=2*NDOF2*NUMVERTICES; 5143 const int numnodes = 2 *NUMVERTICES; 5144 const int numdofm = NDOF2 *NUMVERTICES2D; 5145 const int numdofp = NDOF2 *NUMVERTICES; 5146 const int numdoftotal = 2 *NDOF2*NUMVERTICES; 5146 5147 5147 5148 /*Intermediaries */ … … 5159 5160 GaussPenta *gauss=NULL; 5160 5161 GaussTria *gauss_tria=NULL; 5162 Node *node_list[numnodes]; 5163 int cs_list[numnodes]; 5161 5164 5162 5165 /*Find penta on bed as pattyn must be coupled to the dofs on the bed: */ 5163 5166 Penta* pentabase=GetBasalElement(); 5164 Tria* tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 5167 Tria* tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 5168 5169 /*Prepare node list*/ 5170 for(i=0;i<NUMVERTICES;i++){ 5171 node_list[i+0*NUMVERTICES] = pentabase->nodes[i]; 5172 node_list[i+1*NUMVERTICES] = this->nodes[i]; 5173 cs_list[i+0*NUMVERTICES] = XYEnum; 5174 cs_list[i+1*NUMVERTICES] = XYEnum; 5175 } 5165 5176 5166 5177 /*Initialize Element matrix*/ … … 5209 5220 for(i=0;i<numdofm;i++) for(j=0;j<numdofp;j++) Ke->values[i*numdoftotal+(j+2*numdofm)]+=Ke_gg[j][i]; 5210 5221 5222 /*Transform Coordinate System*/ 5223 TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list); 5224 5211 5225 /*Clean-up and return*/ 5212 5226 delete tria->matice; delete tria; … … 5220 5234 5221 5235 /*Constants*/ 5222 const int numdof = NDOF2 *NUMVERTICES; 5223 const int numdoftotal = NDOF4 *NUMVERTICES; 5236 const int numnodes = 2 *NUMVERTICES; 5237 const int numdof = NDOF2 *NUMVERTICES; 5238 const int numdoftotal = NDOF4 *NUMVERTICES; 5224 5239 5225 5240 /*Intermediaries */ … … 5238 5253 Friction *friction = NULL; 5239 5254 GaussPenta *gauss=NULL; 5255 Node *node_list[numnodes]; 5256 int cs_list[numnodes]; 5240 5257 5241 5258 /*Initialize Element matrix and return if necessary*/ … … 5245 5262 ElementMatrix* Ke=new ElementMatrix(Ke1,Ke2); 5246 5263 delete Ke1; delete Ke2; 5264 5265 /*Prepare node list*/ 5266 for(i=0;i<NUMVERTICES;i++){ 5267 node_list[i+0*NUMVERTICES] = this->nodes[i]; 5268 node_list[i+1*NUMVERTICES] = this->nodes[i]; 5269 cs_list[i+0*NUMVERTICES] = XYEnum; 5270 cs_list[i+1*NUMVERTICES] = XYEnum; 5271 } 5247 5272 5248 5273 /*retrieve inputs :*/ … … 5293 5318 for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdoftotal+(numdof+j)]+=Ke_gg[i][j]; 5294 5319 for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[(i+numdof)*numdoftotal+j]+=Ke_gg[i][j]; 5320 5321 /*Transform Coordinate System*/ 5322 TransformStiffnessMatrixCoord(Ke,node_list,numnodes,cs_list); 5295 5323 5296 5324 /*Clean up and return*/ … … 7354 7382 } 7355 7383 7384 /*Transform solution in Cartesian Space*/ 7385 TransformSolutionCoord(&macayeal_values[0],penta->nodes,NUMVERTICES,XYEnum); 7386 TransformSolutionCoord(&pattyn_values[0], this->nodes,NUMVERTICES,XYEnum); 7387 7356 7388 /*Ok, we have vx and vy in values, fill in vx and vy arrays: */ 7357 7389 for(i=0;i<NUMVERTICES;i++){ -
issm/trunk/src/c/shared/Elements/CoordinateSystemTransform.cpp
r10523 r10524 45 45 case XYEnum: 46 46 /*We remove the z component, we need to renormalize x and y*/ 47 x_norm = sqrt( coord_system[0][0]*coord_system[0][0] + coord_system[1][0]*coord_system[1][0]); 48 y_norm = sqrt( coord_system[0][1]*coord_system[0][1] + coord_system[1][1]*coord_system[1][1]); 47 x_norm = sqrt( coord_system[0][0]*coord_system[0][0] + coord_system[1][0]*coord_system[1][0]); _assert_(x_norm>1.e-5); 48 y_norm = sqrt( coord_system[0][1]*coord_system[0][1] + coord_system[1][1]*coord_system[1][1]); _assert_(y_norm>1.e-5); 49 49 transform[(numdofs)*(counter+0) + counter+0] = coord_system[0][0]/x_norm; 50 50 transform[(numdofs)*(counter+0) + counter+1] = coord_system[0][1]/y_norm;
Note:
See TracChangeset
for help on using the changeset viewer.