Changeset 5863
- Timestamp:
- 09/17/10 09:36:52 (15 years ago)
- Location:
- issm/trunk/src/c/objects/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r5862 r5863 702 702 break; 703 703 case DiagnosticHutterAnalysisEnum: 704 CreateKMatrixDiagnosticHutter( Kgg); 704 Ke=CreateKMatrixDiagnosticHutter(); 705 if(Ke) Ke->AddToGlobal(Kgg,NULL,NULL); 706 delete Ke; 705 707 break; 706 708 case DiagnosticVertAnalysisEnum: … … 2248 2250 /*}}}*/ 2249 2251 /*FUNCTION Penta::CreateKMatrixDiagnosticHutter{{{1*/ 2250 void Penta::CreateKMatrixDiagnosticHutter(Mat Kgg){ 2251 2252 /*Collapsed formulation: */ 2253 int i; 2254 const int numdofs=NDOF2*NUMVERTICES; 2255 int* doflist=NULL; 2256 double Ke_gg[numdofs][numdofs]={0.0}; 2252 ElementMatrix* Penta::CreateKMatrixDiagnosticHutter(void){ 2253 2254 /*Intermediaries*/ 2255 const int numdof=NDOF2*NUMVERTICES; 2257 2256 int connectivity[2]; 2258 2257 double one0,one1; 2259 int i0,i1,j0,j1; 2260 2261 /*If on water, skip: */ 2262 if(IsOnWater())return; 2263 2264 GetDofList(&doflist,NoneApproximationEnum,GsetEnum); 2258 int i,i0,i1,j0,j1; 2259 2260 /*Initialize Element matrix and return if necessary*/ 2261 if(IsOnWater()) return NULL; 2262 ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum); 2265 2263 2266 2264 /*Spawn 3 beam elements: */ … … 2281 2279 /*Create matrix for these two nodes*/ 2282 2280 if (IsOnBed() && IsOnSurface()){ 2283 Ke _gg[i0][i0]=one0;2284 Ke _gg[i1][i1]=one0;2285 Ke _gg[j0][i0]=-one1;2286 Ke _gg[j0][j0]=one1;2287 Ke _gg[j1][i1]=-one1;2288 Ke _gg[j1][j1]=one1;2281 Ke->values[i0*numdof+i0]=one0; 2282 Ke->values[i1*numdof+i1]=one0; 2283 Ke->values[j0*numdof+i0]=-one1; 2284 Ke->values[j0*numdof+j0]=one1; 2285 Ke->values[j1*numdof+i1]=-one1; 2286 Ke->values[j1*numdof+j1]=one1; 2289 2287 } 2290 2288 else if (IsOnBed()){ 2291 Ke _gg[i0][i0]=one0;2292 Ke _gg[i1][i1]=one0;2293 Ke _gg[j0][i0]=-2*one1;2294 Ke _gg[j0][j0]=2*one1;2295 Ke _gg[j1][i1]=-2*one1;2296 Ke _gg[j1][j1]=2*one1;2289 Ke->values[i0*numdof+i0]=one0; 2290 Ke->values[i1*numdof+i1]=one0; 2291 Ke->values[j0*numdof+i0]=-2*one1; 2292 Ke->values[j0*numdof+j0]=2*one1; 2293 Ke->values[j1*numdof+i1]=-2*one1; 2294 Ke->values[j1*numdof+j1]=2*one1; 2297 2295 } 2298 2296 else if (IsOnSurface()){ 2299 Ke _gg[j0][i0]=-one1;2300 Ke _gg[j0][j0]=one1;2301 Ke _gg[j1][i1]=-one1;2302 Ke _gg[j1][j1]=one1;2297 Ke->values[j0*numdof+i0]=-one1; 2298 Ke->values[j0*numdof+j0]=one1; 2299 Ke->values[j1*numdof+i1]=-one1; 2300 Ke->values[j1*numdof+j1]=one1; 2303 2301 } 2304 2302 else{ //node is on two horizontal layers and beams include the values only once, so the have to use half of the connectivity 2305 Ke_gg[j0][i0]=-2*one1; 2306 Ke_gg[j0][j0]=2*one1; 2307 Ke_gg[j1][i1]=-2*one1; 2308 Ke_gg[j1][j1]=2*one1; 2309 } 2310 } 2311 2312 /*Add Ke_gg to global matrix Kgg: */ 2313 MatSetValues(Kgg,numdofs,doflist,numdofs,doflist,(const double*)Ke_gg,ADD_VALUES); 2314 2315 /*Free ressources:*/ 2316 xfree((void**)&doflist); 2317 2303 Ke->values[j0*numdof+i0]=-2*one1; 2304 Ke->values[j0*numdof+j0]=2*one1; 2305 Ke->values[j1*numdof+i1]=-2*one1; 2306 Ke->values[j1*numdof+j1]=2*one1; 2307 } 2308 } 2309 2310 /*Clean up and return*/ 2311 return Ke; 2318 2312 } 2319 2313 /*FUNCTION Penta::CreateKMatrixDiagnosticMacAyeal2d{{{1*/ -
issm/trunk/src/c/objects/Elements/Penta.h
r5862 r5863 128 128 void CreateKMatrixCouplingPattynStokes( Mat Kgg); 129 129 void CreateKMatrixDiagnosticHoriz( Mat Kgg); 130 void CreateKMatrixDiagnosticHutter( Mat Kgg);130 ElementMatrix* CreateKMatrixDiagnosticHutter(void); 131 131 ElementMatrix* CreateKMatrixDiagnosticMacAyeal2d(void); 132 132 ElementMatrix* CreateKMatrixDiagnosticMacAyeal3d(void);
Note:
See TracChangeset
for help on using the changeset viewer.