Changeset 15694 for issm/trunk-jpl/src/c/classes/Elements
- Timestamp:
- 08/02/13 15:05:10 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Elements
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r15689 r15694 456 456 } 457 457 458 /*Add to global matrix*/459 458 if(Ke){ 459 /*Condense if requested*/ 460 if(this->element_type==MINIcondensedEnum){ 461 int indices[3]={18,19,20}; 462 Ke->StaticCondensation(3,&indices[0]); 463 } 464 465 /*Add to global matrix*/ 460 466 Ke->AddToGlobal(Kff,Kfs); 461 467 delete Ke; … … 592 598 } 593 599 594 /*Add to global Vector*/595 600 if(pe){ 601 602 /*StaticCondensation if requested*/ 603 if(this->element_type==MINIcondensedEnum){ 604 int indices[3]={18,19,20}; 605 606 this->element_type=MINIEnum; 607 ElementMatrix* Ke = CreateKMatrixDiagnosticFS(); 608 this->element_type=MINIcondensedEnum; 609 610 pe->StaticCondensation(Ke,3,&indices[0]); 611 delete Ke; 612 } 613 614 /*Add to global Vector*/ 596 615 pe->AddToGlobal(pf); 597 616 delete pe; … … 1165 1184 GaussPenta* gauss=new GaussPenta(); 1166 1185 for(int iv=0;iv<this->NumberofNodes();iv++){ 1167 gauss->GaussNode( numnodes,iv);1186 gauss->GaussNode(this->element_type,iv); 1168 1187 input->GetInputValue(&pvalue[iv],gauss); 1169 1188 } … … 1188 1207 GaussPenta* gauss=new GaussPenta(); 1189 1208 for (int iv=0;iv<this->NumberofNodes();iv++){ 1190 gauss->GaussNode( numnodes,iv);1209 gauss->GaussNode(this->element_type,iv); 1191 1210 input->GetInputValue(&pvalue[iv],gauss); 1192 1211 } … … 7429 7448 Ke =new ElementMatrix(Ke1,Ke2); 7430 7449 7431 /*Condense if requested*/7432 if(this->element_type==MINIcondensedEnum){7433 int indices[3]={18,19,20};7434 Ke->StaticCondensation(3,&indices[0]);7435 }7436 7437 7450 /*clean-up and return*/ 7438 7451 delete Ke1; … … 8458 8471 pe =new ElementVector(pe1,pe2,pe3); 8459 8472 8460 /*Condense if requested*/8461 if(this->element_type==MINIcondensedEnum){8462 int indices[3]={18,19,20};8463 8464 this->element_type=MINIEnum;8465 ElementMatrix* Ke = CreateKMatrixDiagnosticFS();8466 this->element_type=MINIcondensedEnum;8467 8468 pe->StaticCondensation(Ke,3,&indices[0]);8469 delete Ke;8470 }8471 8472 8473 /*clean-up and return*/ 8473 8474 delete pe1; … … 9182 9183 GaussPenta* gauss=new GaussPenta(); 9183 9184 for(int i=0;i<numnodes;i++){ 9184 gauss->GaussNode( numnodes,i);9185 gauss->GaussNode(this->element_type,i); 9185 9186 9186 9187 /*Recover vx and vy*/ … … 9301 9302 gauss = new GaussPenta(); 9302 9303 for(int i=0;i<vnumnodes;i++){ 9303 gauss->GaussNode( vnumnodes,i);9304 gauss->GaussNode(this->VelocityInterpolation(),i); 9304 9305 9305 9306 vx_input->GetInputValue(&vx,gauss); … … 9311 9312 } 9312 9313 for(int i=0;i<pnumnodes;i++){ 9313 gauss->GaussNode( pnumnodes,i);9314 gauss->GaussNode(this->PressureInterpolation(),i); 9314 9315 9315 9316 p_input ->GetInputValue(&p ,gauss); -
issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp
r15689 r15694 1968 1968 } 1969 1969 /*}}}*/ 1970 /*FUNCTION PentaRef::VelocityInterpolation{{{*/ 1971 int PentaRef::VelocityInterpolation(void){ 1972 1973 switch(this->element_type){ 1974 case P1P1Enum: return P1Enum; 1975 case P1P1GLSEnum: return P1Enum; 1976 case MINIcondensedEnum: return P1bubbleEnum; 1977 case MINIEnum: return P1bubbleEnum; 1978 case TaylorHoodEnum: return P2Enum; 1979 default: _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet"); 1980 } 1981 1982 return -1; 1983 } 1984 /*}}}*/ 1985 /*FUNCTION PentaRef::PressureInterpolation{{{*/ 1986 int PentaRef::PressureInterpolation(void){ 1987 1988 switch(this->element_type){ 1989 case P1P1Enum: return P1Enum; 1990 case P1P1GLSEnum: return P1Enum; 1991 case MINIcondensedEnum: return P1Enum; 1992 case MINIEnum: return P1Enum; 1993 case TaylorHoodEnum: return P1Enum; 1994 default: _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet"); 1995 } 1996 1997 return -1; 1998 } 1999 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Elements/PentaRef.h
r15688 r15694 72 72 int NumberofNodesVelocity(void); 73 73 int NumberofNodesPressure(void); 74 int VelocityInterpolation(void); 75 int PressureInterpolation(void); 74 76 }; 75 77 #endif -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r15689 r15694 231 231 } 232 232 233 /*Add to global matrix*/234 233 if(Ke){ 234 /*Static condensation if requested*/ 235 if(this->element_type==P1bubblecondensedEnum){ 236 int size = nodes[3]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum); 237 int offset = 0; 238 for(int i=0;i<3;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum); 239 int* indices=xNew<int>(size); 240 for(int i=0;i<size;i++) indices[i] = offset+i; 241 printarray(indices,1,size); 242 Ke->StaticCondensation(size,indices); 243 xDelete<int>(indices); 244 } 245 246 /*Add to global matrix*/ 235 247 Ke->AddToGlobal(Kff,Kfs); 236 248 delete Ke; … … 346 358 /*Add to global Vector*/ 347 359 if(pe){ 360 /*Static condensation if requested*/ 361 if(this->element_type==P1bubblecondensedEnum){ 362 int size = nodes[3]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum); 363 int offset = 0; 364 for(int i=0;i<3;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum); 365 int* indices=xNew<int>(size); 366 for(int i=0;i<size;i++) indices[i] = offset+i; 367 368 this->element_type=P1bubbleEnum; 369 ElementMatrix* Ke = CreateKMatrixDiagnosticSSA(); 370 this->element_type=P1bubblecondensedEnum; 371 372 pe->StaticCondensation(Ke,size,indices); 373 xDelete<int>(indices); 374 delete Ke; 375 } 376 348 377 pe->AddToGlobal(pf); 349 378 delete pe; … … 1129 1158 GaussTria* gauss=new GaussTria(); 1130 1159 for(int iv=0;iv<this->NumberofNodes();iv++){ 1131 gauss->GaussNode( numnodes,iv);1160 gauss->GaussNode(this->element_type,iv); 1132 1161 input->GetInputValue(&pvalue[iv],gauss); 1133 1162 } … … 1152 1181 GaussTria* gauss=new GaussTria(); 1153 1182 for (int iv=0;iv<this->NumberofNodes();iv++){ 1154 gauss->GaussNode( numnodes,iv);1183 gauss->GaussNode(this->element_type,iv); 1155 1184 input->GetInputValue(&pvalue[iv],gauss); 1156 1185 } … … 3359 3388 gauss=new GaussTria(); 3360 3389 for(int i=0;i<numnodes;i++){ 3361 gauss->GaussNode( numnodes,i);3390 gauss->GaussNode(this->element_type,i); 3362 3391 3363 3392 /*Recover vx and vy*/ -
issm/trunk-jpl/src/c/classes/Elements/TriaRef.cpp
r15689 r15694 444 444 /*bubble*/ 445 445 basis[3]=27.*gauss->coord1*gauss->coord2*gauss->coord3; 446 return; 446 447 case P2Enum: 447 448 /*Corner nodes*/ … … 560 561 dbasis[NUMNODESP1b*1+2] = SQRT3/3.; 561 562 /*Nodal function 4*/ 562 dbasis[NUMNODESP1b*0+ 2] = 27.*(-.5*gauss->coord2*gauss->coord3 + .5*gauss->coord1*gauss->coord3);;563 dbasis[NUMNODESP1b*1+ 2] = 27.*SQRT3*(-1./6.*gauss->coord2*gauss->coord3 - 1./6.*gauss->coord1*gauss->coord3 +1./3.*gauss->coord1*gauss->coord2);563 dbasis[NUMNODESP1b*0+3] = 27.*(-.5*gauss->coord2*gauss->coord3 + .5*gauss->coord1*gauss->coord3);; 564 dbasis[NUMNODESP1b*1+3] = 27.*SQRT3*(-1./6.*gauss->coord2*gauss->coord3 - 1./6.*gauss->coord1*gauss->coord3 +1./3.*gauss->coord1*gauss->coord2); 564 565 return; 565 566 case P2Enum:
Note:
See TracChangeset
for help on using the changeset viewer.