Changeset 15522


Ignore:
Timestamp:
07/19/13 10:12:23 (12 years ago)
Author:
seroussi
Message:

FIX: start to debug new front

File:
1 edited

Legend:

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

    r15518 r15522  
    700700        IssmDouble  xyz_bis[3][3];
    701701
    702         GetJacobianDeterminant(&area_init, &xyz_list[0][0],NULL);
     702        area_init=GetArea();
    703703
    704704        /*Initialize xyz_list with original xyz_list of triangle coordinates*/
    705705        for(j=0;j<3;j++){
    706                 for(k=0;k<3;j++){
     706                for(k=0;k<3;k++){
    707707                        xyz_bis[j][k]=xyz_list[j][k];
    708708                }
     
    710710        for(i=0;i<numpoints;i++){
    711711                for(j=0;j<3;j++){
    712                         for(k=0;k<3;j++){
     712                        for(k=0;k<3;k++){
    713713                                /*Change appropriate line*/
    714714                                xyz_bis[j][k]=xyz_zero[i][k];
     
    716716
    717717                        /*Compute area fraction*/
    718                         GetJacobianDeterminant(&area_portion, &xyz_bis[0][0],NULL);
     718                        area_portion=fabs(xyz_bis[1][0]*xyz_bis[2][1] - xyz_bis[1][1]*xyz_bis[2][0] + xyz_bis[0][0]*xyz_bis[1][1] - xyz_bis[0][1]*xyz_bis[1][0] + xyz_bis[2][0]*xyz_bis[0][1] - xyz_bis[2][1]*xyz_bis[0][0])/2.;
    719719                        *(area_coordinates+3*i+j)=area_portion/area_init;
    720720
    721721                        /*Reinitialize xyz_list*/
    722                         for(k=0;k<3;j++){
     722                        for(k=0;k<3;k++){
    723723                                /*Reinitialize xyz_list with original coordinates*/
    724724                                xyz_bis[j][k]=xyz_list[j][k];
     
    948948                s2=levelset[2]/(levelset[2]-levelset[0]);
    949949
    950                 if(levelset[2]>0) normal_orientation=0;
     950                if(levelset[2]>0) normal_orientation=1;
    951951                /*New point 1*/
    952952                xyz_zero[3*normal_orientation+0]=xyz_list[2][0]+s1*(xyz_list[1][0]-xyz_list[2][0]);
     
    964964                s2=levelset[0]/(levelset[0]-levelset[1]);
    965965
    966                 if(levelset[0]>0) normal_orientation=0;
     966                if(levelset[0]>0) normal_orientation=1;
    967967                /*New point 1*/
    968968                xyz_zero[3*normal_orientation+0]=xyz_list[0][0]+s1*(xyz_list[2][0]-xyz_list[0][0]);
     
    980980                s2=levelset[1]/(levelset[1]-levelset[2]);
    981981
    982                 if(levelset[1]>0) normal_orientation=0;
     982                if(levelset[1]>0) normal_orientation=1;
    983983                /*New point 0*/
    984984                xyz_zero[3*normal_orientation+0]=xyz_list[1][0]+s1*(xyz_list[0][0]-xyz_list[1][0]);
     
    990990                xyz_zero[3*(1-normal_orientation)+1]=xyz_list[1][1]+s2*(xyz_list[2][1]-xyz_list[1][1]);
    991991                xyz_zero[3*(1-normal_orientation)+2]=xyz_list[1][2]+s2*(xyz_list[2][2]-xyz_list[1][2]);
    992                 }
    993 
     992        }
     993        else if(levelset[0]==0 && levelset[1]==0){ //front is on point 0 and 1
     994                xyz_zero[3*0+0]=xyz_list[0][0];
     995                xyz_zero[3*0+1]=xyz_list[0][1];
     996                xyz_zero[3*0+2]=xyz_list[0][2];
     997
     998                /*New point 2*/
     999                xyz_zero[3*1+0]=xyz_list[1][0];
     1000                xyz_zero[3*1+1]=xyz_list[1][1];
     1001                xyz_zero[3*1+2]=xyz_list[1][2];
     1002        }
     1003        else if(levelset[0]==0 && levelset[2]==0){ //front is on point 0 and 1
     1004                xyz_zero[3*0+0]=xyz_list[0][0];
     1005                xyz_zero[3*0+1]=xyz_list[0][1];
     1006                xyz_zero[3*0+2]=xyz_list[0][2];
     1007
     1008                /*New point 2*/
     1009                xyz_zero[3*1+0]=xyz_list[2][0];
     1010                xyz_zero[3*1+1]=xyz_list[2][1];
     1011                xyz_zero[3*1+2]=xyz_list[2][2];
     1012        }
     1013        else if(levelset[1]==0 && levelset[2]==0){ //front is on point 0 and 1
     1014                xyz_zero[3*0+0]=xyz_list[1][0];
     1015                xyz_zero[3*0+1]=xyz_list[1][1];
     1016                xyz_zero[3*0+2]=xyz_list[1][2];
     1017
     1018                /*New point 2*/
     1019                xyz_zero[3*1+0]=xyz_list[2][0];
     1020                xyz_zero[3*1+1]=xyz_list[2][1];
     1021                xyz_zero[3*1+2]=xyz_list[2][2];
     1022        }
     1023        else _error_("Case not covered");
    9941024}
    9951025/*}}}*/
     
    31243154        bool        isfront;
    31253155
    3126         return NULL;
    3127 
    31283156        /*Retrieve all inputs and parameters*/
    31293157        GetInputListOnVertices(&ls[0],IcelevelsetEnum);
     
    31373165        }
    31383166
     3167        return NULL;
    31393168        /*If no front, return NULL*/
    31403169        if(!isfront) return NULL;
     
    31963225        delete gauss;
    31973226        return pe;
    3198 
    31993227}
    32003228/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.