Ignore:
Timestamp:
11/16/13 20:14:26 (11 years ago)
Author:
Mathieu Morlighem
Message:

NEW: done with FS shelf

File:
1 edited

Legend:

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

    r16805 r16807  
    11621162
    11631163}/*}}}*/
    1164 /*FUNCTION Tria::GetSegmentNormal {{{*/
    1165 void Tria:: GetSegmentNormal(IssmDouble* normal,IssmDouble xyz_list[2][3]){
     1164/*FUNCTION Tria::NormalBase {{{*/
     1165void Tria::NormalBase(IssmDouble* normal,IssmDouble* xyz_list){
    11661166
    11671167        /*Build unit outward pointing vector*/
     
    11691169        IssmDouble norm;
    11701170
    1171         vector[0]=xyz_list[1][0] - xyz_list[0][0];
    1172         vector[1]=xyz_list[1][1] - xyz_list[0][1];
     1171        vector[0]=xyz_list[1*3+0] - xyz_list[0*3+0];
     1172        vector[1]=xyz_list[1*3+1] - xyz_list[0*3+1];
    11731173
    11741174        norm=sqrt(vector[0]*vector[0] + vector[1]*vector[1]);
     
    19761976
    19771977        bool onbed;
    1978         inputs->GetInputValue(&onbed,MeshElementonbedEnum);
     1978        int meshtype;
     1979        this->parameters->FindParam(&meshtype,MeshTypeEnum);
     1980        switch(meshtype){
     1981                case Mesh2DverticalEnum:
     1982                        return HasEdgeOnBed();
     1983                        break;
     1984                case Mesh2DhorizontalEnum:
     1985                        inputs->GetInputValue(&onbed,MeshElementonbedEnum);
     1986                        break;
     1987                default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet");
     1988        }
    19791989        return onbed;
    19801990}
     
    38763886        GetZeroLevelsetCoordinates(&xyz_list_front[0][0],xyz_list,MaskIceLevelsetEnum);
    38773887        GetAreaCoordinates(&area_coordinates[0][0],xyz_list_front,xyz_list,2);
    3878         GetSegmentNormal(&normal[0],xyz_list_front);
     3888        NormalBase(&normal[0],&xyz_list_front[0][0]);
    38793889
    38803890        /*Start looping on Gaussian points*/
     
    40224032                GetNodalFunctionsVelocity(vbasis, gauss);
    40234033
    4024                 GetSegmentNormal(&normal[0],xyz_list_seg);
     4034                NormalBase(&normal[0],&xyz_list_seg[0][0]);
    40254035                _assert_(normal[1]<0.);
    40264036                bed_input->GetInputValue(&bed, gauss);
     
    41574167        GetZeroLevelsetCoordinates(&xyz_list_front[0][0],xyz_list,MaskIceLevelsetEnum);
    41584168        GetAreaCoordinates(&area_coordinates[0][0],xyz_list_front,xyz_list,2);
    4159         GetSegmentNormal(&normal[0],xyz_list_front);
     4169        NormalBase(&normal[0],&xyz_list_front[0][0]);
    41604170
    41614171        /*Start looping on Gaussian points*/
     
    71257135        this->EdgeOnSurfaceIndices(&indices[0],&indices[1]);
    71267136        for(int i=0;i<NUMVERTICES1D;i++) for(int j=0;j<2;j++) xyz_list_seg[i][j]=xyz_list[indices[i]][j];
    7127         GetSegmentNormal(&normal[0],xyz_list_seg);
     7137        NormalBase(&normal[0],&xyz_list_seg[0][0]);
    71287138
    71297139        /* Start  looping on the number of gaussian points: */
     
    71757185        this->EdgeOnBedIndices(&indices[0],&indices[1]);
    71767186        for(int i=0;i<NUMVERTICES1D;i++) for(int j=0;j<2;j++) xyz_list_seg[i][j]=xyz_list[indices[i]][j];
    7177         GetSegmentNormal(&normal[0],xyz_list_seg);
     7187        NormalBase(&normal[0],&xyz_list_seg[0][0]);
    71787188
    71797189        /* Start  looping on the number of gaussian points: */
Note: See TracChangeset for help on using the changeset viewer.