Changeset 26531
- Timestamp:
- 11/03/21 06:48:00 (3 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r26529 r26531 179 179 else _error_("not implemented yet"); 180 180 } 181 182 }183 /*}}}*/184 void Penta::Recover3DMLHOInput(int targetVel_enum, int numnodes, IssmDouble* vb, IssmDouble* vsh, IssmDouble* n, IssmDouble* H, IssmDouble* s){/*{{{*/185 /* Recover the velocity acording to v=vb+(1-\zeta^{n+1})vsh, where \zeta=(s-z)/H186 * The variables vb, vsh, n, H and s are all from the 2D horizontal mesh(Tria), with "numnodes" DOFs187 * To project to penta the DOFs are doubled in size188 *189 */190 _assert_(this->inputs);191 if(!IsOnBase()) return;192 else{193 if(targetVel_enum==VxEnum || targetVel_enum==VyEnum){194 IssmDouble vel[NUMVERTICES];195 IssmDouble* xyz_list = NULL;196 Penta* penta = this;197 _assert_(NUMVERTICES-2*numnodes==0);198 199 for(;;){200 penta->GetVerticesCoordinates(&xyz_list);201 for(int i=0;i<numnodes;i++) {202 vel[i] = vb[i] + vsh[i]*(1.0-pow((s[i]-xyz_list[i*3+2])/H[i], (n[i]+1)));203 vel[i+NUMVERTICES2D] = vb[i] + vsh[i]*(1-pow((s[i]-xyz_list[(i+NUMVERTICES2D)*3+2])/H[i], (n[i]+1)));204 }205 xDelete<IssmDouble>(xyz_list);206 207 /*Add to the bottom side of the element*/208 penta->AddInput(targetVel_enum,&vel[0],P1Enum);209 if (penta->IsOnSurface()) break;210 penta=penta->GetUpperPenta(); _assert_(penta->Id()!=this->id);211 }212 }213 else _error_("not implemented yet");214 }215 181 216 182 } … … 3298 3264 int Penta::PressureInterpolation(void){/*{{{*/ 3299 3265 return PentaRef::PressureInterpolation(this->element_type); 3266 } 3267 /*}}}*/ 3268 void Penta::Recover3DMLHOInput(int targetVel_enum, int numnodes, IssmDouble* vb, IssmDouble* vsh, IssmDouble* n, IssmDouble* H, IssmDouble* s){/*{{{*/ 3269 /* Recover the velocity acording to v=vb+(1-\zeta^{n+1})vsh, where \zeta=(s-z)/H 3270 * The variables vb, vsh, n, H and s are all from the 2D horizontal mesh(Tria), with "numnodes" DOFs 3271 * To project to penta the DOFs are doubled in size 3272 * 3273 */ 3274 _assert_(this->inputs); 3275 if(!IsOnBase()) return; 3276 else{ 3277 if(targetVel_enum==VxEnum || targetVel_enum==VyEnum){ 3278 IssmDouble vel[NUMVERTICES2D*5]; 3279 IssmDouble* xyz_list = NULL; 3280 IssmDouble zi; 3281 Penta* penta = this; 3282 numnodes = penta->NumberofNodes(P1xP4Enum); 3283 _assert_(NUMVERTICES2D*5-numnodes==0); 3284 GaussPenta gauss; 3285 3286 for(;;){ 3287 penta->GetVerticesCoordinates(&xyz_list); 3288 for(int i=0;i<NUMVERTICES2D;i++) { 3289 for (int j=0;j<5;j++){ 3290 /* Get z-coordinate of the current node */ 3291 gauss.GaussNode(P1xP4Enum, i+j*NUMVERTICES2D); 3292 zi = this->GetZcoord(xyz_list, &gauss); 3293 vel[i+j*NUMVERTICES2D] = vb[i] + vsh[i]*(1.0-pow((s[i]-zi)/H[i], (n[i]+1))); 3294 } 3295 } 3296 xDelete<IssmDouble>(xyz_list); 3297 3298 /*Add to the bottom side of the element*/ 3299 penta->AddInput(targetVel_enum,&vel[0],P1xP4Enum); 3300 if (penta->IsOnSurface()) break; 3301 penta=penta->GetUpperPenta(); _assert_(penta->Id()!=this->id); 3302 } 3303 } 3304 else _error_("not implemented yet"); 3305 } 3306 3300 3307 } 3301 3308 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r26529 r26531 2604 2604 input->Serve(numindices,&indices[0]); 2605 2605 break; 2606 case P1xP4Enum: 2606 2607 case P1DGEnum: 2607 2608 case P1bubbleEnum:
Note:
See TracChangeset
for help on using the changeset viewer.