Changeset 16147


Ignore:
Timestamp:
09/17/13 13:18:10 (12 years ago)
Author:
seroussi
Message:

BUG: refixed problem with normal =_orientation initialization

File:
1 edited

Legend:

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

    r16146 r16147  
    10061006        /*Computeportion of the element that is grounded*/
    10071007
    1008         int         normal_orientation;
     1008        int         normal_orientation=0;
    10091009        IssmDouble  s1,s2;
    10101010        IssmDouble  levelset[NUMVERTICES];
     
    10131013        GetInputListOnVertices(&levelset[0],levelsetenum);
    10141014
    1015         if(levelset[0]*levelset[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
     1015        if(levelset[0]*levelset[1]>0.){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
    10161016                /*Portion of the segments*/
    10171017                s1=levelset[2]/(levelset[2]-levelset[1]);
    10181018                s2=levelset[2]/(levelset[2]-levelset[0]);
    10191019
    1020                 if(levelset[2]>0) normal_orientation=1;
     1020                if(levelset[2]>0.) normal_orientation=1;
    10211021                /*New point 1*/
    10221022                xyz_zero[3*normal_orientation+0]=xyz_list[2][0]+s1*(xyz_list[1][0]-xyz_list[2][0]);
     
    10291029                xyz_zero[3*(1-normal_orientation)+2]=xyz_list[2][2]+s2*(xyz_list[0][2]-xyz_list[2][2]);
    10301030        }
    1031         else if(levelset[1]*levelset[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
     1031        else if(levelset[1]*levelset[2]>0.){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
    10321032                /*Portion of the segments*/
    10331033                s1=levelset[0]/(levelset[0]-levelset[2]);
    10341034                s2=levelset[0]/(levelset[0]-levelset[1]);
    10351035
    1036                 if(levelset[0]>0) normal_orientation=1;
     1036                if(levelset[0]>0.) normal_orientation=1;
    10371037                /*New point 1*/
    10381038                xyz_zero[3*normal_orientation+0]=xyz_list[0][0]+s1*(xyz_list[2][0]-xyz_list[0][0]);
     
    10451045                xyz_zero[3*(1-normal_orientation)+2]=xyz_list[0][2]+s2*(xyz_list[1][2]-xyz_list[0][2]);
    10461046        }
    1047         else if(levelset[0]*levelset[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
     1047        else if(levelset[0]*levelset[2]>0.){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
    10481048                /*Portion of the segments*/
    10491049                s1=levelset[1]/(levelset[1]-levelset[0]);
    10501050                s2=levelset[1]/(levelset[1]-levelset[2]);
    10511051
    1052                 if(levelset[1]>0) normal_orientation=1;
     1052                if(levelset[1]>0.) normal_orientation=1;
    10531053                /*New point 0*/
    10541054                xyz_zero[3*normal_orientation+0]=xyz_list[1][0]+s1*(xyz_list[0][0]-xyz_list[1][0]);
     
    10611061                xyz_zero[3*(1-normal_orientation)+2]=xyz_list[1][2]+s2*(xyz_list[2][2]-xyz_list[1][2]);
    10621062        }
    1063         else if(levelset[0]==0 && levelset[1]==0){ //front is on point 0 and 1
     1063        else if(levelset[0]==0. && levelset[1]==0.){ //front is on point 0 and 1
    10641064                xyz_zero[3*0+0]=xyz_list[0][0];
    10651065                xyz_zero[3*0+1]=xyz_list[0][1];
     
    10711071                xyz_zero[3*1+2]=xyz_list[1][2];
    10721072        }
    1073         else if(levelset[0]==0 && levelset[2]==0){ //front is on point 0 and 1
     1073        else if(levelset[0]==0. && levelset[2]==0.){ //front is on point 0 and 1
    10741074                xyz_zero[3*0+0]=xyz_list[2][0];
    10751075                xyz_zero[3*0+1]=xyz_list[2][1];
     
    10811081                xyz_zero[3*1+2]=xyz_list[0][2];
    10821082        }
    1083         else if(levelset[1]==0 && levelset[2]==0){ //front is on point 0 and 1
     1083        else if(levelset[1]==0. && levelset[2]==0.){ //front is on point 0 and 1
    10841084                xyz_zero[3*0+0]=xyz_list[1][0];
    10851085                xyz_zero[3*0+1]=xyz_list[1][1];
Note: See TracChangeset for help on using the changeset viewer.