Changeset 15872
- Timestamp:
- 08/22/13 08:31:52 (12 years ago)
- 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 5026 5026 5027 5027 /*Fetch indices of basal nodes for this finite element*/ 5028 BasalNodeIndices(&numindices,&indices,this-> VelocityInterpolation());5028 BasalNodeIndices(&numindices,&indices,this->element_type); 5029 5029 5030 5030 /*Get parameters and inputs: */ … … 5062 5062 /* Intermediaries */ 5063 5063 bool isenthalpy; 5064 int i,j,analysis_type ;5064 int i,j,analysis_type,numindices,numindicesup; 5065 5065 IssmDouble xyz_list[NUMVERTICES][3]; 5066 5066 IssmDouble xyz_list_tria[NUMVERTICES2D][3]; … … 5077 5077 IssmDouble vx,vy,vz; 5078 5078 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; 5082 5082 5083 5083 /* Only compute melt rates at the base of grounded ice*/ … … 5104 5104 friction=new Friction("3d",inputs,matpar,analysis_type); 5105 5105 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]); 5112 5117 5113 5118 watercolumn_input->GetInputValue(&watercolumn, gauss); … … 5161 5166 // TODO: feed meltrate & watercolumn back to model 5162 5167 } 5168 5169 /*Clean up and return*/ 5170 xDelete<int>(indices); 5171 xDelete<int>(indicesup); 5172 delete gauss; 5173 delete gaussup; 5163 5174 } 5164 5175 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp
r15792 r15872 2118 2118 } 2119 2119 /*}}}*/ 2120 /*FUNCTION PentaRef::SurfaceNodeIndices{{{*/ 2121 void 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 70 70 71 71 void BasalNodeIndices(int* pnumindices,int** pindices,int finiteelement); 72 void SurfaceNodeIndices(int* pnumindices,int** pindices,int finiteelement); 72 73 int NumberofNodes(void); 73 74 int NumberofNodesVelocity(void);
Note:
See TracChangeset
for help on using the changeset viewer.