Changeset 15872


Ignore:
Timestamp:
08/22/13 08:31:52 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: fixing some stuff for Johannes

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

Legend:

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

    r15870 r15872  
    50265026
    50275027        /*Fetch indices of basal nodes for this finite element*/
    5028         BasalNodeIndices(&numindices,&indices,this->VelocityInterpolation());
     5028        BasalNodeIndices(&numindices,&indices,this->element_type);
    50295029
    50305030        /*Get parameters and inputs: */
     
    50625062        /* Intermediaries */
    50635063        bool        isenthalpy;
    5064         int         i,j,analysis_type;
     5064        int         i,j,analysis_type,numindices,numindicesup;
    50655065        IssmDouble  xyz_list[NUMVERTICES][3];
    50665066        IssmDouble  xyz_list_tria[NUMVERTICES2D][3];
     
    50775077        IssmDouble  vx,vy,vz;
    50785078        IssmDouble  dt;
    5079         Friction   *friction                 = NULL;
    5080         GaussPenta *gauss                    = NULL;
    5081         GaussPenta *gaussup                  = NULL;
     5079        int        *indices   = NULL;
     5080        int        *indicesup = NULL;
     5081        Friction   *friction  = NULL;
    50825082
    50835083        /* Only compute melt rates at the base of grounded ice*/
     
    51045104        friction=new Friction("3d",inputs,matpar,analysis_type);
    51055105
    5106         /* Start  looping on the number of gaussian points: */
    5107         gauss=new GaussPenta(0,1,2,2);
    5108         gaussup=new GaussPenta(3,4,5,2);
    5109         for(int ig=gauss->begin();ig<gauss->end();ig++){
    5110                 gauss->GaussPoint(ig);
    5111                 gaussup->GaussPoint(ig);
     5106        /*Fetch indices of basal and surface nodes for this finite element*/
     5107        BasalNodeIndices(&numindices,&indices,this->element_type);
     5108        SurfaceNodeIndices(&numindicesup,&indicesup,this->element_type);
     5109        _assert_(numindices==numindicesup);
     5110
     5111        /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
     5112        GaussPenta* gauss=new GaussPenta();
     5113        GaussPenta* gaussup=new GaussPenta();
     5114        for(i=0;i<numindices;i++){
     5115                gauss->GaussNode(this->element_type,indices[i]);
     5116                gaussup->GaussNode(this->element_type,indicesup[i]);
    51125117
    51135118                watercolumn_input->GetInputValue(&watercolumn, gauss);
     
    51615166                // TODO: feed meltrate & watercolumn back to model
    51625167        } 
     5168
     5169        /*Clean up and return*/
     5170        xDelete<int>(indices);
     5171        xDelete<int>(indicesup);
     5172        delete gauss;
     5173        delete gaussup;
    51635174}
    51645175/*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp

    r15792 r15872  
    21182118}
    21192119/*}}}*/
     2120/*FUNCTION PentaRef::SurfaceNodeIndices{{{*/
     2121void PentaRef::SurfaceNodeIndices(int* pnumindices,int** pindices,int finiteelement){
     2122
     2123        /*Output*/
     2124        int  numindices;
     2125        int* indices = NULL;
     2126
     2127        switch(finiteelement){
     2128                case P1Enum: case P1DGEnum:
     2129                        numindices = 3;
     2130                        indices    = xNew<int>(numindices);
     2131                        indices[0] = 3;
     2132                        indices[1] = 4;
     2133                        indices[2] = 5;
     2134                        break;
     2135                case P1bubbleEnum: case P1bubblecondensedEnum:
     2136                        numindices = 3;
     2137                        indices    = xNew<int>(numindices);
     2138                        indices[0] = 3;
     2139                        indices[1] = 4;
     2140                        indices[2] = 5;
     2141                        break;
     2142                case P2xP1Enum:
     2143                        numindices = 6;
     2144                        indices    = xNew<int>(numindices);
     2145                        indices[0] = 3;
     2146                        indices[1] = 4;
     2147                        indices[2] = 5;
     2148                        indices[3] = 9;
     2149                        indices[4] = 10;
     2150                        indices[5] = 11;
     2151                        break;
     2152                case P1xP2Enum:
     2153                        numindices = 3;
     2154                        indices    = xNew<int>(numindices);
     2155                        indices[0] = 3;
     2156                        indices[1] = 4;
     2157                        indices[2] = 5;
     2158                        return;
     2159                case P2Enum:
     2160                        numindices = 6;
     2161                        indices    = xNew<int>(numindices);
     2162                        indices[0] = 3;
     2163                        indices[1] = 4;
     2164                        indices[2] = 5;
     2165                        indices[3] = 12;
     2166                        indices[4] = 13;
     2167                        indices[5] = 14;
     2168                        break;
     2169                default:
     2170                        _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
     2171        }
     2172
     2173        /*Assign output pointer*/
     2174        *pnumindices = numindices;
     2175        *pindices    = indices;
     2176}
     2177/*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/PentaRef.h

    r15793 r15872  
    7070
    7171                void BasalNodeIndices(int* pnumindices,int** pindices,int finiteelement);
     72                void SurfaceNodeIndices(int* pnumindices,int** pindices,int finiteelement);
    7273                int  NumberofNodes(void);
    7374                int  NumberofNodesVelocity(void);
Note: See TracChangeset for help on using the changeset viewer.