Changeset 27252
- Timestamp:
- 08/31/22 12:50:05 (3 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
r27250 r27252 226 226 parameters->AddObject(iomodel->CopyConstantObject("md.calving.yoffset",CalvingYoffsetEnum)); 227 227 parameters->AddObject(iomodel->CopyConstantObject("md.calving.vel_lowerbound",CalvingVelLowerboundEnum)); 228 parameters->AddObject(iomodel->CopyConstantObject("md.calving.vel_threshold",CalvingVelThresholdEnum)); 228 229 parameters->AddObject(iomodel->CopyConstantObject("md.calving.vel_upperbound",CalvingVelUpperboundEnum)); 229 230 break; -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r27226 r27252 845 845 int use_parameter=-1; 846 846 IssmDouble gamma, theta, alpha, xoffset, yoffset; 847 IssmDouble vel_lower, vel_upper, v rate, truncateVrate;847 IssmDouble vel_lower, vel_upper, vel_threshold, vrate, truncateVrate; 848 848 849 849 /* Get node coordinates and dof list: */ … … 873 873 this->FindParam(&vel_lower, CalvingVelLowerboundEnum); 874 874 this->FindParam(&vel_upper, CalvingVelUpperboundEnum); 875 this->FindParam(&vel_threshold, CalvingVelThresholdEnum); 875 876 876 877 /* Start looping on the number of vertices: */ … … 891 892 arate_input->GetInputValue(&arate,gauss); 892 893 vrate = 1.0; 893 if (vel < vel_ upper) vrate = vel / vel_upper;894 if (vel < vel_threshold) vrate = vel / vel_threshold; 894 895 895 896 /*Compute strain rate and viscosity: */ … … 924 925 case 3: 925 926 /* 3 tanh(normal vel): f(x)=y_{o}-\frac{\theta}{2}\tanh(\alpha(x+x_{o})) */ 926 _error_("The normalized velocity is not supported yet!");927 gamma = yoffset - 0.5*theta*tanh(alpha*( vel+xoffset));927 truncateVrate = (min(vel_upper, max(vel_lower, vel))-vel_lower) / (vel_upper - vel_lower); 928 gamma = yoffset - 0.5*theta*tanh(alpha*(truncateVrate+xoffset)); 928 929 break; 929 930 case 4: 930 /* 4 tanh( truncated vel): f(x)=y_{o}-\frac{\theta}{2}\tanh(\alpha(x+x_{o})) */931 truncateVrate = (min(vel_upper, max(vel_lower, vel))-vel_lower) / vel_upper;931 /* 4 tanh(normal vel), cross (0,0): f(x)=y_{o}-\frac{\theta}{2}\tanh(\alpha(x+x_{o})) */ 932 truncateVrate = (min(vel_upper, max(vel_lower, vel))-vel_lower) / (vel_upper - vel_lower); 932 933 gamma = 0.5*theta*(tanh(alpha*xoffset) - tanh(alpha*(truncateVrate+xoffset))); 933 934 break; … … 946 947 947 948 /*-------------------------------------------*/ 948 if (use_parameter < 3) { 949 calvingrate[iv] = arate*gamma*vrate; 950 } 951 else { 952 calvingrate[iv] = arate*gamma; 953 } 949 calvingrate[iv] = arate*gamma*vrate; 954 950 } 955 951 /*Add input*/ -
issm/trunk-jpl/src/c/cores/movingfront_core.cpp
r27017 r27252 20 20 int* extrapol_vars=NULL; 21 21 Analysis *analysis=NULL; 22 IssmDouble maxVel; 22 23 23 24 /* recover parameters */ … … 50 51 /* smoothen slope of lsf for computation of normal on ice domain*/ 51 52 levelsetfunctionslope_core(femmodel); 53 54 /* compute the maximal velocity over the whole domain */ 55 femmodel->MaxVelx(&maxVel); 56 femmodel->parameters->SetParam(maxVel, CalvingVelThresholdEnum); 52 57 53 58 /* start the work from here */ -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r27250 r27252 119 119 CalvingYoffsetEnum, 120 120 CalvingVelLowerboundEnum, 121 CalvingVelThresholdEnum, 121 122 CalvingVelUpperboundEnum, 122 123 ConfigurationTypeEnum, -
issm/trunk-jpl/src/m/classes/calvingparameterization.m
r27226 r27252 12 12 xoffset = 0; 13 13 yoffset = 0; 14 vel_upperbound = 6000; 14 vel_upperbound = 8000; 15 vel_threshold = 6000; 15 16 vel_lowerbound = 0; 16 17 end … … 68 69 md = checkfield(md,'fieldname','calving.yoffset','NaN',1,'Inf',1,'numel',1); 69 70 md = checkfield(md,'fieldname','calving.vel_lowerbound','NaN',1,'Inf',1,'numel',1); 71 md = checkfield(md,'fieldname','calving.vel_threshold','NaN',1,'Inf',1,'numel',1); 70 72 md = checkfield(md,'fieldname','calving.vel_upperbound','NaN',1,'Inf',1,'numel',1); 71 73 end % }}} … … 79 81 fielddisplay(self,'yoffset','offset in y-axis'); 80 82 fielddisplay(self,'vel_lowerbound','lowerbound of ice velocity to reduce the calving rate [m/a]'); 83 fielddisplay(self,'vel_threshold','threshold of ice velocity to reduce the calving rate [m/a]'); 81 84 fielddisplay(self,'vel_upperbound','upperbound of ice velocity to reduce the calving rate [m/a]'); 82 85 end % }}} … … 91 94 WriteData(fid,prefix,'object',self,'fieldname','yoffset','format','Double'); 92 95 WriteData(fid,prefix,'object',self,'fieldname','vel_lowerbound','format','Double','scale', 1./yts); 96 WriteData(fid,prefix,'object',self,'fieldname','vel_threshold','format','Double','scale', 1./yts); 93 97 WriteData(fid,prefix,'object',self,'fieldname','vel_upperbound','format','Double','scale', 1./yts); 94 98 end % }}}
Note:
See TracChangeset
for help on using the changeset viewer.