Changeset 17118
- Timestamp:
- 01/15/14 10:59:22 (11 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Element.h
r17114 r17118 151 151 virtual bool IsOnBed()=0; 152 152 virtual bool IsOnSurface()=0; 153 virtual bool IsIceInElement()=0; 153 154 virtual void GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating)=0; 154 155 virtual IssmDouble GetGroundedPortion(IssmDouble* xyz_list)=0; -
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r17109 r17118 1256 1256 /*FUNCTION Penta::ZeroLevelsetCoordinates{{{*/ 1257 1257 void Penta::ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum){ 1258 /*Compute portion of the element that is grounded*/1258 /*Compute portion of the element that is grounded*/ 1259 1259 1260 1260 int normal_orientation=0; … … 1271 1271 s2=levelset[2]/(levelset[2]-levelset[0]); 1272 1272 1273 if(levelset[2] >0.) normal_orientation=1;1273 if(levelset[2]<0.) normal_orientation=1; //orientation of quadrangle at base and top, depending on distribution of levelsetfunction 1274 1274 /*New point 1*/ 1275 1275 xyz_zero[3*normal_orientation+0]=xyz_list[2*3+0]+s1*(xyz_list[1*3+0]-xyz_list[2*3+0]); … … 1297 1297 s2=levelset[0]/(levelset[0]-levelset[1]); 1298 1298 1299 if(levelset[0] >0.) normal_orientation=1;1299 if(levelset[0]<0.) normal_orientation=1; 1300 1300 /*New point 1*/ 1301 1301 xyz_zero[3*normal_orientation+0]=xyz_list[0*3+0]+s1*(xyz_list[2*3+0]-xyz_list[0*3+0]); … … 1323 1323 s2=levelset[1]/(levelset[1]-levelset[2]); 1324 1324 1325 if(levelset[1] >0.) normal_orientation=1;1325 if(levelset[1]<0.) normal_orientation=1; 1326 1326 /*New point 0*/ 1327 1327 xyz_zero[3*normal_orientation+0]=xyz_list[1*3+0]+s1*(xyz_list[0*3+0]-xyz_list[1*3+0]); … … 2068 2068 } 2069 2069 /*}}}*/ 2070 /*FUNCTION Penta:: NoIceInElement {{{*/2071 bool Penta:: NoIceInElement(){2070 /*FUNCTION Penta::IsIceInElement {{{*/ 2071 bool Penta::IsIceInElement(){ 2072 2072 2073 2073 /*Get levelset*/ … … 2075 2075 GetInputListOnVertices(&ls[0],MaskIceLevelsetEnum); 2076 2076 2077 /*If the level set is >0, ice is present in this element*/2078 if(ls[0] >0. || ls[1]>0. || ls[2]>0.) return false;2079 2080 /*If the level set is awlays <=0, there is no ice here*/2081 return true;2077 /*If the level set one one of the nodes is <0, ice is present in this element*/ 2078 if(ls[0]<0. || ls[1]<0. || ls[2]<0.) 2079 return true; 2080 else 2081 return false; 2082 2082 } 2083 2083 /*}}}*/ … … 2666 2666 2667 2667 /*If on water, return 0: */ 2668 if( NoIceInElement())return 0;2668 if(!IsIceInElement())return 0; 2669 2669 2670 2670 /*Bail out if this element if: … … 3111 3111 /*If the level set is awlays <=0, there is no ice front here*/ 3112 3112 iszerols = false; 3113 if( ls[0]>0. || ls[1]>0. || ls[2]>0.){3113 if(IsIceInElement()){ 3114 3114 if(ls[0]*ls[1]<0. || ls[0]*ls[2]<0. || (ls[0]*ls[1]+ls[0]*ls[2]+ls[1]*ls[2]==0.)){ 3115 3115 iszerols = true; … … 3133 3133 IssmDouble xyz_list[NUMVERTICES][3]; 3134 3134 3135 if( NoIceInElement())return 0;3135 if(!IsIceInElement())return 0; 3136 3136 3137 3137 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); … … 3157 3157 IssmDouble xyz_list[NUMVERTICES][3]; 3158 3158 3159 if( NoIceInElement() || IsFloating() || !IsOnBed())return 0;3159 if(!IsIceInElement() || IsFloating() || !IsOnBed())return 0; 3160 3160 3161 3161 rho_ice=matpar->GetRhoIce(); … … 3380 3380 rho_ice=matpar->GetRhoIce(); 3381 3381 3382 if( NoIceInElement() || !IsOnSurface()) return 0.;3382 if(!IsIceInElement() || !IsOnSurface()) return 0.; 3383 3383 3384 3384 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); … … 3543 3543 3544 3544 /*If on water, skip grad (=0): */ 3545 if( NoIceInElement())return;3545 if(!IsIceInElement())return; 3546 3546 3547 3547 /*First deal with ∂/∂alpha(KU-F)*/ … … 3917 3917 3918 3918 /*If on water, return 0: */ 3919 if( NoIceInElement())return 0;3919 if(!IsIceInElement())return 0; 3920 3920 3921 3921 /*Bail out if this element if: … … 3954 3954 3955 3955 /*If on water, return 0: */ 3956 if( NoIceInElement())return 0;3956 if(!IsIceInElement())return 0; 3957 3957 3958 3958 /*Bail out if this element if: … … 3991 3991 3992 3992 /*If on water, return 0: */ 3993 if( NoIceInElement())return 0;3993 if(!IsIceInElement())return 0; 3994 3994 3995 3995 /*Bail out if this element if: … … 4030 4030 4031 4031 /*If on water, return 0: */ 4032 if( NoIceInElement())return 0;4032 if(!IsIceInElement())return 0; 4033 4033 4034 4034 /*Bail out if this element if: … … 4067 4067 4068 4068 /*If on water, return 0: */ 4069 if( NoIceInElement())return 0;4069 if(!IsIceInElement())return 0; 4070 4070 4071 4071 /*Bail out if this element if: … … 4110 4110 4111 4111 /*If on water, return 0: */ 4112 if( NoIceInElement())return 0;4112 if(!IsIceInElement())return 0; 4113 4113 _error_("Not implemented yet"); 4114 4114 … … 4126 4126 4127 4127 /*If on water, on shelf or not on bed, skip: */ 4128 if( NoIceInElement()|| IsFloating() || !IsOnBed()) return 0;4128 if(!IsIceInElement()|| IsFloating() || !IsOnBed()) return 0; 4129 4129 4130 4130 tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1 … … 4141 4141 4142 4142 /*If on water, on shelf or not on bed, skip: */ 4143 if( NoIceInElement() || !IsOnBed()) return 0;4143 if(!IsIceInElement() || !IsOnBed()) return 0; 4144 4144 4145 4145 tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1 -
issm/trunk-jpl/src/c/classes/Elements/Penta.h
r17109 r17118 234 234 void JacobianDeterminantBase(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss); 235 235 void JacobianDeterminantTop(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss); 236 bool NoIceInElement(void);236 bool IsIceInElement(void); 237 237 Gauss* NewGauss(void); 238 238 Gauss* NewGauss(int order); -
issm/trunk-jpl/src/c/classes/Elements/Seg.h
r17109 r17118 114 114 void NodalFunctionsMINIDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");}; 115 115 void NodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");}; 116 bool NoIceInElement(){_error_("not implemented yet");};116 bool IsIceInElement(){_error_("not implemented yet");}; 117 117 void NormalSection(IssmDouble* normal,IssmDouble* xyz_list){_error_("not implemented yet");}; 118 118 void NormalTop(IssmDouble* normal,IssmDouble* xyz_list){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r17114 r17118 812 812 s2=levelset[2]/(levelset[2]-levelset[0]); 813 813 814 if(levelset[2] >0.) normal_orientation=1;814 if(levelset[2]<0.) normal_orientation=1; //orientation of quadrangle depending on distribution of levelsetfunction 815 815 /*New point 1*/ 816 816 xyz_zero[3*normal_orientation+0]=xyz_list[2*3+0]+s1*(xyz_list[1*3+0]-xyz_list[2*3+0]); … … 828 828 s2=levelset[0]/(levelset[0]-levelset[1]); 829 829 830 if(levelset[0] >0.) normal_orientation=1;830 if(levelset[0]<0.) normal_orientation=1; 831 831 /*New point 1*/ 832 832 xyz_zero[3*normal_orientation+0]=xyz_list[0*3+0]+s1*(xyz_list[2*3+0]-xyz_list[0*3+0]); … … 844 844 s2=levelset[1]/(levelset[1]-levelset[2]); 845 845 846 if(levelset[1] >0.) normal_orientation=1;846 if(levelset[1]<0.) normal_orientation=1; 847 847 /*New point 0*/ 848 848 xyz_zero[3*normal_orientation+0]=xyz_list[1*3+0]+s1*(xyz_list[0*3+0]-xyz_list[1*3+0]); … … 1869 1869 } 1870 1870 /*}}}*/ 1871 /*FUNCTION Tria:: NoIceInElement {{{*/1872 bool Tria:: NoIceInElement(){1871 /*FUNCTION Tria::IsIceInElement {{{*/ 1872 bool Tria::IsIceInElement(){ 1873 1873 1874 1874 /*Get levelset*/ … … 1876 1876 GetInputListOnVertices(&ls[0],MaskIceLevelsetEnum); 1877 1877 1878 /*If the level set is >0, ice is present in this element*/1879 if(ls[0] >0. || ls[1]>0. || ls[2]>0.) return false;1880 1881 /*If the level set is awlays <=0, there is no ice here*/1882 return true;1878 /*If the level set on one of the nodes is <0, ice is present in this element*/ 1879 if(ls[0]<0. || ls[1]<0. || ls[2]<0.) 1880 return true; 1881 else 1882 return false; 1883 1883 } 1884 1884 /*}}}*/ … … 2264 2264 2265 2265 /*If on water, return 0: */ 2266 if( NoIceInElement()){2266 if(!IsIceInElement()){ 2267 2267 printf("no ice in element!\n"); 2268 2268 return 0; … … 2503 2503 /*If the level set is awlays <0, there is no ice front here*/ 2504 2504 iszerols= false; 2505 if( ls[0]>0. || ls[1]>0. || ls[2]>0.){2505 if(IsIceInElement()){ 2506 2506 if(ls[0]*ls[1]<0. || ls[0]*ls[2]<0. || (ls[0]*ls[1]+ls[0]*ls[2]+ls[1]*ls[2]==0.)){ 2507 2507 iszerols= true; … … 2560 2560 IssmDouble xyz_list[NUMVERTICES][3]; 2561 2561 2562 if( NoIceInElement())return 0;2562 if(!IsIceInElement())return 0; 2563 2563 2564 2564 /*First get back the area of the base*/ … … 2590 2590 IssmDouble xyz_list[NUMVERTICES][3]; 2591 2591 2592 if( NoIceInElement() || IsFloating())return 0;2592 if(!IsIceInElement() || IsFloating())return 0; 2593 2593 2594 2594 rho_ice=matpar->GetRhoIce(); … … 2892 2892 rho_ice=matpar->GetRhoIce(); 2893 2893 2894 if( NoIceInElement())return 0;2894 if(!IsIceInElement())return 0; 2895 2895 2896 2896 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); … … 2921 2921 2922 2922 /*If on water, return 0: */ 2923 if( NoIceInElement())return 0;2923 if(!IsIceInElement())return 0; 2924 2924 2925 2925 /*Retrieve all inputs we will be needing: */ … … 2959 2959 2960 2960 /*If on water, return 0: */ 2961 if( NoIceInElement())return 0;2961 if(!IsIceInElement())return 0; 2962 2962 2963 2963 /*Retrieve all inputs we will be needing: */ … … 3137 3137 3138 3138 /*If on water, return 0: */ 3139 if( NoIceInElement()) return 0;3139 if(!IsIceInElement()) return 0; 3140 3140 3141 3141 /*Retrieve all inputs we will be needing: */ … … 3317 3317 3318 3318 /*If on water, grad = 0: */ 3319 if( NoIceInElement()) return;3319 if(!IsIceInElement()) return; 3320 3320 3321 3321 /*First deal with ∂/∂alpha(KU-F)*/ … … 3902 3902 3903 3903 /*If on water, return 0: */ 3904 if( NoIceInElement()) return 0;3904 if(!IsIceInElement()) return 0; 3905 3905 3906 3906 /*Retrieve all inputs we will be needing: */ … … 3941 3941 3942 3942 /*If on water, return 0: */ 3943 if( NoIceInElement())return 0;3943 if(!IsIceInElement())return 0; 3944 3944 3945 3945 /* Get node coordinates and dof list: */ … … 4000 4000 4001 4001 /*If on water, return 0: */ 4002 if( NoIceInElement())return 0;4002 if(!IsIceInElement())return 0; 4003 4003 4004 4004 /* Get node coordinates and dof list: */ … … 4059 4059 4060 4060 /*If on water, return 0: */ 4061 if( NoIceInElement())return 0;4061 if(!IsIceInElement())return 0; 4062 4062 4063 4063 /* Get node coordinates and dof list: */ … … 4117 4117 4118 4118 /*If on water, return 0: */ 4119 if( NoIceInElement())return 0;4119 if(!IsIceInElement())return 0; 4120 4120 4121 4121 /* Get node coordinates and dof list: */ … … 4176 4176 4177 4177 /*If on water, return 0: */ 4178 if( NoIceInElement())return 0;4178 if(!IsIceInElement())return 0; 4179 4179 4180 4180 /* Get node coordinates and dof list: */ … … 4238 4238 4239 4239 /*If on water, return 0: */ 4240 if( NoIceInElement()) return 0;4240 if(!IsIceInElement()) return 0; 4241 4241 4242 4242 /*Retrieve all inputs we will be needing: */ … … 4282 4282 4283 4283 /*If on water, return 0: */ 4284 if( NoIceInElement()) return 0;4284 if(!IsIceInElement()) return 0; 4285 4285 4286 4286 /*Retrieve all inputs we will be needing: */ … … 4333 4333 4334 4334 /*If on water, return 0: */ 4335 if( NoIceInElement()) return 0;4335 if(!IsIceInElement()) return 0; 4336 4336 4337 4337 /*Retrieve all inputs we will be needing: */ … … 4381 4381 4382 4382 /*If on water, return 0: */ 4383 if( NoIceInElement())return 0;4383 if(!IsIceInElement())return 0; 4384 4384 4385 4385 /*Retrieve all inputs we will be needing: */ … … 4427 4427 4428 4428 /*If on water, return 0: */ 4429 if( NoIceInElement()) return 0;4429 if(!IsIceInElement()) return 0; 4430 4430 4431 4431 /*Retrieve all inputs we will be needing: */ -
issm/trunk-jpl/src/c/classes/Elements/Tria.h
r17114 r17118 102 102 int NumberofNodesVelocity(void); 103 103 int NumberofNodesPressure(void); 104 bool NoIceInElement();104 bool IsIceInElement(); 105 105 void GetSolutionFromInputsOneDof(Vector<IssmDouble>* solution,int enum_type); 106 106 void GetVectorFromInputs(Vector<IssmDouble>* vector, int name_enum); -
issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp
r16164 r17118 476 476 /*Initialize Element matrix and return if necessary*/ 477 477 Tria* tria=(Tria*)element; 478 if( tria->NoIceInElement()) return NULL;478 if(!tria->IsIceInElement()) return NULL; 479 479 ElementMatrix* Ke=new ElementMatrix(nodes,NUMNODES_INTERNAL,this->parameters); 480 480 … … 540 540 ElementMatrix* Ke = NULL; 541 541 Tria* tria=(Tria*)element; 542 if( tria->NoIceInElement()) return NULL;542 if(!tria->IsIceInElement()) return NULL; 543 543 544 544 /*Retrieve all inputs and parameters*/ … … 629 629 /*Initialize Element matrix and return if necessary*/ 630 630 Tria* tria=(Tria*)element; 631 if( tria->NoIceInElement()) return NULL;631 if(!tria->IsIceInElement()) return NULL; 632 632 ElementMatrix* Ke=new ElementMatrix(nodes,NUMNODES_INTERNAL,this->parameters); 633 633 … … 692 692 ElementMatrix* Ke = NULL; 693 693 Tria* tria=(Tria*)element; 694 if( tria->NoIceInElement()) return NULL;694 if(!tria->IsIceInElement()) return NULL; 695 695 696 696 /*Retrieve all inputs and parameters*/ … … 818 818 ElementVector* pe = NULL; 819 819 Tria* tria=(Tria*)element; 820 if( tria->NoIceInElement()) return NULL;820 if(!tria->IsIceInElement()) return NULL; 821 821 822 822 /*Retrieve all inputs and parameters*/ … … 912 912 ElementVector* pe = NULL; 913 913 Tria* tria=(Tria*)element; 914 if( tria->NoIceInElement()) return NULL;914 if(!tria->IsIceInElement()) return NULL; 915 915 916 916 /*Retrieve all inputs and parameters*/ -
issm/trunk-jpl/src/m/parameterization/setmask.m
r17115 r17118 42 42 43 43 %level sets 44 md.mask.ice_levelset= +1.*ones(md.mesh.numberofvertices,1);44 md.mask.ice_levelset=-1.*ones(md.mesh.numberofvertices,1); 45 45 md.mask.groundedice_levelset=vertexongroundedice; 46 46 md.mask.groundedice_levelset(find(vertexongroundedice==0.))=-1.; -
issm/trunk-jpl/src/m/parameterization/setmask.py
r17115 r17118 42 42 43 43 #level sets 44 md.mask.ice_levelset = +1.*numpy.ones((md.mesh.numberofvertices,1))44 md.mask.ice_levelset = -1.*numpy.ones((md.mesh.numberofvertices,1)) 45 45 md.mask.groundedice_levelset = -1.*numpy.ones((md.mesh.numberofvertices,1)) 46 46 md.mask.groundedice_levelset[md.mesh.elements[numpy.nonzero(elementongroundedice),:]-1]=1.
Note:
See TracChangeset
for help on using the changeset viewer.