Changeset 15695
- Timestamp:
- 08/02/13 15:37:37 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Elements
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r15694 r15695 391 391 } 392 392 /*}}}*/ 393 /*FUNCTION Penta::CreateKMatrix {{{*/393 /*FUNCTION Penta::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs) {{{*/ 394 394 void Penta::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){ 395 396 /*retrieve parameters: */397 ElementMatrix* Ke=NULL;398 int analysis_type;399 parameters->FindParam(&analysis_type,AnalysisTypeEnum);400 401 /*Checks in debugging {{{*/402 _assert_(this->nodes && this->material && this->matpar && this->verticalneighbors && this->parameters && this->inputs);403 /*}}}*/404 395 405 396 /*Skip if water element*/ 406 397 if(IsOnWater()) return; 407 398 408 /*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */ 409 switch(analysis_type){ 410 #ifdef _HAVE_DIAGNOSTIC_ 411 case DiagnosticHorizAnalysisEnum: 412 Ke=CreateKMatrixDiagnosticHoriz(); 413 break; 414 case AdjointHorizAnalysisEnum: 415 Ke=CreateKMatrixAdjointHoriz(); 416 break; 417 case DiagnosticSIAAnalysisEnum: 418 Ke=CreateKMatrixDiagnosticSIA(); 419 break; 420 case DiagnosticVertAnalysisEnum: 421 Ke=CreateKMatrixDiagnosticVert(); 422 break; 423 #endif 424 case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum: 425 Ke=CreateBasalMassMatrix(); 426 break; 427 case PrognosticAnalysisEnum: 428 Ke=CreateKMatrixPrognostic(); 429 break; 430 #ifdef _HAVE_BALANCED_ 431 case BalancethicknessAnalysisEnum: 432 Ke=CreateKMatrixBalancethickness(); 433 break; 434 #endif 435 #ifdef _HAVE_THERMAL_ 436 case ThermalAnalysisEnum: 437 Ke=CreateKMatrixThermal(); 438 break; 439 case EnthalpyAnalysisEnum: 440 Ke=CreateKMatrixEnthalpy(); 441 break; 442 case MeltingAnalysisEnum: 443 Ke=CreateKMatrixMelting(); 444 break; 445 #endif 446 #ifdef _HAVE_HYDROLOGY_ 447 case HydrologyDCInefficientAnalysisEnum: 448 Ke=CreateKMatrixHydrologyDCInefficient(); 449 break; 450 case HydrologyDCEfficientAnalysisEnum: 451 Ke=CreateKMatrixHydrologyDCEfficient(); 452 break; 453 #endif 454 default: 455 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 456 } 399 /*Create element stiffness matrix*/ 400 ElementMatrix* Ke=CreateKMatrix(); 457 401 458 402 if(Ke){ … … 462 406 Ke->StaticCondensation(3,&indices[0]); 463 407 } 408 else if(this->element_type==P1bubblecondensedEnum){ 409 int size = nodes[6]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum); 410 int offset = 0; 411 for(int i=0;i<6;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum); 412 int* indices=xNew<int>(size); 413 for(int i=0;i<size;i++) indices[i] = offset+i; 414 Ke->StaticCondensation(size,indices); 415 xDelete<int>(indices); 416 } 464 417 465 418 /*Add to global matrix*/ … … 467 420 delete Ke; 468 421 } 422 } 423 /*}}}*/ 424 /*FUNCTION Penta::CreateKMatrix(void){{{*/ 425 ElementMatrix* Penta::CreateKMatrix(void){ 426 427 /*retrieve parameters: */ 428 ElementMatrix* Ke=NULL; 429 int analysis_type; 430 parameters->FindParam(&analysis_type,AnalysisTypeEnum); 431 432 /*Checks in debugging {{{*/ 433 _assert_(this->nodes && this->material && this->matpar && this->verticalneighbors && this->parameters && this->inputs); 434 /*}}}*/ 435 436 /*Skip if water element*/ 437 if(IsOnWater()) return NULL; 438 439 /*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */ 440 switch(analysis_type){ 441 #ifdef _HAVE_DIAGNOSTIC_ 442 case DiagnosticHorizAnalysisEnum: 443 return CreateKMatrixDiagnosticHoriz(); 444 break; 445 case AdjointHorizAnalysisEnum: 446 return CreateKMatrixAdjointHoriz(); 447 break; 448 case DiagnosticSIAAnalysisEnum: 449 return CreateKMatrixDiagnosticSIA(); 450 break; 451 case DiagnosticVertAnalysisEnum: 452 return CreateKMatrixDiagnosticVert(); 453 break; 454 #endif 455 case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum: 456 return CreateBasalMassMatrix(); 457 break; 458 case PrognosticAnalysisEnum: 459 return CreateKMatrixPrognostic(); 460 break; 461 #ifdef _HAVE_BALANCED_ 462 case BalancethicknessAnalysisEnum: 463 return CreateKMatrixBalancethickness(); 464 break; 465 #endif 466 #ifdef _HAVE_THERMAL_ 467 case ThermalAnalysisEnum: 468 return CreateKMatrixThermal(); 469 break; 470 case EnthalpyAnalysisEnum: 471 return CreateKMatrixEnthalpy(); 472 break; 473 case MeltingAnalysisEnum: 474 return CreateKMatrixMelting(); 475 break; 476 #endif 477 #ifdef _HAVE_HYDROLOGY_ 478 case HydrologyDCInefficientAnalysisEnum: 479 return CreateKMatrixHydrologyDCInefficient(); 480 break; 481 case HydrologyDCEfficientAnalysisEnum: 482 return CreateKMatrixHydrologyDCEfficient(); 483 break; 484 #endif 485 default: 486 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 487 } 488 489 /*Make compiler happy*/ 490 return NULL; 469 491 } 470 492 /*}}}*/ … … 531 553 } 532 554 /*}}}*/ 533 /*FUNCTION Penta::CreatePVector {{{*/555 /*FUNCTION Penta::CreatePVector(Vector<IssmDouble>* pf) {{{*/ 534 556 void Penta::CreatePVector(Vector<IssmDouble>* pf){ 535 557 536 /*retrive parameters: */ 537 ElementVector* pe=NULL; 558 /*Skip if water element*/ 559 if(IsOnWater()) return; 560 561 /*Create element load vector*/ 562 ElementVector* pe = CreatePVector(); 563 564 if(pe){ 565 /*StaticCondensation if requested*/ 566 if(this->element_type==MINIcondensedEnum){ 567 int indices[3]={18,19,20}; 568 569 this->element_type=MINIEnum; 570 ElementMatrix* Ke = CreateKMatrixDiagnosticFS(); 571 this->element_type=MINIcondensedEnum; 572 573 pe->StaticCondensation(Ke,3,&indices[0]); 574 delete Ke; 575 } 576 else if(this->element_type==P1bubblecondensedEnum){ 577 int size = nodes[6]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum); 578 int offset = 0; 579 for(int i=0;i<6;i++) offset+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum); 580 int* indices=xNew<int>(size); 581 for(int i=0;i<size;i++) indices[i] = offset+i; 582 583 this->element_type=P1bubbleEnum; 584 ElementMatrix* Ke = CreateKMatrix(); 585 this->element_type=P1bubblecondensedEnum; 586 pe->StaticCondensation(Ke,size,indices); 587 xDelete<int>(indices); 588 delete Ke; 589 } 590 591 /*Add to global Vector*/ 592 pe->AddToGlobal(pf); 593 delete pe; 594 } 595 } 596 /*}}}*/ 597 /*FUNCTION Penta::CreatePVector(void) {{{*/ 598 ElementVector* Penta::CreatePVector(void){ 599 600 /*retrieve parameters: */ 538 601 int analysis_type; 539 602 parameters->FindParam(&analysis_type,AnalysisTypeEnum); … … 544 607 545 608 /*Skip if water element*/ 546 if(IsOnWater()) return ;609 if(IsOnWater()) return NULL; 547 610 548 611 /*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */ … … 550 613 #ifdef _HAVE_DIAGNOSTIC_ 551 614 case DiagnosticHorizAnalysisEnum: 552 pe=CreatePVectorDiagnosticHoriz();615 return CreatePVectorDiagnosticHoriz(); 553 616 break; 554 617 case DiagnosticSIAAnalysisEnum: 555 pe=CreatePVectorDiagnosticSIA();618 return CreatePVectorDiagnosticSIA(); 556 619 break; 557 620 case DiagnosticVertAnalysisEnum: 558 pe=CreatePVectorDiagnosticVert();621 return CreatePVectorDiagnosticVert(); 559 622 break; 560 623 #endif 561 624 #ifdef _HAVE_CONTROL_ 562 625 case AdjointHorizAnalysisEnum: 563 pe=CreatePVectorAdjointHoriz();626 return CreatePVectorAdjointHoriz(); 564 627 break; 565 628 #endif 566 629 #ifdef _HAVE_THERMAL_ 567 630 case ThermalAnalysisEnum: 568 pe=CreatePVectorThermal();631 return CreatePVectorThermal(); 569 632 break; 570 633 case EnthalpyAnalysisEnum: 571 pe=CreatePVectorEnthalpy();634 return CreatePVectorEnthalpy(); 572 635 break; 573 636 case MeltingAnalysisEnum: 574 pe=CreatePVectorMelting();637 return CreatePVectorMelting(); 575 638 break; 576 639 #endif 577 640 case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum: 578 pe=CreatePVectorSlope();641 return CreatePVectorSlope(); 579 642 break; 580 643 case PrognosticAnalysisEnum: 581 pe=CreatePVectorPrognostic();644 return CreatePVectorPrognostic(); 582 645 break; 583 646 #ifdef _HAVE_BALANCED_ 584 647 case BalancethicknessAnalysisEnum: 585 pe=CreatePVectorBalancethickness();648 return CreatePVectorBalancethickness(); 586 649 break; 587 650 #endif 588 651 #ifdef _HAVE_HYDROLOGY_ 589 652 case HydrologyDCInefficientAnalysisEnum: 590 pe=CreatePVectorHydrologyDCInefficient();653 return CreatePVectorHydrologyDCInefficient(); 591 654 break; 592 655 case HydrologyDCEfficientAnalysisEnum: 593 pe=CreatePVectorHydrologyDCEfficient();656 return CreatePVectorHydrologyDCEfficient(); 594 657 break; 595 658 #endif … … 598 661 } 599 662 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*/ 615 pe->AddToGlobal(pf); 616 delete pe; 617 } 663 /*make compiler happy*/ 664 return NULL; 618 665 } 619 666 /*}}}*/ … … 8328 8375 ElementVector* Penta::CreatePVectorDiagnosticHODrivingStress(void){ 8329 8376 8330 /*Constants*/8331 const int numdof=NDOF2*NUMVERTICES;8332 8333 8377 /*Intermediaries*/ 8334 8378 int i,j; … … 8337 8381 IssmDouble driving_stress_baseline,thickness; 8338 8382 IssmDouble xyz_list[NUMVERTICES][3]; 8339 IssmDouble basis[6];8340 8383 GaussPenta *gauss=NULL; 8341 8384 8342 /*Initialize Element vector*/ 8343 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,HOApproximationEnum); 8385 /*Fetch number of nodes and dof for this finite element*/ 8386 int numnodes = this->NumberofNodes(); 8387 int numdof = numnodes*NDOF2; 8388 8389 /*Initialize vector*/ 8390 ElementVector* pe = new ElementVector(nodes,numnodes,this->parameters,HOApproximationEnum); 8391 IssmDouble* basis = xNewZeroInit<IssmDouble>(numnodes); 8344 8392 8345 8393 /*Retrieve all inputs and parameters*/ … … 8355 8403 8356 8404 GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss); 8357 GetNodalFunctions P1(basis,gauss);8405 GetNodalFunctions(basis,gauss); 8358 8406 8359 8407 thickness_input->GetInputValue(&thickness, gauss); … … 8362 8410 driving_stress_baseline=matpar->GetRhoIce()*matpar->GetG(); 8363 8411 8364 for(i=0;i<NUMVERTICES;i++) for(j=0;j<NDOF2;j++) pe->values[i*NDOF2+j]+= -driving_stress_baseline*slope[j]*Jdet*gauss->weight*basis[i]; 8412 for(i=0;i<numnodes;i++){ 8413 pe->values[i*NDOF2+0]+= -driving_stress_baseline*slope[0]*Jdet*gauss->weight*basis[i]; 8414 pe->values[i*NDOF2+1]+= -driving_stress_baseline*slope[1]*Jdet*gauss->weight*basis[i]; 8415 } 8365 8416 } 8366 8417 8367 8418 /*Transform coordinate system*/ 8368 TransformLoadVectorCoord(pe,nodes, NUMVERTICES,XYEnum);8419 TransformLoadVectorCoord(pe,nodes,numnodes,XYEnum); 8369 8420 8370 8421 /*Clean up and return*/ 8371 8422 delete gauss; 8423 xDelete<IssmDouble>(basis); 8372 8424 return pe; 8373 8425 } -
issm/trunk-jpl/src/c/classes/Elements/Penta.h
r15654 r15695 179 179 void BedNormal(IssmDouble* bed_normal, IssmDouble xyz_list[3][3]); 180 180 ElementMatrix* CreateBasalMassMatrix(void); 181 ElementMatrix* CreateKMatrix(void); 181 182 ElementMatrix* CreateKMatrixPrognostic(void); 183 ElementVector* CreatePVector(void); 182 184 ElementVector* CreatePVectorPrognostic(void); 183 185 ElementVector* CreatePVectorSlope(void); -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r15694 r15695 172 172 } 173 173 /*}}}*/ 174 /*FUNCTION Tria::CreateKMatrix {{{*/174 /*FUNCTION Tria::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs) {{{*/ 175 175 void Tria::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){ 176 177 /*retreive parameters: */178 ElementMatrix* Ke=NULL;179 int analysis_type;180 parameters->FindParam(&analysis_type,AnalysisTypeEnum);181 182 /*Checks in debugging mode{{{*/183 _assert_(this->nodes && this->material && this->matpar && this->parameters && this->inputs);184 /*}}}*/185 176 186 177 /*Skip if water element*/ 187 178 if(IsOnWater()) return; 188 179 189 /*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */ 190 switch(analysis_type){ 191 #ifdef _HAVE_DIAGNOSTIC_ 192 case DiagnosticHorizAnalysisEnum: 193 Ke=CreateKMatrixDiagnosticSSA(); 194 break; 195 case DiagnosticSIAAnalysisEnum: 196 Ke=CreateKMatrixDiagnosticSIA(); 197 break; 198 #endif 199 case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum: 200 Ke=CreateMassMatrix(); 201 break; 202 case PrognosticAnalysisEnum: 203 Ke=CreateKMatrixPrognostic(); 204 break; 205 #ifdef _HAVE_HYDROLOGY_ 206 case HydrologyShreveAnalysisEnum: 207 Ke=CreateKMatrixHydrologyShreve(); 208 break; 209 case HydrologyDCInefficientAnalysisEnum: 210 Ke=CreateKMatrixHydrologyDCInefficient(); 211 break; 212 case HydrologyDCEfficientAnalysisEnum: 213 Ke=CreateKMatrixHydrologyDCEfficient(); 214 break; 215 #endif 216 #ifdef _HAVE_BALANCED_ 217 case BalancethicknessAnalysisEnum: 218 Ke=CreateKMatrixBalancethickness(); 219 break; 220 #endif 221 #ifdef _HAVE_CONTROL_ 222 case AdjointBalancethicknessAnalysisEnum: 223 Ke=CreateKMatrixAdjointBalancethickness(); 224 break; 225 case AdjointHorizAnalysisEnum: 226 Ke=CreateKMatrixAdjointSSA(); 227 break; 228 #endif 229 default: 230 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 231 } 180 /*Create element stiffness matrix*/ 181 ElementMatrix* Ke=CreateKMatrix(); 232 182 233 183 if(Ke){ … … 239 189 int* indices=xNew<int>(size); 240 190 for(int i=0;i<size;i++) indices[i] = offset+i; 241 printarray(indices,1,size);242 191 Ke->StaticCondensation(size,indices); 243 192 xDelete<int>(indices); … … 248 197 delete Ke; 249 198 } 199 } 200 /*}}}*/ 201 /*FUNCTION Tria::CreateKMatrix(void) {{{*/ 202 ElementMatrix* Tria::CreateKMatrix(void){ 203 204 /*retreive parameters: */ 205 int analysis_type; 206 parameters->FindParam(&analysis_type,AnalysisTypeEnum); 207 208 /*Checks in debugging mode{{{*/ 209 _assert_(this->nodes && this->material && this->matpar && this->parameters && this->inputs); 210 /*}}}*/ 211 212 /*Skip if water element*/ 213 if(IsOnWater()) return NULL; 214 215 /*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */ 216 switch(analysis_type){ 217 #ifdef _HAVE_DIAGNOSTIC_ 218 case DiagnosticHorizAnalysisEnum: 219 return CreateKMatrixDiagnosticSSA(); 220 break; 221 case DiagnosticSIAAnalysisEnum: 222 return CreateKMatrixDiagnosticSIA(); 223 break; 224 #endif 225 case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum: 226 return CreateMassMatrix(); 227 break; 228 case PrognosticAnalysisEnum: 229 return CreateKMatrixPrognostic(); 230 break; 231 #ifdef _HAVE_HYDROLOGY_ 232 case HydrologyShreveAnalysisEnum: 233 return CreateKMatrixHydrologyShreve(); 234 break; 235 case HydrologyDCInefficientAnalysisEnum: 236 return CreateKMatrixHydrologyDCInefficient(); 237 break; 238 case HydrologyDCEfficientAnalysisEnum: 239 return CreateKMatrixHydrologyDCEfficient(); 240 break; 241 #endif 242 #ifdef _HAVE_BALANCED_ 243 case BalancethicknessAnalysisEnum: 244 return CreateKMatrixBalancethickness(); 245 break; 246 #endif 247 #ifdef _HAVE_CONTROL_ 248 case AdjointBalancethicknessAnalysisEnum: 249 return CreateKMatrixAdjointBalancethickness(); 250 break; 251 case AdjointHorizAnalysisEnum: 252 return CreateKMatrixAdjointSSA(); 253 break; 254 #endif 255 default: 256 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 257 } 258 259 /*Make compiler happy*/ 260 return NULL; 250 261 } 251 262 /*}}}*/ … … 296 307 } 297 308 /*}}}*/ 298 /*FUNCTION Tria::CreatePVector {{{*/309 /*FUNCTION Tria::CreatePVector(Vector<IssmDouble>* pf) {{{*/ 299 310 void Tria::CreatePVector(Vector<IssmDouble>* pf){ 300 301 /*retrive parameters: */302 ElementVector* pe=NULL;303 int analysis_type;304 parameters->FindParam(&analysis_type,AnalysisTypeEnum);305 306 /*asserts: {{{*/307 /*if debugging mode, check that all pointers exist*/308 _assert_(this->nodes && this->material && this->matpar && this->parameters && this->inputs);309 /*}}}*/310 311 311 312 /*Skip if water element*/ 312 313 if(IsOnWater()) return; 313 314 314 /*Just branch to the correct load generator, according to the type of analysis we are carrying out: */ 315 switch(analysis_type){ 316 #ifdef _HAVE_DIAGNOSTIC_ 317 case DiagnosticHorizAnalysisEnum: 318 pe=CreatePVectorDiagnosticSSA(); 319 break; 320 case DiagnosticSIAAnalysisEnum: 321 pe=CreatePVectorDiagnosticSIA(); 322 break; 323 #endif 324 case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum: 325 pe=CreatePVectorSlope(); 326 break; 327 case PrognosticAnalysisEnum: 328 pe=CreatePVectorPrognostic(); 329 break; 330 #ifdef _HAVE_HYDROLOGY_ 331 case HydrologyShreveAnalysisEnum: 332 pe=CreatePVectorHydrologyShreve(); 333 break; 334 case HydrologyDCInefficientAnalysisEnum: 335 pe=CreatePVectorHydrologyDCInefficient(); 336 break; 337 case HydrologyDCEfficientAnalysisEnum: 338 pe=CreatePVectorHydrologyDCEfficient(); 339 break; 340 #endif 341 #ifdef _HAVE_BALANCED_ 342 case BalancethicknessAnalysisEnum: 343 pe=CreatePVectorBalancethickness(); 344 break; 345 #endif 346 #ifdef _HAVE_CONTROL_ 347 case AdjointBalancethicknessAnalysisEnum: 348 pe=CreatePVectorAdjointBalancethickness(); 349 break; 350 case AdjointHorizAnalysisEnum: 351 pe=CreatePVectorAdjointHoriz(); 352 break; 353 #endif 354 default: 355 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 356 } 315 /*Create element load vector*/ 316 ElementVector* pe = CreatePVector(); 357 317 358 318 /*Add to global Vector*/ … … 367 327 368 328 this->element_type=P1bubbleEnum; 369 ElementMatrix* Ke = CreateKMatrix DiagnosticSSA();329 ElementMatrix* Ke = CreateKMatrix(); 370 330 this->element_type=P1bubblecondensedEnum; 371 331 … … 378 338 delete pe; 379 339 } 340 } 341 /*}}}*/ 342 /*FUNCTION Tria::CreatePVector(void){{{*/ 343 ElementVector* Tria::CreatePVector(void){ 344 345 /*retrive parameters: */ 346 ElementVector* pe=NULL; 347 int analysis_type; 348 parameters->FindParam(&analysis_type,AnalysisTypeEnum); 349 350 /*asserts: {{{*/ 351 /*if debugging mode, check that all pointers exist*/ 352 _assert_(this->nodes && this->material && this->matpar && this->parameters && this->inputs); 353 /*}}}*/ 354 355 /*Skip if water element*/ 356 if(IsOnWater()) return NULL; 357 358 /*Just branch to the correct load generator, according to the type of analysis we are carrying out: */ 359 switch(analysis_type){ 360 #ifdef _HAVE_DIAGNOSTIC_ 361 case DiagnosticHorizAnalysisEnum: 362 return CreatePVectorDiagnosticSSA(); 363 break; 364 case DiagnosticSIAAnalysisEnum: 365 return CreatePVectorDiagnosticSIA(); 366 break; 367 #endif 368 case BedSlopeXAnalysisEnum: case SurfaceSlopeXAnalysisEnum: case BedSlopeYAnalysisEnum: case SurfaceSlopeYAnalysisEnum: 369 return CreatePVectorSlope(); 370 break; 371 case PrognosticAnalysisEnum: 372 return CreatePVectorPrognostic(); 373 break; 374 #ifdef _HAVE_HYDROLOGY_ 375 case HydrologyShreveAnalysisEnum: 376 return CreatePVectorHydrologyShreve(); 377 break; 378 case HydrologyDCInefficientAnalysisEnum: 379 return CreatePVectorHydrologyDCInefficient(); 380 break; 381 case HydrologyDCEfficientAnalysisEnum: 382 return CreatePVectorHydrologyDCEfficient(); 383 break; 384 #endif 385 #ifdef _HAVE_BALANCED_ 386 case BalancethicknessAnalysisEnum: 387 return CreatePVectorBalancethickness(); 388 break; 389 #endif 390 #ifdef _HAVE_CONTROL_ 391 case AdjointBalancethicknessAnalysisEnum: 392 return CreatePVectorAdjointBalancethickness(); 393 break; 394 case AdjointHorizAnalysisEnum: 395 return CreatePVectorAdjointHoriz(); 396 break; 397 #endif 398 default: 399 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); 400 } 401 402 /*make compiler happy*/ 403 return NULL; 380 404 } 381 405 /*}}}*/ … … 3153 3177 3154 3178 /*Build load vector: */ 3155 for (i=0;i<numnodes;i++){ 3156 for(j=0;j<NDOF2;j++){ 3157 pe->values[i*NDOF2+j]+=-driving_stress_baseline*slope[j]*Jdet*gauss->weight*basis[i]; 3158 } 3179 for(i=0;i<numnodes;i++){ 3180 pe->values[i*NDOF2+0]+=-driving_stress_baseline*slope[0]*Jdet*gauss->weight*basis[i]; 3181 pe->values[i*NDOF2+1]+=-driving_stress_baseline*slope[1]*Jdet*gauss->weight*basis[i]; 3159 3182 } 3160 3183 } -
issm/trunk-jpl/src/c/classes/Elements/Tria.h
r15613 r15695 179 179 /*}}}*/ 180 180 /*Tria specific routines:{{{*/ 181 ElementMatrix* CreateKMatrix(void); 181 182 ElementMatrix* CreateKMatrixBalancethickness(void); 182 183 ElementMatrix* CreateKMatrixBalancethickness_DG(void); … … 187 188 ElementMatrix* CreateKMatrixPrognostic_DG(void); 188 189 ElementMatrix* CreateMassMatrix(void); 190 ElementVector* CreatePVector(void); 189 191 ElementVector* CreatePVectorBalancethickness(void); 190 192 ElementVector* CreatePVectorBalancethickness_DG(void);
Note:
See TracChangeset
for help on using the changeset viewer.