Changeset 3832
- Timestamp:
- 05/18/10 18:31:36 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Makefile.am
r3828 r3832 50 50 ./objects/Loads/Friction.h\ 51 51 ./objects/Loads/Friction.cpp\ 52 ./objects/Loads/Friction2.h\ 53 ./objects/Loads/Friction2.cpp\ 52 54 ./objects/DakotaPlugin.h\ 53 55 ./objects/DakotaPlugin.cpp\ … … 497 499 ./objects/Loads/Friction.h\ 498 500 ./objects/Loads/Friction.cpp\ 501 ./objects/Loads/Friction2.h\ 502 ./objects/Loads/Friction2.cpp\ 499 503 ./objects/DakotaPlugin.h\ 500 504 ./objects/DakotaPlugin.cpp\ -
issm/trunk/src/c/objects/Elements/Tria.cpp
r3831 r3832 1282 1282 double gauss_weight; 1283 1283 double gauss_l1l2l3[3]; 1284 double gaussgrids[numgrids][numgrids]={{1,0,0},{0,1,0},{0,0,1}};1285 1284 1286 1285 /* matrices: */ … … 1299 1298 double slope_magnitude; 1300 1299 1301 /*input parameters for structural analysis (diagnostic): */1302 double vx_list[numgrids];1303 double vy_list[numgrids];1304 double thickness_list[numgrids];1305 double bed_list[numgrids];1306 double dragcoefficient_list[numgrids];1307 double drag_p,drag_q;1308 1309 1300 /*friction: */ 1310 double alpha2_list[numgrids]={0.0,0.0,0.0};1301 Friction2* friction2=NULL; 1311 1302 double alpha2; 1312 1303 … … 1331 1322 } 1332 1323 1324 /*build friction object, used later on: */ 1333 1325 if (drag_type!=2)ISSMERROR(" non-viscous friction not supported yet!"); 1334 1335 /*Recover inputs: */ 1336 inputs->GetParameterValues(&vx_list[0],&gaussgrids[0][0],3,VxAverageEnum); 1337 inputs->GetParameterValues(&vy_list[0],&gaussgrids[0][0],3,VyAverageEnum); 1338 inputs->GetParameterValues(&dragcoefficient_list[0],&gaussgrids[0][0],3,DragCoefficientEnum); 1339 inputs->GetParameterValues(&bed_list[0],&gaussgrids[0][0],3,BedEnum); 1340 inputs->GetParameterValues(&thickness_list[0],&gaussgrids[0][0],3,ThicknessEnum); 1341 inputs->GetParameterValue(&drag_p,DragPEnum); 1342 inputs->GetParameterValue(&drag_q,DragQEnum); 1343 1344 /*Build alpha2_list used by drag stiffness matrix*/ 1345 Friction* friction=NewFriction(); 1346 1347 /*Initialize all fields: */ 1348 friction->element_type=(char*)xmalloc((strlen("2d")+1)*sizeof(char)); 1349 strcpy(friction->element_type,"2d"); 1350 1351 friction->gravity=matpar->GetG(); 1352 friction->rho_ice=matpar->GetRhoIce(); 1353 friction->rho_water=matpar->GetRhoWater(); 1354 friction->K=&dragcoefficient_list[0]; 1355 friction->bed=&bed_list[0]; 1356 friction->thickness=&thickness_list[0]; 1357 friction->vx=&vx_list[0]; 1358 friction->vy=&vy_list[0]; 1359 friction->p=drag_p; 1360 friction->q=drag_q; 1361 1362 /*Compute alpha2_list: */ 1363 FrictionGetAlpha2(&alpha2_list[0],friction); 1364 1365 /*Erase friction object: */ 1366 DeleteFriction(&friction); 1326 friction2=new Friction2("2d",inputs,matpar); 1367 1327 1368 1328 /* Get gaussian points and weights (make this a statically initialized list of points? fstd): */ … … 1378 1338 1379 1339 1340 /*Friction: */ 1341 friction2->GetAlpha2(&alpha2, gauss_l1l2l3,VxAverageEnum,VyAverageEnum,VzAverageEnum); 1342 1380 1343 // If we have a slope > 6% for this element, it means we are on a mountain. In this particular case, 1381 1344 //velocity should be = 0. To achieve this result, we set alpha2_list to a very high value: */ … … 1384 1347 1385 1348 if (slope_magnitude>MAXSLOPE){ 1386 alpha2_list[0]=pow((double)10,MOUNTAINKEXPONENT); 1387 alpha2_list[1]=pow((double)10,MOUNTAINKEXPONENT); 1388 alpha2_list[2]=pow((double)10,MOUNTAINKEXPONENT); 1349 alpha2=pow((double)10,MOUNTAINKEXPONENT); 1389 1350 } 1390 1351 … … 1395 1356 GetL(&L[0][0], &xyz_list[0][0], gauss_l1l2l3,numberofdofspernode); 1396 1357 1397 /*Now, take care of the basal friction if there is any: */ 1398 GetParameterValue(&alpha2, &alpha2_list[0],gauss_l1l2l3); 1399 1358 1400 1359 DL_scalar=alpha2*gauss_weight*Jdet; 1401 1360 for (i=0;i<2;i++){ … … 1421 1380 xfree((void**)&third_gauss_area_coord); 1422 1381 xfree((void**)&gauss_weights); 1382 delete friction2; 1423 1383 1424 1384 } … … 2940 2900 double pressure_list[3]; 2941 2901 double pressure; 2942 double alpha2_list[3]; 2943 double basalfriction_list[3]; 2902 int drag_type; 2944 2903 double basalfriction; 2904 Friction2* friction2=NULL; 2905 double alpha2,vx,vy; 2945 2906 double geothermalflux_value; 2946 2947 double vx_list[numgrids];2948 double vy_list[numgrids];2949 double thickness_list[numgrids];2950 double bed_list[numgrids];2951 double dragcoefficient_list[numgrids];2952 double drag_p,drag_q;2953 int drag_type;2954 2907 2955 2908 /* gaussian points: */ … … 2961 2914 double gauss_weight; 2962 2915 double gauss_coord[3]; 2963 double gaussgrids[numgrids][numgrids]={{1,0,0},{0,1,0},{0,0,1}};2964 2916 2965 2917 /*matrices: */ … … 2969 2921 double scalar; 2970 2922 2971 2972 /*retrieve inputs :*/2973 inputs->GetParameterValue(&drag_type,DragTypeEnum);2974 2923 2975 2924 /* Get node coordinates and dof list: */ … … 2984 2933 this->parameters->FindParam(&dt,DtEnum); 2985 2934 2986 2987 /*Recover inputs: */ 2988 inputs->GetParameterValues(&vx_list[0],&gaussgrids[0][0],3,VxAverageEnum); 2989 inputs->GetParameterValues(&vy_list[0],&gaussgrids[0][0],3,VyAverageEnum); 2990 inputs->GetParameterValues(&dragcoefficient_list[0],&gaussgrids[0][0],3,DragCoefficientEnum); 2991 inputs->GetParameterValues(&bed_list[0],&gaussgrids[0][0],3,BedEnum); 2992 inputs->GetParameterValues(&thickness_list[0],&gaussgrids[0][0],3,ThicknessEnum); 2993 inputs->GetParameterValue(&drag_p,DragPEnum); 2994 inputs->GetParameterValue(&drag_q,DragQEnum); 2995 2996 /*Build alpha2_list used by drag stiffness matrix*/ 2997 Friction* friction=NewFriction(); 2998 2999 /*Initialize all fields: */ 2935 /*Build frictoin element, needed later: */ 2936 inputs->GetParameterValue(&drag_type,DragTypeEnum); 3000 2937 if (drag_type!=2)ISSMERROR(" non-viscous friction not supported yet!"); 3001 3002 friction->element_type=(char*)xmalloc((strlen("3d")+1)*sizeof(char)); 3003 strcpy(friction->element_type,"3d"); 3004 3005 friction->gravity=matpar->GetG(); 3006 friction->rho_ice=matpar->GetRhoIce(); 3007 friction->rho_water=matpar->GetRhoWater(); 3008 friction->K=&dragcoefficient_list[0]; 3009 friction->bed=&bed_list[0]; 3010 friction->thickness=&thickness_list[0]; 3011 friction->vx=&vx_list[0]; 3012 friction->vy=&vy_list[0]; 3013 friction->p=drag_p; 3014 friction->q=drag_q; 3015 3016 /*Compute alpha2_list: */ 3017 FrictionGetAlpha2(&alpha2_list[0],friction); 3018 3019 /*Erase friction object: */ 3020 DeleteFriction(&friction); 3021 3022 /* Compute basal friction */ 3023 for(i=0;i<numgrids;i++){ 3024 basalfriction_list[i]= alpha2_list[i]*(pow(vx_list[i],(double)2.0)+pow(vy_list[i],(double)2.0)); 3025 } 2938 friction2=new Friction2("3d",inputs,matpar); 3026 2939 3027 2940 /* Ice/ocean heat exchange flux on ice shelf base */ … … 3043 2956 /*Get geothermal flux and basal friction */ 3044 2957 inputs->GetParameterValue(&geothermalflux_value, &gauss_coord[0],GeothermalFluxEnum); 3045 GetParameterValue(&basalfriction,&basalfriction_list[0],gauss_coord); 3046 2958 2959 friction2->GetAlpha2(&alpha2,&gauss_coord[0],VxAverageEnum,VyAverageEnum,VzAverageEnum); 2960 inputs->GetParameterValue(&vx, &gauss_coord[0],VxAverageEnum); 2961 inputs->GetParameterValue(&vy, &gauss_coord[0],VyAverageEnum); 2962 basalfriction= alpha2*(pow(vx,(double)2.0)+pow(vy,(double)2.0)); 2963 3047 2964 /*Calculate scalar parameter*/ 3048 2965 scalar=gauss_weight*Jdet*(basalfriction+geothermalflux_value)/(heatcapacity*rho_ice); … … 3064 2981 xfree((void**)&third_gauss_area_coord); 3065 2982 xfree((void**)&gauss_weights); 2983 delete friction2; 3066 2984 3067 2985 } -
issm/trunk/src/c/objects/objects.h
r3828 r3832 26 26 /*Loads: */ 27 27 #include "./Loads/Friction.h" 28 #include "./Loads/Friction2.h" 28 29 #include "./Loads/Icefront.h" 29 30 #include "./Loads/Numericalflux.h"
Note:
See TracChangeset
for help on using the changeset viewer.