Changeset 2908
- Timestamp:
- 01/26/10 08:22:02 (15 years ago)
- Location:
- issm/trunk/src/c/objects
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Riftfront.cpp
r2742 r2908 19 19 20 20 21 /*Object constructors and destructor*/ 22 /*FUNCTION Riftfront::constructor {{{1*/ 21 23 Riftfront::Riftfront(){ 22 24 /*in case :*/ … … 24 26 return; 25 27 } 26 28 /*}}}1*/ 29 /*FUNCTION Riftfront::creation {{{1*/ 27 30 Riftfront::Riftfront(char riftfront_type[RIFTFRONTSTRING],int riftfront_id, int riftfront_node_ids[MAX_RIFTFRONT_GRIDS], int riftfront_mparid, double riftfront_h[MAX_RIFTFRONT_GRIDS],double riftfront_b[MAX_RIFTFRONT_GRIDS],double riftfront_s[MAX_RIFTFRONT_GRIDS],double riftfront_normal[2],double riftfront_length,int riftfront_fill,double riftfront_friction, double riftfront_fraction,double riftfront_fractionincrement, double riftfront_penalty_offset, int riftfront_penalty_lock, bool riftfront_active,int riftfront_counter,bool riftfront_prestable,bool riftfront_shelf){ 28 31 … … 67 70 return; 68 71 } 69 72 /*}}}1*/ 73 /*FUNCTION Riftfront::destructor {{{1*/ 70 74 Riftfront::~Riftfront(){ 71 75 return; 72 76 } 77 /*}}}1*/ 73 78 74 void Riftfront::Echo(void){ 75 76 int i; 77 78 printf("Riftfront:\n"); 79 printf(" type: %s\n",type); 80 printf(" id: %i\n",id); 81 printf(" mparid: %i\n",mparid); 82 83 printf(" node_ids: "); 84 for(i=0;i<MAX_RIFTFRONT_GRIDS;i++)printf("%i ",node_ids[i]); 85 printf("\n"); 86 87 printf("normal [%g,%g], length %g\n",normal[0],normal[1],normal[2]); 88 printf("fill: %i friction %g fraction %g fractionincrement %g \n",fill,friction,fraction,fractionincrement); 89 printf("penalty_offset %g\n",penalty_offset); 90 printf("penalty_lock %i\n",penalty_lock); 91 printf("active %i\n",active); 92 printf("counter %i\n",counter); 93 printf("prestable %i\n",prestable); 94 printf("material_converged %i\n",material_converged); 95 printf("shelf %i\n",shelf); 96 } 97 98 void Riftfront::DeepEcho(void){ 99 100 int i; 101 102 printf("Riftfront:\n"); 103 printf(" type: %s\n",type); 104 printf(" id: %i\n",id); 105 106 printf(" node_ids: "); 107 for(i=0;i<MAX_RIFTFRONT_GRIDS;i++)printf("%i ",node_ids[i]); 108 for(i=0;i<MAX_RIFTFRONT_GRIDS;i++){ 109 if (nodes[i])nodes[i]->Echo(); 110 } 111 printf("\n"); 112 113 printf(" mparid: %i\n",mparid); 114 if(matpar)matpar->Echo(); 115 116 printf("normal [%g,%g], length %g\n",normal[0],normal[1],normal[2]); 117 printf("fill: %i friction %g fraction %g fractionincrement %g \n",fill,friction,fraction,fractionincrement); 118 printf("penalty_offset %g\n",penalty_offset); 119 printf("penalty_lock %i\n",penalty_lock); 120 printf("active %i\n",active); 121 printf("counter %i\n",counter); 122 printf("prestable %i\n",prestable); 123 printf("material_converged %i\n",material_converged); 124 printf("shelf %i\n",shelf); 125 126 } 127 79 /*Object marshall*/ 80 /*FUNCTION Riftfront::Marshall {{{1*/ 128 81 void Riftfront::Marshall(char** pmarshalled_dataset){ 129 82 … … 169 122 return; 170 123 } 171 124 /*}}}1*/ 125 /*FUNCTION Riftfront::MarshallSize {{{1*/ 172 126 int Riftfront::MarshallSize(){ 173 127 … … 196 150 sizeof(int); //sizeof(int) for enum type 197 151 } 198 199 char* Riftfront::GetName(void){ 200 return "riftfront"; 201 } 202 203 152 /*}}}1*/ 153 /*FUNCTION Riftfront::Demarshall {{{1*/ 204 154 void Riftfront::Demarshall(char** pmarshalled_dataset){ 205 155 … … 244 194 return; 245 195 } 246 247 int Riftfront::Enum(void){ 248 249 return RiftfrontEnum(); 250 251 } 252 253 int Riftfront::GetId(void){ return id; } 254 255 int Riftfront::MyRank(void){ 256 extern int my_rank; 257 return my_rank; 258 } 259 196 /*}}}1*/ 197 198 /*Object functions*/ 199 /*FUNCTION Riftfront::Configure {{{1*/ 260 200 #undef __FUNCT__ 261 201 #define __FUNCT__ "Riftfront::Configure" … … 276 216 277 217 } 278 279 #undef __FUNCT__ 280 #define __FUNCT__ "Riftfront::UpdateFromInputs" 281 void Riftfront::UpdateFromInputs(void* vinputs){ 282 283 int dofs[1]={0}; 284 ParameterInputs* inputs=NULL; 285 218 /*}}}1*/ 219 /*FUNCTION Riftfront::Constrain {{{1*/ 220 #define _ZIGZAGCOUNTER_ 221 222 #undef __FUNCT__ 223 #define __FUNCT__ "Riftfront::Constrain" 224 int Riftfront::Constrain(int* punstable, void* vinputs, int analysis_type){ 225 226 const int numgrids=2; 227 int dofs[2]={0,1}; 228 double vxvy_list[2][2]; //velocities for all grids 229 double max_penetration; 230 double penetration; 231 int activate; 232 int found; 233 int unstable; 234 235 ParameterInputs* inputs=NULL; 236 286 237 inputs=(ParameterInputs*)vinputs; 287 238 288 inputs->Recover("thickness",&h[0],1,dofs,MAX_RIFTFRONT_GRIDS,(void**)nodes); 289 inputs->Recover("bed",&b[0],1,dofs,MAX_RIFTFRONT_GRIDS,(void**)nodes); 290 inputs->Recover("surface",&s[0],1,dofs,MAX_RIFTFRONT_GRIDS,(void**)nodes); 291 292 } 293 239 240 /*First recover parameter inputs: */ 241 found=inputs->Recover("velocity",&vxvy_list[0][0],2,dofs,numgrids,(void**)nodes); 242 if(!found)throw ErrorException(__FUNCT__," could not find velocity in inputs!"); 243 244 245 /*Grid 1 faces grid2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */ 246 penetration=(vxvy_list[1][0]-vxvy_list[0][0])*normal[0]+(vxvy_list[1][1]-vxvy_list[0][1])*normal[1]; 247 248 /*activation: */ 249 if(penetration<0)activate=1; 250 else activate=0; 251 252 /*Here, we try to avoid zigzaging. When a penalty activates and deactivates for more than penalty_lock times, 253 * we increase the fraction of melange:*/ 254 if(this->counter>this->penalty_lock){ 255 /*reset counter: */ 256 this->counter=0; 257 /*increase melange fraction: */ 258 this->fraction+=this->fractionincrement; 259 if (this->fraction>1)this->fraction=(double)1.0; 260 //printf("riftfront %i fraction: %g\n",this->GetId(),this->fraction); 261 } 262 263 //Figure out stability of this penalty 264 if(this->active==activate){ 265 unstable=0; 266 } 267 else{ 268 unstable=1; 269 this->counter++; 270 } 271 272 //Set penalty flag 273 this->active=activate; 274 275 //if ((penetration>0) & (this->active==1))printf("Riftfront %i wants to be released\n",GetId()); 276 277 /*assign output pointer: */ 278 *punstable=unstable; 279 } 280 /*}}}1*/ 281 /*FUNCTION Riftfront::copy {{{1*/ 282 Object* Riftfront::copy() { 283 return new Riftfront(*this); 284 } 285 /*}}}1*/ 286 /*FUNCTION Riftfront::CreateKMatrix {{{1*/ 287 #undef __FUNCT__ 288 #define __FUNCT__ "Riftfront::CreateKMatrix" 289 void Riftfront::CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type){ 290 /*do nothing: */ 291 } 292 /*}}}1*/ 293 /*FUNCTION Riftfront::CreatePVector {{{1*/ 294 #undef __FUNCT__ 295 #define __FUNCT__ "Riftfront::CreatePVector" 296 void Riftfront::CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type){ 297 /*do nothing: */ 298 } 299 /*}}}1*/ 300 /*FUNCTION Riftfront::DeepEcho {{{1*/ 301 void Riftfront::DeepEcho(void){ 302 303 int i; 304 305 printf("Riftfront:\n"); 306 printf(" type: %s\n",type); 307 printf(" id: %i\n",id); 308 309 printf(" node_ids: "); 310 for(i=0;i<MAX_RIFTFRONT_GRIDS;i++)printf("%i ",node_ids[i]); 311 for(i=0;i<MAX_RIFTFRONT_GRIDS;i++){ 312 if (nodes[i])nodes[i]->Echo(); 313 } 314 printf("\n"); 315 316 printf(" mparid: %i\n",mparid); 317 if(matpar)matpar->Echo(); 318 319 printf("normal [%g,%g], length %g\n",normal[0],normal[1],normal[2]); 320 printf("fill: %i friction %g fraction %g fractionincrement %g \n",fill,friction,fraction,fractionincrement); 321 printf("penalty_offset %g\n",penalty_offset); 322 printf("penalty_lock %i\n",penalty_lock); 323 printf("active %i\n",active); 324 printf("counter %i\n",counter); 325 printf("prestable %i\n",prestable); 326 printf("material_converged %i\n",material_converged); 327 printf("shelf %i\n",shelf); 328 329 } 330 /*}}}1*/ 331 /*FUNCTION Riftfront::Echo {{{1*/ 332 void Riftfront::Echo(void){ 333 334 int i; 335 336 printf("Riftfront:\n"); 337 printf(" type: %s\n",type); 338 printf(" id: %i\n",id); 339 printf(" mparid: %i\n",mparid); 340 341 printf(" node_ids: "); 342 for(i=0;i<MAX_RIFTFRONT_GRIDS;i++)printf("%i ",node_ids[i]); 343 printf("\n"); 344 345 printf("normal [%g,%g], length %g\n",normal[0],normal[1],normal[2]); 346 printf("fill: %i friction %g fraction %g fractionincrement %g \n",fill,friction,fraction,fractionincrement); 347 printf("penalty_offset %g\n",penalty_offset); 348 printf("penalty_lock %i\n",penalty_lock); 349 printf("active %i\n",active); 350 printf("counter %i\n",counter); 351 printf("prestable %i\n",prestable); 352 printf("material_converged %i\n",material_converged); 353 printf("shelf %i\n",shelf); 354 } 355 /*}}}1*/ 356 /*FUNCTION Riftfront::Enum {{{1*/ 357 int Riftfront::Enum(void){ 358 359 return RiftfrontEnum(); 360 361 } 362 /*}}}1*/ 363 /*FUNCTION Riftfront::GetDofList {{{1*/ 294 364 #undef __FUNCT__ 295 365 #define __FUNCT__ "Riftfront::GetDofList" … … 311 381 *pnumberofdofspernode=numberofdofspernode; 312 382 } 313 383 /*}}}1*/ 384 /*FUNCTION Riftfront::GetId {{{1*/ 385 int Riftfront::GetId(void){ return id; } 386 /*}}}1*/ 387 /*FUNCTION Riftfront::GetName {{{1*/ 388 char* Riftfront::GetName(void){ 389 return "riftfront"; 390 } 391 /*}}}1*/ 392 /*FUNCTION Riftfront::IsMaterialStable {{{1*/ 393 #undef __FUNCT__ 394 #define __FUNCT__ "Riftfront::IsMaterialStable" 395 int Riftfront::IsMaterialStable(void* vinputs, int analysis_type){ 396 397 int found=0; 398 ParameterInputs* inputs=NULL; 399 double converged=0; 400 401 inputs=(ParameterInputs*)vinputs; 402 403 found=inputs->Recover("converged",&converged); 404 if(!found)throw ErrorException(__FUNCT__," could not find converged flag in inputs!"); 405 406 if(converged){ 407 /*ok, material non-linearity has converged. If that was already the case, we keep 408 * constraining the rift front. If it was not, and this is the first time the material 409 * has converged, we start constraining now!: */ 410 this->material_converged=1; 411 } 412 413 return this->material_converged; 414 } 415 /*}}}1*/ 416 /*FUNCTION Riftfront::MaxPenetration {{{1*/ 417 #undef __FUNCT__ 418 #define __FUNCT__ "Riftfront::MaxPenetration" 419 int Riftfront::MaxPenetration(double* ppenetration, void* vinputs, int analysis_type){ 420 421 const int numgrids=2; 422 int dofs[2]={0,1}; 423 double vxvy_list[2][2]; //velocities for all grids 424 double max_penetration; 425 double penetration=0; 426 int found; 427 428 ParameterInputs* inputs=NULL; 429 430 inputs=(ParameterInputs*)vinputs; 431 432 //initialize: 433 penetration=-1; 434 435 found=inputs->Recover("velocity",&vxvy_list[0][0],2,dofs,numgrids,(void**)nodes); 436 if(!found)throw ErrorException(__FUNCT__," could not find velocity in inputs!"); 437 438 /*Grid 1 faces grid2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */ 439 penetration=(vxvy_list[1][0]-vxvy_list[0][0])*normal[0]+(vxvy_list[1][1]-vxvy_list[0][1])*normal[1]; 440 441 /*Now, we return penetration only if we are active!: */ 442 if(this->active==0)penetration=-1; 443 444 /*If we are zigzag locked, same thing: */ 445 if(this->counter>this->penalty_lock)penetration=-1; 446 447 /*assign output pointer: */ 448 *ppenetration=penetration; 449 450 } 451 /*}}}1*/ 452 /*FUNCTION Riftfront::MyRank {{{1*/ 453 int Riftfront::MyRank(void){ 454 extern int my_rank; 455 return my_rank; 456 } 457 /*}}}1*/ 458 /*FUNCTION Riftfront::OutputProperties {{{1*/ 459 #undef __FUNCT__ 460 #define __FUNCT__ "Riftfront::OutputProperties" 461 void Riftfront::OutputProperties(Vec riftproperties){ 462 463 int row_id=0; 464 double value; 465 466 /*recover id of penalty: */ 467 row_id=this->GetId()-1; //c indexing, ids were matlab indexed 468 value=(double)this->fraction; 469 470 /*Plug id and fraction into riftproperties matrix: */ 471 VecSetValues(riftproperties,1,&row_id,&value,INSERT_VALUES); 472 } 473 /*}}}1*/ 474 /*FUNCTION Riftfront::PenaltyCreateKMatrix {{{1*/ 314 475 #undef __FUNCT__ 315 476 #define __FUNCT__ "Riftfront::PenaltyCreateKMatrix" … … 409 570 410 571 } 411 572 /*}}}1*/ 573 /*FUNCTION Riftfront::PenaltyCreatePVector {{{1*/ 412 574 #undef __FUNCT__ 413 575 #define __FUNCT__ "Riftfront::PenaltyCreatePVector" … … 515 677 } 516 678 } 517 518 Object* Riftfront::copy() { 519 return new Riftfront(*this); 520 } 521 522 #undef __FUNCT__ 523 #define __FUNCT__ "Riftfront::CreateKMatrix" 524 void Riftfront::CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type){ 525 /*do nothing: */ 526 } 527 528 #undef __FUNCT__ 529 #define __FUNCT__ "Riftfront::CreatePVector" 530 void Riftfront::CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type){ 531 /*do nothing: */ 532 } 533 534 bool Riftfront::PreStable(){ 535 return prestable; 536 } 537 538 void Riftfront::SetPreStable(){ 539 prestable=1; 540 } 541 542 #undef __FUNCT__ 543 #define __FUNCT__ "Riftfront::PreConstrain" 544 int Riftfront::PreConstrain(int* punstable, void* vinputs, int analysis_type){ 545 546 const int numgrids=2; 547 int dofs[2]={0,1}; 548 double vxvy_list[2][2]; //velocities for all grids 549 double penetration; 550 int unstable; 551 ParameterInputs* inputs=NULL; 552 int found; 553 554 inputs=(ParameterInputs*)vinputs; 555 556 /*First recover velocity: */ 557 found=inputs->Recover("velocity",&vxvy_list[0][0],2,dofs,numgrids,(void**)nodes); 558 if(!found)throw ErrorException(__FUNCT__," could not find velocity in inputs!"); 559 560 /*Grid 1 faces grid2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */ 561 penetration=(vxvy_list[1][0]-vxvy_list[0][0])*normal[0]+(vxvy_list[1][1]-vxvy_list[0][1])*normal[1]; 562 563 /*Ok, we are preconstraining here. Ie, anything that penetrates is constrained until stability of the entire set 564 * of constraints is reached.: */ 565 if(penetration<0){ 566 if (!this->active){ 567 /*This is the first time penetration happens: */ 568 this->active=1; 569 unstable=1; 570 } 571 else{ 572 /*This constraint was already active: */ 573 this->active=1; 574 unstable=0; 575 } 576 } 577 else{ 578 /*No penetration happening. : */ 579 if (!this->active){ 580 /*This penalty was not active, and no penetration happening. Do nonthing: */ 581 this->active=0; 582 unstable=0; 583 } 584 else{ 585 /*Ok, this penalty wants to get released. But not now, this is preconstraint, not constraint: */ 586 this->active=1; 587 unstable=0; 588 } 589 } 590 591 /*assign output pointer: */ 592 *punstable=unstable; 593 } 594 595 596 #define _ZIGZAGCOUNTER_ 597 598 #undef __FUNCT__ 599 #define __FUNCT__ "Riftfront::Constrain" 600 int Riftfront::Constrain(int* punstable, void* vinputs, int analysis_type){ 601 602 const int numgrids=2; 603 int dofs[2]={0,1}; 604 double vxvy_list[2][2]; //velocities for all grids 605 double max_penetration; 606 double penetration; 607 int activate; 608 int found; 609 int unstable; 610 611 ParameterInputs* inputs=NULL; 612 613 inputs=(ParameterInputs*)vinputs; 614 615 616 /*First recover parameter inputs: */ 617 found=inputs->Recover("velocity",&vxvy_list[0][0],2,dofs,numgrids,(void**)nodes); 618 if(!found)throw ErrorException(__FUNCT__," could not find velocity in inputs!"); 619 620 621 /*Grid 1 faces grid2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */ 622 penetration=(vxvy_list[1][0]-vxvy_list[0][0])*normal[0]+(vxvy_list[1][1]-vxvy_list[0][1])*normal[1]; 623 624 /*activation: */ 625 if(penetration<0)activate=1; 626 else activate=0; 627 628 /*Here, we try to avoid zigzaging. When a penalty activates and deactivates for more than penalty_lock times, 629 * we increase the fraction of melange:*/ 630 if(this->counter>this->penalty_lock){ 631 /*reset counter: */ 632 this->counter=0; 633 /*increase melange fraction: */ 634 this->fraction+=this->fractionincrement; 635 if (this->fraction>1)this->fraction=(double)1.0; 636 //printf("riftfront %i fraction: %g\n",this->GetId(),this->fraction); 637 } 638 639 //Figure out stability of this penalty 640 if(this->active==activate){ 641 unstable=0; 642 } 643 else{ 644 unstable=1; 645 this->counter++; 646 } 647 648 //Set penalty flag 649 this->active=activate; 650 651 //if ((penetration>0) & (this->active==1))printf("Riftfront %i wants to be released\n",GetId()); 652 653 /*assign output pointer: */ 654 *punstable=unstable; 655 } 656 679 /*}}}1*/ 680 /*FUNCTION Riftfront::Penetration {{{1*/ 657 681 #undef __FUNCT__ 658 682 #define __FUNCT__ "Riftfront::Penetration" … … 684 708 685 709 } 686 687 #undef __FUNCT__ 688 #define __FUNCT__ "Riftfront::MaxPenetration" 689 int Riftfront::MaxPenetration(double* ppenetration, void* vinputs, int analysis_type){ 690 691 const int numgrids=2; 692 int dofs[2]={0,1}; 693 double vxvy_list[2][2]; //velocities for all grids 694 double max_penetration; 695 double penetration=0; 696 int found; 697 698 ParameterInputs* inputs=NULL; 699 700 inputs=(ParameterInputs*)vinputs; 701 702 //initialize: 703 penetration=-1; 704 705 found=inputs->Recover("velocity",&vxvy_list[0][0],2,dofs,numgrids,(void**)nodes); 706 if(!found)throw ErrorException(__FUNCT__," could not find velocity in inputs!"); 707 708 /*Grid 1 faces grid2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */ 709 penetration=(vxvy_list[1][0]-vxvy_list[0][0])*normal[0]+(vxvy_list[1][1]-vxvy_list[0][1])*normal[1]; 710 711 /*Now, we return penetration only if we are active!: */ 712 if(this->active==0)penetration=-1; 713 714 /*If we are zigzag locked, same thing: */ 715 if(this->counter>this->penalty_lock)penetration=-1; 716 717 /*assign output pointer: */ 718 *ppenetration=penetration; 719 720 } 721 710 /*}}}1*/ 711 /*FUNCTION Riftfront::PotentialUnstableConstraint {{{1*/ 722 712 #undef __FUNCT__ 723 713 #define __FUNCT__ "Riftfront::PotentialUnstableConstraint" … … 760 750 *punstable=unstable; 761 751 } 762 763 764 #undef __FUNCT__ 765 #define __FUNCT__ "Riftfront::IsMaterialStable" 766 int Riftfront::IsMaterialStable(void* vinputs, int analysis_type){ 767 768 int found=0; 752 /*}}}1*/ 753 /*FUNCTION Riftfront::PreConstrain {{{1*/ 754 #undef __FUNCT__ 755 #define __FUNCT__ "Riftfront::PreConstrain" 756 int Riftfront::PreConstrain(int* punstable, void* vinputs, int analysis_type){ 757 758 const int numgrids=2; 759 int dofs[2]={0,1}; 760 double vxvy_list[2][2]; //velocities for all grids 761 double penetration; 762 int unstable; 769 763 ParameterInputs* inputs=NULL; 770 double converged=0;764 int found; 771 765 772 766 inputs=(ParameterInputs*)vinputs; 773 767 774 found=inputs->Recover("converged",&converged); 775 if(!found)throw ErrorException(__FUNCT__," could not find converged flag in inputs!"); 776 777 if(converged){ 778 /*ok, material non-linearity has converged. If that was already the case, we keep 779 * constraining the rift front. If it was not, and this is the first time the material 780 * has converged, we start constraining now!: */ 781 this->material_converged=1; 782 } 783 784 return this->material_converged; 785 } 786 787 #undef __FUNCT__ 788 #define __FUNCT__ "Riftfront::OutputProperties" 789 void Riftfront::OutputProperties(Vec riftproperties){ 790 791 int row_id=0; 792 double value; 793 794 /*recover id of penalty: */ 795 row_id=this->GetId()-1; //c indexing, ids were matlab indexed 796 value=(double)this->fraction; 797 798 /*Plug id and fraction into riftproperties matrix: */ 799 VecSetValues(riftproperties,1,&row_id,&value,INSERT_VALUES); 800 } 768 /*First recover velocity: */ 769 found=inputs->Recover("velocity",&vxvy_list[0][0],2,dofs,numgrids,(void**)nodes); 770 if(!found)throw ErrorException(__FUNCT__," could not find velocity in inputs!"); 771 772 /*Grid 1 faces grid2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */ 773 penetration=(vxvy_list[1][0]-vxvy_list[0][0])*normal[0]+(vxvy_list[1][1]-vxvy_list[0][1])*normal[1]; 774 775 /*Ok, we are preconstraining here. Ie, anything that penetrates is constrained until stability of the entire set 776 * of constraints is reached.: */ 777 if(penetration<0){ 778 if (!this->active){ 779 /*This is the first time penetration happens: */ 780 this->active=1; 781 unstable=1; 782 } 783 else{ 784 /*This constraint was already active: */ 785 this->active=1; 786 unstable=0; 787 } 788 } 789 else{ 790 /*No penetration happening. : */ 791 if (!this->active){ 792 /*This penalty was not active, and no penetration happening. Do nonthing: */ 793 this->active=0; 794 unstable=0; 795 } 796 else{ 797 /*Ok, this penalty wants to get released. But not now, this is preconstraint, not constraint: */ 798 this->active=1; 799 unstable=0; 800 } 801 } 802 803 /*assign output pointer: */ 804 *punstable=unstable; 805 } 806 /*}}}1*/ 807 /*FUNCTION Riftfront::PreStable {{{1*/ 808 bool Riftfront::PreStable(){ 809 return prestable; 810 } 811 /*}}}1*/ 812 /*FUNCTION Riftfront::SetPreStable {{{1*/ 813 void Riftfront::SetPreStable(){ 814 prestable=1; 815 } 816 /*}}}1*/ 817 /*FUNCTION Riftfront::UpdateFromInputs {{{1*/ 818 #undef __FUNCT__ 819 #define __FUNCT__ "Riftfront::UpdateFromInputs" 820 void Riftfront::UpdateFromInputs(void* vinputs){ 821 822 int dofs[1]={0}; 823 ParameterInputs* inputs=NULL; 824 825 inputs=(ParameterInputs*)vinputs; 826 827 inputs->Recover("thickness",&h[0],1,dofs,MAX_RIFTFRONT_GRIDS,(void**)nodes); 828 inputs->Recover("bed",&b[0],1,dofs,MAX_RIFTFRONT_GRIDS,(void**)nodes); 829 inputs->Recover("surface",&s[0],1,dofs,MAX_RIFTFRONT_GRIDS,(void**)nodes); 830 831 } 832 /*}}}1*/ -
issm/trunk/src/c/objects/Sing.cpp
r2334 r2908 18 18 19 19 20 /*Object constructors and destructor*/ 21 /*FUNCTION Sing::constructor {{{1*/ 20 22 Sing::Sing(){ 21 23 return; 22 24 } 23 25 /*}}}*/ 26 /*FUNCTION Sing::destructor {{{1*/ 24 27 Sing::~Sing(){ 25 28 return; 26 29 } 27 30 /*}}}*/ 31 /*FUNCTION Sing::creation {{{1*/ 28 32 Sing::Sing(int sing_id, int sing_mid, int sing_mparid, int sing_numparid,int sing_g, double sing_h, double sing_k){ 29 33 … … 53 57 return; 54 58 } 55 56 #undef __FUNCT__ 57 #define __FUNCT__ "Sing::Echo" 58 59 void Sing::Echo(void){ 60 61 printf("Sing:\n"); 62 printf(" id: %i\n",id); 63 printf(" mid: %i\n",mid); 64 printf(" mparid: %i\n",mparid); 65 printf(" node_id=[%i]\n",node_id); 66 printf(" node_offset=[%i]\n",node_offset); 67 printf(" matice_offset=%i\n",matice_offset); 68 printf(" matpar_offset=%i\n",matpar_offset); 69 printf(" h=[%g]\n",h); 70 printf(" k=[%g]\n",h); 71 printf(" node: \n"); 72 if(node)node->Echo(); 73 if(matice)matice->Echo(); 74 if(matpar)matpar->Echo(); 75 76 return; 77 } 78 79 #undef __FUNCT__ 80 #define __FUNCT__ "Sing::DeepEcho" 81 void Sing::DeepEcho(void){ 82 83 printf("Sing:\n"); 84 printf(" id: %i\n",id); 85 printf(" mid: %i\n",mid); 86 printf(" mparid: %i\n",mparid); 87 printf(" node_id=[%i]\n",node_id); 88 printf(" node_offset=[%i]\n",node_offset); 89 printf(" matice_offset=%i\n",matice_offset); 90 printf(" matpar_offset=%i\n",matpar_offset); 91 printf(" h=[%g]\n",h); 92 printf(" k=[%g]\n",h); 93 printf(" node: \n"); 94 if(node)node->Echo(); 95 if(matice)matice->Echo(); 96 if(matpar)matpar->Echo(); 97 98 return; 99 } 59 /*}}}*/ 60 61 /*Object marshall*/ 62 /*FUNCTION Sing::Marshall {{{1*/ 100 63 void Sing::Marshall(char** pmarshalled_dataset){ 101 64 … … 132 95 return; 133 96 } 134 97 /*}}}*/ 98 /*FUNCTION Sing::MashallSize {{{1*/ 135 99 int Sing::MarshallSize(){ 136 100 return sizeof(id) … … 151 115 +sizeof(int); //sizeof(int) for enum type 152 116 } 153 154 char* Sing::GetName(void){ 155 return "sing"; 156 } 157 117 /*}}}*/ 118 /*FUNCTION Sing::Demarshall {{{1*/ 158 119 void Sing::Demarshall(char** pmarshalled_dataset){ 159 120 … … 193 154 return; 194 155 } 195 int Sing::Enum(void){ 196 197 return SingEnum(); 198 199 } 200 int Sing::GetId(void){ return id; } 201 202 int Sing::MyRank(void){ 203 extern int my_rank; 204 return my_rank; 205 } 206 207 156 /*}}}*/ 157 158 /*Object functions*/ 159 /*FUNCTION Sing::ComputePressure {{{1*/ 160 #undef __FUNCT__ 161 #define __FUNCT__ "Sing::ComputePressure" 162 void Sing::ComputePressure(Vec p_g){ 163 164 int i; 165 const int numgrids=1; 166 int doflist[numgrids]; 167 double pressure[numgrids]; 168 double rho_ice,g; 169 170 /*Get dof list on which we will plug the pressure values: */ 171 GetDofList1(&doflist[0]); 172 173 /*pressure is lithostatic: */ 174 rho_ice=matpar->GetRhoIce(); 175 g=matpar->GetG(); 176 pressure[0]=rho_ice*g*h; 177 178 /*plug local pressure values into global pressure vector: */ 179 VecSetValues(p_g,numgrids,doflist,(const double*)pressure,INSERT_VALUES); 180 181 } 182 /*}}}*/ 183 /*FUNCTION Sing::Configure {{{1*/ 208 184 #undef __FUNCT__ 209 185 #define __FUNCT__ "Sing::Configure" … … 232 208 233 209 } 234 210 /*}}}*/ 211 /*FUNCTION Sing::copy {{{1*/ 212 Object* Sing::copy() { 213 214 return new Sing(*this); 215 216 } 217 /*}}}*/ 218 /*FUNCTION Sing::CreateKMatrix {{{1*/ 235 219 #undef __FUNCT__ 236 220 #define __FUNCT__ "Sing::CreateKMatrix" … … 249 233 250 234 } 251 252 235 /*}}}*/ 236 /*FUNCTION Sing::CreateKMatrixDiagnosticHutter {{{1*/ 253 237 #undef __FUNCT__ 254 238 #define __FUNCT__ "Sing::CreateKMatrixDiagnosticHutter" … … 273 257 274 258 } 275 276 259 /*}}}*/ 260 /*FUNCTION Sing::CreatePVector {{{1*/ 277 261 #undef __FUNCT__ 278 262 #define __FUNCT__ "Sing::CreatePVector" … … 290 274 291 275 } 292 293 294 276 /*}}}*/ 277 /*FUNCTION Sing::CreatePVectorDiagnosticHutter {{{1*/ 295 278 #undef __FUNCT__ 296 279 #define __FUNCT__ "Sing::CreatePVectorDiagnosticHutter" … … 347 330 348 331 } 349 350 332 /*}}}*/ 333 /*FUNCTION Sing::DeepEcho {{{1*/ 334 #undef __FUNCT__ 335 #define __FUNCT__ "Sing::DeepEcho" 336 void Sing::DeepEcho(void){ 337 338 printf("Sing:\n"); 339 printf(" id: %i\n",id); 340 printf(" mid: %i\n",mid); 341 printf(" mparid: %i\n",mparid); 342 printf(" node_id=[%i]\n",node_id); 343 printf(" node_offset=[%i]\n",node_offset); 344 printf(" matice_offset=%i\n",matice_offset); 345 printf(" matpar_offset=%i\n",matpar_offset); 346 printf(" h=[%g]\n",h); 347 printf(" k=[%g]\n",h); 348 printf(" node: \n"); 349 if(node)node->Echo(); 350 if(matice)matice->Echo(); 351 if(matpar)matpar->Echo(); 352 353 return; 354 } 355 /*}}}*/ 356 /*FUNCTION Sing::Du {{{1*/ 357 #undef __FUNCT__ 358 #define __FUNCT__ "Sing::Du" 359 void Sing::Du(_p_Vec*,void*,int,int){ 360 throw ErrorException(__FUNCT__," not supported yet!"); 361 } 362 /*}}}*/ 363 /*FUNCTION Sing::Echo{{{1*/ 364 #undef __FUNCT__ 365 #define __FUNCT__ "Sing::Echo" 366 367 void Sing::Echo(void){ 368 369 printf("Sing:\n"); 370 printf(" id: %i\n",id); 371 printf(" mid: %i\n",mid); 372 printf(" mparid: %i\n",mparid); 373 printf(" node_id=[%i]\n",node_id); 374 printf(" node_offset=[%i]\n",node_offset); 375 printf(" matice_offset=%i\n",matice_offset); 376 printf(" matpar_offset=%i\n",matpar_offset); 377 printf(" h=[%g]\n",h); 378 printf(" k=[%g]\n",h); 379 printf(" node: \n"); 380 if(node)node->Echo(); 381 if(matice)matice->Echo(); 382 if(matpar)matpar->Echo(); 383 384 return; 385 } 386 /*}}}*/ 387 /*FUNCTION Sing::Enum {{{1*/ 388 int Sing::Enum(void){ 389 390 return SingEnum(); 391 392 } 393 /*}}}*/ 394 /*FUNCTION Sing::GetBedList {{{1*/ 395 #undef __FUNCT__ 396 #define __FUNCT__ "Sing::GetBedList" 397 void Sing::GetBedList(double*){ 398 throw ErrorException(__FUNCT__," not supported yet!"); 399 } 400 /*}}}*/ 401 /*FUNCTION Sing::GetDofList {{{1*/ 402 void Sing::GetDofList(int* doflist,int* pnumberofdofspernode){ 403 404 int i; 405 int doflist_per_node[MAXDOFSPERNODE]; 406 int numberofdofspernode; 407 408 node->GetDofList(&doflist_per_node[0],&numberofdofspernode); 409 for(i=0;i<numberofdofspernode;i++){ 410 doflist[i]=doflist_per_node[i]; 411 } 412 413 /*Assign output pointers:*/ 414 *pnumberofdofspernode=numberofdofspernode; 415 416 } 417 /*}}}*/ 418 /*FUNCTION Sing::GetDofList1 {{{1*/ 419 void Sing::GetDofList1(int* doflist){ 420 421 int i; 422 doflist[0]=node->GetDofList1(); 423 424 } 425 /*}}}*/ 426 /*FUNCTION Sing::GetId {{{1*/ 427 int Sing::GetId(void){ return id; } 428 /*}}}*/ 429 /*FUNCTION Sing::GetMatPar {{{1*/ 430 void* Sing::GetMatPar(){ 431 return matpar; 432 } 433 /*}}}*/ 434 /*FUNCTION Sing::GetName {{{1*/ 435 char* Sing::GetName(void){ 436 return "sing"; 437 } 438 /*}}}*/ 439 /*FUNCTION Sing::GetNodes {{{1*/ 440 void Sing::GetNodes(void** vpnodes){ 441 442 Node** pnodes=(Node**)vpnodes; 443 444 pnodes[0]=node; 445 } 446 /*}}}*/ 447 /*FUNCTION Sing::GetOnBed {{{1*/ 448 #undef __FUNCT__ 449 #define __FUNCT__ "Sing::GetOnBed" 450 int Sing::GetOnBed(){ 451 throw ErrorException(__FUNCT__," not supported yet!"); 452 } 453 /*}}}*/ 454 /*FUNCTION Sing::GetShelf {{{1*/ 455 #undef __FUNCT__ 456 #define __FUNCT__ "Sing::GetShelf" 457 int Sing::GetShelf(){ 458 throw ErrorException(__FUNCT__," not supported yet!"); 459 } 460 /*}}}*/ 461 /*FUNCTION Sing::GetThicknessList {{{1*/ 462 #undef __FUNCT__ 463 #define __FUNCT__ "Sing::GetThicknessList" 464 void Sing::GetThicknessList(double* thickness_list){ 465 throw ErrorException(__FUNCT__," not supported yet!"); 466 } 467 /*}}}*/ 468 /*FUNCTION Sing::Gradj {{{1*/ 469 #undef __FUNCT__ 470 #define __FUNCT__ "Sing::Gradj" 471 void Sing::Gradj(_p_Vec*, void*, int, int ,char*){ 472 throw ErrorException(__FUNCT__," not supported yet!"); 473 } 474 /*}}}*/ 475 /*FUNCTION Sing::GradB {{{1*/ 476 #undef __FUNCT__ 477 #define __FUNCT__ "Sing::GradjB" 478 void Sing::GradjB(_p_Vec*, void*, int,int){ 479 throw ErrorException(__FUNCT__," not supported yet!"); 480 } 481 /*}}}*/ 482 /*FUNCTION Sing::GradjDrag {{{1*/ 483 #undef __FUNCT__ 484 #define __FUNCT__ "Sing::GradjDrag" 485 void Sing::GradjDrag(_p_Vec*, void*, int,int){ 486 throw ErrorException(__FUNCT__," not supported yet!"); 487 } 488 /*}}}*/ 489 /*FUNCTION Sing::MassFlux {{{1*/ 490 #undef __FUNCT__ 491 #define __FUNCT__ "Sing::MassFlux" 492 double Sing::MassFlux( double* segment,double* ug){ 493 throw ErrorException(__FUNCT__," not supported yet!"); 494 } 495 /*}}}*/ 496 /*FUNCTION Sing::MaticeConfiguration {{{1*/ 497 #undef __FUNCT__ 498 #define __FUNCT__ "Sing::MaticeConfiguration" 499 void Sing::MaticeConfiguration(Matice* sing_matice,int sing_matice_offset){ 500 matice=sing_matice; 501 matice_offset=sing_matice_offset; 502 } 503 /*}}}*/ 504 /*FUNCTION Sing::MatparConfiguration {{{1*/ 505 #undef __FUNCT__ 506 #define __FUNCT__ "Sing::MatparConfiguration" 507 void Sing::MatparConfiguration(Matpar* sing_matpar,int sing_matpar_offset){ 508 509 matpar=sing_matpar; 510 matpar_offset=sing_matpar_offset; 511 512 } 513 /*}}}*/ 514 /*FUNCTION Sing::Misfit {{{1*/ 515 #undef __FUNCT__ 516 #define __FUNCT__ "Sing::Misfit" 517 double Sing::Misfit(void*, int,int){ 518 throw ErrorException(__FUNCT__," not supported yet!"); 519 } 520 /*}}}*/ 521 /*FUNCTION Sing::MyRank {{{1*/ 522 int Sing::MyRank(void){ 523 extern int my_rank; 524 return my_rank; 525 } 526 /*}}}*/ 527 /*FUNCTION Sing::UpdateFromInputs {{{1*/ 351 528 #undef __FUNCT__ 352 529 #define __FUNCT__ "Sing::UpdateFromInputs" … … 381 558 382 559 } 383 384 void Sing::GetDofList(int* doflist,int* pnumberofdofspernode){ 385 386 int i; 387 int doflist_per_node[MAXDOFSPERNODE]; 388 int numberofdofspernode; 389 390 node->GetDofList(&doflist_per_node[0],&numberofdofspernode); 391 for(i=0;i<numberofdofspernode;i++){ 392 doflist[i]=doflist_per_node[i]; 393 } 394 395 /*Assign output pointers:*/ 396 *pnumberofdofspernode=numberofdofspernode; 397 398 } 399 400 void Sing::GetDofList1(int* doflist){ 401 402 int i; 403 doflist[0]=node->GetDofList1(); 404 405 } 406 407 408 void* Sing::GetMatPar(){ 409 return matpar; 410 } 411 412 413 void Sing::GetNodes(void** vpnodes){ 414 415 Node** pnodes=(Node**)vpnodes; 416 417 pnodes[0]=node; 418 } 419 420 421 Object* Sing::copy() { 422 423 return new Sing(*this); 424 425 } 426 427 428 #undef __FUNCT__ 429 #define __FUNCT__ "Sing::NodeConfiguration" 430 void Sing::NodeConfiguration(int sing_node_id,Node* sing_node,int sing_node_offset){ 431 432 node_id=sing_node_id; 433 node=sing_node; 434 node_offset=sing_node_offset; 435 436 } 437 #undef __FUNCT__ 438 #define __FUNCT__ "Sing::MaticeConfiguration" 439 void Sing::MaticeConfiguration(Matice* sing_matice,int sing_matice_offset){ 440 matice=sing_matice; 441 matice_offset=sing_matice_offset; 442 } 443 444 #undef __FUNCT__ 445 #define __FUNCT__ "Sing::MatparConfiguration" 446 void Sing::MatparConfiguration(Matpar* sing_matpar,int sing_matpar_offset){ 447 448 matpar=sing_matpar; 449 matpar_offset=sing_matpar_offset; 450 451 } 452 453 454 #undef __FUNCT__ 455 #define __FUNCT__ "Sing::GetShelf" 456 int Sing::GetShelf(){ 457 throw ErrorException(__FUNCT__," not supported yet!"); 458 } 459 #undef __FUNCT__ 460 #define __FUNCT__ "Sing::GetOnBed" 461 int Sing::GetOnBed(){ 462 throw ErrorException(__FUNCT__," not supported yet!"); 463 } 464 465 466 #undef __FUNCT__ 467 #define __FUNCT__ "Sing::GetBedList" 468 void Sing::GetBedList(double*){ 469 throw ErrorException(__FUNCT__," not supported yet!"); 470 } 471 472 #undef __FUNCT__ 473 #define __FUNCT__ "Sing::Du" 474 void Sing::Du(_p_Vec*,void*,int,int){ 475 throw ErrorException(__FUNCT__," not supported yet!"); 476 } 477 #undef __FUNCT__ 478 #define __FUNCT__ "Sing::Gradj" 479 void Sing::Gradj(_p_Vec*, void*, int, int ,char*){ 480 throw ErrorException(__FUNCT__," not supported yet!"); 481 } 482 #undef __FUNCT__ 483 #define __FUNCT__ "Sing::GradjDrag" 484 void Sing::GradjDrag(_p_Vec*, void*, int,int){ 485 throw ErrorException(__FUNCT__," not supported yet!"); 486 } 487 #undef __FUNCT__ 488 #define __FUNCT__ "Sing::GradjB" 489 void Sing::GradjB(_p_Vec*, void*, int,int){ 490 throw ErrorException(__FUNCT__," not supported yet!"); 491 } 492 #undef __FUNCT__ 493 #define __FUNCT__ "Sing::Misfit" 494 double Sing::Misfit(void*, int,int){ 495 throw ErrorException(__FUNCT__," not supported yet!"); 496 } 497 498 #undef __FUNCT__ 499 #define __FUNCT__ "Sing::GetThicknessList" 500 void Sing::GetThicknessList(double* thickness_list){ 501 throw ErrorException(__FUNCT__," not supported yet!"); 502 } 503 504 #undef __FUNCT__ 505 #define __FUNCT__ "Sing::ComputePressure" 506 void Sing::ComputePressure(Vec p_g){ 507 508 int i; 509 const int numgrids=1; 510 int doflist[numgrids]; 511 double pressure[numgrids]; 512 double rho_ice,g; 513 514 /*Get dof list on which we will plug the pressure values: */ 515 GetDofList1(&doflist[0]); 516 517 /*pressure is lithostatic: */ 518 rho_ice=matpar->GetRhoIce(); 519 g=matpar->GetG(); 520 pressure[0]=rho_ice*g*h; 521 522 /*plug local pressure values into global pressure vector: */ 523 VecSetValues(p_g,numgrids,doflist,(const double*)pressure,INSERT_VALUES); 524 525 } 526 527 #undef __FUNCT__ 528 #define __FUNCT__ "Sing::MassFlux" 529 double Sing::MassFlux( double* segment,double* ug){ 530 throw ErrorException(__FUNCT__," not supported yet!"); 531 } 560 /*}}}*/ -
issm/trunk/src/c/objects/Spc.cpp
r803 r2908 17 17 18 18 19 /*Object constructors and destructor*/ 20 /*FUNCTION Spc::constructor {{{1*/ 19 21 Spc::Spc(){ 20 22 return; 21 23 } 24 /*}}}1*/ 25 /*FUNCTION Spc::creation {{{1*/ 22 26 Spc::Spc(int spc_sid,int spc_nodeid, int spc_dof,double spc_value){ 23 27 … … 29 33 return; 30 34 } 31 35 /*}}}1*/ 36 /*FUNCTION Spc::destructor {{{1*/ 32 37 Spc::~Spc(){ 33 38 return; 34 39 } 40 /*}}}1*/ 35 41 36 void Spc::Echo(void){ 37 38 printf("Spc:\n"); 39 printf(" sid: %i\n",sid); 40 printf(" nodeid: %i\n",nodeid); 41 printf(" dof: %i\n",dof); 42 printf(" value: %g\n",value); 43 return; 44 } 45 46 void Spc::DeepEcho(void){ 47 48 printf("Spc:\n"); 49 printf(" sid: %i\n",sid); 50 printf(" nodeid: %i\n",nodeid); 51 printf(" dof: %i\n",dof); 52 printf(" value: %g\n",value); 53 return; 54 } 42 /*Object marshall*/ 43 /*FUNCTION Spc::Marshall {{{1*/ 55 44 void Spc::Marshall(char** pmarshalled_dataset){ 56 45 … … 76 65 return; 77 66 } 78 67 /*}}}1*/ 68 /*FUNCTION Spc::MarshallSize {{{1*/ 79 69 int Spc::MarshallSize(){ 80 70 81 71 return sizeof(sid)+sizeof(nodeid)+sizeof(dof)+sizeof(value)+sizeof(int); //sizeof(int) for enum type 82 72 } 83 84 char* Spc::GetName(void){ 85 return "spc"; 86 } 87 88 73 /*}}}1*/ 74 /*FUNCTION Spc::Demarshall {{{1*/ 89 75 void Spc::Demarshall(char** pmarshalled_dataset){ 90 76 … … 106 92 return; 107 93 } 94 /*}}}1*/ 95 96 /*Object functions*/ 97 /*FUNCTION Spc::copy {{{1*/ 98 Object* Spc::copy() { 99 return new Spc(*this); 100 } 101 /*}}}1*/ 102 /*FUNCTION Spc::DeepEcho {{{1*/ 103 void Spc::DeepEcho(void){ 104 105 printf("Spc:\n"); 106 printf(" sid: %i\n",sid); 107 printf(" nodeid: %i\n",nodeid); 108 printf(" dof: %i\n",dof); 109 printf(" value: %g\n",value); 110 return; 111 } 112 /*}}}1*/ 113 /*FUNCTION Spc::DistributeNumDofs {{{1*/ 114 void Spc::DistributeNumDofs(int* numdofspernode,int analysis_type){return;} 115 /*}}}1*/ 116 /*FUNCTION Spc::Echo {{{1*/ 117 void Spc::Echo(void){ 118 119 printf("Spc:\n"); 120 printf(" sid: %i\n",sid); 121 printf(" nodeid: %i\n",nodeid); 122 printf(" dof: %i\n",dof); 123 printf(" value: %g\n",value); 124 return; 125 } 126 /*}}}1*/ 127 /*FUNCTION Spc::Enum {{{1*/ 108 128 int Spc::Enum(void){ 109 129 … … 111 131 112 132 } 133 /*}}}1*/ 134 /*FUNCTION Spc::GetDof {{{1*/ 135 int Spc::GetDof(){ 136 return dof; 137 } 138 /*}}}1*/ 139 /*FUNCTION Spc::GetId {{{1*/ 113 140 int Spc::GetId(void){ return sid; } 114 141 /*}}}1*/ 142 /*FUNCTION Spc::GetName {{{1*/ 143 char* Spc::GetName(void){ 144 return "spc"; 145 } 146 /*}}}1*/ 147 /*FUNCTION Spc::GetNodeId {{{1*/ 148 int Spc::GetNodeId(){ 149 150 return nodeid; 151 } 152 /*}}}1*/ 153 /*FUNCTION Spc::GetValue {{{1*/ 154 double Spc::GetValue(){ 155 return value; 156 } 157 /*}}}1*/ 158 /*FUNCTION Spc::MyRank {{{1*/ 115 159 int Spc::MyRank(void){ 116 160 extern int my_rank; 117 161 return my_rank; 118 162 } 119 void Spc::DistributeNumDofs(int* numdofspernode,int analysis_type){return;} 120 121 int Spc::GetNodeId(){ 122 123 return nodeid; 124 } 125 126 int Spc::GetDof(){ 127 return dof; 128 } 129 130 double Spc::GetValue(){ 131 return value; 132 } 133 134 Object* Spc::copy() { 135 return new Spc(*this); 136 } 137 163 /*}}}1*/
Note:
See TracChangeset
for help on using the changeset viewer.