Changeset 23462
- Timestamp:
- 11/09/18 09:05:58 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.cpp
r23066 r23462 38 38 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 39 39 } 40 iomodel->FetchDataToInput(elements,"md.mesh.vertexonboundary",MeshVertexonboundaryEnum); 40 41 }/*}}}*/ 41 42 void GLheightadvectionAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/ … … 61 62 /*Intermediaries */ 62 63 int domaintype,dim; 63 IssmDouble Jdet,D_scalar ;64 IssmDouble Jdet,D_scalar,onboundary; 64 65 IssmDouble vel,vx,vy; 65 66 IssmDouble* xyz_list = NULL; … … 89 90 Input* vx_input=element->GetInput(VxEnum); _assert_(vx_input); 90 91 Input* vy_input=element->GetInput(VyEnum); _assert_(vy_input); 92 Input* bc_input=element->GetInput(MeshVertexonboundaryEnum); _assert_(bc_input); 91 93 92 94 IssmDouble h = element->CharacteristicLength(); … … 104 106 D_scalar=gauss->weight*Jdet; 105 107 108 /*Get velocity*/ 109 vx_input->GetInputValue(&vx,gauss); 110 vy_input->GetInputValue(&vy,gauss); 111 bc_input->GetInputValue(&onboundary,gauss); 112 if(onboundary>0.){ 113 /*We do not want to advect garbage, make sure only diffusion is applied on boundary*/ 114 vx = 0.; vy = 0.; 115 } 116 106 117 /*Diffusion */ 107 118 if(sqrt(vx*vx+vy*vy)<1000./31536000.){ 108 IssmPDouble kappa = -10 ;119 IssmPDouble kappa = -10.; 109 120 for(int i=0;i<numnodes;i++){ 110 121 for(int j=0;j<numnodes;j++){ … … 113 124 } 114 125 } 126 115 127 /*Advection: */ 116 vx_input->GetInputValue(&vx,gauss);117 vy_input->GetInputValue(&vy,gauss);118 128 for(int i=0;i<numnodes;i++){ 119 129 for(int j=0;j<numnodes;j++){ … … 122 132 } 123 133 124 /*Artif ficial diffusivity*/134 /*Artificial diffusivity*/ 125 135 vel=sqrt(vx*vx + vy*vy)+1.e-14; 126 136 D[0][0]=D_scalar*h/(2.*vel)*fabs(vx*vx); D[0][1]=D_scalar*h/(2.*vel)*fabs(vx*vy);
Note:
See TracChangeset
for help on using the changeset viewer.