Changeset 16023


Ignore:
Timestamp:
08/29/13 16:10:29 (12 years ago)
Author:
seroussi
Message:

CHG: working on Subelement2 migration in Penta

Location:
issm/trunk-jpl/src/c/classes/Elements
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r16021 r16023  
    10811081        /*Assign output pointers:*/
    10821082        *pdoflist=doflist;
     1083}
     1084/*}}}*/
     1085/*FUNCTION Penta::GetGroundedPart{{{*/
     1086void Penta::GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating){
     1087        /*Computeportion of the element that is grounded*/
     1088
     1089        bool               floating=true;
     1090        int                point;
     1091        const IssmPDouble  epsilon= 1.e-15;
     1092        IssmDouble         gl[NUMVERTICES];
     1093        IssmDouble         f1,f2;
     1094
     1095        /*Recover parameters and values*/
     1096        GetInputListOnVertices(&gl[0],MaskGroundediceLevelsetEnum);
     1097
     1098        /*Be sure that values are not zero*/
     1099        if(gl[0]==0.) gl[0]=gl[0]+epsilon;
     1100        if(gl[1]==0.) gl[1]=gl[1]+epsilon;
     1101        if(gl[2]==0.) gl[2]=gl[2]+epsilon;
     1102
     1103        /*Check that not all nodes are grounded or floating*/
     1104        if(gl[0]>0 && gl[1]>0 && gl[2]>0){ // All grounded
     1105                point=0;
     1106                f1=1.;
     1107                f2=1.;
     1108        }
     1109        else if(gl[0]<0 && gl[1]<0 && gl[2]<0){ //All floating
     1110                point=0;
     1111                f1=0.;
     1112                f2=0.;
     1113        }
     1114        else{
     1115                if(gl[0]*gl[1]*gl[2]<0) floating=false;
     1116
     1117                if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
     1118                        point=2;
     1119                        f1=gl[2]/(gl[2]-gl[0]);
     1120                        f2=gl[2]/(gl[2]-gl[1]);
     1121                }
     1122                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
     1123                        point=0;
     1124                        f1=gl[0]/(gl[0]-gl[1]);
     1125                        f2=gl[0]/(gl[0]-gl[2]);
     1126                }
     1127                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
     1128                        point=1;
     1129                        f1=gl[1]/(gl[1]-gl[2]);
     1130                        f2=gl[1]/(gl[1]-gl[0]);
     1131                }
     1132        }
     1133        *point1=point;
     1134        *fraction1=f1;
     1135        *fraction2=f2;
     1136        *mainlyfloating=floating;
    10831137}
    10841138/*}}}*/
     
    80198073
    80208074        /*Intermediaries */
     8075        bool       mainlyfloating;
    80218076        int         i,j;
    80228077        int         analysis_type,migration_style;
     
    80628117        if(migration_style==SubelementMigration2Enum){
    80638118                gllevelset_input=inputs->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input);
    8064                 //this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
     8119                this->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
    80658120                //gauss=new GaussPenta(point1,fraction1,fraction2,mainlyfloating,2);
    80668121                gauss=new GaussPenta(0,1,2,2);
  • issm/trunk-jpl/src/c/classes/Elements/Penta.h

    r15982 r16023  
    195195                void           GetVertexSidList(int* sidlist);
    196196                void           GetConnectivityList(int* connectivity);
     197                void           GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);
    197198                IssmDouble     GetGroundedPortion(IssmDouble* xyz_list);
    198199                int            GetElementType(void);
  • issm/trunk-jpl/src/c/classes/Elements/Tria.h

    r16010 r16023  
    212212                void           GetVertexSidList(int* sidlist);
    213213                void           GetConnectivityList(int* connectivity);
     214                void           GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);
    214215                IssmDouble     GetGroundedPortion(IssmDouble* xyz_list);
    215                 void           GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);
    216216                void           GetSegmentNormal(IssmDouble* normal,IssmDouble xyz_list[2][3]);
    217217                void           GetZeroLevelsetCoordinates(IssmDouble* xyz_zero,IssmDouble xyz_list[3][3],int levelsetenum);
Note: See TracChangeset for help on using the changeset viewer.