Changeset 15792


Ignore:
Timestamp:
08/11/13 00:28:36 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: update coordinates for all basal nodes

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

Legend:

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

    r15790 r15792  
    29742974
    29752975        int        approximation;
     2976        int        numindices;
     2977        int       *indices = NULL;
    29762978        IssmDouble slopex,slopey;
    29772979        IssmDouble xz_plane[6];
     
    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*/
     
    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);
     
    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}
  • issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp

    r15779 r15792  
    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/*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/PentaRef.h

    r15694 r15792  
    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);
Note: See TracChangeset for help on using the changeset viewer.