Changeset 23970
- Timestamp:
- 05/31/19 11:24:02 (6 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp
r23968 r23970 60 60 } 61 61 iomodel->DeleteData(1,"md.mesh.vertexonbase"); 62 63 /*Deal with Neumann BC*/ 64 int M,N; 65 int *segments = NULL; 66 iomodel->FetchData(&segments,&M,&N,"md.mesh.segments"); 67 68 /*Check that the size seem right*/ 69 _assert_(N==3); _assert_(M>=3); 70 for(int i=0;i<M;i++){ 71 if(iomodel->my_elements[segments[i*3+2]-1]){ 72 loads->AddObject(new Neumannflux(i+1,i,iomodel,segments)); 73 } 74 } 75 62 76 }/*}}}*/ 63 77 void HydrologyGlaDSAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/ … … 108 122 iomodel->FetchDataToInput(elements,"md.hydrology.bump_height",HydrologyBumpHeightEnum); 109 123 iomodel->FetchDataToInput(elements,"md.hydrology.sheet_conductivity",HydrologySheetConductivityEnum); 124 iomodel->FetchDataToInput(elements,"md.hydrology.neumannflux",HydrologyNeumannfluxEnum,0.); 110 125 iomodel->FetchDataToInput(elements,"md.initialization.watercolumn",HydrologySheetThicknessEnum); 111 126 iomodel->FetchDataToInput(elements,"md.initialization.hydraulic_potential",HydraulicPotentialEnum); -
issm/trunk-jpl/src/c/classes/Loads/Neumannflux.cpp
r23959 r23970 187 187 /*Nothing!*/ 188 188 break; 189 case HydrologyGlaDSAnalysisEnum: 190 /*Nothing!*/ 191 break; 189 192 default: 190 193 _error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet"); … … 209 212 case HydrologyShaktiAnalysisEnum: 210 213 pe=CreatePVectorHydrologyShakti(); 214 break; 215 case HydrologyGlaDSAnalysisEnum: 216 pe=CreatePVectorHydrologyGlaDS(); 211 217 break; 212 218 default: … … 379 385 } 380 386 /*}}}*/ 387 ElementVector* Neumannflux::CreatePVectorHydrologyGlaDS(void){/*{{{*/ 388 389 /* constants*/ 390 const int numdof=2; 391 392 /* Intermediaries*/ 393 IssmDouble Jdet,flux; 394 IssmDouble xyz_list[NUMVERTICES][3]; 395 IssmDouble basis[numdof]; 396 397 /*Initialize Load Vector and return if necessary*/ 398 Tria* tria=(Tria*)element; 399 _assert_(tria->FiniteElement()==P1Enum); 400 if(!tria->IsIceInElement() || tria->IsFloating()) return NULL; 401 402 /*Initialize Element vector and other vectors*/ 403 ElementVector* pe=new ElementVector(nodes,NUMNODES_BOUNDARY,this->parameters); 404 405 /*Retrieve all inputs and parameters*/ 406 GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 407 Input* flux_input = tria->inputs->GetInput(HydrologyNeumannfluxEnum); _assert_(flux_input); 408 409 /*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/ 410 int index1=tria->GetNodeIndex(nodes[0]); 411 int index2=tria->GetNodeIndex(nodes[1]); 412 413 /* Start looping on the number of gaussian points: */ 414 GaussTria* gauss=new GaussTria(index1,index2,2); 415 for(int ig=gauss->begin();ig<gauss->end();ig++){ 416 417 gauss->GaussPoint(ig); 418 419 tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss); 420 tria->GetSegmentNodalFunctions(&basis[0],gauss,index1,index2,tria->FiniteElement()); 421 flux_input->GetInputValue(&flux,gauss); 422 423 for(int i=0;i<numdof;i++) pe->values[i] += gauss->weight*Jdet*flux*basis[i]; 424 } 425 426 /*Clean up and return*/ 427 delete gauss; 428 return pe; 429 } 430 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Loads/Neumannflux.h
r23959 r23970 72 72 /*Neumannflux management:{{{*/ 73 73 ElementVector* CreatePVectorHydrologyShakti(void); 74 ElementVector* CreatePVectorHydrologyGlaDS(void); 74 75 /*}}}*/ 75 76
Note:
See TracChangeset
for help on using the changeset viewer.