Changeset 27226
- Timestamp:
- 08/24/22 13:59:17 (3 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
r27203 r27226 225 225 parameters->AddObject(iomodel->CopyConstantObject("md.calving.xoffset",CalvingXoffsetEnum)); 226 226 parameters->AddObject(iomodel->CopyConstantObject("md.calving.yoffset",CalvingYoffsetEnum)); 227 parameters->AddObject(iomodel->CopyConstantObject("md.calving.vel_threshold",CalvingVelThresholdEnum)); 227 parameters->AddObject(iomodel->CopyConstantObject("md.calving.vel_lowerbound",CalvingVelLowerboundEnum)); 228 parameters->AddObject(iomodel->CopyConstantObject("md.calving.vel_upperbound",CalvingVelUpperboundEnum)); 228 229 break; 229 230 default: -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r27203 r27226 844 844 IssmDouble arate, rho_ice, rho_water, thickness; 845 845 int use_parameter=-1; 846 IssmDouble gamma, theta, alpha, xoffset, yoffset, vel_threshold, vrate; 846 IssmDouble gamma, theta, alpha, xoffset, yoffset; 847 IssmDouble vel_lower, vel_upper, vrate, truncateVrate; 847 848 848 849 /* Get node coordinates and dof list: */ … … 870 871 this->FindParam(&xoffset, CalvingXoffsetEnum); 871 872 this->FindParam(&yoffset, CalvingYoffsetEnum); 872 this->FindParam(&vel_threshold, CalvingVelThresholdEnum); 873 this->FindParam(&vel_lower, CalvingVelLowerboundEnum); 874 this->FindParam(&vel_upper, CalvingVelUpperboundEnum); 873 875 874 876 /* Start looping on the number of vertices: */ … … 889 891 arate_input->GetInputValue(&arate,gauss); 890 892 vrate = 1.0; 891 if (vel < vel_ threshold) vrate = vel / vel_threshold;893 if (vel < vel_upper) vrate = vel / vel_upper; 892 894 893 895 /*Compute strain rate and viscosity: */ … … 920 922 gamma = yoffset - 0.5*theta*tanh(alpha*(-thickness+xoffset)); 921 923 break; 924 case 3: 925 /* 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)); 928 break; 929 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; 932 gamma = 0.5*theta*(tanh(alpha*xoffset) - tanh(alpha*(truncateVrate+xoffset))); 933 break; 922 934 case -1: 923 935 /* nothing, just the arate*/ … … 934 946 935 947 /*-------------------------------------------*/ 936 calvingrate[iv] = arate*gamma*vrate; 937 } 938 948 if (use_parameter < 3) { 949 calvingrate[iv] = arate*gamma*vrate; 950 } 951 else { 952 calvingrate[iv] = arate*gamma; 953 } 954 } 939 955 /*Add input*/ 940 956 this->AddInput(CalvingCalvingrateEnum,&calvingrate[0],P1DGEnum); -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r27203 r27226 116 116 CalvingXoffsetEnum, 117 117 CalvingYoffsetEnum, 118 CalvingVelThresholdEnum, 118 CalvingVelLowerboundEnum, 119 CalvingVelUpperboundEnum, 119 120 ConfigurationTypeEnum, 120 121 ConstantsGEnum, -
issm/trunk-jpl/src/m/classes/calvingparameterization.m
r27203 r27226 12 12 xoffset = 0; 13 13 yoffset = 0; 14 vel_threshold = 6000; 14 vel_upperbound = 6000; 15 vel_lowerbound = 0; 15 16 end 16 17 methods … … 52 53 % offset in y-axis 53 54 self.yoffset = 0; 54 % velocity threshold to reduce calving rate 55 vel_threshold = 6000; % m/a 55 % velocity thresholds to reduce calving rate 56 vel_upperbound = 6000; % m/a 57 vel_lowerbound = 0; % m/a 56 58 end % }}} 57 59 function md = checkconsistency(self,md,solution,analyses) % {{{ … … 60 62 61 63 md = checkfield(md,'fieldname','calving.min_thickness','>=',0,'NaN',1,'Inf',1,'numel',1); 62 md = checkfield(md,'fieldname','calving.use_param','values',[-1, 0, 1, 2 ]);64 md = checkfield(md,'fieldname','calving.use_param','values',[-1, 0, 1, 2, 3, 4]); 63 65 md = checkfield(md,'fieldname','calving.theta','NaN',1,'Inf',1,'numel',1); 64 66 md = checkfield(md,'fieldname','calving.alpha','NaN',1,'Inf',1,'numel',1); 65 67 md = checkfield(md,'fieldname','calving.xoffset','NaN',1,'Inf',1,'numel',1); 66 68 md = checkfield(md,'fieldname','calving.yoffset','NaN',1,'Inf',1,'numel',1); 67 md = checkfield(md,'fieldname','calving.vel_threshold','NaN',1,'Inf',1,'numel',1); 69 md = checkfield(md,'fieldname','calving.vel_lowerbound','NaN',1,'Inf',1,'numel',1); 70 md = checkfield(md,'fieldname','calving.vel_upperbound','NaN',1,'Inf',1,'numel',1); 68 71 end % }}} 69 72 function disp(self) % {{{ 70 73 disp(sprintf(' Calving test parameters:')); 71 74 fielddisplay(self,'min_thickness','minimum thickness below which no ice is allowed [m]'); 72 fielddisplay(self,'use_param','-1 - just use frontal ablation rate, 0 - f(x) = y_{o} + \alpha (x+x_{o}), 1 - f(x)=y_{o}-\frac{\theta}{2}\tanh(\alpha(x+x_{o})), 2 - tanh(thickness) ');75 fielddisplay(self,'use_param','-1 - just use frontal ablation rate, 0 - f(x) = y_{o} + \alpha (x+x_{o}), 1 - f(x)=y_{o}-\frac{\theta}{2}\tanh(\alpha(x+x_{o})), 2 - tanh(thickness), 3 - tanh(normalized vel), 4 - tanh(truncated vel)'); 73 76 fielddisplay(self,'theta','the amplifier'); 74 77 fielddisplay(self,'alpha','the slope'); 75 78 fielddisplay(self,'xoffset','offset in x-axis'); 76 79 fielddisplay(self,'yoffset','offset in y-axis'); 77 fielddisplay(self,'vel_threshold','threshold of ice velocity to reduce the calving rate'); 80 fielddisplay(self,'vel_lowerbound','lowerbound of ice velocity to reduce the calving rate [m/a]'); 81 fielddisplay(self,'vel_upperbound','upperbound of ice velocity to reduce the calving rate [m/a]'); 78 82 end % }}} 79 83 function marshall(self,prefix,md,fid) % {{{ … … 86 90 WriteData(fid,prefix,'object',self,'fieldname','xoffset','format','Double'); 87 91 WriteData(fid,prefix,'object',self,'fieldname','yoffset','format','Double'); 88 WriteData(fid,prefix,'object',self,'fieldname','vel_threshold','format','Double','scale', 1./yts); 92 WriteData(fid,prefix,'object',self,'fieldname','vel_lowerbound','format','Double','scale', 1./yts); 93 WriteData(fid,prefix,'object',self,'fieldname','vel_upperbound','format','Double','scale', 1./yts); 89 94 end % }}} 90 95 end -
issm/trunk-jpl/src/m/classes/initialization.m
r27021 r27226 150 150 yts=md.constants.yts; 151 151 152 WriteData(fid,prefix,'object',self,'fieldname','vx','format','DoubleMat','mattype',1,'scale',1./yts );153 WriteData(fid,prefix,'object',self,'fieldname','vy','format','DoubleMat','mattype',1,'scale',1./yts );152 WriteData(fid,prefix,'object',self,'fieldname','vx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); 153 WriteData(fid,prefix,'object',self,'fieldname','vy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); 154 154 WriteData(fid,prefix,'object',self,'fieldname','vz','format','DoubleMat','mattype',1,'scale',1./yts); 155 155 WriteData(fid,prefix,'object',self,'fieldname','pressure','format','DoubleMat','mattype',1); -
issm/trunk-jpl/src/m/parameterization/setflowequation.m
r27031 r27226 55 55 %check that each element has at least one flag 56 56 if any(SIAflag+SSAflag+HOflag+L1L2flag+MOLHOflag+FSflag==0), 57 error('elements type not assigned, supported models are ''SIA'',''SSA'',''HO'' and ''FS''')57 error('elements type not assigned, supported models are ''SIA'',''SSA'',''HO'',''MOLHO'' and ''FS''') 58 58 end 59 59
Note:
See TracChangeset
for help on using the changeset viewer.