Changeset 15054
- Timestamp:
- 05/21/13 09:28:30 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r15041 r15054 1240 1240 1241 1241 return phi; 1242 } 1243 /*}}}*/ 1244 /*FUNCTION Tria::GetGroundedPart{{{*/ 1245 void Tria::GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating){ 1246 /*Computeportion of the element that is grounded*/ 1247 1248 bool floating=true; 1249 int point; 1250 const IssmPDouble epsilon= 1.e-15; 1251 IssmDouble gl[3]; 1252 IssmDouble f1,f2; 1253 1254 1255 /*Recover parameters and values*/ 1256 GetInputListOnVertices(&gl[0],GLlevelsetEnum); 1257 1258 /*Be sure that values are not zero*/ 1259 if(gl[0]==0) gl[0]=gl[0]+epsilon; 1260 if(gl[1]==0) gl[1]=gl[1]+epsilon; 1261 if(gl[2]==0) gl[2]=gl[2]+epsilon; 1262 1263 /*Check that not all nodes are grounded or floating*/ 1264 if(gl[0]>0 && gl[1]>0 && gl[2]>0){ // All grounded 1265 point=0; 1266 f1=1.; 1267 f2=1.; 1268 } 1269 else if(gl[0]<0 && gl[1]<0 && gl[2]<0){ //All floating 1270 point=0; 1271 f1=0.; 1272 f2=0.; 1273 } 1274 else{ 1275 if(gl[0]*gl[1]*gl[2]<0) floating=false; 1276 1277 if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2 1278 point=2; 1279 f1=gl[2]/(gl[2]-gl[0]); 1280 f2=gl[2]/(gl[2]-gl[1]); 1281 } 1282 else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2 1283 point=0; 1284 f1=gl[0]/(gl[0]-gl[1]); 1285 f2=gl[0]/(gl[0]-gl[2]); 1286 } 1287 else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2 1288 point=1; 1289 f1=gl[1]/(gl[1]-gl[2]); 1290 f2=gl[1]/(gl[1]-gl[0]); 1291 } 1292 } 1293 *point1=point; 1294 *fraction1=f1; 1295 *fraction2=f2; 1296 *mainlyfloating=floating; 1242 1297 } 1243 1298 /*}}}*/ … … 3316 3371 3317 3372 /*Intermediaries*/ 3373 bool mainlyfloating; 3318 3374 int i,j; 3319 3375 int analysis_type,migration_style; 3320 int gausspoints=2;3376 int point1; 3321 3377 IssmDouble alpha2; 3322 3378 IssmDouble Jdet; 3379 IssmDouble fraction1,fraction2; 3323 3380 IssmDouble phi=1.0; 3324 3381 IssmDouble L[2][numdof]; … … 3352 3409 if(migration_style==SubelementMigration2Enum){ 3353 3410 gllevelset_input=inputs->GetInput(GLlevelsetEnum); _assert_(gllevelset_input); 3354 gausspoints=20; 3411 this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating); 3412 gauss=new GaussTria(point1,fraction1,fraction2,mainlyfloating,2); 3413 } 3414 else{ 3415 gauss=new GaussTria(2); 3355 3416 } 3356 3417 3357 3418 /* Start looping on the number of gaussian points: */ 3358 gauss=new GaussTria(gausspoints);3359 3419 for(int ig=gauss->begin();ig<gauss->end();ig++){ 3360 3420 -
issm/trunk-jpl/src/c/classes/Elements/Tria.h
r15049 r15054 204 204 void GetConnectivityList(int* connectivity); 205 205 IssmDouble GetGroundedPortion(IssmDouble* xyz_list); 206 void GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating); 206 207 void GetInputListOnVertices(IssmDouble* pvalue,int enumtype); 207 208 void GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue);
Note:
See TracChangeset
for help on using the changeset viewer.