Changeset 17118


Ignore:
Timestamp:
01/15/14 10:59:22 (11 years ago)
Author:
jbondzio
Message:

CHG: Negative sign of md.mask.ice_levelset represents existence of ice. This way the normal computed by the level-set function points out of the ice domain.

Location:
issm/trunk-jpl/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Element.h

    r17114 r17118  
    151151                virtual bool   IsOnBed()=0;
    152152                virtual bool   IsOnSurface()=0;
     153                virtual bool   IsIceInElement()=0;
    153154                virtual void   GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating)=0;
    154155                virtual IssmDouble GetGroundedPortion(IssmDouble* xyz_list)=0;
  • issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r17109 r17118  
    12561256/*FUNCTION Penta::ZeroLevelsetCoordinates{{{*/
    12571257void Penta::ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum){
    1258         /*Computeportion of the element that is grounded*/
     1258        /*Compute portion of the element that is grounded*/
    12591259
    12601260        int         normal_orientation=0;
     
    12711271                s2=levelset[2]/(levelset[2]-levelset[0]);
    12721272
    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
    12741274                /*New point 1*/
    12751275                xyz_zero[3*normal_orientation+0]=xyz_list[2*3+0]+s1*(xyz_list[1*3+0]-xyz_list[2*3+0]);
     
    12971297                s2=levelset[0]/(levelset[0]-levelset[1]);
    12981298
    1299                 if(levelset[0]>0.) normal_orientation=1;
     1299                if(levelset[0]<0.) normal_orientation=1;
    13001300                /*New point 1*/
    13011301                xyz_zero[3*normal_orientation+0]=xyz_list[0*3+0]+s1*(xyz_list[2*3+0]-xyz_list[0*3+0]);
     
    13231323                s2=levelset[1]/(levelset[1]-levelset[2]);
    13241324
    1325                 if(levelset[1]>0.) normal_orientation=1;
     1325                if(levelset[1]<0.) normal_orientation=1;
    13261326                /*New point 0*/
    13271327                xyz_zero[3*normal_orientation+0]=xyz_list[1*3+0]+s1*(xyz_list[0*3+0]-xyz_list[1*3+0]);
     
    20682068}
    20692069/*}}}*/
    2070 /*FUNCTION Penta::NoIceInElement {{{*/
    2071 bool   Penta::NoIceInElement(){
     2070/*FUNCTION Penta::IsIceInElement {{{*/
     2071bool   Penta::IsIceInElement(){
    20722072
    20732073        /*Get levelset*/
     
    20752075        GetInputListOnVertices(&ls[0],MaskIceLevelsetEnum);
    20762076
    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;
    20822082}
    20832083/*}}}*/
     
    26662666
    26672667        /*If on water, return 0: */
    2668         if(NoIceInElement())return 0;
     2668        if(!IsIceInElement())return 0;
    26692669
    26702670        /*Bail out if this element if:
     
    31113111        /*If the level set is awlays <=0, there is no ice front here*/
    31123112        iszerols = false;
    3113         if(ls[0]>0. || ls[1]>0. || ls[2]>0.){
     3113        if(IsIceInElement()){
    31143114                if(ls[0]*ls[1]<0. || ls[0]*ls[2]<0. || (ls[0]*ls[1]+ls[0]*ls[2]+ls[1]*ls[2]==0.)){
    31153115                        iszerols = true;
     
    31333133        IssmDouble xyz_list[NUMVERTICES][3];
    31343134
    3135         if(NoIceInElement())return 0;
     3135        if(!IsIceInElement())return 0;
    31363136
    31373137        ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
     
    31573157        IssmDouble xyz_list[NUMVERTICES][3];
    31583158
    3159         if(NoIceInElement() || IsFloating() || !IsOnBed())return 0;
     3159        if(!IsIceInElement() || IsFloating() || !IsOnBed())return 0;
    31603160
    31613161        rho_ice=matpar->GetRhoIce();
     
    33803380        rho_ice=matpar->GetRhoIce();
    33813381
    3382         if(NoIceInElement() || !IsOnSurface()) return 0.;
     3382        if(!IsIceInElement() || !IsOnSurface()) return 0.;
    33833383
    33843384        ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
     
    35433543
    35443544        /*If on water, skip grad (=0): */
    3545         if(NoIceInElement())return;
     3545        if(!IsIceInElement())return;
    35463546                                       
    35473547        /*First deal with ∂/∂alpha(KU-F)*/
     
    39173917
    39183918        /*If on water, return 0: */
    3919         if(NoIceInElement())return 0;
     3919        if(!IsIceInElement())return 0;
    39203920
    39213921        /*Bail out if this element if:
     
    39543954
    39553955        /*If on water, return 0: */
    3956         if(NoIceInElement())return 0;
     3956        if(!IsIceInElement())return 0;
    39573957
    39583958        /*Bail out if this element if:
     
    39913991
    39923992        /*If on water, return 0: */
    3993         if(NoIceInElement())return 0;
     3993        if(!IsIceInElement())return 0;
    39943994
    39953995        /*Bail out if this element if:
     
    40304030
    40314031        /*If on water, return 0: */
    4032         if(NoIceInElement())return 0;
     4032        if(!IsIceInElement())return 0;
    40334033
    40344034        /*Bail out if this element if:
     
    40674067
    40684068        /*If on water, return 0: */
    4069         if(NoIceInElement())return 0;
     4069        if(!IsIceInElement())return 0;
    40704070
    40714071        /*Bail out if this element if:
     
    41104110
    41114111        /*If on water, return 0: */
    4112         if(NoIceInElement())return 0;
     4112        if(!IsIceInElement())return 0;
    41134113        _error_("Not implemented yet");
    41144114
     
    41264126
    41274127        /*If on water, on shelf or not on bed, skip: */
    4128         if(NoIceInElement()|| IsFloating() || !IsOnBed()) return 0;
     4128        if(!IsIceInElement()|| IsFloating() || !IsOnBed()) return 0;
    41294129
    41304130        tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1
     
    41414141
    41424142        /*If on water, on shelf or not on bed, skip: */
    4143         if(NoIceInElement() || !IsOnBed()) return 0;
     4143        if(!IsIceInElement() || !IsOnBed()) return 0;
    41444144
    41454145        tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1
  • issm/trunk-jpl/src/c/classes/Elements/Penta.h

    r17109 r17118  
    234234                void           JacobianDeterminantBase(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss);
    235235                void           JacobianDeterminantTop(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss);
    236                 bool           NoIceInElement(void);
     236                bool           IsIceInElement(void);
    237237                Gauss*         NewGauss(void);
    238238                Gauss*         NewGauss(int order);
  • issm/trunk-jpl/src/c/classes/Elements/Seg.h

    r17109 r17118  
    114114                void        NodalFunctionsMINIDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
    115115                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");};
    117117                void        NormalSection(IssmDouble* normal,IssmDouble* xyz_list){_error_("not implemented yet");};
    118118                void        NormalTop(IssmDouble* normal,IssmDouble* xyz_list){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r17114 r17118  
    812812                s2=levelset[2]/(levelset[2]-levelset[0]);
    813813
    814                 if(levelset[2]>0.) normal_orientation=1;
     814                if(levelset[2]<0.) normal_orientation=1; //orientation of quadrangle depending on distribution of levelsetfunction
    815815                /*New point 1*/
    816816                xyz_zero[3*normal_orientation+0]=xyz_list[2*3+0]+s1*(xyz_list[1*3+0]-xyz_list[2*3+0]);
     
    828828                s2=levelset[0]/(levelset[0]-levelset[1]);
    829829
    830                 if(levelset[0]>0.) normal_orientation=1;
     830                if(levelset[0]<0.) normal_orientation=1;
    831831                /*New point 1*/
    832832                xyz_zero[3*normal_orientation+0]=xyz_list[0*3+0]+s1*(xyz_list[2*3+0]-xyz_list[0*3+0]);
     
    844844                s2=levelset[1]/(levelset[1]-levelset[2]);
    845845
    846                 if(levelset[1]>0.) normal_orientation=1;
     846                if(levelset[1]<0.) normal_orientation=1;
    847847                /*New point 0*/
    848848                xyz_zero[3*normal_orientation+0]=xyz_list[1*3+0]+s1*(xyz_list[0*3+0]-xyz_list[1*3+0]);
     
    18691869}
    18701870/*}}}*/
    1871 /*FUNCTION Tria::NoIceInElement {{{*/
    1872 bool   Tria::NoIceInElement(){
     1871/*FUNCTION Tria::IsIceInElement {{{*/
     1872bool   Tria::IsIceInElement(){
    18731873
    18741874        /*Get levelset*/
     
    18761876        GetInputListOnVertices(&ls[0],MaskIceLevelsetEnum);
    18771877
    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;
    18831883}
    18841884/*}}}*/
     
    22642264
    22652265        /*If on water, return 0: */
    2266         if(NoIceInElement()){
     2266        if(!IsIceInElement()){
    22672267                printf("no ice in element!\n");
    22682268                return 0;
     
    25032503        /*If the level set is awlays <0, there is no ice front here*/
    25042504        iszerols= false;
    2505         if(ls[0]>0. || ls[1]>0. || ls[2]>0.){
     2505        if(IsIceInElement()){
    25062506                if(ls[0]*ls[1]<0. || ls[0]*ls[2]<0. || (ls[0]*ls[1]+ls[0]*ls[2]+ls[1]*ls[2]==0.)){
    25072507                        iszerols= true;
     
    25602560        IssmDouble xyz_list[NUMVERTICES][3];
    25612561
    2562         if(NoIceInElement())return 0;
     2562        if(!IsIceInElement())return 0;
    25632563
    25642564        /*First get back the area of the base*/
     
    25902590        IssmDouble xyz_list[NUMVERTICES][3];
    25912591
    2592         if(NoIceInElement() || IsFloating())return 0;
     2592        if(!IsIceInElement() || IsFloating())return 0;
    25932593
    25942594        rho_ice=matpar->GetRhoIce();
     
    28922892        rho_ice=matpar->GetRhoIce();
    28932893
    2894    if(NoIceInElement())return 0;
     2894   if(!IsIceInElement())return 0;
    28952895
    28962896        ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
     
    29212921
    29222922        /*If on water, return 0: */
    2923         if(NoIceInElement())return 0;
     2923        if(!IsIceInElement())return 0;
    29242924
    29252925        /*Retrieve all inputs we will be needing: */
     
    29592959
    29602960        /*If on water, return 0: */
    2961         if(NoIceInElement())return 0;
     2961        if(!IsIceInElement())return 0;
    29622962
    29632963        /*Retrieve all inputs we will be needing: */
     
    31373137
    31383138        /*If on water, return 0: */
    3139         if(NoIceInElement()) return 0;
     3139        if(!IsIceInElement()) return 0;
    31403140
    31413141        /*Retrieve all inputs we will be needing: */
     
    33173317
    33183318        /*If on water, grad = 0: */
    3319         if(NoIceInElement()) return;
     3319        if(!IsIceInElement()) return;
    33203320
    33213321        /*First deal with ∂/∂alpha(KU-F)*/
     
    39023902
    39033903        /*If on water, return 0: */
    3904         if(NoIceInElement()) return 0;
     3904        if(!IsIceInElement()) return 0;
    39053905
    39063906        /*Retrieve all inputs we will be needing: */
     
    39413941
    39423942        /*If on water, return 0: */
    3943         if(NoIceInElement())return 0;
     3943        if(!IsIceInElement())return 0;
    39443944
    39453945        /* Get node coordinates and dof list: */
     
    40004000
    40014001        /*If on water, return 0: */
    4002         if(NoIceInElement())return 0;
     4002        if(!IsIceInElement())return 0;
    40034003
    40044004        /* Get node coordinates and dof list: */
     
    40594059
    40604060        /*If on water, return 0: */
    4061         if(NoIceInElement())return 0;
     4061        if(!IsIceInElement())return 0;
    40624062
    40634063        /* Get node coordinates and dof list: */
     
    41174117
    41184118        /*If on water, return 0: */
    4119         if(NoIceInElement())return 0;
     4119        if(!IsIceInElement())return 0;
    41204120
    41214121        /* Get node coordinates and dof list: */
     
    41764176
    41774177        /*If on water, return 0: */
    4178         if(NoIceInElement())return 0;
     4178        if(!IsIceInElement())return 0;
    41794179
    41804180        /* Get node coordinates and dof list: */
     
    42384238
    42394239        /*If on water, return 0: */
    4240         if(NoIceInElement()) return 0;
     4240        if(!IsIceInElement()) return 0;
    42414241
    42424242        /*Retrieve all inputs we will be needing: */
     
    42824282
    42834283        /*If on water, return 0: */
    4284         if(NoIceInElement()) return 0;
     4284        if(!IsIceInElement()) return 0;
    42854285
    42864286        /*Retrieve all inputs we will be needing: */
     
    43334333
    43344334        /*If on water, return 0: */
    4335         if(NoIceInElement()) return 0;
     4335        if(!IsIceInElement()) return 0;
    43364336
    43374337        /*Retrieve all inputs we will be needing: */
     
    43814381
    43824382        /*If on water, return 0: */
    4383         if(NoIceInElement())return 0;
     4383        if(!IsIceInElement())return 0;
    43844384
    43854385        /*Retrieve all inputs we will be needing: */
     
    44274427
    44284428        /*If on water, return 0: */
    4429         if(NoIceInElement()) return 0;
     4429        if(!IsIceInElement()) return 0;
    44304430
    44314431        /*Retrieve all inputs we will be needing: */
  • issm/trunk-jpl/src/c/classes/Elements/Tria.h

    r17114 r17118  
    102102                int         NumberofNodesVelocity(void);
    103103                int         NumberofNodesPressure(void);
    104                 bool        NoIceInElement();
     104                bool        IsIceInElement();
    105105                void        GetSolutionFromInputsOneDof(Vector<IssmDouble>* solution,int enum_type);
    106106                void        GetVectorFromInputs(Vector<IssmDouble>* vector, int name_enum);
  • issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp

    r16164 r17118  
    476476        /*Initialize Element matrix and return if necessary*/
    477477        Tria*  tria=(Tria*)element;
    478         if(tria->NoIceInElement()) return NULL;
     478        if(!tria->IsIceInElement()) return NULL;
    479479        ElementMatrix* Ke=new ElementMatrix(nodes,NUMNODES_INTERNAL,this->parameters);
    480480
     
    540540        ElementMatrix* Ke = NULL;
    541541        Tria*  tria=(Tria*)element;
    542         if(tria->NoIceInElement()) return NULL;
     542        if(!tria->IsIceInElement()) return NULL;
    543543
    544544        /*Retrieve all inputs and parameters*/
     
    629629        /*Initialize Element matrix and return if necessary*/
    630630        Tria*  tria=(Tria*)element;
    631         if(tria->NoIceInElement()) return NULL;
     631        if(!tria->IsIceInElement()) return NULL;
    632632        ElementMatrix* Ke=new ElementMatrix(nodes,NUMNODES_INTERNAL,this->parameters);
    633633
     
    692692        ElementMatrix* Ke = NULL;
    693693        Tria*  tria=(Tria*)element;
    694         if(tria->NoIceInElement()) return NULL;
     694        if(!tria->IsIceInElement()) return NULL;
    695695
    696696        /*Retrieve all inputs and parameters*/
     
    818818        ElementVector* pe = NULL;
    819819        Tria*  tria=(Tria*)element;
    820         if(tria->NoIceInElement()) return NULL;
     820        if(!tria->IsIceInElement()) return NULL;
    821821
    822822        /*Retrieve all inputs and parameters*/
     
    912912        ElementVector* pe = NULL;
    913913        Tria*  tria=(Tria*)element;
    914         if(tria->NoIceInElement()) return NULL;
     914        if(!tria->IsIceInElement()) return NULL;
    915915
    916916        /*Retrieve all inputs and parameters*/
  • issm/trunk-jpl/src/m/parameterization/setmask.m

    r17115 r17118  
    4242
    4343%level sets
    44 md.mask.ice_levelset=+1.*ones(md.mesh.numberofvertices,1);
     44md.mask.ice_levelset=-1.*ones(md.mesh.numberofvertices,1);
    4545md.mask.groundedice_levelset=vertexongroundedice;
    4646md.mask.groundedice_levelset(find(vertexongroundedice==0.))=-1.;
  • issm/trunk-jpl/src/m/parameterization/setmask.py

    r17115 r17118  
    4242
    4343        #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))
    4545        md.mask.groundedice_levelset = -1.*numpy.ones((md.mesh.numberofvertices,1))
    4646        md.mask.groundedice_levelset[md.mesh.elements[numpy.nonzero(elementongroundedice),:]-1]=1.
Note: See TracChangeset for help on using the changeset viewer.