source: issm/oecreview/Archive/15392-16133/ISSM-15791-15792.diff@ 16134

Last change on this file since 16134 was 16134, checked in by Mathieu Morlighem, 12 years ago

Added Archive/15392-16133

File size: 4.0 KB
  • ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp

     
    20592059        return -1;
    20602060}
    20612061/*}}}*/
     2062/*FUNCTION PentaRef::BasalNodeIndices{{{*/
     2063void PentaRef::BasalNodeIndices(int* pnumindices,int** pindices,int finiteelement){
     2064
     2065        /*Output*/
     2066        int  numindices;
     2067        int* indices = NULL;
     2068
     2069        switch(finiteelement){
     2070                case P1Enum: case P1DGEnum:
     2071                        numindices = 3;
     2072                        indices    = xNew<int>(numindices);
     2073                        indices[0] = 0;
     2074                        indices[1] = 1;
     2075                        indices[2] = 2;
     2076                        break;
     2077                case P1bubbleEnum: case P1bubblecondensedEnum:
     2078                        numindices = 3;
     2079                        indices    = xNew<int>(numindices);
     2080                        indices[0] = 0;
     2081                        indices[1] = 1;
     2082                        indices[2] = 2;
     2083                        break;
     2084                case P2xP1Enum:
     2085                        numindices = 6;
     2086                        indices    = xNew<int>(numindices);
     2087                        indices[0] = 0;
     2088                        indices[1] = 1;
     2089                        indices[2] = 2;
     2090                        indices[3] = 6;
     2091                        indices[4] = 7;
     2092                        indices[5] = 8;
     2093                        break;
     2094                case P1xP2Enum:
     2095                        numindices = 3;
     2096                        indices    = xNew<int>(numindices);
     2097                        indices[0] = 0;
     2098                        indices[1] = 1;
     2099                        indices[2] = 2;
     2100                        return;
     2101                case P2Enum:
     2102                        numindices = 6;
     2103                        indices    = xNew<int>(numindices);
     2104                        indices[0] = 0;
     2105                        indices[1] = 1;
     2106                        indices[2] = 2;
     2107                        indices[3] = 9;
     2108                        indices[4] = 10;
     2109                        indices[5] = 11;
     2110                        break;
     2111                default:
     2112                        _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
     2113        }
     2114
     2115        /*Assign output pointer*/
     2116        *pnumindices = numindices;
     2117        *pindices    = indices;
     2118}
     2119/*}}}*/
  • ../trunk-jpl/src/c/classes/Elements/Penta.cpp

     
    29732973void  Penta::ResetCoordinateSystem(void){
    29742974
    29752975        int        approximation;
     2976        int        numindices;
     2977        int       *indices = NULL;
    29762978        IssmDouble slopex,slopey;
    29772979        IssmDouble xz_plane[6];
    29782980
     
    29812983        if(IsFloating() || !IsOnBed() || (approximation!=FSApproximationEnum && approximation!=SSAFSApproximationEnum &&  approximation!=HOFSApproximationEnum)) return;
    29822984
    29832985        /*Get number of nodes for velocity only and base*/
    2984         int  vnumnodes = this->NumberofNodesVelocity();
     2986        BasalNodeIndices(&numindices,&indices,this->VelocityInterpolation());
    29852987
    29862988        /*Get inputs*/
    29872989        Input* slopex_input=inputs->GetInput(BedSlopeXEnum); _assert_(slopex_input);
     
    29892991
    29902992        /*Loop over basal nodes and update their CS*/
    29912993        GaussPenta* gauss = new GaussPenta();
    2992         for(int i=0;i<3;i++){//FIXME
    2993                 gauss->GaussNode(this->VelocityInterpolation(),i);
     2994        for(int i=0;i<numindices;i++){//FIXME
     2995                gauss->GaussNode(this->VelocityInterpolation(),indices[i]);
    29942996
    29952997                slopex_input->GetInputValue(&slopex,gauss);
    29962998                slopey_input->GetInputValue(&slopey,gauss);
     
    30003002                xz_plane[1]=0.;       xz_plane[4]=-slopey; 
    30013003                xz_plane[2]=slopex;   xz_plane[5]=1.;         
    30023004
    3003                 XZvectorsToCoordinateSystem(&this->nodes[i]->coord_system[0][0],&xz_plane[0]);
     3005                XZvectorsToCoordinateSystem(&this->nodes[indices[i]]->coord_system[0][0],&xz_plane[0]);
    30043006        }
    30053007
    30063008        /*cleanup*/
     3009        xDelete<int>(indices);
    30073010        delete gauss;
    30083011}
    30093012/*}}}*/
  • ../trunk-jpl/src/c/classes/Elements/PentaRef.h

     
    6868                void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, GaussPenta* gauss);
    6969                void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, GaussTria* gauss){_error_("only PentaGauss are supported");};
    7070
     71                int  BasalNodeIndices(int* pnumindices,int** pindices,int finiteelement);
    7172                int  NumberofNodes(void);
    7273                int  NumberofNodesVelocity(void);
    7374                int  NumberofNodesPressure(void);
Note: See TracBrowser for help on using the repository browser.