Changeset 4835
- Timestamp:
- 07/27/10 13:47:28 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r4832 r4835 378 378 } 379 379 else if (analysis_type==BedSlopeXAnalysisEnum){ 380 InputUpdateFrom BedSlopeX( solution);380 InputUpdateFromSolutionOneDofCollapsed(solution,BedSlopeXEnum); 381 381 } 382 382 else if (analysis_type==BedSlopeYAnalysisEnum){ 383 InputUpdateFrom BedSlopeY( solution);383 InputUpdateFromSolutionOneDofCollapsed(solution,BedSlopeYEnum); 384 384 } 385 385 else if (analysis_type==SurfaceSlopeXAnalysisEnum){ 386 InputUpdateFromS urfaceSlopeX( solution);386 InputUpdateFromSolutionOneDofCollapsed(solution,SurfaceSlopeXEnum); 387 387 } 388 388 else if (analysis_type==SurfaceSlopeYAnalysisEnum){ 389 InputUpdateFromS urfaceSlopeY( solution);389 InputUpdateFromSolutionOneDofCollapsed(solution,SurfaceSlopeYEnum); 390 390 } 391 391 else if (analysis_type==PrognosticAnalysisEnum){ 392 InputUpdateFromSolution Prognostic( solution);392 InputUpdateFromSolutionOneDofCollapsed(solution,ThicknessEnum); 393 393 } 394 394 else if (analysis_type==BalancedthicknessAnalysisEnum){ 395 InputUpdateFromSolution Balancedthickness( solution);395 InputUpdateFromSolutionOneDofCollapsed(solution,ThicknessEnum); 396 396 } 397 397 else if (analysis_type==BalancedvelocitiesAnalysisEnum){ 398 InputUpdateFromSolution Balancedvelocities( solution);398 InputUpdateFromSolutionOneDofCollapsed(solution,VelEnum); 399 399 } 400 400 else if (analysis_type==ThermalAnalysisEnum){ … … 402 402 } 403 403 else if (analysis_type==MeltingAnalysisEnum){ 404 InputUpdateFromSolution Melting( solution);404 InputUpdateFromSolutionOneDof(solution,MeltingRateEnum); 405 405 } 406 406 else{ … … 2136 2136 if (collapsed){ 2137 2137 if (!onbed){ 2138 /*Do nothing. Element on bed will take care of it*/ 2138 2139 return; 2139 2140 } … … 2171 2172 double gauss[numvertices][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}}; 2172 2173 2173 Input * VzInput = NULL;2174 double * VzPtr = NULL;2174 Input *vz_input = NULL; 2175 double *vz_ptr = NULL; 2175 2176 Penta *penta = NULL; 2176 2177 … … 2205 2206 2206 2207 /*Now Compute vel*/ 2207 VzInput=inputs->GetInput(VzEnum);2208 if ( VzInput){2209 if ( VzInput->Enum()!=PentaVertexInputEnum) ISSMERROR("Cannot compute Vel as Vz is of type %s",EnumAsString(VzInput->Enum()));2210 VzInput->GetValuesPtr(&VzPtr,&dummy);2211 for(i=0;i<numvertices;i++) vz[i]= VzPtr[i];2208 vz_input=inputs->GetInput(VzEnum); 2209 if (vz_input){ 2210 if (vz_input->Enum()!=PentaVertexInputEnum) ISSMERROR("Cannot compute Vel as Vz is of type %s",EnumAsString(vz_input->Enum())); 2211 vz_input->GetValuesPtr(&vz_ptr,&dummy); 2212 for(i=0;i<numvertices;i++) vz[i]=vz_ptr[i]; 2212 2213 } 2213 2214 else{for(i=0;i<numvertices;i++) vz[i]=0.0;} … … 2262 2263 double gauss[numvertices][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}}; 2263 2264 2264 Input * VzInput = NULL;2265 double * VzPtr = NULL;2265 Input *vz_input = NULL; 2266 double *vz_ptr = NULL; 2266 2267 2267 2268 /*Get dof list: */ … … 2283 2284 2284 2285 /*Get Vz*/ 2285 VzInput=inputs->GetInput(VzEnum);2286 if ( VzInput){2287 if ( VzInput->Enum()!=PentaVertexInputEnum){2288 ISSMERROR("Cannot compute Vel as Vz is of type %s",EnumAsString( VzInput->Enum()));2286 vz_input=inputs->GetInput(VzEnum); 2287 if (vz_input){ 2288 if (vz_input->Enum()!=PentaVertexInputEnum){ 2289 ISSMERROR("Cannot compute Vel as Vz is of type %s",EnumAsString(vz_input->Enum())); 2289 2290 } 2290 VzInput->GetValuesPtr(&VzPtr,&dummy);2291 for(i=0;i<numvertices;i++) vz[i]= VzPtr[i];2291 vz_input->GetValuesPtr(&vz_ptr,&dummy); 2292 for(i=0;i<numvertices;i++) vz[i]=vz_ptr[i]; 2292 2293 } 2293 2294 else{ … … 2343 2344 double gauss[numvertices][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}}; 2344 2345 2345 Input* VzInput=NULL;2346 double* VzPtr=NULL;2346 Input* vz_input=NULL; 2347 double* vz_ptr=NULL; 2347 2348 2348 2349 /*Get dof list: */ … … 2364 2365 2365 2366 /*Get Vz*/ 2366 VzInput=inputs->GetInput(VzEnum);2367 if ( VzInput){2368 if ( VzInput->Enum()!=PentaVertexInputEnum){2369 ISSMERROR("Cannot compute Vel as Vz is of type %s",EnumAsString( VzInput->Enum()));2367 vz_input=inputs->GetInput(VzEnum); 2368 if (vz_input){ 2369 if (vz_input->Enum()!=PentaVertexInputEnum){ 2370 ISSMERROR("Cannot compute Vel as Vz is of type %s",EnumAsString(vz_input->Enum())); 2370 2371 } 2371 VzInput->GetValuesPtr(&VzPtr,&dummy);2372 for(i=0;i<numvertices;i++) vz[i]= VzPtr[i];2372 vz_input->GetValuesPtr(&vz_ptr,&dummy); 2373 for(i=0;i<numvertices;i++) vz[i]=vz_ptr[i]; 2373 2374 } 2374 2375 else{ … … 2424 2425 double gauss[numvertices][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}}; 2425 2426 2426 Input* VxInput=NULL;2427 double* VxPtr=NULL;2428 Input* VyInput=NULL;2429 double* VyPtr=NULL;2427 Input* vx_input=NULL; 2428 double* vx_ptr=NULL; 2429 Input* vy_input=NULL; 2430 double* vy_ptr=NULL; 2430 2431 2431 2432 /*Get dof list: */ … … 2446 2447 2447 2448 /*Get Vx and Vy*/ 2448 VxInput=inputs->GetInput(VxEnum);2449 if ( VxInput){2450 if ( VxInput->Enum()!=PentaVertexInputEnum) ISSMERROR("Cannot compute Vel as Vx is of type %s",EnumAsString(VxInput->Enum()));2451 VxInput->GetValuesPtr(&VxPtr,&dummy);2452 for(i=0;i<numvertices;i++) vx[i]= VxPtr[i];2449 vx_input=inputs->GetInput(VxEnum); 2450 if (vx_input){ 2451 if (vx_input->Enum()!=PentaVertexInputEnum) ISSMERROR("Cannot compute Vel as Vx is of type %s",EnumAsString(vx_input->Enum())); 2452 vx_input->GetValuesPtr(&vx_ptr,&dummy); 2453 for(i=0;i<numvertices;i++) vx[i]=vx_ptr[i]; 2453 2454 } 2454 2455 else for(i=0;i<numvertices;i++) vx[i]=0.0; 2455 2456 2456 VyInput=inputs->GetInput(VyEnum);2457 if ( VyInput){2458 if ( VyInput->Enum()!=PentaVertexInputEnum) ISSMERROR("Cannot compute Vel as Vy is of type %s",EnumAsString(VyInput->Enum()));2459 VyInput->GetValuesPtr(&VyPtr,&dummy);2460 for(i=0;i<numvertices;i++) vy[i]= VyPtr[i];2457 vy_input=inputs->GetInput(VyEnum); 2458 if (vy_input){ 2459 if (vy_input->Enum()!=PentaVertexInputEnum) ISSMERROR("Cannot compute Vel as Vy is of type %s",EnumAsString(vy_input->Enum())); 2460 vy_input->GetValuesPtr(&vy_ptr,&dummy); 2461 for(i=0;i<numvertices;i++) vy[i]=vy_ptr[i]; 2461 2462 } 2462 2463 else for(i=0;i<numvertices;i++) vy[i]=0.0; … … 2543 2544 2544 2545 /*}}}*/ 2545 /*FUNCTION Penta::InputUpdateFromBedSlopeX{{{1*/2546 void Penta::InputUpdateFromBedSlopeX(double* solution){2547 2548 int i;2549 2550 const int numvertices=6;2551 const int numdofpervertex=1;2552 const int numdof=numdofpervertex*numvertices;2553 2554 int doflist[numdof];2555 double values[numdof];2556 2557 int dummy;2558 2559 /*Get dof list: */2560 GetDofList(&doflist[0],&dummy);2561 2562 /*Use the dof list to index into the solution vector: */2563 for(i=0;i<numdof;i++){2564 values[i]=solution[doflist[i]];2565 }2566 2567 /*Add bedslopex as inputs to the tria element: */2568 this->inputs->AddInput(new PentaVertexInput(BedSlopeXEnum,values));2569 }2570 /*}}}*/2571 /*FUNCTION Penta::InputUpdateFromBedSlopeY{{{1*/2572 void Penta::InputUpdateFromBedSlopeY(double* solution){2573 2574 int i;2575 2576 const int numvertices=6;2577 const int numdofpervertex=1;2578 const int numdof=numdofpervertex*numvertices;2579 2580 int doflist[numdof];2581 double values[numdof];2582 2583 int dummy;2584 2585 /*Get dof list: */2586 GetDofList(&doflist[0],&dummy);2587 2588 /*Use the dof list to index into the solution vector: */2589 for(i=0;i<numdof;i++){2590 values[i]=solution[doflist[i]];2591 }2592 2593 /*Add bedslopey as inputs to the tria element: */2594 this->inputs->AddInput(new PentaVertexInput(BedSlopeYEnum,values));2595 }2596 /*}}}*/2597 /*FUNCTION Penta::InputUpdateFromSurfaceSlopeX{{{1*/2598 void Penta::InputUpdateFromSurfaceSlopeX(double* solution){2599 2600 int i;2601 2602 const int numvertices=6;2603 const int numdofpervertex=1;2604 const int numdof=numdofpervertex*numvertices;2605 2606 int doflist[numdof];2607 double values[numdof];2608 2609 int dummy;2610 2611 /*Get dof list: */2612 GetDofList(&doflist[0],&dummy);2613 2614 /*Use the dof list to index into the solution vector: */2615 for(i=0;i<numdof;i++){2616 values[i]=solution[doflist[i]];2617 }2618 2619 /*Add surfaceslopex as inputs to the tria element: */2620 this->inputs->AddInput(new PentaVertexInput(SurfaceSlopeXEnum,values));2621 }2622 /*}}}*/2623 /*FUNCTION Penta::InputUpdateFromSurfaceSlopeY{{{1*/2624 void Penta::InputUpdateFromSurfaceSlopeY(double* solution){2625 2626 int i;2627 2628 const int numvertices=6;2629 const int numdofpervertex=1;2630 const int numdof=numdofpervertex*numvertices;2631 2632 int doflist[numdof];2633 double values[numdof];2634 2635 int dummy;2636 2637 /*Get dof list: */2638 GetDofList(&doflist[0],&dummy);2639 2640 /*Use the dof list to index into the solution vector: */2641 for(i=0;i<numdof;i++){2642 values[i]=solution[doflist[i]];2643 }2644 2645 /*Add surfaceslopey as inputs to the tria element: */2646 this->inputs->AddInput(new PentaVertexInput(SurfaceSlopeYEnum,values));2647 }2648 /*}}}*/2649 2546 /*FUNCTION Penta::InputUpdateFromSolutionAdjointStokes {{{1*/ 2650 2547 void Penta::InputUpdateFromSolutionAdjointStokes(double* solution){ … … 2725 2622 } 2726 2623 /*}}}*/ 2727 /*FUNCTION Penta::InputUpdateFromSolutionPrognostic {{{1*/2728 void Penta::InputUpdateFromSolutionPrognostic(double* solution){2729 2730 int i;2731 2732 const int numvertices=6;2733 const int numdofpervertex=1;2734 const int numdof=numdofpervertex*numvertices;2735 2736 int doflist[numdof];2737 double values[numdof];2738 2739 int dummy;2740 2741 /*Get dof list: */2742 GetDofList(&doflist[0],&dummy);2743 2744 /*Use the dof list to index into the solution vector: */2745 for(i=0;i<numdof;i++){2746 values[i]=solution[doflist[i]];2747 }2748 2749 /*Add thickness as inputs to the tria element: */2750 this->inputs->AddInput(new PentaVertexInput(ThicknessEnum,values));2751 }2752 /*}}}*/2753 /*FUNCTION Penta::InputUpdateFromSolutionBalancedthickness {{{1*/2754 void Penta::InputUpdateFromSolutionBalancedthickness(double* solution){2755 2756 int i;2757 2758 const int numvertices=6;2759 const int numdofpervertex=1;2760 const int numdof=numdofpervertex*numvertices;2761 2762 int doflist[numdof];2763 double values[numdof];2764 2765 int dummy;2766 2767 /*Get dof list: */2768 GetDofList(&doflist[0],&dummy);2769 2770 /*Use the dof list to index into the solution vector: */2771 for(i=0;i<numdof;i++){2772 values[i]=solution[doflist[i]];2773 }2774 2775 /*Add thickness as inputs to the tria element: */2776 this->inputs->AddInput(new PentaVertexInput(ThicknessEnum,values));2777 }2778 /*}}}*/2779 /*FUNCTION Penta::InputUpdateFromSolutionBalancedvelocities {{{1*/2780 void Penta::InputUpdateFromSolutionBalancedvelocities(double* solution){2781 ISSMERROR(" not supported yet!");2782 }2783 /*}}}*/2784 2624 /*FUNCTION Penta::InputUpdateFromSolutionThermal {{{1*/ 2785 2625 void Penta::InputUpdateFromSolutionThermal(double* solution){ … … 2822 2662 } 2823 2663 /*}}}*/ 2824 /*FUNCTION Penta::InputUpdateFromSolutionMelting {{{1*/ 2825 void Penta::InputUpdateFromSolutionMelting(double* solution){ 2826 2827 int i; 2828 2829 const int numvertices=6; 2830 const int numdofpervertex=1; 2831 const int numdof=numdofpervertex*numvertices; 2832 2833 int doflist[numdof]; 2834 double values[numdof]; 2835 2836 int dummy; 2664 /*FUNCTION Penta::InputUpdateFromSolutionOneDof{{{1*/ 2665 void Penta::InputUpdateFromSolutionOneDof(double* solution,int enum_type){ 2666 2667 const int numvertices = 6; 2668 const int numdofpervertex = 1; 2669 const int numdof = numdofpervertex *numvertices; 2670 int doflist[numdof]; 2671 double values[numdof]; 2672 int dummy; 2837 2673 2838 2674 /*Get dof list: */ … … 2840 2676 2841 2677 /*Use the dof list to index into the solution vector: */ 2842 for(i =0;i<numdof;i++){2678 for(int i=0;i<numdof;i++){ 2843 2679 values[i]=solution[doflist[i]]; 2844 2680 } 2845 2681 2846 /*Add thickness as inputs to the tria element: */ 2847 this->inputs->AddInput(new PentaVertexInput(MeltingRateEnum,values)); 2682 /*Add input to the element: */ 2683 this->inputs->AddInput(new PentaVertexInput(enum_type,values)); 2684 } 2685 /*}}}*/ 2686 /*FUNCTION Penta::InputUpdateFromSolutionOneDofCollpased{{{1*/ 2687 void Penta::InputUpdateFromSolutionOneDofCollapsed(double* solution,int enum_type){ 2688 2689 const int numvertices = 6; 2690 const int numdofpervertex = 1; 2691 const int numdof = numdofpervertex *numvertices; 2692 const int numdof2d = numdof/2; 2693 int doflist[numdof]; 2694 double values[numdof]; 2695 int dummy; 2696 Penta *penta = NULL; 2697 bool onbed; 2698 2699 /*Recover inputs*/ 2700 inputs->GetParameterValue(&onbed,ElementOnBedEnum); 2701 2702 /*If not on bed, return*/ 2703 if (!onbed) return; 2704 2705 /*Get dof list: */ 2706 GetDofList(&doflist[0],&dummy); 2707 2708 /*Use the dof list to index into the solution vector and extrude it */ 2709 for(int i=0;i<numdof2d;i++){ 2710 values[i] =solution[doflist[i]]; 2711 values[i+numdof2d]=values[i]; 2712 } 2713 2714 /*Start looping over all elements above current element and update all inputs*/ 2715 penta=this; 2716 for(;;){ 2717 2718 /*Add input to the element: */ 2719 penta->inputs->AddInput(new PentaVertexInput(enum_type,values)); 2720 2721 /*Stop if we have reached the surface*/ 2722 if (penta->IsOnSurface()) break; 2723 2724 /* get upper Penta*/ 2725 penta=penta->GetUpperElement(); ISSMASSERT(penta->Id()!=this->id); 2726 } 2848 2727 } 2849 2728 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Penta.h
r4832 r4835 174 174 void InputUpdateFromSolutionAdjointHoriz( double* solutiong); 175 175 void InputUpdateFromSolutionAdjointStokes( double* solutiong); 176 void InputUpdateFromSolutionBalancedthickness( double* solutiong);177 void InputUpdateFromSolutionBalancedvelocities( double* solutiong);178 176 void InputUpdateFromSolutionDiagnosticHoriz( double* solutiong); 179 177 void InputUpdateFromSolutionDiagnosticMacAyeal( double* solutiong); … … 182 180 void InputUpdateFromSolutionDiagnosticVert( double* solutiong); 183 181 void InputUpdateFromSolutionDiagnosticStokes( double* solutiong); 184 void InputUpdateFromSolutionPrognostic( double* solutiong);185 void InputUpdateFromBedSlopeX( double* solutiong);186 void InputUpdateFromBedSlopeY( double* solutiong);187 void InputUpdateFromSurfaceSlopeX( double* solutiong);188 void InputUpdateFromSurfaceSlopeY( double* solutiong);189 182 void InputUpdateFromSolutionThermal( double* solutiong); 190 void InputUpdateFromSolutionMelting( double* solutiong); 183 void InputUpdateFromSolutionOneDof(double* solutiong,int enum_type); 184 void InputUpdateFromSolutionOneDofCollapsed(double* solutiong,int enum_type); 191 185 bool IsInput(int name); 192 186 bool IsOnSurface(void); -
issm/trunk/src/c/objects/Elements/Tria.cpp
r4804 r4835 377 377 } 378 378 else if (analysis_type==BedSlopeXAnalysisEnum){ 379 InputUpdateFromSolution BedSlopeX( solution);379 InputUpdateFromSolutionOneDof(solution,BedSlopeXEnum); 380 380 } 381 381 else if (analysis_type==BedSlopeYAnalysisEnum){ 382 InputUpdateFromSolution BedSlopeY( solution);382 InputUpdateFromSolutionOneDof(solution,BedSlopeYEnum); 383 383 } 384 384 else if (analysis_type==SurfaceSlopeXAnalysisEnum){ 385 InputUpdateFromSolution SurfaceSlopeX( solution);385 InputUpdateFromSolutionOneDof(solution,SurfaceSlopeXEnum); 386 386 } 387 387 else if (analysis_type==SurfaceSlopeYAnalysisEnum){ 388 InputUpdateFromSolution SurfaceSlopeY( solution);388 InputUpdateFromSolutionOneDof(solution,SurfaceSlopeYEnum); 389 389 } 390 390 else if (analysis_type==PrognosticAnalysisEnum){ 391 InputUpdateFromSolution Prognostic( solution);391 InputUpdateFromSolutionOneDof(solution,ThicknessEnum); 392 392 } 393 393 else if (analysis_type==BalancedthicknessAnalysisEnum){ 394 InputUpdateFromSolution Balancedthickness( solution);394 InputUpdateFromSolutionOneDof(solution,ThicknessEnum); 395 395 } 396 396 else if (analysis_type==BalancedvelocitiesAnalysisEnum){ 397 InputUpdateFromSolution Balancedvelocities( solution);397 InputUpdateFromSolutionOneDof(solution,VelEnum); 398 398 } 399 399 else{ … … 5551 5551 } 5552 5552 /*}}}*/ 5553 /*FUNCTION Tria::InputUpdateFromSolutionBedSlopeX {{{1*/ 5554 void Tria::InputUpdateFromSolutionBedSlopeX(double* solution){ 5555 5556 int i; 5557 5558 const int numvertices=3; 5559 const int numdofpervertex=1; 5560 const int numdof=numdofpervertex*numvertices; 5561 5562 int doflist[numdof]; 5563 double values[numdof]; 5564 5565 int dummy; 5553 /*FUNCTION Tria::InputUpdateFromSolutionOneDof{{{1*/ 5554 void Tria::InputUpdateFromSolutionOneDof(double* solution,int enum_type){ 5555 5556 const int numvertices = 3; 5557 const int numdofpervertex = 1; 5558 const int numdof = numdofpervertex *numvertices; 5559 int doflist[numdof]; 5560 double values[numdof]; 5561 int dummy; 5566 5562 5567 5563 /*Get dof list: */ … … 5569 5565 5570 5566 /*Use the dof list to index into the solution vector: */ 5571 for(i =0;i<numdof;i++){5567 for(int i=0;i<numdof;i++){ 5572 5568 values[i]=solution[doflist[i]]; 5573 5569 } 5574 5570 5575 /*Add slopex as inputs to the tria element: */ 5576 this->inputs->AddInput(new TriaVertexInput(BedSlopeXEnum,values)); 5577 } 5578 /*}}}*/ 5579 /*FUNCTION Tria::InputUpdateFromSolutionBedSlopeX {{{1*/ 5580 void Tria::InputUpdateFromSolutionBedSlopeY(double* solution){ 5581 5582 int i; 5583 5584 const int numvertices=3; 5585 const int numdofpervertex=1; 5586 const int numdof=numdofpervertex*numvertices; 5587 5588 int doflist[numdof]; 5589 double values[numdof]; 5590 5591 int dummy; 5592 5593 /*Get dof list: */ 5594 GetDofList(&doflist[0],&dummy); 5595 5596 /*Use the dof list to index into the solution vector: */ 5597 for(i=0;i<numdof;i++){ 5598 values[i]=solution[doflist[i]]; 5599 } 5600 5601 /*Add slopex as inputs to the tria element: */ 5602 this->inputs->AddInput(new TriaVertexInput(BedSlopeYEnum,values)); 5603 } 5604 /*}}}*/ 5605 /*FUNCTION Tria::InputUpdateFromSolutionSurfaceSlopeX {{{1*/ 5606 void Tria::InputUpdateFromSolutionSurfaceSlopeX(double* solution){ 5607 5608 int i; 5609 5610 const int numvertices=3; 5611 const int numdofpervertex=1; 5612 const int numdof=numdofpervertex*numvertices; 5613 5614 int doflist[numdof]; 5615 double values[numdof]; 5616 5617 int dummy; 5618 5619 /*Get dof list: */ 5620 GetDofList(&doflist[0],&dummy); 5621 5622 /*Use the dof list to index into the solution vector: */ 5623 for(i=0;i<numdof;i++){ 5624 values[i]=solution[doflist[i]]; 5625 } 5626 5627 /*Add slopex as inputs to the tria element: */ 5628 this->inputs->AddInput(new TriaVertexInput(SurfaceSlopeXEnum,values)); 5629 } 5630 /*}}}*/ 5631 /*FUNCTION Tria::InputUpdateFromSolutionSurfaceSlopeY {{{1*/ 5632 void Tria::InputUpdateFromSolutionSurfaceSlopeY(double* solution){ 5633 5634 int i; 5635 5636 const int numvertices=3; 5637 const int numdofpervertex=1; 5638 const int numdof=numdofpervertex*numvertices; 5639 5640 int doflist[numdof]; 5641 double values[numdof]; 5642 5643 int dummy; 5644 5645 /*Get dof list: */ 5646 GetDofList(&doflist[0],&dummy); 5647 5648 /*Use the dof list to index into the solution vector: */ 5649 for(i=0;i<numdof;i++){ 5650 values[i]=solution[doflist[i]]; 5651 } 5652 5653 /*Add slopex as inputs to the tria element: */ 5654 this->inputs->AddInput(new TriaVertexInput(SurfaceSlopeYEnum,values)); 5655 } 5656 /*}}}*/ 5657 /*FUNCTION Tria::InputUpdateFromSolutionPrognostic {{{1*/ 5658 void Tria::InputUpdateFromSolutionPrognostic(double* solution){ 5659 5660 int i; 5661 5662 const int numvertices=3; 5663 const int numdofpervertex=1; 5664 const int numdof=numdofpervertex*numvertices; 5665 5666 int doflist[numdof]; 5667 double values[numdof]; 5668 5669 int dummy; 5670 5671 /*Get dof list: */ 5672 GetDofList(&doflist[0],&dummy); 5673 5674 /*Use the dof list to index into the solution vector: */ 5675 for(i=0;i<numdof;i++){ 5676 values[i]=solution[doflist[i]]; 5677 } 5678 5679 /*Add thickness as inputs to the tria element: */ 5680 this->inputs->AddInput(new TriaVertexInput(ThicknessEnum,values)); 5681 } 5682 /*}}}*/ 5683 /*FUNCTION Tria::InputUpdateFromSolutionBalancedthickness {{{1*/ 5684 void Tria::InputUpdateFromSolutionBalancedthickness(double* solution){ 5685 5686 int i; 5687 5688 const int numvertices=3; 5689 const int numdofpervertex=1; 5690 const int numdof=numdofpervertex*numvertices; 5691 5692 int doflist[numdof]; 5693 double values[numdof]; 5694 double thickness[numvertices]; 5695 5696 int dummy; 5697 5698 /*Get dof list: */ 5699 GetDofList(&doflist[0],&dummy); 5700 5701 /*Use the dof list to index into the solution vector: */ 5702 for(i=0;i<numdof;i++){ 5703 values[i]=solution[doflist[i]]; 5704 } 5705 5706 /*Add thickness as inputs to the tria element: */ 5707 this->inputs->AddInput(new TriaVertexInput(ThicknessEnum,values)); 5708 } 5709 /*}}}*/ 5710 /*FUNCTION Tria::InputUpdateFromSolutionBalancedvelocities {{{1*/ 5711 void Tria::InputUpdateFromSolutionBalancedvelocities(double* solution){ 5712 ISSMERROR(" not supported yet!"); 5571 /*Add input to the element: */ 5572 this->inputs->AddInput(new TriaVertexInput(enum_type,values)); 5713 5573 } 5714 5574 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Tria.h
r4780 r4835 151 151 void InputUpdateFromSolutionDiagnosticHoriz( double* solution); 152 152 void InputUpdateFromSolutionDiagnosticHutter( double* solution); 153 void InputUpdateFromSolutionBedSlopeX( double* solution); 154 void InputUpdateFromSolutionBedSlopeY( double* solution); 155 void InputUpdateFromSolutionSurfaceSlopeX( double* solution); 156 void InputUpdateFromSolutionSurfaceSlopeY( double* solution); 157 void InputUpdateFromSolutionPrognostic( double* solution); 158 void InputUpdateFromSolutionBalancedthickness( double* solution); 159 void InputUpdateFromSolutionBalancedvelocities( double* solution); 153 void InputUpdateFromSolutionOneDof(double* solution,int enum_type); 160 154 bool IsInput(int name); 161 155 void SetClone(int* minranks); -
issm/trunk/src/c/solutions/balancedthickness_core.cpp
r4409 r4835 34 34 solver_linear(NULL,femmodel); 35 35 36 _printf_("extrude computed thickness on all layers:\n");37 InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,ThicknessEnum);38 39 36 if(verbose)_printf_("saving results:\n"); 40 37 if(solution_type==BalancedthicknessSolutionEnum){ -
issm/trunk/src/c/solutions/balancedvelocities_core.cpp
r4356 r4835 34 34 solver_linear(NULL,femmodel); 35 35 36 _printf_("extrude computed velocity on all layers:\n");37 InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VxEnum);38 InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,VyEnum);39 40 36 if(verbose)_printf_("saving results:\n"); 41 37 if(solution_type==BalancedvelocitiesSolutionEnum){ -
issm/trunk/src/c/solutions/bedslope_core.cpp
r4356 r4835 32 32 solver_linear(NULL,femmodel); 33 33 34 /*extrude inputs if we are in 3D: */35 if (dim==3){36 if(verbose)_printf_("%s\n","extruding bed in 3d...");37 InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,BedSlopeXEnum);38 InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,BedSlopeYEnum);39 }40 41 34 if(verbose)_printf_("saving results:\n"); 42 35 if(solution_type==BedSlopeSolutionEnum){ -
issm/trunk/src/c/solutions/prognostic_core.cpp
r4356 r4835 31 31 solver_linear(NULL,femmodel); 32 32 33 _printf_("extrude computed thickness on all layers:\n");34 InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,ThicknessEnum);35 36 33 if(verbose)_printf_("saving results:\n"); 37 34 if(solution_type==PrognosticSolutionEnum){ -
issm/trunk/src/c/solutions/surfaceslope_core.cpp
r4356 r4835 32 32 solver_linear(NULL,femmodel); 33 33 34 /*extrude inputs if we are in 3D: */35 if (dim==3){36 if(verbose)_printf_("%s\n","extruding slope in 3d...");37 InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,SurfaceSlopeXEnum);38 InputExtrudex(femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,SurfaceSlopeYEnum);39 }40 41 34 if(verbose)_printf_("saving results:\n"); 42 35 if(solution_type==SurfaceSlopeSolutionEnum){ -
issm/trunk/src/m/solutions/balancedthickness_core.m
r4481 r4835 19 19 displaystring(verbose,'\n%s',['call computational core...']); 20 20 femmodel=solver_linear(femmodel); 21 22 displaystring(verbose,'\n%s',['extude computed thickness on all layers...']);23 femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,ThicknessEnum);24 21 25 22 if solution_type==BalancedthicknessSolutionEnum, -
issm/trunk/src/m/solutions/balancedvelocities_core.m
r4366 r4835 23 23 femmodel=solver_linear(femmodel); 24 24 25 displaystring(verbose,'\n%s',['extude computed thickness on all layers...']);26 femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,VxEnum);27 femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,VyEnum);28 29 25 if solution_type==BalancedvelocitiesSolutionEnum, 30 26 displaystring(verbose,'\n%s',['saving results...']); -
issm/trunk/src/m/solutions/bedslope_core.m
r4438 r4835 19 19 femmodel=solver_linear(femmodel); 20 20 21 %extrude inputs if we are in 3D: */22 if dim==3,23 displaystring(verbose,'\n%s',['extruding bed slope in 3d...']);24 femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,femmodel.parameters,BedSlopeXEnum);25 femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,femmodel.parameters,BedSlopeYEnum);26 end27 28 21 if solution_type==BedSlopeSolutionEnum, 29 22 displaystring(verbose,'\n%s',['saving results...']); -
issm/trunk/src/m/solutions/prognostic_core.m
r4366 r4835 19 19 femmodel=solver_linear(femmodel); 20 20 21 displaystring(verbose,'\n%s',['extude computed thickness on all layers...']);22 femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,ThicknessEnum);23 24 21 if solution_type==PrognosticSolutionEnum, 25 22 displaystring(verbose,'\n%s',['saving results...']); -
issm/trunk/src/m/solutions/surfaceslope_core.m
r4415 r4835 19 19 femmodel=solver_linear(femmodel); 20 20 21 %extrude inputs if we are in 3D: */22 if dim==3,23 displaystring(verbose,'\n%s',['extruding surface slope in 3d...']);24 femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,femmodel.parameters,SurfaceSlopeXEnum);25 femmodel.elements=InputExtrude(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,femmodel.parameters,SurfaceSlopeYEnum);26 end27 28 21 if solution_type==SurfaceSlopeSolutionEnum, 29 22 displaystring(verbose,'\n%s',['saving results...']);
Note:
See TracChangeset
for help on using the changeset viewer.