Changeset 22294
- Timestamp:
- 12/19/17 03:01:17 (7 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/AdaptiveMeshRefinement.cpp
r22276 r22294 112 112 if(this->groundingline_distance>0 && !gl_distance) _error_("gl_distance is NULL!\n"); 113 113 if(this->icefront_distance>0 && !if_distance) _error_("if_distance is NULL!\n"); 114 /*Attributes verifications*/ 115 if(this->deviatoricerror_threshold>0 && this->deviatoricerror_groupthreshold<DBL_EPSILON) _error_("group threshold is too small!"); 116 if(this->thicknesserror_threshold>0 && this->thicknesserror_groupthreshold<DBL_EPSILON) _error_("group threshold is too small!"); 114 117 115 118 /*Intermediaries*/ … … 229 232 gl_distance_h = this->lag*gl_distance_hmax*std::pow(this->gradation,this->level_max-gmesh->Element(i)->Level()); 230 233 if_distance_h = this->lag*if_distance_hmax*std::pow(this->gradation,this->level_max-gmesh->Element(i)->Level()); 231 d_maxerror = 0.01*this->deviatoricerror_maximum;//itapopo definir melhor 0.05232 t_maxerror = 0.01*this->thicknesserror_maximum;//itapopo definir melhor 0.05234 d_maxerror = this->deviatoricerror_groupthreshold*this->deviatoricerror_maximum; 235 t_maxerror = this->thicknesserror_groupthreshold*this->thicknesserror_maximum; 233 236 /*Get the sons of the father (sibilings)*/ 234 237 sons.clear(); -
issm/trunk-jpl/src/c/classes/AdaptiveMeshRefinement.h
r22276 r22294 64 64 double icefront_distance; //all elements with distance from ice front <= icefront_distance will be refined 65 65 double thicknesserror_threshold; //if ==0, it will not be used 66 double thicknesserror_groupthreshold;//group threshold 66 67 double thicknesserror_maximum; //max value of the error estimator; in general, it is defined in the first time step. Attention with restart 67 68 double deviatoricerror_threshold; //if ==0, it will not be used 69 double deviatoricerror_groupthreshold;//group threshold 68 70 double deviatoricerror_maximum; //max value of the error estimator; in general, it is defined in the first time step. Attention with restart 69 71 /*}}}*/ -
issm/trunk-jpl/src/c/classes/AmrBamg.cpp
r22252 r22294 20 20 21 21 /*These attributes MUST be setup by FemModel*/ 22 this->fieldenum = -1;//fieldenum_in; 23 this->keepmetric = -1;//keepmetric_in; 24 this->groundingline_resolution = -1;//groundingline_resolution_in; 25 this->groundingline_distance = -1;//groundingline_distance_in; 26 this->icefront_resolution = -1;//icefront_resolution_in; 27 this->icefront_distance = -1;//icefront_distance_in; 28 this->thicknesserror_resolution = -1;//thicknesserror_resolution_in; 29 this->thicknesserror_threshold = -1;//thicknesserror_threshold_in; 30 this->thicknesserror_maximum = -1; 31 this->deviatoricerror_resolution = -1;//deviatoricerror_resolution_in; 32 this->deviatoricerror_threshold = -1;//deviatoricerror_threshold_in; 33 this->deviatoricerror_maximum = -1; 22 this->fieldenum = -1; 23 this->keepmetric = -1; 24 this->groundingline_resolution = -1; 25 this->groundingline_distance = -1; 26 this->icefront_resolution = -1; 27 this->icefront_distance = -1; 28 this->thicknesserror_resolution = -1; 29 this->thicknesserror_threshold = -1; 30 this->thicknesserror_groupthreshold = -1; 31 this->thicknesserror_maximum = -1; 32 this->deviatoricerror_resolution = -1; 33 this->deviatoricerror_threshold = -1; 34 this->deviatoricerror_groupthreshold = -1; 35 this->deviatoricerror_maximum = -1; 34 36 35 37 /*Geometry and mesh as NULL*/ 36 this->geometry 37 this->fathermesh 38 this->previousmesh 38 this->geometry = NULL; 39 this->fathermesh = NULL; 40 this->previousmesh = NULL; 39 41 40 42 /*Only initialize options for now (same as bamg.m)*/ 41 this->options 42 this->options->anisomax 43 this->options->cutoff 44 this->options->coeff 45 this->options->errg 46 this->options->gradation 47 this->options->Hessiantype 48 this->options->maxnbv 49 this->options->maxsubdiv 50 this->options->Metrictype 51 this->options->nbjacobi 52 this->options->nbsmooth 53 this->options->omega 54 this->options->power 55 this->options->verbose 56 this->options->Crack 57 this->options->KeepVertices 58 this->options->splitcorners 59 this->options->hmin 60 this->options->hmax 61 this->options->err = xNew<IssmDouble>(1);62 this->options->err[0] = -1;/*MUST be setup by the FemModel*/63 this->options->errSize[0] = 1;64 this->options->errSize[1] = 1;43 this->options = new BamgOpts(); 44 this->options->anisomax = 10.e30; 45 this->options->cutoff = 10.e-5; 46 this->options->coeff = 1; 47 this->options->errg = 0.1; 48 this->options->gradation = -1; //MUST be setup by the FemModel 49 this->options->Hessiantype = 0; 50 this->options->maxnbv = 1e6; 51 this->options->maxsubdiv = 10; 52 this->options->Metrictype = 0; 53 this->options->nbjacobi = 1; 54 this->options->nbsmooth = 3; 55 this->options->omega = 1.8; 56 this->options->power = 1; 57 this->options->verbose = 0; 58 this->options->Crack = 0; 59 this->options->KeepVertices = 1; /*!!!!! VERY IMPORTANT !!!!! This avoid numerical errors when remeshing*/ 60 this->options->splitcorners = 1; 61 this->options->hmin = -1;/*MUST be setup by the FemModel*/ 62 this->options->hmax = -1;/*MUST be setup by the FemModel*/ 63 this->options->err = xNew<IssmDouble>(1); 64 this->options->err[0] = -1;/*MUST be setup by the FemModel*/ 65 this->options->errSize[0] = 1; 66 this->options->errSize[1] = 1; 65 67 } 66 68 /*}}}*/ -
issm/trunk-jpl/src/c/classes/AmrBamg.h
r22241 r22294 21 21 IssmDouble thicknesserror_resolution; 22 22 IssmDouble thicknesserror_threshold; 23 IssmDouble thicknesserror_groupthreshold; 23 24 IssmDouble thicknesserror_maximum; 24 25 IssmDouble deviatoricerror_resolution; 25 26 IssmDouble deviatoricerror_threshold; 27 IssmDouble deviatoricerror_groupthreshold; 26 28 IssmDouble deviatoricerror_maximum; 27 29 -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r22285 r22294 2424 2424 int* my_vertices = NULL; 2425 2425 int elementswidth = this->GetElementsWidth();//just tria elements in this version 2426 int amrtype ;2426 int amrtype,basalforcing_model; 2427 2427 bool isgroundingline; 2428 2428 2429 2429 /*Branch to specific amr depending on requested method*/ 2430 parameters->FindParam(&amrtype,AmrTypeEnum);2430 this->parameters->FindParam(&amrtype,AmrTypeEnum); 2431 2431 switch(amrtype){ 2432 2432 #if defined(_HAVE_NEOPZ_) && !defined(_HAVE_ADOLC_) … … 2539 2539 2540 2540 /*Insert MISMIP+ bed topography FIXME it could be stay in another place*/ 2541 if(false) this->BedrockFromMismipPlus(); 2541 this->parameters->FindParam(&basalforcing_model,BasalforcingsEnum); 2542 if(basalforcing_model==MismipFloatingMeltRateEnum) this->BedrockFromMismipPlus(); 2542 2543 2543 2544 /*Adjust base, thickness and mask grounded ice leve set*/ … … 2563 2564 /*This was used to Misomip project/simulations*/ 2564 2565 2566 if(VerboseSolution())_printf0_(" call Mismip bedrock adjust module\n"); 2567 2565 2568 IssmDouble x,y,bx,by; 2566 2569 int numvertices = this->GetElementsWidth(); … … 2570 2573 for(int el=0;el<this->elements->Size();el++){ 2571 2574 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(el)); 2572 2573 2575 element->GetVerticesCoordinates(&xyz_list); 2574 2576 for(int i=0;i<numvertices;i++){ 2575 x = xyz_list[3*i+0]; 2576 y = xyz_list[3*i+1]; 2577 2578 bx=-150.-728.8*pow(x/300000.,2)+343.91*pow(x/300000.,4)-50.57*pow(x/300000.,6); 2579 by=500./(1.+exp((-2./4000.)*(y-80000./2.-24000.)))+500./(1.+exp((2./4000.)*(y-80000./2.+24000.))); 2580 2581 r[i] = -720.; 2582 if(bx+by>-720.) r[i] = bx+by; 2577 x = xyz_list[3*i+0]; 2578 y = xyz_list[3*i+1]; 2579 bx = -150.-728.8*pow(x/300000.,2)+343.91*pow(x/300000.,4)-50.57*pow(x/300000.,6); 2580 by = 500./(1.+exp((-2./4000.)*(y-80000./2.-24000.)))+500./(1.+exp((2./4000.)*(y-80000./2.+24000.))); 2581 r[i] = max(bx+by,-720.); 2583 2582 } 2584 2585 2583 /*insert new bedrock*/ 2586 2584 element->AddInput(BedEnum,&r[0],P1Enum); 2587 2588 2585 /*Cleanup*/ 2589 2586 xDelete<IssmDouble>(xyz_list); 2590 2587 } 2591 2592 2588 /*Delete*/ 2593 2589 xDelete<IssmDouble>(r); … … 2596 2592 void FemModel::AdjustBaseThicknessAndMask(void){/*{{{*/ 2597 2593 2594 if(VerboseSolution())_printf0_(" call adjust base and thickness module\n"); 2595 2598 2596 int numvertices = this->GetElementsWidth(); 2599 2597 IssmDouble rho_water,rho_ice,density,base_float; … … 4743 4741 this->parameters->FindParam(&this->amrbamg->thicknesserror_resolution,AmrThicknessErrorResolutionEnum); 4744 4742 this->parameters->FindParam(&this->amrbamg->thicknesserror_threshold,AmrThicknessErrorThresholdEnum); 4743 this->parameters->FindParam(&this->amrbamg->thicknesserror_groupthreshold,AmrThicknessErrorGroupThresholdEnum); 4745 4744 this->parameters->FindParam(&this->amrbamg->thicknesserror_maximum,AmrThicknessErrorMaximumEnum); 4746 4745 this->parameters->FindParam(&this->amrbamg->deviatoricerror_resolution,AmrDeviatoricErrorResolutionEnum); 4747 4746 this->parameters->FindParam(&this->amrbamg->deviatoricerror_threshold,AmrDeviatoricErrorThresholdEnum); 4747 this->parameters->FindParam(&this->amrbamg->deviatoricerror_groupthreshold,AmrDeviatoricErrorGroupThresholdEnum); 4748 4748 this->parameters->FindParam(&this->amrbamg->deviatoricerror_maximum,AmrDeviatoricErrorMaximumEnum); 4749 4749 /*Set BamgOpts*/ … … 4814 4814 IssmDouble* z = NULL; 4815 4815 int* index = NULL; 4816 IssmDouble maxerror,threshold, resolution,length;4816 IssmDouble maxerror,threshold,groupthreshold,resolution,length; 4817 4817 IssmDouble L1,L2,L3; 4818 4818 int vid,v1,v2,v3; … … 4822 4822 switch(errorestimator_type){ 4823 4823 case ThicknessErrorEstimatorEnum: 4824 threshold = this->amrbamg->thicknesserror_threshold; 4825 resolution = this->amrbamg->thicknesserror_resolution; 4826 maxerror = this->amrbamg->thicknesserror_maximum; 4824 threshold = this->amrbamg->thicknesserror_threshold; 4825 groupthreshold = this->amrbamg->thicknesserror_groupthreshold; 4826 resolution = this->amrbamg->thicknesserror_resolution; 4827 maxerror = this->amrbamg->thicknesserror_maximum; 4827 4828 this->ThicknessZZErrorEstimator(&error_elements);//error is serial, but the calculation is parallel 4828 4829 break; 4829 4830 case DeviatoricStressErrorEstimatorEnum: 4830 threshold = this->amrbamg->deviatoricerror_threshold; 4831 resolution = this->amrbamg->deviatoricerror_resolution; 4832 maxerror = this->amrbamg->deviatoricerror_maximum; 4831 threshold = this->amrbamg->deviatoricerror_threshold; 4832 groupthreshold = this->amrbamg->deviatoricerror_groupthreshold; 4833 resolution = this->amrbamg->deviatoricerror_resolution; 4834 maxerror = this->amrbamg->deviatoricerror_maximum; 4833 4835 this->ZZErrorEstimator(&error_elements);//error is serial, but the calculation is parallel 4834 4836 break; … … 4836 4838 } 4837 4839 if(!error_elements) _error_("error_elements is NULL!\n"); 4840 if(groupthreshold<DBL_EPSILON) _error_("group threshold is too small!"); 4838 4841 4839 4842 /*Find the max of the estimators if it was not provided*/ … … 4873 4876 for(int j=0;j<elementswidth;j++){ 4874 4877 vid=index[i*elementswidth+j]-1;//Matlab to C indexing 4875 if(error_vertices[vid]> 0.01*maxerror) refine=true;//itapopo must be better defined4878 if(error_vertices[vid]>groupthreshold*maxerror) refine=true; 4876 4879 } 4877 4880 } … … 5034 5037 this->parameters->FindParam(&this->amr->icefront_distance,AmrIceFrontDistanceEnum); 5035 5038 this->parameters->FindParam(&this->amr->thicknesserror_threshold,AmrThicknessErrorThresholdEnum); 5039 this->parameters->FindParam(&this->amr->thicknesserror_groupthreshold,AmrThicknessErrorGroupThresholdEnum); 5036 5040 this->parameters->FindParam(&this->amr->thicknesserror_maximum,AmrThicknessErrorMaximumEnum); 5037 5041 this->parameters->FindParam(&this->amr->deviatoricerror_threshold,AmrDeviatoricErrorThresholdEnum); 5042 this->parameters->FindParam(&this->amr->deviatoricerror_groupthreshold,AmrDeviatoricErrorGroupThresholdEnum); 5038 5043 this->parameters->FindParam(&this->amr->deviatoricerror_maximum,AmrDeviatoricErrorMaximumEnum); 5039 5044 if(my_rank==0){ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
r22276 r22294 124 124 iomodel->FindConstant(&amr_frequency,"md.transient.amr_frequency"); 125 125 if(solution_type==TransientSolutionEnum && amr_frequency){ 126 /*Load common amr parameters*/ 126 127 parameters->AddObject(iomodel->CopyConstantObject("md.amr.type",AmrTypeEnum)); 128 parameters->AddObject(iomodel->CopyConstantObject("md.amr.groundingline_distance",AmrGroundingLineDistanceEnum)); 129 parameters->AddObject(iomodel->CopyConstantObject("md.amr.icefront_distance",AmrIceFrontDistanceEnum)); 130 parameters->AddObject(iomodel->CopyConstantObject("md.amr.thicknesserror_threshold",AmrThicknessErrorThresholdEnum)); 131 parameters->AddObject(iomodel->CopyConstantObject("md.amr.thicknesserror_groupthreshold",AmrThicknessErrorGroupThresholdEnum)); 132 parameters->AddObject(iomodel->CopyConstantObject("md.amr.thicknesserror_maximum",AmrThicknessErrorMaximumEnum)); 133 parameters->AddObject(iomodel->CopyConstantObject("md.amr.deviatoricerror_threshold",AmrDeviatoricErrorThresholdEnum)); 134 parameters->AddObject(iomodel->CopyConstantObject("md.amr.deviatoricerror_groupthreshold",AmrDeviatoricErrorGroupThresholdEnum)); 135 parameters->AddObject(iomodel->CopyConstantObject("md.amr.deviatoricerror_maximum",AmrDeviatoricErrorMaximumEnum)); 136 parameters->AddObject(iomodel->CopyConstantObject("md.amr.restart",AmrRestartEnum)); 137 /*Load specific amr parameters*/ 127 138 iomodel->FindConstant(&amrtype,"md.amr.type"); 128 139 switch(amrtype){ … … 132 143 parameters->AddObject(iomodel->CopyConstantObject("md.amr.gradation",AmrGradationEnum)); 133 144 parameters->AddObject(iomodel->CopyConstantObject("md.amr.lag",AmrLagEnum)); 134 parameters->AddObject(iomodel->CopyConstantObject("md.amr.groundingline_distance",AmrGroundingLineDistanceEnum));135 parameters->AddObject(iomodel->CopyConstantObject("md.amr.icefront_distance",AmrIceFrontDistanceEnum));136 parameters->AddObject(iomodel->CopyConstantObject("md.amr.thicknesserror_threshold",AmrThicknessErrorThresholdEnum));137 parameters->AddObject(iomodel->CopyConstantObject("md.amr.thicknesserror_maximum",AmrThicknessErrorMaximumEnum));138 parameters->AddObject(iomodel->CopyConstantObject("md.amr.deviatoricerror_threshold",AmrDeviatoricErrorThresholdEnum));139 parameters->AddObject(iomodel->CopyConstantObject("md.amr.deviatoricerror_maximum",AmrDeviatoricErrorMaximumEnum));140 parameters->AddObject(iomodel->CopyConstantObject("md.amr.restart",AmrRestartEnum));141 145 break; 142 146 #endif … … 150 154 parameters->AddObject(iomodel->CopyConstantObject("md.amr.gradation",AmrGradationEnum)); 151 155 parameters->AddObject(iomodel->CopyConstantObject("md.amr.groundingline_resolution",AmrGroundingLineResolutionEnum)); 152 parameters->AddObject(iomodel->CopyConstantObject("md.amr.groundingline_distance",AmrGroundingLineDistanceEnum));153 156 parameters->AddObject(iomodel->CopyConstantObject("md.amr.icefront_resolution",AmrIceFrontResolutionEnum)); 154 parameters->AddObject(iomodel->CopyConstantObject("md.amr.icefront_distance",AmrIceFrontDistanceEnum));155 157 parameters->AddObject(iomodel->CopyConstantObject("md.amr.thicknesserror_resolution",AmrThicknessErrorResolutionEnum)); 156 parameters->AddObject(iomodel->CopyConstantObject("md.amr.thicknesserror_threshold",AmrThicknessErrorThresholdEnum));157 parameters->AddObject(iomodel->CopyConstantObject("md.amr.thicknesserror_maximum",AmrThicknessErrorMaximumEnum));158 158 parameters->AddObject(iomodel->CopyConstantObject("md.amr.deviatoricerror_resolution",AmrDeviatoricErrorResolutionEnum)); 159 parameters->AddObject(iomodel->CopyConstantObject("md.amr.deviatoricerror_threshold",AmrDeviatoricErrorThresholdEnum));160 parameters->AddObject(iomodel->CopyConstantObject("md.amr.deviatoricerror_maximum",AmrDeviatoricErrorMaximumEnum));161 parameters->AddObject(iomodel->CopyConstantObject("md.amr.restart",AmrRestartEnum));162 159 /*Convert fieldname to enum and put it in params*/ 163 160 iomodel->FindConstant(&fieldname,"md.amr.fieldname"); -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r22285 r22294 901 901 AmrThicknessErrorResolutionEnum, 902 902 AmrThicknessErrorThresholdEnum, 903 AmrThicknessErrorGroupThresholdEnum, 903 904 AmrThicknessErrorMaximumEnum, 904 905 AmrDeviatoricErrorResolutionEnum, 905 906 AmrDeviatoricErrorThresholdEnum, 907 AmrDeviatoricErrorGroupThresholdEnum, 906 908 AmrDeviatoricErrorMaximumEnum, 907 909 DeviatoricStressErrorEstimatorEnum, -
issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
r22285 r22294 874 874 case AmrThicknessErrorResolutionEnum : return "AmrThicknessErrorResolution"; 875 875 case AmrThicknessErrorThresholdEnum : return "AmrThicknessErrorThreshold"; 876 case AmrThicknessErrorGroupThresholdEnum : return "AmrThicknessErrorGroupThreshold"; 876 877 case AmrThicknessErrorMaximumEnum : return "AmrThicknessErrorMaximum"; 877 878 case AmrDeviatoricErrorResolutionEnum : return "AmrDeviatoricErrorResolution"; 878 879 case AmrDeviatoricErrorThresholdEnum : return "AmrDeviatoricErrorThreshold"; 880 case AmrDeviatoricErrorGroupThresholdEnum : return "AmrDeviatoricErrorGroupThreshold"; 879 881 case AmrDeviatoricErrorMaximumEnum : return "AmrDeviatoricErrorMaximum"; 880 882 case DeviatoricStressErrorEstimatorEnum : return "DeviatoricStressErrorEstimator"; -
issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
r22285 r22294 895 895 else if (strcmp(name,"AmrThicknessErrorResolution")==0) return AmrThicknessErrorResolutionEnum; 896 896 else if (strcmp(name,"AmrThicknessErrorThreshold")==0) return AmrThicknessErrorThresholdEnum; 897 else if (strcmp(name,"AmrThicknessErrorGroupThreshold")==0) return AmrThicknessErrorGroupThresholdEnum; 897 898 else if (strcmp(name,"AmrThicknessErrorMaximum")==0) return AmrThicknessErrorMaximumEnum; 898 899 else if (strcmp(name,"AmrDeviatoricErrorResolution")==0) return AmrDeviatoricErrorResolutionEnum; 899 900 else if (strcmp(name,"AmrDeviatoricErrorThreshold")==0) return AmrDeviatoricErrorThresholdEnum; 901 else if (strcmp(name,"AmrDeviatoricErrorGroupThreshold")==0) return AmrDeviatoricErrorGroupThresholdEnum; 900 902 else if (strcmp(name,"AmrDeviatoricErrorMaximum")==0) return AmrDeviatoricErrorMaximumEnum; 901 903 else if (strcmp(name,"DeviatoricStressErrorEstimator")==0) return DeviatoricStressErrorEstimatorEnum; … … 996 998 else if (strcmp(name,"HydrologySolution")==0) return HydrologySolutionEnum; 997 999 else if (strcmp(name,"MeltingAnalysis")==0) return MeltingAnalysisEnum; 998 else if (strcmp(name,"MasstransportAnalysis")==0) return MasstransportAnalysisEnum;999 else if (strcmp(name,"MasstransportSolution")==0) return MasstransportSolutionEnum;1000 1000 else stage=9; 1001 1001 } 1002 1002 if(stage==9){ 1003 if (strcmp(name,"FreeSurfaceBaseAnalysis")==0) return FreeSurfaceBaseAnalysisEnum; 1003 if (strcmp(name,"MasstransportAnalysis")==0) return MasstransportAnalysisEnum; 1004 else if (strcmp(name,"MasstransportSolution")==0) return MasstransportSolutionEnum; 1005 else if (strcmp(name,"FreeSurfaceBaseAnalysis")==0) return FreeSurfaceBaseAnalysisEnum; 1004 1006 else if (strcmp(name,"FreeSurfaceTopAnalysis")==0) return FreeSurfaceTopAnalysisEnum; 1005 1007 else if (strcmp(name,"ExtrudeFromBaseAnalysis")==0) return ExtrudeFromBaseAnalysisEnum; -
issm/trunk-jpl/src/m/classes/amr.js
r22241 r22294 7 7 //methods 8 8 this.setdefaultparameters = function(){// {{{ 9 this.hmin = 100.; 10 this.hmax = 100.e3; 11 this.fieldname = "Vel"; 12 this.err = 3.; 13 this.keepmetric = 1; 14 this.gradation = 1.5; 15 this.groundingline_resolution = 500.; 16 this.groundingline_distance = 0; 17 this.icefront_resolution = 500; 18 this.icefront_distance = 0; 19 this.thicknesserror_resolution = 500; 20 this.thicknesserror_threshold = 0; 21 this.thicknesserror_maximum = 0; 22 this.deviatoricerror_resolution = 500; 23 this.deviatoricerror_threshold = 0; 24 this.deviatoricerror_maximum = 0; 9 this.hmin = 100.; 10 this.hmax = 100.e3; 11 this.fieldname = "Vel"; 12 this.err = 3.; 13 this.keepmetric = 1; 14 this.gradation = 1.5; 15 this.groundingline_resolution = 500.; 16 this.groundingline_distance = 0; 17 this.icefront_resolution = 500; 18 this.icefront_distance = 0; 19 this.thicknesserror_resolution = 500; 20 this.thicknesserror_threshold = 0; 21 this.thicknesserror_groupthreshold = 0; 22 this.thicknesserror_maximum = 0; 23 this.deviatoricerror_resolution = 500; 24 this.deviatoricerror_threshold = 0; 25 this.deviatoricerror_groupthreshold = 0; 26 this.deviatoricerror_maximum = 0; 25 27 }// }}} 26 28 this.disp= function(){// {{{ … … 37 39 fielddisplay(this,'thicknesserror_resolution','element length when thickness error estimator is used'); 38 40 fielddisplay(this,'thicknesserror_threshold','maximum threshold thickness error permitted'); 41 fielddisplay(this,'thicknesserror_groupthreshold','maximum group threshold thickness error permitted'); 39 42 fielddisplay(this,'thicknesserror_maximum','maximum thickness error permitted'); 40 43 fielddisplay(this,'deviatoricerror_resolution','element length when deviatoric stress error estimator is used'); 41 44 fielddisplay(this,'deviatoricerror_threshold','maximum threshold deviatoricstress error permitted'); 45 fielddisplay(this,'deviatoricerror_groupthreshold','maximum group threshold deviatoricstress error permitted'); 42 46 fielddisplay(this,'deviatoricerror_maximum','maximum deviatoricstress error permitted'); 43 47 }// }}} … … 57 61 checkfield(md,'fieldname','amr.thicknesserror_resolution','numel',[1],'>',0,'<',this.hmax,'NaN',1); 58 62 checkfield(md,'fieldname','amr.thicknesserror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1); 63 checkfield(md,'fieldname','amr.thicknesserror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1); 59 64 checkfield(md,'fieldname','amr.thicknesserror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1); 60 65 checkfield(md,'fieldname','amr.deviatoricerror_resolution','numel',[1],'>',0,'<',this.hmax,'NaN',1); 61 66 checkfield(md,'fieldname','amr.deviatoricerror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1); 67 checkfield(md,'fieldname','amr.deviatoricerror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1); 62 68 checkfield(md,'fieldname','amr.deviatoricerror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1); 63 69 } // }}} … … 76 82 WriteData(fid,prefix,'object',this,'fieldname','thicknesserror_resolution','format','Double'); 77 83 WriteData(fid,prefix,'object',this,'fieldname','thicknesserror_threshold','format','Double'); 84 WriteData(fid,prefix,'object',this,'fieldname','thicknesserror_groupthreshold','format','Double'); 78 85 WriteData(fid,prefix,'object',this,'fieldname','thicknesserror_maximum','format','Double'); 79 86 WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_resolution','format','Double'); 80 WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_threshold','format','Double'); 87 writedata(fid,prefix,'object',this,'fieldname','deviatoricerror_threshold','format','double'); 88 writedata(fid,prefix,'object',this,'fieldname','deviatoricerror_groupthreshold','format','double'); 81 89 WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_maximum','format','Double'); 82 90 }//}}} … … 85 93 //properties 86 94 // {{{ 87 this.hmin = 0.; 88 this.hmax = 0.; 89 this.fieldname = ""; 90 this.err = 0.; 91 this.keepmetric = 0; 92 this.gradation = 0.; 93 this.groundingline_resolution = 0.; 94 this.groundingline_distance = 0.; 95 this.icefront_resolution = 0.; 96 this.icefront_distance = 0.; 97 this.thicknesserror_resolution = 0.; 98 this.thicknesserror_threshold = 0.; 99 this.thicknesserror_maximum = 0.; 100 this.deviatoricerror_resolution = 0.; 101 this.deviatoricerror_threshold = 0.; 102 this.deviatoricerror_maximum = 0.; 95 this.hmin = 0.; 96 this.hmax = 0.; 97 this.fieldname = ""; 98 this.err = 0.; 99 this.keepmetric = 0; 100 this.gradation = 0.; 101 this.groundingline_resolution = 0.; 102 this.groundingline_distance = 0.; 103 this.icefront_resolution = 0.; 104 this.icefront_distance = 0.; 105 this.thicknesserror_resolution = 0.; 106 this.thicknesserror_threshold = 0.; 107 this.thicknesserror_groupthreshold = 0.; 108 this.thicknesserror_maximum = 0.; 109 this.deviatoricerror_resolution = 0.; 110 this.deviatoricerror_threshold = 0.; 111 this.deviatoricerror_groupthreshold = 0.; 112 this.deviatoricerror_maximum = 0.; 103 113 104 114 this.setdefaultparameters(); -
issm/trunk-jpl/src/m/classes/amr.m
r22241 r22294 18 18 thicknesserror_resolution = 0.; 19 19 thicknesserror_threshold = 0.; 20 thicknesserror_groupthreshold = 0.; 20 21 thicknesserror_maximum = 0.; 21 22 deviatoricerror_resolution = 0.; 22 23 deviatoricerror_threshold = 0.; 24 deviatoricerror_groupthreshold = 0.; 23 25 deviatoricerror_maximum = 0.; 24 26 restart=0.; … … 89 91 self.thicknesserror_resolution=500.; 90 92 self.thicknesserror_threshold=0.; 93 self.thicknesserror_groupthreshold=0.; 91 94 self.thicknesserror_maximum=0.; 92 95 self.deviatoricerror_resolution=500.; 93 96 self.deviatoricerror_threshold=0.; 97 self.deviatoricerror_groupthreshold=0.; 94 98 self.deviatoricerror_maximum=0.; 95 99 … … 111 115 md = checkfield(md,'fieldname','amr.thicknesserror_resolution','numel',[1],'>',0,'<',self.hmax,'NaN',1); 112 116 md = checkfield(md,'fieldname','amr.thicknesserror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1); 117 md = checkfield(md,'fieldname','amr.thicknesserror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1); 113 118 md = checkfield(md,'fieldname','amr.thicknesserror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1); 114 119 md = checkfield(md,'fieldname','amr.deviatoricerror_resolution','numel',[1],'>',0,'<',self.hmax,'NaN',1); 115 120 md = checkfield(md,'fieldname','amr.deviatoricerror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1); 121 md = checkfield(md,'fieldname','amr.deviatoricerror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1); 116 122 md = checkfield(md,'fieldname','amr.deviatoricerror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1); 117 123 md = checkfield(md,'fieldname','amr.restart','numel',[1],'>=',0,'<=',1,'NaN',1); … … 131 137 fielddisplay(self,'thicknesserror_resolution',['element length when thickness error estimator is used']); 132 138 fielddisplay(self,'thicknesserror_threshold',['maximum threshold thickness error permitted']); 139 fielddisplay(self,'thicknesserror_groupthreshold',['maximum group threshold thickness error permitted']); 133 140 fielddisplay(self,'thicknesserror_maximum',['maximum thickness error permitted']); 134 141 fielddisplay(self,'deviatoricerror_resolution',['element length when deviatoric stress error estimator is used']); 135 142 fielddisplay(self,'deviatoricerror_threshold',['maximum threshold deviatoricstress error permitted']); 143 fielddisplay(self,'deviatoricerror_groupthreshold',['maximum group threshold deviatoricstress error permitted']); 136 144 fielddisplay(self,'deviatoricerror_maximum',['maximum deviatoricstress error permitted']); 137 145 fielddisplay(self,'restart',['indicates if ReMesh() will call before first time step']); … … 152 160 WriteData(fid,prefix,'object',self,'class','amr','fieldname','thicknesserror_resolution','format','Double'); 153 161 WriteData(fid,prefix,'object',self,'class','amr','fieldname','thicknesserror_threshold','format','Double'); 162 WriteData(fid,prefix,'object',self,'class','amr','fieldname','thicknesserror_groupthreshold','format','Double'); 154 163 WriteData(fid,prefix,'object',self,'class','amr','fieldname','thicknesserror_maximum','format','Double'); 155 164 WriteData(fid,prefix,'object',self,'class','amr','fieldname','deviatoricerror_resolution','format','Double'); 156 165 WriteData(fid,prefix,'object',self,'class','amr','fieldname','deviatoricerror_threshold','format','Double'); 166 WriteData(fid,prefix,'object',self,'class','amr','fieldname','deviatoricerror_groupthreshold','format','Double'); 157 167 WriteData(fid,prefix,'object',self,'class','amr','fieldname','deviatoricerror_maximum','format','Double'); 158 168 WriteData(fid,prefix,'object',self,'class','amr','fieldname','restart','format','Integer'); -
issm/trunk-jpl/src/m/classes/amr.py
r22267 r22294 12 12 13 13 def __init__(self): # {{{ 14 self.hmin = 0. 15 self.hmax = 0. 16 self.fieldname ='' 17 self.err = 0. 18 self.keepmetric = 0. 19 self.gradation = 0. 20 self.groundingline_resolution = 0. 21 self.groundingline_distance = 0. 22 self.icefront_resolution = 0. 23 self.icefront_distance = 0. 24 self.thicknesserror_resolution = 0. 25 self.thicknesserror_threshold = 0. 26 self.thicknesserror_maximum = 0. 27 self.deviatoricerror_resolution= 0. 28 self.deviatoricerror_threshold = 0. 29 self.deviatoricerror_maximum = 0. 30 self.restart=0. 14 self.hmin = 0. 15 self.hmax = 0. 16 self.fieldname ='' 17 self.err = 0. 18 self.keepmetric = 0. 19 self.gradation = 0. 20 self.groundingline_resolution = 0. 21 self.groundingline_distance = 0. 22 self.icefront_resolution = 0. 23 self.icefront_distance = 0. 24 self.thicknesserror_resolution = 0. 25 self.thicknesserror_threshold = 0. 26 self.thicknesserror_groupthreshold = 0. 27 self.thicknesserror_maximum = 0. 28 self.deviatoricerror_resolution = 0. 29 self.deviatoricerror_threshold = 0. 30 self.deviatoricerror_groupthreshold = 0. 31 self.deviatoricerror_maximum = 0. 32 self.restart = 0. 31 33 #set defaults 32 34 self.setdefaultparameters() … … 45 47 string="%s\n%s"%(string,fielddisplay(self,"thicknesserror_resolution","element length when thickness error estimator is used")) 46 48 string="%s\n%s"%(string,fielddisplay(self,"thicknesserror_threshold","maximum threshold thickness error permitted")) 49 string="%s\n%s"%(string,fielddisplay(self,"thicknesserror_groupthreshold","maximum group threshold thickness error permitted")) 47 50 string="%s\n%s"%(string,fielddisplay(self,"thicknesserror_maximum","maximum thickness error permitted")) 48 51 string="%s\n%s"%(string,fielddisplay(self,"deviatoricerror_resolution","element length when deviatoric stress error estimator is used")) 49 52 string="%s\n%s"%(string,fielddisplay(self,"deviatoricerror_threshold","maximum threshold deviatoricstress error permitted")) 53 string="%s\n%s"%(string,fielddisplay(self,"deviatoricerror_groupthreshold","maximum group threshold deviatoric stress error permitted")) 50 54 string="%s\n%s"%(string,fielddisplay(self,"deviatoricerror_maximum","maximum deviatoricstress error permitted")) 51 string="%s\n%s"%(string,fielddisplay(self,'restart',['indicates if ReMesh() will call before first time step']))55 string="%s\n%s"%(string,fielddisplay(self,'restart',['indicates if ReMesh() will call before first time step'])) 52 56 return string 53 57 #}}} 54 58 def setdefaultparameters(self): # {{{ 55 self.hmin = 100. 56 self.hmax = 100.e3 57 self.fieldname = 'Vel' 58 self.err = 3. 59 self.keepmetric = 1 60 self.gradation = 1.5 61 self.groundingline_resolution = 500. 62 self.groundingline_distance = 0 63 self.icefront_resolution = 500. 64 self.icefront_distance = 0 65 self.thicknesserror_resolution = 500. 66 self.thicknesserror_threshold = 0 67 self.thicknesserror_maximum = 0 68 self.deviatoricerror_resolution= 500. 69 self.deviatoricerror_threshold = 0 70 self.deviatoricerror_maximum = 0 71 self.restart = 0. 59 self.hmin = 100. 60 self.hmax = 100.e3 61 self.fieldname = 'Vel' 62 self.err = 3. 63 self.keepmetric = 1 64 self.gradation = 1.5 65 self.groundingline_resolution = 500. 66 self.groundingline_distance = 0 67 self.icefront_resolution = 500. 68 self.icefront_distance = 0 69 self.thicknesserror_resolution = 500. 70 self.thicknesserror_threshold = 0 71 self.thicknesserror_groupthreshold = 0 72 self.thicknesserror_maximum = 0 73 self.deviatoricerror_resolution = 500. 74 self.deviatoricerror_threshold = 0 75 self.deviatoricerror_groupthreshold = 0 76 self.deviatoricerror_maximum = 0 77 self.restart = 0. 72 78 return self 73 79 #}}} … … 83 89 md = checkfield(md,'fieldname','amr.thicknesserror_resolution','numel',[1],'>',0,'<',self.hmax,'NaN',1); 84 90 md = checkfield(md,'fieldname','amr.thicknesserror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1); 91 md = checkfield(md,'fieldname','amr.thicknesserror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1); 85 92 md = checkfield(md,'fieldname','amr.thicknesserror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1); 86 93 md = checkfield(md,'fieldname','amr.deviatoricerror_resolution','numel',[1],'>',0,'<',self.hmax,'NaN',1); 87 94 md = checkfield(md,'fieldname','amr.deviatoricerror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1); 95 md = checkfield(md,'fieldname','amr.deviatoricerror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1); 88 96 md = checkfield(md,'fieldname','amr.deviatoricerror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1); 89 97 md = checkfield(md,'fieldname','amr.restart','numel',[1],'>=',0,'<=',1,'NaN',1) 90 98 return md 91 99 # }}} … … 104 112 WriteData(fid,prefix,'object',self,'fieldname','thicknesserror_resolution','format','Double'); 105 113 WriteData(fid,prefix,'object',self,'fieldname','thicknesserror_threshold','format','Double'); 114 WriteData(fid,prefix,'object',self,'fieldname','thicknesserror_groupthreshold','format','Double'); 106 115 WriteData(fid,prefix,'object',self,'fieldname','thicknesserror_maximum','format','Double'); 107 116 WriteData(fid,prefix,'object',self,'fieldname','deviatoricerror_resolution','format','Double'); 108 117 WriteData(fid,prefix,'object',self,'fieldname','deviatoricerror_threshold','format','Double'); 118 WriteData(fid,prefix,'object',self,'fieldname','deviatoricerror_groupthreshold','format','Double'); 109 119 WriteData(fid,prefix,'object',self,'fieldname','deviatoricerror_maximum','format','Double'); 110 120 WriteData(fid,prefix,'object',self,'class','amr','fieldname','restart','format','Integer') 111 121 # }}} -
issm/trunk-jpl/src/m/classes/amrneopz.m
r22276 r22294 6 6 classdef amrneopz 7 7 properties (SetAccess=public) 8 level_max = 0; 9 gradation = 0; 10 lag = 0; 11 groundingline_distance = 0; 12 icefront_distance = 0; 13 thicknesserror_threshold = 0; 14 thicknesserror_maximum = 0; 15 deviatoricerror_threshold = 0; 16 deviatoricerror_maximum = 0; 17 restart = 0; 8 level_max = 0; 9 gradation = 0; 10 lag = 0; 11 groundingline_distance = 0; 12 icefront_distance = 0; 13 thicknesserror_threshold = 0; 14 thicknesserror_groupthreshold = 0; 15 thicknesserror_maximum = 0; 16 deviatoricerror_threshold = 0; 17 deviatoricerror_groupthreshold = 0; 18 deviatoricerror_maximum = 0; 19 restart = 0; 18 20 end 19 21 methods (Static) … … 59 61 %radius_level_max was deleted! 60 62 63 %2017 December 18th 64 %group threshold was inserted 65 61 66 %end% }}} 62 67 end … … 73 78 74 79 %filter parameters: 75 self.level_max = 2;76 self.gradation = 1.5;77 self.lag = 1.1;80 self.level_max = 2; 81 self.gradation = 1.5; 82 self.lag = 1.1; 78 83 79 84 %other criterias 80 self.groundingline_distance = 10000; 81 self.icefront_distance = 0; 82 self.thicknesserror_threshold = 0; 83 self.thicknesserror_maximum = 0; 84 self.deviatoricerror_threshold= 0; 85 self.deviatoricerror_maximum = 0; 86 self.restart = 0; 85 self.groundingline_distance = 10000; 86 self.icefront_distance = 0; 87 self.thicknesserror_threshold = 0; 88 self.thicknesserror_groupthreshold = 0; 89 self.thicknesserror_maximum = 0; 90 self.deviatoricerror_threshold = 0; 91 self.deviatoricerror_groupthreshold = 0; 92 self.deviatoricerror_maximum = 0; 93 self.restart = 0; 87 94 end % }}} 88 95 function md = checkconsistency(self,md,solution,analyses) % {{{ … … 94 101 md = checkfield(md,'fieldname','amr.icefront_distance','numel',[1],'>=',0,'NaN',1,'Inf',1); 95 102 md = checkfield(md,'fieldname','amr.thicknesserror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1); 103 md = checkfield(md,'fieldname','amr.thicknesserror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1); 96 104 md = checkfield(md,'fieldname','amr.thicknesserror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1); 97 105 md = checkfield(md,'fieldname','amr.deviatoricerror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1); 106 md = checkfield(md,'fieldname','amr.deviatoricerror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1); 98 107 md = checkfield(md,'fieldname','amr.deviatoricerror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1); 99 108 md = checkfield(md,'fieldname','amr.restart','numel',[1],'>=',0,'<=',1,'NaN',1); … … 108 117 fielddisplay(self,'icefront_distance',['distance around the ice front which elements will be refined']); 109 118 fielddisplay(self,'thicknesserror_threshold',['maximum threshold thickness error permitted']); 119 fielddisplay(self,'thicknesserror_groupthreshold',['maximum group threshold thickness error permitted']); 110 120 fielddisplay(self,'thicknesserror_maximum',['maximum thickness error permitted']); 111 121 fielddisplay(self,'deviatoricerror_threshold',['maximum threshold deviatoricstress error permitted']); 122 fielddisplay(self,'deviatoricerror_groupthreshold',['maximum group threshold deviatoricstress error permitted']); 112 123 fielddisplay(self,'deviatoricerror_maximum',['maximum deviatoricstress error permitted']); 113 124 fielddisplay(self,'restart',['indicates if ReMesh() will call before first time step']); … … 122 133 WriteData(fid,prefix,'object',self,'class','amr','fieldname','icefront_distance','format','Double'); 123 134 WriteData(fid,prefix,'object',self,'class','amr','fieldname','thicknesserror_threshold','format','Double'); 135 WriteData(fid,prefix,'object',self,'class','amr','fieldname','thicknesserror_groupthreshold','format','Double'); 124 136 WriteData(fid,prefix,'object',self,'class','amr','fieldname','thicknesserror_maximum','format','Double'); 125 137 WriteData(fid,prefix,'object',self,'class','amr','fieldname','deviatoricerror_threshold','format','Double'); 138 WriteData(fid,prefix,'object',self,'class','amr','fieldname','deviatoricerror_groupthreshold','format','Double'); 126 139 WriteData(fid,prefix,'object',self,'class','amr','fieldname','deviatoricerror_maximum','format','Double'); 127 140 WriteData(fid,prefix,'object',self,'class','amr','fieldname','restart','format','Integer'); … … 135 148 writejsdouble(fid,[modelname '.amr.icefront_distance'],self.icefront_distance); 136 149 writejsdouble(fid,[modelname '.amr.thicknesserror_threshold'],self.thicknesserror_threshold); 150 writejsdouble(fid,[modelname '.amr.thicknesserror_groupthreshold'],self.thicknesserror_threshold); 137 151 writejsdouble(fid,[modelname '.amr.thicknesserror_maximum'],self.thicknesserror_maximum); 138 152 writejsdouble(fid,[modelname '.amr.deviatoricerror_threshold'],self.deviatoricerror_threshold); 153 writejsdouble(fid,[modelname '.amr.deviatoricerror_groupthreshold'],self.deviatoricerror_threshold); 139 154 writejsdouble(fid,[modelname '.amr.deviatoricerror_maximum'],self.deviatoricerror_maximum); 140 155 writejsdouble(fid,[modelname '.amr.restart'],self.restart); -
issm/trunk-jpl/src/m/contrib/tsantos/mismip/ice_evolution.m
r22241 r22294 7 7 % 8 8 % Default: y=40km, i0=1 9 % [ga iv ivaf GL_y nelem t] = ice_evolution(md);9 % [ga iv ivaf GL_y IF_y nelem t] = ice_evolution(md); 10 10 % 11 11 % Default: y=40km 12 % [ga iv ivaf GL_y nelem t] = ice_evolution(md,i0);12 % [ga iv ivaf GL_y IF_y nelem t] = ice_evolution(md,i0); 13 13 % 14 14 % Use this for y the borders (y=0 or y=ymax) 15 % [ga iv ivaf GL_y nelem t] = ice_evolution(md,i0,y);15 % [ga iv ivaf GL_y IF_y nelem t] = ice_evolution(md,i0,y); 16 16 % 17 17 % 18 18 19 function [ga iv ivaf GL_y nelem t] = ice_evolution(varargin),19 function [ga iv ivaf GL_y IF_y nelem t] = ice_evolution(varargin), 20 20 21 21 ga = []; … … 23 23 ivaf = []; 24 24 GL_y = []; 25 IF_y = []; 25 26 nelem = []; 26 27 t = []; … … 66 67 end 67 68 t(i) = md.results.TransientSolution(i).time; 68 %find GL position between y0 and y1 69 %find GL position between y0 and y1 {{{ 69 70 [glx gly] = gl_position(md,i,0); 70 71 pos = find(gly<y1 & gly>y0); … … 87 88 end 88 89 end 89 90 %}}} 91 %find IF position between y0 and y1 {{{ 92 [ifx ify] = if_position(md,i,0); 93 if(length(ifx)==0) 94 continue 95 end 96 pos = find(ify<y1 & ify>y0); 97 x = ify(pos); 98 v = ifx(pos); 99 if(length(pos)==0) 100 error('pos is null') 101 elseif(length(pos)==1) 102 %this should be used for y=0 or y=ymax 103 IF_y(i) = v; 104 else 105 %this should be used when y is inside the domain; so, use linear interpolation 106 xq = [y0:dy:y1]; 107 vq = interp1(x,v,xq,'linear'); 108 pos = find(xq==y); 109 if(pos) 110 IF_y(i) = vq(pos); 111 else 112 error('pos is null') 113 end 114 end 115 %}}} 90 116 end 91 117
Note:
See TracChangeset
for help on using the changeset viewer.