- Timestamp:
- 05/31/22 06:20:44 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/m/parameterization/setflowequation.js ¶
r25609 r27031 3 3 // 4 4 // This routine works like plotmodel: it works with an even number of inputs 5 // 'SIA','SSA','L1L2','M LHO','HO','FS' and 'fill' are the possible options5 // 'SIA','SSA','L1L2','MOLHO','HO','FS' and 'fill' are the possible options 6 6 // that must be followed by the corresponding exp file or flags list 7 7 // It can either be a domain file (argus type, .exp extension), or an array of element flags. … … 11 11 // a string 'all' will be considered as the entire domain 12 12 // You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling' 13 // NB: L1L2 and M LHO cannot currently be coupled to any other ice flow model13 // NB: L1L2 and MOLHO cannot currently be coupled to any other ice flow model 14 14 // 15 15 // Usage: … … 38 38 HOflag = FlagElements(md,options.getfieldvalue('HO','')); 39 39 L1L2flag = FlagElements(md,options.getfieldvalue('L1L2','')); 40 M LHOflag = FlagElements(md,options.getfieldvalue('MLHO',''));40 MOLHOflag = FlagElements(md,options.getfieldvalue('MOLHO','')); 41 41 FSflag = FlagElements(md,options.getfieldvalue('FS','')); 42 42 filltype = options.getfieldvalue('fill','none'); … … 55 55 56 56 //check that each element has at least one flag 57 for(var i=0;i<md.mesh.numberofelements;i++)if((SIAflag[i] + SSAflag[i] + HOflag[i] + L1L2flag[i] + M LHOflag[i] + FSflag[i])==0)57 for(var i=0;i<md.mesh.numberofelements;i++)if((SIAflag[i] + SSAflag[i] + HOflag[i] + L1L2flag[i] + MOLHOflag[i] + FSflag[i])==0) 58 58 throw Error("elements type not assigned, supported models are 'SIA','SSA','HO' and 'FS'"); 59 59 60 60 //check that each element has only one flag 61 if (ArrayAnyAboveStrict(ArrayXPY(SIAflag,SSAflag,HOflag,L1L2flag,M LHOflag),1)){61 if (ArrayAnyAboveStrict(ArrayXPY(SIAflag,SSAflag,HOflag,L1L2flag,MOLHOflag),1)){ 62 62 console.log('setflowequation warning message: some elements have several types, higher order type is used for them') 63 63 … … 71 71 //check that L1L2 is not coupled to any other model for now 72 72 if (ArrayAnyEqual(L1L2flag,1) & ArrayAnyEqual(ArrayOr(SIAflag,SSAflag,HOflag,FSflag),1)) throw Error('L1L2 cannot be coupled to any other model'); 73 if (ArrayAnyEqual(M LHOflag,1) & ArrayAnyEqual(ArrayOr(SIAflag,SSAflag,HOflag,FSflag),1)) throw Error('MLHO cannot be coupled to any other model');73 if (ArrayAnyEqual(MOLHOflag,1) & ArrayAnyEqual(ArrayOr(SIAflag,SSAflag,HOflag,FSflag),1)) throw Error('MOLHO cannot be coupled to any other model'); 74 74 75 75 //Check that no HO or FS for 2d mesh … … 100 100 for(var i=0;i<pos.length;i++) for(var j=0;j<md.mesh.elements[0].length;j++) nodeonL1L2[md.mesh.elements[pos[i]][j]-1]=1; 101 101 102 nodeonM LHO=NewArrayFill(md.mesh.numberofvertices,0);103 pos=ArrayFind(M LHOflag,1);104 for(var i=0;i<pos.length;i++) for(var j=0;j<md.mesh.elements[0].length;j++) nodeonM LHO[md.mesh.elements[pos[i]][j]-1]=1;102 nodeonMOLHO=NewArrayFill(md.mesh.numberofvertices,0); 103 pos=ArrayFind(MOLHOflag,1); 104 for(var i=0;i<pos.length;i++) for(var j=0;j<md.mesh.elements[0].length;j++) nodeonMOLHO[md.mesh.elements[pos[i]][j]-1]=1; 105 105 106 106 nodeonFS=NewArrayFill(md.mesh.numberofvertices,0); … … 262 262 pos=ArrayFind(SSAflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=2; 263 263 pos=ArrayFind(L1L2flag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=3; 264 pos=ArrayFind(M LHOflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=4;264 pos=ArrayFind(MOLHOflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=4; 265 265 pos=ArrayFind(HOflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=5; 266 266 pos=ArrayFind(FSflag,1);for(var i=0;i<pos.length;i++)md.flowequation.element_equation[pos[i]]=6; … … 281 281 pos=ArrayFind(nodeonSSA,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=2; 282 282 pos=ArrayFind(nodeonL1L2,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=3; 283 pos=ArrayFind(nodeonM LHO,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=4;283 pos=ArrayFind(nodeonMOLHO,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=4; 284 284 pos=ArrayFind(nodeonHO,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=5; 285 285 pos=ArrayFind(nodeonFS,1);for(var i=0;i<pos.length;i++)md.flowequation.vertex_equation[pos[i]]=6; … … 301 301 md.flowequation.isSSA = ArrayAnyEqual(md.flowequation.element_equation,2); 302 302 md.flowequation.isL1L2 = ArrayAnyEqual(md.flowequation.element_equation,3); 303 md.flowequation.isM LHO = ArrayAnyEqual(md.flowequation.element_equation,4);303 md.flowequation.isMOLHO = ArrayAnyEqual(md.flowequation.element_equation,4); 304 304 md.flowequation.isHO = ArrayAnyEqual(md.flowequation.element_equation,5); 305 305 md.flowequation.isFS = ArrayAnyEqual(md.flowequation.element_equation,6);
Note:
See TracChangeset
for help on using the changeset viewer.