Changeset 5746
- Timestamp:
- 09/10/10 11:20:29 (15 years ago)
- Location:
- issm/trunk/src/c/objects/Elements
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r5745 r5746 521 521 522 522 /*flags: */ 523 bool onbed;524 523 int approximation; 525 524 … … 535 534 if (approximation!=StokesApproximationEnum) ISSMERROR("Not supported yet!"); 536 535 537 /*recover some inputs: */538 inputs->GetParameterValue(&onbed,ElementOnBedEnum);539 540 536 /*retrieve some parameters: */ 541 537 this->parameters->FindParam(&stokesreconditioning,StokesReconditioningEnum); 542 538 543 if(! onbed){539 if(!IsOnBed()){ 544 540 //put zero 545 541 VecSetValue(sigma_b,id-1,0.0,INSERT_VALUES); … … 644 640 Tria* tria=NULL; 645 641 646 /*flags: */ 647 bool onbed; 648 bool onwater; 649 bool onsurface; 642 /*recover some inputs: */ 650 643 int approximation; 651 652 /*recover some inputs: */653 inputs->GetParameterValue(&onbed,ElementOnBedEnum);654 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);655 inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);656 644 inputs->GetParameterValue(&approximation,ApproximationEnum); 657 645 658 646 /*If on water, return 0: */ 659 if( onwater)return 0;647 if(IsOnWater())return 0; 660 648 661 649 /*Bail out if this element if: 662 650 * -> Not MacAyeal and not on the surface 663 651 * -> MacAyeal (2d model) and not on bed) */ 664 if ((approximation!=MacAyealApproximationEnum && ! onsurface) || (approximation==MacAyealApproximationEnum && !onbed)){652 if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){ 665 653 return 0; 666 654 } … … 953 941 void Penta::Gradj(Vec gradient,int control_type){ 954 942 955 /*inputs: */956 bool onwater;957 958 /*retrieve inputs :*/959 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);960 961 943 /*If on water, skip grad (=0): */ 962 if( onwater)return;944 if(IsOnWater())return; 963 945 964 946 if (control_type==DragCoefficientEnum){ … … 1011 993 double cm_min,cm_max; 1012 994 int control_type; 1013 bool onbed;1014 995 1015 996 /*retrieve some parameters: */ … … 1022 1003 1023 1004 /*The update is done by the element on bed only*/ 1024 inputs->GetParameterValue(&onbed,ElementOnBedEnum); 1025 if (!onbed) return; 1005 if (!IsOnBed()) return; 1026 1006 1027 1007 /*First, get revert to previous parameter value (kept in ControlParameter input)*/ … … 1074 1054 1075 1055 /*Intermediaries*/ 1076 bool onbed;1077 1056 int step,i; 1078 1057 … … 1090 1069 1091 1070 /*recover parameters: */ 1092 inputs->GetParameterValue(&onbed,ElementOnBedEnum);1093 1071 1094 1072 /*Are we on the base? If not, return*/ 1095 if(! onbed) return;1073 if(!IsOnBed()) return; 1096 1074 1097 1075 /*OK, we are on bed. Initialize global inputs as 0*/ … … 1389 1367 1390 1368 /*inputs: */ 1391 bool onwater;1392 bool onsurface;1393 bool onbed;1394 1369 int approximation; 1395 1370 1396 1371 /*retrieve inputs :*/ 1397 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);1398 inputs->GetParameterValue(&onbed,ElementOnBedEnum);1399 inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);1400 1372 inputs->GetParameterValue(&approximation,ApproximationEnum); 1401 1373 1402 1374 /*If on water, return 0: */ 1403 if( onwater)return 0;1375 if(IsOnWater())return 0; 1404 1376 ISSMERROR("Not implemented yet"); 1405 1377 … … 1417 1389 1418 1390 /*inputs: */ 1419 bool onwater;1420 bool onsurface;1421 bool onbed;1422 1391 int approximation; 1423 1392 1424 1393 /*retrieve inputs :*/ 1425 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);1426 inputs->GetParameterValue(&onbed,ElementOnBedEnum);1427 inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);1428 1394 inputs->GetParameterValue(&approximation,ApproximationEnum); 1429 1395 1430 1396 /*If on water, return 0: */ 1431 if( onwater)return 0;1397 if(IsOnWater())return 0; 1432 1398 1433 1399 /*Bail out if this element if: 1434 1400 * -> Non MacAyeal and not on the surface 1435 1401 * -> MacAyeal (2d model) and not on bed) */ 1436 if ((approximation!=MacAyealApproximationEnum && ! onsurface) || (approximation==MacAyealApproximationEnum && !onbed)){1402 if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){ 1437 1403 return 0; 1438 1404 } … … 1462 1428 1463 1429 /*inputs: */ 1464 bool onwater;1465 bool onsurface;1466 bool onbed;1467 1430 int approximation; 1468 1431 1469 1432 /*retrieve inputs :*/ 1470 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);1471 inputs->GetParameterValue(&onbed,ElementOnBedEnum);1472 inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);1473 1433 inputs->GetParameterValue(&approximation,ApproximationEnum); 1474 1434 1475 1435 /*If on water, return 0: */ 1476 if( onwater)return 0;1436 if(IsOnWater())return 0; 1477 1437 1478 1438 /*Bail out if this element if: 1479 1439 * -> Non MacAyeal and not on the surface 1480 1440 * -> MacAyeal (2d model) and not on bed) */ 1481 if ((approximation!=MacAyealApproximationEnum && ! onsurface) || (approximation==MacAyealApproximationEnum && !onbed)){1441 if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){ 1482 1442 return 0; 1483 1443 } … … 1507 1467 1508 1468 /*inputs: */ 1509 bool onwater;1510 bool onsurface;1511 bool onbed;1512 1469 int approximation; 1513 1470 1514 1471 /*retrieve inputs :*/ 1515 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);1516 inputs->GetParameterValue(&onbed,ElementOnBedEnum);1517 inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);1518 1472 inputs->GetParameterValue(&approximation,ApproximationEnum); 1519 1473 1520 1474 /*If on water, return 0: */ 1521 if( onwater)return 0;1475 if(IsOnWater())return 0; 1522 1476 1523 1477 /*Bail out if this element if: 1524 1478 * -> Non MacAyeal and not on the surface 1525 1479 * -> MacAyeal (2d model) and not on bed) */ 1526 if ((approximation!=MacAyealApproximationEnum && ! onsurface) || (approximation==MacAyealApproximationEnum && !onbed)){1480 if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){ 1527 1481 return 0; 1528 1482 } … … 1552 1506 1553 1507 /*inputs: */ 1554 bool onwater;1555 bool onsurface;1556 bool onbed;1557 1508 int approximation; 1558 1509 1559 1510 /*retrieve inputs :*/ 1560 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);1561 inputs->GetParameterValue(&onbed,ElementOnBedEnum);1562 inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);1563 1511 inputs->GetParameterValue(&approximation,ApproximationEnum); 1564 1512 1565 1513 /*If on water, return 0: */ 1566 if( onwater)return 0;1514 if(IsOnWater())return 0; 1567 1515 1568 1516 /*Bail out if this element if: 1569 1517 * -> Non MacAyeal and not on the surface 1570 1518 * -> MacAyeal (2d model) and not on bed) */ 1571 if ((approximation!=MacAyealApproximationEnum && ! onsurface) || (approximation==MacAyealApproximationEnum && !onbed)){1519 if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){ 1572 1520 return 0; 1573 1521 } … … 1597 1545 1598 1546 /*inputs: */ 1599 bool onwater;1600 bool onsurface;1601 bool onbed;1602 1547 int approximation; 1603 1548 1604 1549 /*retrieve inputs :*/ 1605 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);1606 inputs->GetParameterValue(&onbed,ElementOnBedEnum);1607 inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);1608 1550 inputs->GetParameterValue(&approximation,ApproximationEnum); 1609 1551 1610 1552 /*If on water, return 0: */ 1611 if( onwater)return 0;1553 if(IsOnWater())return 0; 1612 1554 1613 1555 /*Bail out if this element if: 1614 1556 * -> Non MacAyeal and not on the surface 1615 1557 * -> MacAyeal (2d model) and not on bed) */ 1616 if ((approximation!=MacAyealApproximationEnum && ! onsurface) || (approximation==MacAyealApproximationEnum && !onbed)){1558 if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){ 1617 1559 return 0; 1618 1560 } … … 1724 1666 1725 1667 /*inputs: */ 1726 bool onwater;1727 bool onsurface;1728 bool onbed;1729 1668 int approximation; 1730 1669 1731 1670 /*retrieve inputs :*/ 1732 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);1733 inputs->GetParameterValue(&onbed,ElementOnBedEnum);1734 inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);1735 1671 inputs->GetParameterValue(&approximation,ApproximationEnum); 1736 1672 1737 1673 /*If on water, return 0: */ 1738 if( onwater)return 0;1674 if(IsOnWater())return 0; 1739 1675 1740 1676 /*Bail out if this element if: 1741 1677 * -> Non MacAyeal not on the surface 1742 1678 * -> MacAyeal (2d model) and not on bed) */ 1743 if ((approximation!=MacAyealApproximationEnum && ! onsurface) || (approximation==MacAyealApproximationEnum && !onbed)){1679 if ((approximation!=MacAyealApproximationEnum && !IsOnSurface()) || (approximation==MacAyealApproximationEnum && !IsOnBed())){ 1744 1680 return 0; 1745 1681 } … … 2041 1977 Tria* tria=NULL; 2042 1978 2043 /*flags: */2044 bool onwater;2045 bool onbed;2046 2047 /*recover some inputs: */2048 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);2049 inputs->GetParameterValue(&onbed,ElementOnBedEnum);2050 2051 1979 /*If on water, skip: */ 2052 if( onwater)return;1980 if(IsOnWater())return; 2053 1981 2054 1982 /*Is this element on the bed? :*/ 2055 if(! onbed)return;1983 if(!IsOnBed())return; 2056 1984 2057 1985 /*Depth Averaging Vx and Vy*/ … … 2079 2007 Tria* tria=NULL; 2080 2008 2081 /*flags: */2082 bool onbed;2083 bool onwater;2084 2085 /*recover some inputs: */2086 inputs->GetParameterValue(&onbed,ElementOnBedEnum);2087 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);2088 2089 2009 /*If on water, skip: */ 2090 if( onwater)return;2010 if(IsOnWater())return; 2091 2011 2092 2012 /*Is this element on the bed? :*/ 2093 if(! onbed)return;2013 if(!IsOnBed())return; 2094 2014 2095 2015 /*Depth Averaging Vx and Vy*/ … … 2166 2086 2167 2087 /*inputs: */ 2168 bool onwater;2169 bool onbed;2170 bool shelf;2171 2088 Input* vx_input=NULL; 2172 2089 Input* vy_input=NULL; … … 2174 2091 Input* vyold_input=NULL; 2175 2092 2176 /*retrieve inputs :*/2177 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);2178 inputs->GetParameterValue(&onbed,ElementOnBedEnum);2179 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);2180 2181 2093 /*retrieve some parameters: */ 2182 2094 this->parameters->FindParam(&viscosity_overshoot,ViscosityOvershootEnum); 2183 2095 2184 2096 /*If on water, skip stiffness: */ 2185 if( onwater)return;2097 if(IsOnWater())return; 2186 2098 2187 2099 /*Find penta on bed as pattyn must be coupled to the dofs on the bed: */ … … 2246 2158 2247 2159 //Deal with 2d friction at the bedrock interface 2248 if( (onbed && !shelf)){2160 if(IsOnBed() && !IsOnShelf()){ 2249 2161 2250 2162 /*Build a tria element using the 3 grids of the base of the penta. Then use … … 2271 2183 int* doflist=NULL; 2272 2184 double Ke_gg[numdofs][numdofs]={0.0}; 2273 bool onbed;2274 bool onsurface;2275 2185 int connectivity[2]; 2276 2186 double one0,one1; 2277 2187 int i0,i1,j0,j1; 2278 2188 2279 /*flags: */2280 bool onwater;2281 2282 /*recover some inputs: */2283 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);2284 2285 2189 /*If on water, skip: */ 2286 if(onwater)return; 2287 2288 inputs->GetParameterValue(&onbed,ElementOnBedEnum); 2289 inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum); 2190 if(IsOnWater())return; 2290 2191 2291 2192 GetDofList(&doflist); … … 2307 2208 2308 2209 /*Create matrix for these two nodes*/ 2309 if ( onbed && onsurface){2210 if (IsOnBed() && IsOnSurface()){ 2310 2211 Ke_gg[i0][i0]=one0; 2311 2212 Ke_gg[i1][i1]=one0; … … 2315 2216 Ke_gg[j1][j1]=one1; 2316 2217 } 2317 else if ( onbed){2218 else if (IsOnBed()){ 2318 2219 Ke_gg[i0][i0]=one0; 2319 2220 Ke_gg[i1][i1]=one0; … … 2323 2224 Ke_gg[j1][j1]=2*one1; 2324 2225 } 2325 else if ( onsurface){2226 else if (IsOnSurface()){ 2326 2227 Ke_gg[j0][i0]=-one1; 2327 2228 Ke_gg[j0][j0]=one1; … … 2402 2303 2403 2304 /*inputs: */ 2404 bool onwater;2405 bool onbed;2406 bool shelf;2407 2305 int approximation; 2408 2306 Input* vx_input=NULL; … … 2412 2310 2413 2311 inputs->GetParameterValue(&approximation,ApproximationEnum); 2414 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);2415 inputs->GetParameterValue(&onbed,ElementOnBedEnum);2416 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);2417 2312 2418 2313 /*If on water, skip stiffness: */ 2419 2314 if(approximation==MacAyealApproximationEnum){ 2420 if( onwater)return;2315 if(IsOnWater())return; 2421 2316 2422 2317 /*Figure out if this pentaelem is collapsed. If so, then bailout, except if it is at the … … 2424 2319 the stiffness matrix. */ 2425 2320 2426 if ( onbed==0){2321 if (!IsOnBed()){ 2427 2322 /*This element should be collapsed, but this element is not on the bedrock, therefore all its 2428 2323 * dofs have already been frozen! Do nothing: */ 2429 2324 return; 2430 2325 } 2431 else if (onbed==1){2326 else{ 2432 2327 2433 2328 /*This element should be collapsed into a tria element at its base. Create this tria element, … … 2453 2348 2454 2349 /*If on water, skip stiffness: */ 2455 if( onwater)return;2350 if(IsOnWater())return; 2456 2351 2457 2352 /*Find penta on bed as this is a macayeal elements: */ … … 2512 2407 2513 2408 //Deal with 2d friction at the bedrock interface 2514 if( (onbed && !shelf)){2409 if(IsOnBed() && !IsOnShelf()){ 2515 2410 /*Build a tria element using the 3 grids of the base of the penta. Then use 2516 2411 * the tria functionality to build a friction stiffness matrix on these 3 … … 2585 2480 2586 2481 /*inputs: */ 2587 bool onwater;2588 bool onbed;2589 bool shelf;2590 2482 Input* vx_input=NULL; 2591 2483 Input* vy_input=NULL; … … 2593 2485 Input* vyold_input=NULL; 2594 2486 2595 /*retrieve inputs :*/2596 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);2597 inputs->GetParameterValue(&onbed,ElementOnBedEnum);2598 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);2599 2600 2487 /*retrieve some parameters: */ 2601 2488 this->parameters->FindParam(&viscosity_overshoot,ViscosityOvershootEnum); 2602 2489 2603 2490 /*If on water, skip stiffness: */ 2604 if( onwater)return;2491 if(IsOnWater())return; 2605 2492 2606 2493 /*Implement standard penta element: */ … … 2659 2546 2660 2547 //Deal with 2d friction at the bedrock interface 2661 if( (onbed && !shelf)){2548 if(IsOnBed() && !IsOnShelf()){ 2662 2549 /*Build a tria element using the 3 grids of the base of the penta. Then use 2663 2550 * the tria functionality to build a friction stiffness matrix on these 3 … … 2716 2603 int approximation; 2717 2604 2718 /*inputs: */2719 bool onwater;2720 bool onbed;2721 bool shelf;2722 2723 2605 /*retrive parameters: */ 2724 2606 parameters->FindParam(&analysis_type,AnalysisTypeEnum); … … 2726 2608 2727 2609 /*retrieve inputs :*/ 2728 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);2729 inputs->GetParameterValue(&onbed,ElementOnBedEnum);2730 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);2731 2610 inputs->GetParameterValue(&approximation,ApproximationEnum); 2732 2611 2733 2612 /*If on water or not Stokes, skip stiffness: */ 2734 if( onwater|| approximation!=StokesApproximationEnum) return;2613 if(IsOnWater() || approximation!=StokesApproximationEnum) return; 2735 2614 2736 2615 /* Get node coordinates and dof list: */ … … 2779 2658 delete gauss; //gauss of previous loop 2780 2659 2781 if( (onbed==1) && (shelf==0)){2660 if(IsOnBed() && !IsOnShelf()){ 2782 2661 2783 2662 /*build friction object, used later on: */ … … 2843 2722 delete gauss; 2844 2723 2845 } //if ( ( onbed==1) && (shelf==0))2724 } //if ( (IsOnBed()==1) && (IsOnShelf()==0)) 2846 2725 2847 2726 /*Reduce the matrix */ … … 2881 2760 Tria* tria=NULL; 2882 2761 2883 /*inputs: */2884 bool onwater;2885 bool onsurface;2886 2887 /*retrieve inputs :*/2888 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);2889 inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);2890 2891 2762 /*If on water, skip stiffness: */ 2892 if( onwater)return;2763 if(IsOnWater())return; 2893 2764 2894 2765 /*If this element is on the surface, we have a dynamic boundary condition that applies, as a stiffness 2895 2766 * matrix: */ 2896 if( onsurface){2767 if(IsOnSurface()){ 2897 2768 tria=(Tria*)SpawnTria(3,4,5); //nodes 3,4 and 5 are on the surface 2898 2769 tria->CreateKMatrixDiagnosticSurfaceVert(Kgg); … … 2942 2813 Tria* tria=NULL; 2943 2814 2944 /*inputs: */2945 bool onwater;2946 bool onbed;2947 2948 /*retrieve inputs :*/2949 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);2950 inputs->GetParameterValue(&onbed,ElementOnBedEnum);2951 2952 2815 /*If on water, skip: */ 2953 if( onwater)return;2954 2955 if (! onbed){2816 if(IsOnWater())return; 2817 2818 if (!IsOnBed()){ 2956 2819 return; 2957 2820 } … … 2971 2834 Tria* tria=NULL; 2972 2835 2973 /*inputs: */2974 bool onwater;2975 bool onbed;2976 2977 /*retrieve inputs :*/2978 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);2979 inputs->GetParameterValue(&onbed,ElementOnBedEnum);2980 2981 2836 /*If on water, skip: */ 2982 if( onwater)return;2837 if(IsOnWater())return; 2983 2838 2984 2839 /*Is this element on the bed? :*/ 2985 if(! onbed)return;2840 if(!IsOnBed())return; 2986 2841 2987 2842 /*Depth Averaging Vx and Vy*/ … … 3008 2863 Tria* tria=NULL; 3009 2864 3010 /*inputs: */3011 bool onwater;3012 bool onbed;3013 3014 /*retrieve inputs :*/3015 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);3016 inputs->GetParameterValue(&onbed,ElementOnBedEnum);3017 3018 3019 2865 /*If on water, skip: */ 3020 if( onwater)return;2866 if(IsOnWater())return; 3021 2867 3022 2868 /*Is this element on the bed? :*/ 3023 if(! onbed)return;2869 if(!IsOnBed())return; 3024 2870 3025 2871 /*Spawn Tria element from the base of the Penta: */ … … 3089 2935 3090 2936 /*inputs: */ 3091 bool onwater;3092 bool onbed;3093 bool shelf;3094 2937 Input* vx_input=NULL; 3095 2938 Input* vy_input=NULL; 3096 2939 Input* vz_input=NULL; 3097 2940 3098 /*retrieve inputs :*/3099 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);3100 inputs->GetParameterValue(&onbed,ElementOnBedEnum);3101 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);3102 3103 2941 /*If on water, skip: */ 3104 if( onwater)return;2942 if(IsOnWater())return; 3105 2943 3106 2944 /* Get node coordinates and dof list: */ … … 3214 3052 3215 3053 //Ice/ocean heat exchange flux on ice shelf base 3216 if( onbed && shelf){3054 if(IsOnBed() && IsOnShelf()){ 3217 3055 3218 3056 tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria. … … 3233 3071 Tria* tria=NULL; 3234 3072 3235 /*inputs: */3236 bool onwater;3237 bool onbed;3238 3239 /*retrieve inputs :*/3240 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);3241 inputs->GetParameterValue(&onbed,ElementOnBedEnum);3242 3243 3073 /*If on water, skip: */ 3244 if( onwater) return;3074 if(IsOnWater()) return; 3245 3075 3246 3076 /*Bail out if this element if: 3247 3077 * -> Non MacAyeal and not on the surface 3248 3078 * -> MacAyeal(2d model) and not on bed) */ 3249 if (! onbed){3079 if (!IsOnBed()){ 3250 3080 return; 3251 3081 } … … 3267 3097 Tria* tria=NULL; 3268 3098 3269 /*inputs: */3270 bool onwater;3271 bool onsurface;3272 3273 /*retrieve inputs :*/3274 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);3275 inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);3276 3277 3099 /*If on water, skip: */ 3278 if( onwater) return;3100 if(IsOnWater()) return; 3279 3101 3280 3102 /*Bail out if this element if: 3281 3103 * -> Non MacAyeal and not on the surface 3282 3104 * -> MacAyeal(2d model) and not on bed) */ 3283 if (! onsurface){3105 if (!IsOnSurface()){ 3284 3106 return; 3285 3107 } … … 3299 3121 Tria* tria=NULL; 3300 3122 3301 /*flags: */3302 bool onbed;3303 bool onwater;3304 3305 /*recover some inputs: */3306 inputs->GetParameterValue(&onbed,ElementOnBedEnum);3307 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);3308 3309 3123 /*If on water, skip: */ 3310 if( onwater)return;3124 if(IsOnWater())return; 3311 3125 3312 3126 /*Is this element on the bed? :*/ 3313 if(! onbed)return;3127 if(!IsOnBed())return; 3314 3128 3315 3129 /*Depth Averaging Vx and Vy*/ … … 3335 3149 Tria* tria=NULL; 3336 3150 3337 /*flags: */3338 bool onbed;3339 bool onwater;3340 3341 /*recover some inputs: */3342 inputs->GetParameterValue(&onbed,ElementOnBedEnum);3343 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);3344 3345 3151 /*If on water, skip: */ 3346 if( onwater)return;3152 if(IsOnWater())return; 3347 3153 3348 3154 /*Is this element on the bed? :*/ 3349 if(! onbed)return;3155 if(!IsOnBed())return; 3350 3156 3351 3157 /*Depth Averaging Vx and Vy*/ … … 3390 3196 3391 3197 /*flags: */ 3392 bool onwater;3393 bool onbed;3394 bool onsurface;3395 3198 int connectivity[2]; 3396 3199 3397 /*recover some inputs: */3398 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);3399 3400 3200 /*If on water, skip: */ 3401 if( onwater)return;3201 if(IsOnWater())return; 3402 3202 3403 3203 /*recover doflist: */ 3404 3204 GetDofList(&doflist); 3405 3406 /*recover some inputs: */3407 inputs->GetParameterValue(&onbed,ElementOnBedEnum);3408 inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);3409 3205 3410 3206 /*recover parameters: */ … … 3453 3249 GetSegmentJacobianDeterminant(&Jdet,&xyz_list_segment[0][0],gauss); 3454 3250 3455 if ( onsurface){3251 if (IsOnSurface()){ 3456 3252 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]; 3457 3253 } … … 3463 3259 3464 3260 //Deal with lower surface 3465 if ( onbed){3261 if (IsOnBed()){ 3466 3262 constant_part=-1.58*pow((double)10.0,-(double)10.0)*rho_ice*gravity*thickness; 3467 3263 ub=constant_part*slope[0]; … … 3486 3282 Tria* tria=NULL; 3487 3283 3488 /*inputs: */3489 bool onwater;3490 bool onbed;3491 3492 /*retrieve inputs :*/3493 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);3494 inputs->GetParameterValue(&onbed,ElementOnBedEnum);3495 3496 3284 /*If on water, skip load: */ 3497 if( onwater)return;3285 if(IsOnWater())return; 3498 3286 3499 3287 /*Figure out if this pentaelem is Macayeal. If so, then bailout, except if it is at the … … 3501 3289 the load vector. */ 3502 3290 3503 if ( onbed==0){3291 if (!IsOnBed()){ 3504 3292 /*This element should be collapsed, but this element is not on the bedrock, therefore all its 3505 3293 * dofs have already been frozen! Do nothing: */ 3506 3294 return; 3507 3295 } 3508 else if (onbed==1){3296 else{ 3509 3297 3510 3298 /*This element should be collapsed into a tria element at its base. Create this tria element, … … 3547 3335 3548 3336 /*inputs: */ 3549 bool onwater;3550 3337 Input* surface_input=NULL; 3551 3338 Input* thickness_input=NULL; 3552 3339 3553 /*retrieve inputs :*/3554 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);3555 3556 3340 /*If on water, skip load: */ 3557 if( onwater)return;3341 if(IsOnWater())return; 3558 3342 3559 3343 /*Implement standard penta element: */ … … 3655 3439 3656 3440 /*inputs: */ 3657 bool onwater;3658 bool onbed;3659 bool shelf;3660 3441 int approximation; 3661 3442 Input* vx_input=NULL; … … 3665 3446 3666 3447 /*retrieve inputs :*/ 3667 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);3668 inputs->GetParameterValue(&onbed,ElementOnBedEnum);3669 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);3670 3448 inputs->GetParameterValue(&approximation,ApproximationEnum); 3671 3449 … … 3674 3452 3675 3453 /*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; 3680 3455 3681 3456 /*recovre material parameters: */ … … 3741 3516 3742 3517 /*Deal with 2d friction at the bedrock interface: */ 3743 if ( (onbed==1) && (shelf==1)){3518 if(IsOnBed() && IsOnShelf()){ 3744 3519 3745 3520 for(i=0;i<NUMVERTICES2D;i++){ … … 3778 3553 /*Free ressources:*/ 3779 3554 delete gauss; 3780 } //if ( ( onbed==1) && (shelf==1))3555 } //if ( (IsOnBed()==1) && (IsOnShelf()==1)) 3781 3556 3782 3557 /*Reduce the matrix */ … … 3794 3569 void Penta::CreatePVectorAdjointStokes(Vec p_g){ 3795 3570 3796 int i;3797 3571 Tria* tria=NULL; 3798 3572 3799 /*inputs: */3800 bool onwater;3801 bool onsurface;3802 3803 /*retrieve inputs :*/3804 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);3805 inputs->GetParameterValue(&onsurface,ElementOnSurfaceEnum);3806 3807 3573 /*If on water, skip: */ 3808 if( onwater || !onsurface)return;3574 if(IsOnWater() || !IsOnSurface())return; 3809 3575 3810 3576 /*Call Tria's function*/ … … 3846 3612 3847 3613 /*inputs: */ 3848 bool onwater;3849 bool onbed;3850 3614 Input* vx_input=NULL; 3851 3615 Input* vy_input=NULL; 3852 3616 3853 /*retrieve inputs :*/3854 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);3855 inputs->GetParameterValue(&onbed,ElementOnBedEnum);3856 3857 3617 /*If on water, skip: */ 3858 if( onwater)return;3618 if(IsOnWater())return; 3859 3619 3860 3620 /*If we are on the bedrock, spawn a tria on the bedrock, and use it to build the 3861 3621 *diagnostic base vertical stifness: */ 3862 if( onbed){3622 if(IsOnBed()){ 3863 3623 tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 are on the bedrock 3864 3624 tria->CreatePVectorDiagnosticBaseVert(pg); … … 3919 3679 /*Collapsed formulation: */ 3920 3680 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);3929 3681 3930 3682 /*If on water, skip: */ 3931 if( onwater)return;3683 if(IsOnWater())return; 3932 3684 3933 3685 /*Is this element on the bed? :*/ 3934 if(! onbed)return;3686 if(!IsOnBed())return; 3935 3687 3936 3688 /*Depth Averaging Vx and Vy*/ … … 3956 3708 Tria* tria=NULL; 3957 3709 3958 /*inputs: */3959 bool onwater;3960 bool onbed;3961 3962 /*retrieve inputs :*/3963 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);3964 inputs->GetParameterValue(&onbed,ElementOnBedEnum);3965 3966 3710 /*If on water, skip: */ 3967 if( onwater)return;3711 if(IsOnWater())return; 3968 3712 3969 3713 /*Is this element on the bed? :*/ 3970 if(! onbed)return;3714 if(!IsOnBed())return; 3971 3715 3972 3716 /*Spawn Tria element from the base of the Penta: */ … … 4031 3775 4032 3776 /*inputs: */ 4033 bool onwater;4034 bool onbed;4035 bool shelf;4036 3777 Input* vx_input=NULL; 4037 3778 Input* vy_input=NULL; … … 4039 3780 Input* temperature_input=NULL; 4040 3781 4041 /*retrieve inputs :*/4042 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);4043 inputs->GetParameterValue(&onbed,ElementOnBedEnum);4044 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);4045 4046 3782 /*retrieve some parameters: */ 4047 3783 this->parameters->FindParam(&dt,DtEnum); 4048 3784 4049 3785 /*If on water, skip: */ 4050 if( onwater)return;3786 if(IsOnWater())return; 4051 3787 4052 3788 /* Get node coordinates and dof list: */ … … 4105 3841 4106 3842 /* Ice/ocean heat exchange flux on ice shelf base */ 4107 if( onbed && shelf){3843 if(IsOnBed() && IsOnShelf()){ 4108 3844 4109 3845 tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria. … … 4113 3849 4114 3850 /* Geothermal flux on ice sheet base and basal friction */ 4115 if( onbed && !shelf){3851 if(IsOnBed() && !IsOnShelf()){ 4116 3852 4117 3853 tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria. … … 4580 4316 TriaVertexInput* triavertexinput=NULL; 4581 4317 4582 /*inputs: */ 4583 bool onwater; 4584 bool onbed; 4318 /*retrieve inputs :*/ 4585 4319 int approximation; 4586 4587 /*retrieve inputs :*/4588 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);4589 inputs->GetParameterValue(&onbed,ElementOnBedEnum);4590 4320 inputs->GetParameterValue(&approximation,ApproximationEnum); 4591 4321 4592 4322 /*If on water, skip: */ 4593 if( onwater)return;4323 if(IsOnWater())return; 4594 4324 4595 4325 if (approximation==MacAyealApproximationEnum){ 4596 4326 /*Bail out element if MacAyeal (2d) and not on bed*/ 4597 if (! onbed) return;4327 if (!IsOnBed()) return; 4598 4328 4599 4329 /*This element should be collapsed into a tria element at its base. Create this tria element, … … 4612 4342 else{ 4613 4343 /*Gradient is computed on bed only (Bbar)*/ 4614 if (! onbed) return;4344 if (!IsOnBed()) return; 4615 4345 4616 4346 /*Depth Average B*/ … … 4636 4366 double temp_gradient[6]={0,0,0,0,0,0}; 4637 4367 4638 /*inputs: */ 4639 bool onwater; 4640 bool onbed; 4641 bool shelf; 4368 /*retrieve inputs :*/ 4642 4369 int approximation; 4643 4644 /*retrieve inputs :*/4645 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);4646 inputs->GetParameterValue(&onbed,ElementOnBedEnum);4647 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);4648 4370 inputs->GetParameterValue(&approximation,ApproximationEnum); 4649 4371 4650 4372 /*If on water, skip: */ 4651 if( onwater)return;4373 if(IsOnWater())return; 4652 4374 4653 4375 /*If on shelf, skip: */ 4654 if( shelf)return;4376 if(IsOnShelf())return; 4655 4377 4656 4378 /*Bail out if this element does not touch the bedrock: */ 4657 if (! onbed) return;4379 if (!IsOnBed()) return; 4658 4380 4659 4381 if (approximation==MacAyealApproximationEnum || approximation==PattynApproximationEnum){ … … 4682 4404 void Penta::InputExtrude(int enum_type,int object_type){ 4683 4405 4684 bool onbed;4685 4406 Penta *penta = NULL; 4686 4407 Input *original_input = NULL; 4687 4408 4688 /*recover parameters: */4689 inputs->GetParameterValue(&onbed,ElementOnBedEnum);4690 4691 4409 /*Are we on the base, not on the surface?:*/ 4692 if( onbed){4410 if(IsOnBed()){ 4693 4411 4694 4412 /*OK, we are on bed. we will follow the steps: … … 4741 4459 4742 4460 /*Inputs*/ 4743 bool onbed;4744 4461 int approximation; 4745 4462 4746 4463 /*Recover inputs*/ 4747 inputs->GetParameterValue(&onbed,ElementOnBedEnum);4748 4464 inputs->GetParameterValue(&approximation,ApproximationEnum); 4749 4465 4750 4466 /*MacAyeal, everything is done by the element on bed*/ 4751 4467 if (approximation==MacAyealApproximationEnum){ 4752 if (! onbed){4468 if (!IsOnBed()){ 4753 4469 /*Do nothing. Element on bed will take care of it*/ 4754 4470 return; … … 5396 5112 double values[numdof]; 5397 5113 Penta *penta = NULL; 5398 bool onbed;5399 5400 /*Recover inputs*/5401 inputs->GetParameterValue(&onbed,ElementOnBedEnum);5402 5114 5403 5115 /*If not on bed, return*/ 5404 if (! onbed) return;5116 if (!IsOnBed()) return; 5405 5117 5406 5118 /*Get dof list: */ … … 5472 5184 } 5473 5185 /*}}}*/ 5186 /*FUNCTION Penta::IsOnWater {{{1*/ 5187 bool Penta::IsOnWater(){ 5188 5189 bool onwater; 5190 inputs->GetParameterValue(&onwater,ElementOnWaterEnum); 5191 return onwater; 5192 5193 } 5194 /*}}}*/ 5474 5195 /*FUNCTION Penta::IsOnSurface{{{1*/ 5475 5196 bool Penta::IsOnSurface(void){ -
issm/trunk/src/c/objects/Elements/Penta.h
r5745 r5746 178 178 bool IsOnBed(void); 179 179 bool IsOnShelf(void); 180 bool IsOnWater(void); 180 181 void ReduceMatrixStokes(double* Ke_reduced, double* Ke_temp); 181 182 void ReduceVectorStokes(double* Pe_reduced, double* Ke_temp, double* Pe_temp); -
issm/trunk/src/c/objects/Elements/Tria.cpp
r5745 r5746 637 637 int i,j,ig; 638 638 int control_type; 639 bool onwater,shelf;640 639 double Jelem = 0; 641 640 double cm_noisedmp; … … 648 647 this->parameters->FindParam(&control_type,ControlTypeEnum); 649 648 this->parameters->FindParam(&cm_noisedmp,CmNoiseDmpEnum); 650 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);651 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);652 649 Input* drag_input=inputs->GetInput(DragCoefficientEnum); 653 650 Input* dhdt_input=inputs->GetInput(DhDtEnum); … … 655 652 656 653 /*If on water, return 0: */ 657 if( onwater) return 0;654 if(IsOnWater()) return 0; 658 655 659 656 GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES); … … 824 821 bool onbed; 825 822 inputs->GetParameterValue(&onbed,ElementOnBedEnum); 826 827 823 return onbed; 828 824 } … … 830 826 /*FUNCTION Tria::IsOnShelf {{{1*/ 831 827 bool Tria::IsOnShelf(){ 832 /*inputs: */ 828 833 829 bool shelf; 834 835 /*retrieve inputs :*/836 830 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum); 837 838 831 return shelf; 832 } 833 /*}}}*/ 834 /*FUNCTION Tria::IsOnWater {{{1*/ 835 bool Tria::IsOnWater(){ 836 837 bool water; 838 inputs->GetParameterValue(&water,ElementOnWaterEnum); 839 return water; 839 840 } 840 841 /*}}}*/ … … 876 877 void Tria::Gradj(Vec gradient,int control_type){ 877 878 878 /*retrieve inputs :*/879 bool onwater;880 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);881 882 879 /*If on water, grad = 0: */ 883 if( onwater)return;880 if(IsOnWater())return; 884 881 885 882 switch(control_type){ … … 1009 1006 1010 1007 /*inputs: */ 1011 bool shelf;1012 1008 Input* vx_input=NULL; 1013 1009 Input* vy_input=NULL; … … 1024 1020 parameters->FindParam(&analysis_type,AnalysisTypeEnum); 1025 1021 1026 /*retrieve inputs :*/1027 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);1028 1029 1022 /*retrieve some parameters: */ 1030 1023 this->parameters->FindParam(&cm_noisedmp,CmNoiseDmpEnum); 1031 1024 1032 1025 /*Get out if shelf*/ 1033 if( shelf)return;1026 if(IsOnShelf())return; 1034 1027 1035 1028 /* Get node coordinates and dof list: */ … … 1536 1529 /*Intermediaries*/ 1537 1530 int i,ig; 1538 bool onwater;1539 1531 double thickness,thicknessobs,weight; 1540 1532 double Jdet; … … 1544 1536 1545 1537 /*If on water, return 0: */ 1546 if( onwater)return 0;1538 if(IsOnWater())return 0; 1547 1539 1548 1540 /* Get node coordinates and dof list: */ … … 1550 1542 1551 1543 /*Retrieve all inputs we will be needing: */ 1552 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);1553 1544 Input* thickness_input =inputs->GetInput(ThicknessEnum); ISSMASSERT(thickness_input); 1554 1545 Input* thicknessobs_input=inputs->GetInput(ThicknessObsEnum);ISSMASSERT(thicknessobs_input); … … 1609 1600 /* Jacobian: */ 1610 1601 double Jdet; 1611 1612 /*inputs: */1613 bool onwater;1614 1615 1602 double meanvel, epsvel; 1616 1603 1617 /*retrieve inputs :*/1618 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);1619 1620 1604 /*If on water, return 0: */ 1621 if( onwater)return 0;1605 if(IsOnWater())return 0; 1622 1606 1623 1607 /* Get node coordinates and dof list: */ … … 1714 1698 double scalex=1; 1715 1699 double scaley=1; 1716 1717 /*inputs: */1718 bool onwater;1719 1720 1700 double meanvel, epsvel; 1721 1701 1722 /*retrieve inputs :*/1723 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);1724 1725 1702 /*If on water, return 0: */ 1726 if( onwater)return 0;1703 if(IsOnWater())return 0; 1727 1704 1728 1705 /* Get node coordinates and dof list: */ … … 1824 1801 double scalex=1; 1825 1802 double scaley=1; 1826 1827 /*inputs: */1828 bool onwater;1829 1803 double meanvel, epsvel; 1830 1804 1831 /*retrieve inputs :*/1832 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);1833 1834 1805 /*If on water, return 0: */ 1835 if( onwater)return 0;1806 if(IsOnWater())return 0; 1836 1807 1837 1808 /* Get node coordinates and dof list: */ … … 1933 1904 double S=0; 1934 1905 int fit=-1; 1935 1936 /*inputs: */1937 bool onwater;1938 1939 1906 double meanvel, epsvel; 1940 1907 1941 /*retrieve inputs :*/1942 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);1943 1944 1908 /*If on water, return 0: */ 1945 if( onwater)return 0;1909 if(IsOnWater())return 0; 1946 1910 1947 1911 /* Get node coordinates and dof list: */ … … 2043 2007 double S=0; 2044 2008 int fit=-1; 2045 2046 /*inputs: */2047 bool onwater;2048 2049 2009 double meanvel, epsvel; 2050 2010 2051 /*retrieve inputs :*/2052 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);2053 2054 2011 /*If on water, return 0: */ 2055 if( onwater)return 0;2012 if(IsOnWater())return 0; 2056 2013 2057 2014 /* Get node coordinates and dof list: */ … … 2195 2152 double normal[3]; 2196 2153 2197 /*inputs: */2198 bool onwater;2199 2200 /*retrieve inputs :*/2201 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);2202 2203 2154 /*If on water, return 0: */ 2204 if( onwater)return 0;2155 if(IsOnWater())return 0; 2205 2156 2206 2157 /* Get node coordinates and dof list: */ … … 2904 2855 Input* vxold_input=NULL; 2905 2856 Input* vyold_input=NULL; 2906 bool onwater,shelf;2907 2908 /*retrieve inputs :*/2909 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);2910 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);2911 2857 2912 2858 /*retrieve some parameters: */ … … 2914 2860 2915 2861 /*First, if we are on water, return empty matrix: */ 2916 if( onwater) return;2862 if(IsOnWater()) return; 2917 2863 2918 2864 /* Get node coordinates and dof list: */ … … 2975 2921 2976 2922 /*Do not forget to include friction: */ 2977 if(! shelf){2923 if(!IsOnShelf()){ 2978 2924 CreateKMatrixDiagnosticMacAyealFriction(Kgg); 2979 2925 } … … 3026 2972 3027 2973 /*inputs: */ 3028 bool shelf;3029 2974 int drag_type; 3030 2975 Input* surface_input=NULL; … … 3037 2982 3038 2983 /*retrieve inputs :*/ 3039 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);3040 2984 inputs->GetParameterValue(&drag_type,DragTypeEnum); 3041 2985 surface_input=inputs->GetInput(SurfaceEnum); … … 3049 2993 GetDofList(&doflistp,PattynApproximationEnum); 3050 2994 3051 if ( shelf){2995 if (IsOnShelf()){ 3052 2996 /*no friction, do nothing*/ 3053 2997 return; … … 3149 3093 3150 3094 /*inputs: */ 3151 bool shelf;3152 3095 int drag_type; 3153 3096 Input* surface_input=NULL; … … 3160 3103 3161 3104 /*retrieve inputs :*/ 3162 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);3163 3105 inputs->GetParameterValue(&drag_type,DragTypeEnum); 3164 3106 surface_input=inputs->GetInput(SurfaceEnum); … … 3171 3113 GetDofList(&doflist,MacAyealApproximationEnum); 3172 3114 3173 if ( shelf){3115 if (IsOnShelf()){ 3174 3116 /*no friction, do nothing*/ 3175 3117 return; … … 3269 3211 3270 3212 /*inputs: */ 3271 bool shelf;3272 3213 int drag_type; 3273 3214 Input* surface_input=NULL; … … 3280 3221 3281 3222 /*retrieve inputs :*/ 3282 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);3283 3223 inputs->GetParameterValue(&drag_type,DragTypeEnum); 3284 3224 surface_input=inputs->GetInput(SurfaceEnum); … … 3291 3231 GetDofList(&doflist,PattynApproximationEnum); 3292 3232 3293 if ( shelf){3233 if (IsOnShelf()){ 3294 3234 /*no friction, do nothing*/ 3295 3235 return; … … 3357 3297 const int numdofs=NUMVERTICES*NDOF2; 3358 3298 int* doflist=NULL; 3359 3360 3299 double Ke_gg[numdofs][numdofs]={0.0}; 3361 3300 3362 /*flags: */3363 bool onwater;3364 3365 /*recover some inputs: */3366 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);3367 3368 3301 /*If on water, skip: */ 3369 if( onwater)return;3302 if(IsOnWater())return; 3370 3303 3371 3304 GetDofList(&doflist); … … 4280 4213 double pe_g_gaussian[numdof]; 4281 4214 double thickness; 4282 bool onwater;4283 4215 int drag_type; 4284 4216 4285 4217 /*retrieve inputs :*/ 4286 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);4287 4218 inputs->GetParameterValue(&drag_type,DragTypeEnum); 4288 4219 Input* thickness_input=inputs->GetInput(ThicknessEnum); ISSMASSERT(thickness_input); … … 4291 4222 4292 4223 /*First, if we are on water, return empty vector: */ 4293 if( onwater) return;4224 if(IsOnWater()) return; 4294 4225 4295 4226 /* Get node coordinates and dof list: */ … … 4879 4810 4880 4811 /*flags: */ 4881 bool onwater;4882 4812 Input* slopex_input=NULL; 4883 4813 Input* slopey_input=NULL; … … 4885 4815 GaussTria* gauss=NULL; 4886 4816 4887 /*recover some inputs: */4888 inputs->GetParameterValue(&onwater,ElementOnWaterEnum);4889 4890 4817 /*If on water, skip: */ 4891 if( onwater)return;4818 if(IsOnWater())return; 4892 4819 4893 4820 GetDofList(&doflist); … … 5630 5557 double l1l2l3[3]; 5631 5558 double epsilon[3]; /* epsilon=[exx,eyy,exy];*/ 5632 bool shelf;5633 5559 int drag_type; 5634 5560 double cm_noisedmp; … … 5639 5565 5640 5566 /*retrieve inputs :*/ 5641 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum);5642 5567 inputs->GetParameterValue(&drag_type,DragTypeEnum); 5643 5568 Input* drag_input=inputs->GetInput(DragCoefficientEnum); ISSMASSERT(drag_input); … … 5647 5572 5648 5573 /*Get out if shelf*/ 5649 if( shelf)return;5574 if(IsOnShelf())return; 5650 5575 5651 5576 /* Get node coordinates and dof list: */ -
issm/trunk/src/c/objects/Elements/Tria.h
r5745 r5746 77 77 bool IsOnBed(); 78 78 bool IsOnShelf(); 79 bool IsOnWater(); 79 80 void GetSolutionFromInputs(Vec solution); 80 81 void GetVectorFromInputs(Vec vector,int NameEnum);
Note:
See TracChangeset
for help on using the changeset viewer.