Changeset 5746


Ignore:
Timestamp:
09/10/10 11:20:29 (15 years ago)
Author:
Mathieu Morlighem
Message:

Cleaned elements

Location:
issm/trunk/src/c/objects/Elements
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r5745 r5746  
    521521       
    522522        /*flags: */
    523         bool onbed;
    524523        int  approximation;
    525524
     
    535534        if (approximation!=StokesApproximationEnum) ISSMERROR("Not supported yet!");
    536535
    537         /*recover some inputs: */
    538         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    539 
    540536        /*retrieve some parameters: */
    541537        this->parameters->FindParam(&stokesreconditioning,StokesReconditioningEnum);
    542538       
    543         if(!onbed){
     539        if(!IsOnBed()){
    544540                //put zero
    545541                VecSetValue(sigma_b,id-1,0.0,INSERT_VALUES);
     
    644640        Tria* tria=NULL;
    645641
    646         /*flags: */
    647         bool onbed;
    648         bool onwater;
    649         bool onsurface;
     642        /*recover some inputs: */
    650643        int  approximation;
    651 
    652         /*recover some inputs: */
    653         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    654         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    655         inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
    656644        inputs->GetParameterValue(&approximation,ApproximationEnum);
    657645
    658646        /*If on water, return 0: */
    659         if(onwater)return 0;
     647        if(IsOnWater())return 0;
    660648
    661649        /*Bail out if this element if:
    662650         * -> Not MacAyeal and not on the surface
    663651         * -> MacAyeal (2d model) and not on bed) */
    664         if ((approximation!=MacAyealApproximationEnum && !onsurface) || (approximation==MacAyealApproximationEnum && !onbed)){
     652        if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
    665653                return 0;
    666654        }
     
    953941void  Penta::Gradj(Vec gradient,int control_type){
    954942
    955         /*inputs: */
    956         bool onwater;
    957 
    958         /*retrieve inputs :*/
    959         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    960 
    961943        /*If on water, skip grad (=0): */
    962         if(onwater)return;
     944        if(IsOnWater())return;
    963945
    964946        if (control_type==DragCoefficientEnum){
     
    1011993        double cm_min,cm_max;
    1012994        int    control_type;
    1013         bool   onbed;
    1014995
    1015996        /*retrieve some parameters: */
     
    10221003
    10231004                /*The update is done by the element on bed only*/
    1024                 inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    1025                 if (!onbed) return;
     1005                if (!IsOnBed()) return;
    10261006
    10271007                /*First, get revert to previous parameter value (kept in ControlParameter input)*/
     
    10741054
    10751055        /*Intermediaries*/
    1076         bool onbed;
    10771056        int  step,i;
    10781057
     
    10901069
    10911070        /*recover parameters: */
    1092         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    10931071
    10941072        /*Are we on the base? If not, return*/
    1095         if(!onbed) return;
     1073        if(!IsOnBed()) return;
    10961074
    10971075        /*OK, we are on bed. Initialize global inputs as 0*/
     
    13891367
    13901368        /*inputs: */
    1391         bool onwater;
    1392         bool onsurface;
    1393         bool onbed;
    13941369        int  approximation;
    13951370
    13961371        /*retrieve inputs :*/
    1397         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    1398         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    1399         inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
    14001372        inputs->GetParameterValue(&approximation,ApproximationEnum);
    14011373
    14021374        /*If on water, return 0: */
    1403         if(onwater)return 0;
     1375        if(IsOnWater())return 0;
    14041376        ISSMERROR("Not implemented yet");
    14051377
     
    14171389
    14181390        /*inputs: */
    1419         bool onwater;
    1420         bool onsurface;
    1421         bool onbed;
    14221391        int  approximation;
    14231392
    14241393        /*retrieve inputs :*/
    1425         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    1426         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    1427         inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
    14281394        inputs->GetParameterValue(&approximation,ApproximationEnum);
    14291395
    14301396        /*If on water, return 0: */
    1431         if(onwater)return 0;
     1397        if(IsOnWater())return 0;
    14321398
    14331399        /*Bail out if this element if:
    14341400         * -> Non MacAyeal and not on the surface
    14351401         * -> MacAyeal (2d model) and not on bed) */
    1436         if ((approximation!=MacAyealApproximationEnum && !onsurface) || (approximation==MacAyealApproximationEnum && !onbed)){
     1402        if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
    14371403                return 0;
    14381404        }
     
    14621428
    14631429        /*inputs: */
    1464         bool onwater;
    1465         bool onsurface;
    1466         bool onbed;
    14671430        int  approximation;
    14681431
    14691432        /*retrieve inputs :*/
    1470         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    1471         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    1472         inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
    14731433        inputs->GetParameterValue(&approximation,ApproximationEnum);
    14741434
    14751435        /*If on water, return 0: */
    1476         if(onwater)return 0;
     1436        if(IsOnWater())return 0;
    14771437
    14781438        /*Bail out if this element if:
    14791439         * -> Non MacAyeal and not on the surface
    14801440         * -> MacAyeal (2d model) and not on bed) */
    1481         if ((approximation!=MacAyealApproximationEnum && !onsurface) || (approximation==MacAyealApproximationEnum && !onbed)){
     1441        if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
    14821442                return 0;
    14831443        }
     
    15071467
    15081468        /*inputs: */
    1509         bool onwater;
    1510         bool onsurface;
    1511         bool onbed;
    15121469        int  approximation;
    15131470
    15141471        /*retrieve inputs :*/
    1515         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    1516         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    1517         inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
    15181472        inputs->GetParameterValue(&approximation,ApproximationEnum);
    15191473
    15201474        /*If on water, return 0: */
    1521         if(onwater)return 0;
     1475        if(IsOnWater())return 0;
    15221476
    15231477        /*Bail out if this element if:
    15241478         * -> Non MacAyeal and not on the surface
    15251479         * -> MacAyeal (2d model) and not on bed) */
    1526         if ((approximation!=MacAyealApproximationEnum && !onsurface) || (approximation==MacAyealApproximationEnum && !onbed)){
     1480        if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
    15271481                return 0;
    15281482        }
     
    15521506
    15531507        /*inputs: */
    1554         bool onwater;
    1555         bool onsurface;
    1556         bool onbed;
    15571508        int  approximation;
    15581509
    15591510        /*retrieve inputs :*/
    1560         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    1561         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    1562         inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
    15631511        inputs->GetParameterValue(&approximation,ApproximationEnum);
    15641512
    15651513        /*If on water, return 0: */
    1566         if(onwater)return 0;
     1514        if(IsOnWater())return 0;
    15671515
    15681516        /*Bail out if this element if:
    15691517         * -> Non MacAyeal and not on the surface
    15701518         * -> MacAyeal (2d model) and not on bed) */
    1571         if ((approximation!=MacAyealApproximationEnum && !onsurface) || (approximation==MacAyealApproximationEnum && !onbed)){
     1519        if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
    15721520                return 0;
    15731521        }
     
    15971545
    15981546        /*inputs: */
    1599         bool onwater;
    1600         bool onsurface;
    1601         bool onbed;
    16021547        int  approximation;
    16031548
    16041549        /*retrieve inputs :*/
    1605         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    1606         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    1607         inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
    16081550        inputs->GetParameterValue(&approximation,ApproximationEnum);
    16091551
    16101552        /*If on water, return 0: */
    1611         if(onwater)return 0;
     1553        if(IsOnWater())return 0;
    16121554
    16131555        /*Bail out if this element if:
    16141556         * -> Non MacAyeal and not on the surface
    16151557         * -> MacAyeal (2d model) and not on bed) */
    1616         if ((approximation!=MacAyealApproximationEnum && !onsurface) || (approximation==MacAyealApproximationEnum && !onbed)){
     1558        if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
    16171559                return 0;
    16181560        }
     
    17241666
    17251667        /*inputs: */
    1726         bool onwater;
    1727         bool onsurface;
    1728         bool onbed;
    17291668        int  approximation;
    17301669
    17311670        /*retrieve inputs :*/
    1732         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    1733         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    1734         inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
    17351671        inputs->GetParameterValue(&approximation,ApproximationEnum);
    17361672
    17371673        /*If on water, return 0: */
    1738         if(onwater)return 0;
     1674        if(IsOnWater())return 0;
    17391675
    17401676        /*Bail out if this element if:
    17411677         * -> Non MacAyeal not on the surface
    17421678         * -> MacAyeal (2d model) and not on bed) */
    1743         if ((approximation!=MacAyealApproximationEnum && !onsurface) || (approximation==MacAyealApproximationEnum && !onbed)){
     1679        if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){
    17441680                return 0;
    17451681        }
     
    20411977        Tria*  tria=NULL;
    20421978
    2043         /*flags: */
    2044         bool onwater;
    2045         bool onbed;
    2046 
    2047         /*recover some inputs: */
    2048         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    2049         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    2050 
    20511979        /*If on water, skip: */
    2052         if(onwater)return;
     1980        if(IsOnWater())return;
    20531981
    20541982        /*Is this element on the bed? :*/
    2055         if(!onbed)return;
     1983        if(!IsOnBed())return;
    20561984
    20571985        /*Depth Averaging Vx and Vy*/
     
    20792007        Tria*  tria=NULL;
    20802008
    2081         /*flags: */
    2082         bool onbed;
    2083         bool onwater;
    2084 
    2085         /*recover some inputs: */
    2086         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    2087         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    2088 
    20892009        /*If on water, skip: */
    2090         if(onwater)return;
     2010        if(IsOnWater())return;
    20912011
    20922012        /*Is this element on the bed? :*/
    2093         if(!onbed)return;
     2013        if(!IsOnBed())return;
    20942014
    20952015        /*Depth Averaging Vx and Vy*/
     
    21662086
    21672087        /*inputs: */
    2168         bool onwater;
    2169         bool onbed;
    2170         bool shelf;
    21712088        Input* vx_input=NULL;
    21722089        Input* vy_input=NULL;
     
    21742091        Input* vyold_input=NULL;
    21752092
    2176         /*retrieve inputs :*/
    2177         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    2178         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    2179         inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    2180 
    21812093        /*retrieve some parameters: */
    21822094        this->parameters->FindParam(&viscosity_overshoot,ViscosityOvershootEnum);
    21832095
    21842096        /*If on water, skip stiffness: */
    2185         if(onwater)return;
     2097        if(IsOnWater())return;
    21862098
    21872099        /*Find penta on bed as pattyn must be coupled to the dofs on the bed: */
     
    22462158
    22472159        //Deal with 2d friction at the bedrock interface
    2248         if((onbed && !shelf)){
     2160        if(IsOnBed() && !IsOnShelf()){
    22492161
    22502162                /*Build a tria element using the 3 grids of the base of the penta. Then use
     
    22712183        int*      doflist=NULL;
    22722184        double    Ke_gg[numdofs][numdofs]={0.0};
    2273         bool      onbed;
    2274         bool      onsurface;
    22752185        int       connectivity[2];
    22762186        double    one0,one1;
    22772187        int       i0,i1,j0,j1;
    22782188       
    2279         /*flags: */
    2280         bool onwater;
    2281        
    2282         /*recover some inputs: */
    2283         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    2284        
    22852189        /*If on water, skip: */
    2286         if(onwater)return;
    2287 
    2288         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    2289         inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
     2190        if(IsOnWater())return;
    22902191
    22912192        GetDofList(&doflist);
     
    23072208
    23082209                /*Create matrix for these two nodes*/
    2309                 if (onbed && onsurface){
     2210                if (IsOnBed() && IsOnSurface()){
    23102211                        Ke_gg[i0][i0]=one0;
    23112212                        Ke_gg[i1][i1]=one0;
     
    23152216                        Ke_gg[j1][j1]=one1;
    23162217                }
    2317                 else if (onbed){
     2218                else if (IsOnBed()){
    23182219                        Ke_gg[i0][i0]=one0;
    23192220                        Ke_gg[i1][i1]=one0;
     
    23232224                        Ke_gg[j1][j1]=2*one1;
    23242225                }
    2325                 else if (onsurface){
     2226                else if (IsOnSurface()){
    23262227                        Ke_gg[j0][i0]=-one1;
    23272228                        Ke_gg[j0][j0]=one1;
     
    24022303
    24032304        /*inputs: */
    2404         bool onwater;
    2405         bool onbed;
    2406         bool shelf;
    24072305        int  approximation;
    24082306        Input* vx_input=NULL;
     
    24122310
    24132311        inputs->GetParameterValue(&approximation,ApproximationEnum);
    2414         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    2415         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    2416         inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    24172312
    24182313        /*If on water, skip stiffness: */
    24192314        if(approximation==MacAyealApproximationEnum){
    2420                 if(onwater)return;
     2315                if(IsOnWater())return;
    24212316
    24222317                /*Figure out if this pentaelem is collapsed. If so, then bailout, except if it is at the
     
    24242319                  the stiffness matrix. */
    24252320
    2426                 if (onbed==0){
     2321                if (!IsOnBed()){
    24272322                        /*This element should be collapsed, but this element is not on the bedrock, therefore all its
    24282323                         * dofs have already been frozen! Do nothing: */
    24292324                        return;
    24302325                }
    2431                 else if (onbed==1){
     2326                else{
    24322327
    24332328                        /*This element should be collapsed into a tria element at its base. Create this tria element,
     
    24532348
    24542349                /*If on water, skip stiffness: */
    2455                 if(onwater)return;
     2350                if(IsOnWater())return;
    24562351
    24572352                /*Find penta on bed as this is a macayeal elements: */
     
    25122407
    25132408                //Deal with 2d friction at the bedrock interface
    2514                 if((onbed && !shelf)){
     2409                if(IsOnBed() && !IsOnShelf()){
    25152410                        /*Build a tria element using the 3 grids of the base of the penta. Then use
    25162411                         * the tria functionality to build a friction stiffness matrix on these 3
     
    25852480
    25862481        /*inputs: */
    2587         bool onwater;
    2588         bool onbed;
    2589         bool shelf;
    25902482        Input* vx_input=NULL;
    25912483        Input* vy_input=NULL;
     
    25932485        Input* vyold_input=NULL;
    25942486
    2595         /*retrieve inputs :*/
    2596         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    2597         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    2598         inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    2599 
    26002487        /*retrieve some parameters: */
    26012488        this->parameters->FindParam(&viscosity_overshoot,ViscosityOvershootEnum);
    26022489
    26032490        /*If on water, skip stiffness: */
    2604         if(onwater)return;
     2491        if(IsOnWater())return;
    26052492
    26062493        /*Implement standard penta element: */
     
    26592546
    26602547        //Deal with 2d friction at the bedrock interface
    2661         if((onbed && !shelf)){
     2548        if(IsOnBed() && !IsOnShelf()){
    26622549                /*Build a tria element using the 3 grids of the base of the penta. Then use
    26632550                 * the tria functionality to build a friction stiffness matrix on these 3
     
    27162603        int approximation;
    27172604
    2718         /*inputs: */
    2719         bool onwater;
    2720         bool onbed;
    2721         bool shelf;
    2722 
    27232605        /*retrive parameters: */
    27242606        parameters->FindParam(&analysis_type,AnalysisTypeEnum);
     
    27262608
    27272609        /*retrieve inputs :*/
    2728         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    2729         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    2730         inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    27312610        inputs->GetParameterValue(&approximation,ApproximationEnum);
    27322611
    27332612        /*If on water or not Stokes, skip stiffness: */
    2734         if(onwater || approximation!=StokesApproximationEnum) return;
     2613        if(IsOnWater() || approximation!=StokesApproximationEnum) return;
    27352614
    27362615        /* Get node coordinates and dof list: */
     
    27792658        delete gauss; //gauss of previous loop
    27802659
    2781         if((onbed==1) && (shelf==0)){
     2660        if(IsOnBed() && !IsOnShelf()){
    27822661
    27832662                /*build friction object, used later on: */
     
    28432722                delete gauss;
    28442723
    2845         } //if ( (onbed==1) && (shelf==0))
     2724        } //if ( (IsOnBed()==1) && (IsOnShelf()==0))
    28462725
    28472726        /*Reduce the matrix */
     
    28812760        Tria*  tria=NULL;
    28822761
    2883         /*inputs: */
    2884         bool onwater;
    2885         bool onsurface;
    2886 
    2887         /*retrieve inputs :*/
    2888         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    2889         inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
    2890 
    28912762        /*If on water, skip stiffness: */
    2892         if(onwater)return;
     2763        if(IsOnWater())return;
    28932764
    28942765        /*If this element  is on the surface, we have a dynamic boundary condition that applies, as a stiffness
    28952766         * matrix: */
    2896         if(onsurface){
     2767        if(IsOnSurface()){
    28972768                tria=(Tria*)SpawnTria(3,4,5); //nodes 3,4 and 5 are on the surface
    28982769                tria->CreateKMatrixDiagnosticSurfaceVert(Kgg);
     
    29422813        Tria* tria=NULL;
    29432814
    2944         /*inputs: */
    2945         bool onwater;
    2946         bool onbed;
    2947 
    2948         /*retrieve inputs :*/
    2949         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    2950         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    2951 
    29522815        /*If on water, skip: */
    2953         if(onwater)return;
    2954 
    2955         if (!onbed){
     2816        if(IsOnWater())return;
     2817
     2818        if (!IsOnBed()){
    29562819                return;
    29572820        }
     
    29712834        Tria*  tria=NULL;
    29722835
    2973         /*inputs: */
    2974         bool onwater;
    2975         bool onbed;
    2976 
    2977         /*retrieve inputs :*/
    2978         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    2979         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    2980 
    29812836        /*If on water, skip: */
    2982         if(onwater)return;
     2837        if(IsOnWater())return;
    29832838
    29842839        /*Is this element on the bed? :*/
    2985         if(!onbed)return;
     2840        if(!IsOnBed())return;
    29862841
    29872842        /*Depth Averaging Vx and Vy*/
     
    30082863        Tria*  tria=NULL;
    30092864
    3010         /*inputs: */
    3011         bool onwater;
    3012         bool onbed;
    3013 
    3014         /*retrieve inputs :*/
    3015         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    3016         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    3017 
    3018 
    30192865        /*If on water, skip: */
    3020         if(onwater)return;
     2866        if(IsOnWater())return;
    30212867
    30222868        /*Is this element on the bed? :*/
    3023         if(!onbed)return;
     2869        if(!IsOnBed())return;
    30242870
    30252871        /*Spawn Tria element from the base of the Penta: */
     
    30892935
    30902936        /*inputs: */
    3091         bool onwater;
    3092         bool onbed;
    3093         bool shelf;
    30942937        Input* vx_input=NULL;
    30952938        Input* vy_input=NULL;
    30962939        Input* vz_input=NULL;
    30972940
    3098         /*retrieve inputs :*/
    3099         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    3100         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    3101         inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    3102 
    31032941        /*If on water, skip: */
    3104         if(onwater)return;
     2942        if(IsOnWater())return;
    31052943
    31062944        /* Get node coordinates and dof list: */
     
    32143052
    32153053        //Ice/ocean heat exchange flux on ice shelf base
    3216         if(onbed && shelf){
     3054        if(IsOnBed() && IsOnShelf()){
    32173055
    32183056                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
     
    32333071        Tria* tria=NULL;
    32343072
    3235         /*inputs: */
    3236         bool onwater;
    3237         bool onbed;
    3238 
    3239         /*retrieve inputs :*/
    3240         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    3241         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    3242 
    32433073        /*If on water, skip: */
    3244         if(onwater) return;
     3074        if(IsOnWater()) return;
    32453075
    32463076        /*Bail out if this element if:
    32473077         * -> Non MacAyeal and not on the surface
    32483078         * -> MacAyeal(2d model) and not on bed) */
    3249         if (!onbed){
     3079        if (!IsOnBed()){
    32503080                return;
    32513081        }
     
    32673097        Tria* tria=NULL;
    32683098
    3269         /*inputs: */
    3270         bool onwater;
    3271         bool onsurface;
    3272 
    3273         /*retrieve inputs :*/
    3274         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    3275         inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
    3276 
    32773099        /*If on water, skip: */
    3278         if(onwater) return;
     3100        if(IsOnWater()) return;
    32793101
    32803102        /*Bail out if this element if:
    32813103         * -> Non MacAyeal and not on the surface
    32823104         * -> MacAyeal(2d model) and not on bed) */
    3283         if (!onsurface){
     3105        if (!IsOnSurface()){
    32843106                return;
    32853107        }
     
    32993121        Tria*  tria=NULL;
    33003122
    3301         /*flags: */
    3302         bool onbed;
    3303         bool onwater;
    3304 
    3305         /*recover some inputs: */
    3306         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    3307         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    3308 
    33093123        /*If on water, skip: */
    3310         if(onwater)return;
     3124        if(IsOnWater())return;
    33113125
    33123126        /*Is this element on the bed? :*/
    3313         if(!onbed)return;
     3127        if(!IsOnBed())return;
    33143128
    33153129        /*Depth Averaging Vx and Vy*/
     
    33353149        Tria*  tria=NULL;
    33363150
    3337         /*flags: */
    3338         bool onbed;
    3339         bool onwater;
    3340 
    3341         /*recover some inputs: */
    3342         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    3343         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    3344 
    33453151        /*If on water, skip: */
    3346         if(onwater)return;
     3152        if(IsOnWater())return;
    33473153
    33483154        /*Is this element on the bed? :*/
    3349         if(!onbed)return;
     3155        if(!IsOnBed())return;
    33503156
    33513157        /*Depth Averaging Vx and Vy*/
     
    33903196
    33913197        /*flags: */
    3392         bool onwater;
    3393         bool onbed;
    3394         bool onsurface;
    33953198        int  connectivity[2];
    33963199
    3397         /*recover some inputs: */
    3398         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    3399 
    34003200        /*If on water, skip: */
    3401         if(onwater)return;
     3201        if(IsOnWater())return;
    34023202
    34033203        /*recover doflist: */
    34043204        GetDofList(&doflist);
    3405 
    3406         /*recover some inputs: */
    3407         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    3408         inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
    34093205
    34103206        /*recover parameters: */
     
    34533249                        GetSegmentJacobianDeterminant(&Jdet,&xyz_list_segment[0][0],gauss);
    34543250
    3455                         if (onsurface){
     3251                        if (IsOnSurface()){
    34563252                                for(j=0;j<NDOF2;j++) pe_g[2*node1+j]+=constant_part*pow((surface-z_g)/B,n)*slope[j]*Jdet*gauss->weight/(double)connectivity[1];
    34573253                        }
     
    34633259
    34643260                //Deal with lower surface
    3465                 if (onbed){
     3261                if (IsOnBed()){
    34663262                        constant_part=-1.58*pow((double)10.0,-(double)10.0)*rho_ice*gravity*thickness;
    34673263                        ub=constant_part*slope[0];
     
    34863282        Tria* tria=NULL;
    34873283
    3488         /*inputs: */
    3489         bool onwater;
    3490         bool onbed;
    3491 
    3492         /*retrieve inputs :*/
    3493         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    3494         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    3495 
    34963284        /*If on water, skip load: */
    3497         if(onwater)return;
     3285        if(IsOnWater())return;
    34983286
    34993287        /*Figure out if this pentaelem is Macayeal. If so, then bailout, except if it is at the
     
    35013289          the load vector. */
    35023290
    3503         if (onbed==0){
     3291        if (!IsOnBed()){
    35043292                /*This element should be collapsed, but this element is not on the bedrock, therefore all its
    35053293                 * dofs have already been frozen! Do nothing: */
    35063294                return;
    35073295        }
    3508         else if (onbed==1){
     3296        else{
    35093297
    35103298                /*This element should be collapsed into a tria element at its base. Create this tria element,
     
    35473335
    35483336        /*inputs: */
    3549         bool onwater;
    35503337        Input* surface_input=NULL;
    35513338        Input* thickness_input=NULL;
    35523339
    3553         /*retrieve inputs :*/
    3554         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    3555 
    35563340        /*If on water, skip load: */
    3557         if(onwater)return;
     3341        if(IsOnWater())return;
    35583342
    35593343        /*Implement standard penta element: */
     
    36553439
    36563440        /*inputs: */
    3657         bool onwater;
    3658         bool onbed;
    3659         bool shelf;
    36603441        int  approximation;
    36613442        Input* vx_input=NULL;
     
    36653446
    36663447        /*retrieve inputs :*/
    3667         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    3668         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    3669         inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    36703448        inputs->GetParameterValue(&approximation,ApproximationEnum);
    36713449
     
    36743452
    36753453        /*If on water or not Stokes, skip load: */
    3676         if(onwater || approximation!=StokesApproximationEnum) return;
    3677 
    3678         /*If on water, skip load: */
    3679         if(onwater)return;
     3454        if(IsOnWater() || approximation!=StokesApproximationEnum) return;
    36803455
    36813456        /*recovre material parameters: */
     
    37413516
    37423517        /*Deal with 2d friction at the bedrock interface: */
    3743         if ( (onbed==1) && (shelf==1)){
     3518        if(IsOnBed() && IsOnShelf()){
    37443519
    37453520                for(i=0;i<NUMVERTICES2D;i++){
     
    37783553                /*Free ressources:*/
    37793554                delete gauss;
    3780         } //if ( (onbed==1) && (shelf==1))
     3555        } //if ( (IsOnBed()==1) && (IsOnShelf()==1))
    37813556
    37823557        /*Reduce the matrix */
     
    37943569void  Penta::CreatePVectorAdjointStokes(Vec p_g){
    37953570
    3796         int i;
    37973571        Tria* tria=NULL;
    37983572
    3799         /*inputs: */
    3800         bool onwater;
    3801         bool onsurface;
    3802 
    3803         /*retrieve inputs :*/
    3804         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    3805         inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);
    3806 
    38073573        /*If on water, skip: */
    3808         if(onwater || !onsurface)return;
     3574        if(IsOnWater() || !IsOnSurface())return;
    38093575
    38103576        /*Call Tria's function*/
     
    38463612
    38473613        /*inputs: */
    3848         bool onwater;
    3849         bool onbed;
    38503614        Input* vx_input=NULL;
    38513615        Input* vy_input=NULL;
    38523616
    3853         /*retrieve inputs :*/
    3854         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    3855         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    3856 
    38573617        /*If on water, skip: */
    3858         if(onwater)return;
     3618        if(IsOnWater())return;
    38593619
    38603620        /*If we are on the bedrock, spawn a tria on the bedrock, and use it to build the
    38613621         *diagnostic base vertical stifness: */
    3862         if(onbed){
     3622        if(IsOnBed()){
    38633623                tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 are on the bedrock
    38643624                tria->CreatePVectorDiagnosticBaseVert(pg);
     
    39193679        /*Collapsed formulation: */
    39203680        Tria*  tria=NULL;
    3921 
    3922         /*inputs: */
    3923         bool onwater;
    3924         bool onbed;
    3925 
    3926         /*retrieve inputs :*/
    3927         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    3928         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    39293681       
    39303682        /*If on water, skip: */
    3931         if(onwater)return;
     3683        if(IsOnWater())return;
    39323684
    39333685        /*Is this element on the bed? :*/
    3934         if(!onbed)return;
     3686        if(!IsOnBed())return;
    39353687
    39363688        /*Depth Averaging Vx and Vy*/
     
    39563708        Tria*  tria=NULL;
    39573709
    3958         /*inputs: */
    3959         bool onwater;
    3960         bool onbed;
    3961 
    3962         /*retrieve inputs :*/
    3963         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    3964         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    3965 
    39663710        /*If on water, skip: */
    3967         if(onwater)return;
     3711        if(IsOnWater())return;
    39683712
    39693713        /*Is this element on the bed? :*/
    3970         if(!onbed)return;
     3714        if(!IsOnBed())return;
    39713715
    39723716        /*Spawn Tria element from the base of the Penta: */
     
    40313775
    40323776        /*inputs: */
    4033         bool onwater;
    4034         bool onbed;
    4035         bool shelf;
    40363777        Input* vx_input=NULL;
    40373778        Input* vy_input=NULL;
     
    40393780        Input* temperature_input=NULL;
    40403781
    4041         /*retrieve inputs :*/
    4042         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    4043         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    4044         inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    4045 
    40463782        /*retrieve some parameters: */
    40473783        this->parameters->FindParam(&dt,DtEnum);
    40483784
    40493785        /*If on water, skip: */
    4050         if(onwater)return;
     3786        if(IsOnWater())return;
    40513787
    40523788        /* Get node coordinates and dof list: */
     
    41053841
    41063842        /* Ice/ocean heat exchange flux on ice shelf base */
    4107         if(onbed && shelf){
     3843        if(IsOnBed() && IsOnShelf()){
    41083844
    41093845                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
     
    41133849
    41143850        /* Geothermal flux on ice sheet base and basal friction */
    4115         if(onbed && !shelf){
     3851        if(IsOnBed() && !IsOnShelf()){
    41163852
    41173853                tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria.
     
    45804316        TriaVertexInput* triavertexinput=NULL;
    45814317
    4582         /*inputs: */
    4583         bool onwater;
    4584         bool onbed;
     4318        /*retrieve inputs :*/
    45854319        int  approximation;
    4586 
    4587         /*retrieve inputs :*/
    4588         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    4589         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    45904320        inputs->GetParameterValue(&approximation,ApproximationEnum);
    45914321
    45924322        /*If on water, skip: */
    4593         if(onwater)return;
     4323        if(IsOnWater())return;
    45944324
    45954325        if (approximation==MacAyealApproximationEnum){
    45964326                /*Bail out element if MacAyeal (2d) and not on bed*/
    4597                 if (!onbed) return;
     4327                if (!IsOnBed()) return;
    45984328
    45994329                /*This element should be collapsed into a tria element at its base. Create this tria element,
     
    46124342        else{
    46134343                /*Gradient is computed on bed only (Bbar)*/
    4614                 if (!onbed) return;
     4344                if (!IsOnBed()) return;
    46154345
    46164346                /*Depth Average B*/
     
    46364366        double temp_gradient[6]={0,0,0,0,0,0};
    46374367
    4638         /*inputs: */
    4639         bool onwater;
    4640         bool onbed;
    4641         bool shelf;
     4368        /*retrieve inputs :*/
    46424369        int approximation;
    4643 
    4644         /*retrieve inputs :*/
    4645         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    4646         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    4647         inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    46484370        inputs->GetParameterValue(&approximation,ApproximationEnum);
    46494371
    46504372        /*If on water, skip: */
    4651         if(onwater)return;
     4373        if(IsOnWater())return;
    46524374
    46534375        /*If on shelf, skip: */
    4654         if(shelf)return;
     4376        if(IsOnShelf())return;
    46554377
    46564378        /*Bail out if this element does not touch the bedrock: */
    4657         if (!onbed) return;
     4379        if (!IsOnBed()) return;
    46584380
    46594381        if (approximation==MacAyealApproximationEnum || approximation==PattynApproximationEnum){
     
    46824404void  Penta::InputExtrude(int enum_type,int object_type){
    46834405
    4684         bool   onbed;
    46854406        Penta *penta          = NULL;
    46864407        Input *original_input = NULL;
    46874408
    4688         /*recover parameters: */
    4689         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    4690 
    46914409        /*Are we on the base, not on the surface?:*/
    4692         if(onbed){
     4410        if(IsOnBed()){
    46934411
    46944412                /*OK, we are on bed. we will follow the steps:
     
    47414459
    47424460        /*Inputs*/
    4743         bool onbed;
    47444461        int  approximation;
    47454462
    47464463        /*Recover inputs*/
    4747         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    47484464        inputs->GetParameterValue(&approximation,ApproximationEnum);
    47494465
    47504466        /*MacAyeal, everything is done by the element on bed*/
    47514467        if (approximation==MacAyealApproximationEnum){
    4752                 if (!onbed){
     4468                if (!IsOnBed()){
    47534469                        /*Do nothing. Element on bed will take care of it*/
    47544470                        return;
     
    53965112        double     values[numdof];
    53975113        Penta     *penta           = NULL;
    5398         bool       onbed;
    5399 
    5400         /*Recover inputs*/
    5401         inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    54025114
    54035115        /*If not on bed, return*/
    5404         if (!onbed) return;
     5116        if (!IsOnBed()) return;
    54055117
    54065118        /*Get dof list: */
     
    54725184}
    54735185/*}}}*/
     5186/*FUNCTION Penta::IsOnWater {{{1*/
     5187bool   Penta::IsOnWater(){
     5188
     5189        bool onwater;
     5190        inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
     5191        return onwater;
     5192
     5193}
     5194/*}}}*/
    54745195/*FUNCTION Penta::IsOnSurface{{{1*/
    54755196bool Penta::IsOnSurface(void){
  • issm/trunk/src/c/objects/Elements/Penta.h

    r5745 r5746  
    178178                bool      IsOnBed(void);
    179179                bool    IsOnShelf(void);
     180                bool    IsOnWater(void);
    180181                void      ReduceMatrixStokes(double* Ke_reduced, double* Ke_temp);
    181182                void      ReduceVectorStokes(double* Pe_reduced, double* Ke_temp, double* Pe_temp);
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r5745 r5746  
    637637        int        i,j,ig;
    638638        int        control_type;
    639         bool       onwater,shelf;
    640639        double     Jelem = 0;
    641640        double     cm_noisedmp;
     
    648647        this->parameters->FindParam(&control_type,ControlTypeEnum);
    649648        this->parameters->FindParam(&cm_noisedmp,CmNoiseDmpEnum);
    650         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    651         inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    652649        Input* drag_input=inputs->GetInput(DragCoefficientEnum);
    653650        Input* dhdt_input=inputs->GetInput(DhDtEnum);
     
    655652
    656653        /*If on water, return 0: */
    657         if(onwater) return 0;
     654        if(IsOnWater()) return 0;
    658655
    659656        GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
     
    824821        bool onbed;
    825822        inputs->GetParameterValue(&onbed,ElementOnBedEnum);
    826 
    827823        return onbed;
    828824}
     
    830826/*FUNCTION Tria::IsOnShelf {{{1*/
    831827bool   Tria::IsOnShelf(){
    832         /*inputs: */
     828
    833829        bool shelf;
    834 
    835         /*retrieve inputs :*/
    836830        inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    837 
    838831        return shelf;
     832}
     833/*}}}*/
     834/*FUNCTION Tria::IsOnWater {{{1*/
     835bool   Tria::IsOnWater(){
     836
     837        bool water;
     838        inputs->GetParameterValue(&water,ElementOnWaterEnum);
     839        return water;
    839840}
    840841/*}}}*/
     
    876877void  Tria::Gradj(Vec gradient,int control_type){
    877878
    878         /*retrieve inputs :*/
    879         bool onwater;
    880         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    881 
    882879        /*If on water, grad = 0: */
    883         if(onwater)return;
     880        if(IsOnWater())return;
    884881
    885882        switch(control_type){
     
    10091006
    10101007        /*inputs: */
    1011         bool shelf;
    10121008        Input* vx_input=NULL;
    10131009        Input* vy_input=NULL;
     
    10241020        parameters->FindParam(&analysis_type,AnalysisTypeEnum);
    10251021
    1026         /*retrieve inputs :*/
    1027         inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    1028 
    10291022        /*retrieve some parameters: */
    10301023        this->parameters->FindParam(&cm_noisedmp,CmNoiseDmpEnum);
    10311024
    10321025        /*Get out if shelf*/
    1033         if(shelf)return;
     1026        if(IsOnShelf())return;
    10341027
    10351028        /* Get node coordinates and dof list: */
     
    15361529        /*Intermediaries*/
    15371530        int        i,ig;
    1538         bool       onwater;
    15391531        double     thickness,thicknessobs,weight;
    15401532        double     Jdet;
     
    15441536
    15451537        /*If on water, return 0: */
    1546         if(onwater)return 0;
     1538        if(IsOnWater())return 0;
    15471539
    15481540        /* Get node coordinates and dof list: */
     
    15501542
    15511543        /*Retrieve all inputs we will be needing: */
    1552         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    15531544        Input* thickness_input   =inputs->GetInput(ThicknessEnum);   ISSMASSERT(thickness_input);
    15541545        Input* thicknessobs_input=inputs->GetInput(ThicknessObsEnum);ISSMASSERT(thicknessobs_input);
     
    16091600        /* Jacobian: */
    16101601        double Jdet;
    1611 
    1612         /*inputs: */
    1613         bool onwater;
    1614        
    16151602        double  meanvel, epsvel;
    16161603
    1617         /*retrieve inputs :*/
    1618         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    1619 
    16201604        /*If on water, return 0: */
    1621         if(onwater)return 0;
     1605        if(IsOnWater())return 0;
    16221606
    16231607        /* Get node coordinates and dof list: */
     
    17141698        double scalex=1;
    17151699        double scaley=1;
    1716 
    1717         /*inputs: */
    1718         bool onwater;
    1719 
    17201700        double  meanvel, epsvel;
    17211701
    1722         /*retrieve inputs :*/
    1723         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    1724 
    17251702        /*If on water, return 0: */
    1726         if(onwater)return 0;
     1703        if(IsOnWater())return 0;
    17271704
    17281705        /* Get node coordinates and dof list: */
     
    18241801        double scalex=1;
    18251802        double scaley=1;
    1826 
    1827         /*inputs: */
    1828         bool onwater;
    18291803        double  meanvel, epsvel;
    18301804
    1831         /*retrieve inputs :*/
    1832         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    1833 
    18341805        /*If on water, return 0: */
    1835         if(onwater)return 0;
     1806        if(IsOnWater())return 0;
    18361807
    18371808        /* Get node coordinates and dof list: */
     
    19331904        double S=0;
    19341905        int    fit=-1;
    1935 
    1936         /*inputs: */
    1937         bool onwater;
    1938        
    19391906        double  meanvel, epsvel;
    19401907
    1941         /*retrieve inputs :*/
    1942         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    1943 
    19441908        /*If on water, return 0: */
    1945         if(onwater)return 0;
     1909        if(IsOnWater())return 0;
    19461910
    19471911        /* Get node coordinates and dof list: */
     
    20432007        double S=0;
    20442008        int    fit=-1;
    2045 
    2046         /*inputs: */
    2047         bool onwater;
    2048 
    20492009        double  meanvel, epsvel;
    20502010
    2051         /*retrieve inputs :*/
    2052         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    2053 
    20542011        /*If on water, return 0: */
    2055         if(onwater)return 0;
     2012        if(IsOnWater())return 0;
    20562013
    20572014        /* Get node coordinates and dof list: */
     
    21952152        double normal[3];
    21962153
    2197         /*inputs: */
    2198         bool onwater;
    2199 
    2200         /*retrieve inputs :*/
    2201         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    2202 
    22032154        /*If on water, return 0: */
    2204         if(onwater)return 0;
     2155        if(IsOnWater())return 0;
    22052156
    22062157        /* Get node coordinates and dof list: */
     
    29042855        Input* vxold_input=NULL;
    29052856        Input* vyold_input=NULL;
    2906         bool onwater,shelf;
    2907 
    2908         /*retrieve inputs :*/
    2909         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    2910         inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    29112857
    29122858        /*retrieve some parameters: */
     
    29142860
    29152861        /*First, if we are on water, return empty matrix: */
    2916         if(onwater) return;
     2862        if(IsOnWater()) return;
    29172863
    29182864        /* Get node coordinates and dof list: */
     
    29752921
    29762922        /*Do not forget to include friction: */
    2977         if(!shelf){
     2923        if(!IsOnShelf()){
    29782924                CreateKMatrixDiagnosticMacAyealFriction(Kgg);
    29792925        }
     
    30262972
    30272973        /*inputs: */
    3028         bool shelf;
    30292974        int  drag_type;
    30302975        Input* surface_input=NULL;
     
    30372982
    30382983        /*retrieve inputs :*/
    3039         inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    30402984        inputs->GetParameterValue(&drag_type,DragTypeEnum);
    30412985        surface_input=inputs->GetInput(SurfaceEnum);
     
    30492993        GetDofList(&doflistp,PattynApproximationEnum);
    30502994
    3051         if (shelf){
     2995        if (IsOnShelf()){
    30522996                /*no friction, do nothing*/
    30532997                return;
     
    31493093
    31503094        /*inputs: */
    3151         bool shelf;
    31523095        int  drag_type;
    31533096        Input* surface_input=NULL;
     
    31603103
    31613104        /*retrieve inputs :*/
    3162         inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    31633105        inputs->GetParameterValue(&drag_type,DragTypeEnum);
    31643106        surface_input=inputs->GetInput(SurfaceEnum);
     
    31713113        GetDofList(&doflist,MacAyealApproximationEnum);
    31723114
    3173         if (shelf){
     3115        if (IsOnShelf()){
    31743116                /*no friction, do nothing*/
    31753117                return;
     
    32693211
    32703212        /*inputs: */
    3271         bool shelf;
    32723213        int  drag_type;
    32733214        Input* surface_input=NULL;
     
    32803221
    32813222        /*retrieve inputs :*/
    3282         inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    32833223        inputs->GetParameterValue(&drag_type,DragTypeEnum);
    32843224        surface_input=inputs->GetInput(SurfaceEnum);
     
    32913231        GetDofList(&doflist,PattynApproximationEnum);
    32923232
    3293         if (shelf){
     3233        if (IsOnShelf()){
    32943234                /*no friction, do nothing*/
    32953235                return;
     
    33573297        const int numdofs=NUMVERTICES*NDOF2;
    33583298        int*         doflist=NULL;
    3359 
    33603299        double Ke_gg[numdofs][numdofs]={0.0};
    33613300
    3362         /*flags: */
    3363         bool onwater;
    3364 
    3365         /*recover some inputs: */
    3366         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    3367 
    33683301        /*If on water, skip: */
    3369         if(onwater)return;
     3302        if(IsOnWater())return;
    33703303
    33713304        GetDofList(&doflist);
     
    42804213        double  pe_g_gaussian[numdof];
    42814214        double  thickness;
    4282         bool onwater;
    42834215        int  drag_type;
    42844216
    42854217        /*retrieve inputs :*/
    4286         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    42874218        inputs->GetParameterValue(&drag_type,DragTypeEnum);
    42884219        Input* thickness_input=inputs->GetInput(ThicknessEnum); ISSMASSERT(thickness_input);
     
    42914222
    42924223        /*First, if we are on water, return empty vector: */
    4293         if(onwater) return;
     4224        if(IsOnWater()) return;
    42944225
    42954226        /* Get node coordinates and dof list: */
     
    48794810
    48804811        /*flags: */
    4881         bool onwater;
    48824812        Input* slopex_input=NULL;
    48834813        Input* slopey_input=NULL;
     
    48854815        GaussTria* gauss=NULL;
    48864816
    4887         /*recover some inputs: */
    4888         inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
    4889 
    48904817        /*If on water, skip: */
    4891         if(onwater)return;
     4818        if(IsOnWater())return;
    48924819
    48934820        GetDofList(&doflist);
     
    56305557        double l1l2l3[3];
    56315558        double epsilon[3]; /* epsilon=[exx,eyy,exy];*/
    5632         bool shelf;
    56335559        int  drag_type;
    56345560        double  cm_noisedmp;
     
    56395565
    56405566        /*retrieve inputs :*/
    5641         inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);
    56425567        inputs->GetParameterValue(&drag_type,DragTypeEnum);
    56435568        Input* drag_input=inputs->GetInput(DragCoefficientEnum); ISSMASSERT(drag_input);
     
    56475572
    56485573        /*Get out if shelf*/
    5649         if(shelf)return;
     5574        if(IsOnShelf())return;
    56505575
    56515576        /* Get node coordinates and dof list: */
  • issm/trunk/src/c/objects/Elements/Tria.h

    r5745 r5746  
    7777                bool   IsOnBed();
    7878                bool   IsOnShelf();
     79                bool   IsOnWater();
    7980                void   GetSolutionFromInputs(Vec solution);
    8081                void   GetVectorFromInputs(Vec vector,int NameEnum);
Note: See TracChangeset for help on using the changeset viewer.