Changeset 22435
- Timestamp:
- 02/20/18 17:21:38 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/amr.js
r22294 r22435 7 7 //methods 8 8 this.setdefaultparameters = function(){// {{{ 9 this.hmin= 100.;10 this.hmax= 100.e3;11 this.fieldname 12 this.err 13 14 this.gradation= 1.5;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 15 this.groundingline_resolution = 500.; 16 this.groundingline_distance= 0;17 18 19 this.thicknesserror_resolution= 500;20 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 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; 27 27 }// }}} 28 28 this.disp= function(){// {{{ 29 29 console.log(sprintf(' amr parameters:')); 30 30 fielddisplay(this,'hmin','minimum element length'); 31 32 31 fielddisplay(this,'hmax','maximum element length'); 32 fielddisplay(this,'fieldname','name of input that will be used to compute the metric (should be an input of FemModel)'); 33 33 fielddisplay(this,'keepmetric','indicates whether the metric should be kept every remeshing time'); 34 34 fielddisplay(this,'gradation','maximum ratio between two adjacent edges'); … … 50 50 51 51 }// }}} 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 writedata(fid,prefix,'object',this,'fieldname','deviatoricerror_threshold','format','double');88 writedata(fid,prefix,'object',this,'fieldname','deviatoricerror_groupthreshold','format','double');89 90 91 92 52 this.checkconsistency = function(md,solution,analyses) { //{{{ 53 checkfield(md,'fieldname','amr.hmax','numel',[1],'>',0,'NaN',1); 54 checkfield(md,'fieldname','amr.hmin','numel',[1],'>',0,'<',this.hmax,'NaN',1); 55 checkfield(md,'fieldname','amr.keepmetric','numel',[1],'>=',0,'<=',1,'NaN',1); 56 checkfield(md,'fieldname','amr.gradation','numel',[1],'>=',1.1,'<=',5,'NaN',1); 57 checkfield(md,'fieldname','amr.groundingline_resolution','numel',[1],'>',0,'<',this.hmax,'NaN',1); 58 checkfield(md,'fieldname','amr.groundingline_distance','numel',[1],'>=',0,'NaN',1,'Inf',1); 59 checkfield(md,'fieldname','amr.icefront_resolution','numel',[1],'>',0,'<',this.hmax,'NaN',1); 60 checkfield(md,'fieldname','amr.icefront_distance','numel',[1],'>=',0,'NaN',1,'Inf',1); 61 checkfield(md,'fieldname','amr.thicknesserror_resolution','numel',[1],'>',0,'<',this.hmax,'NaN',1); 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); 64 checkfield(md,'fieldname','amr.thicknesserror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1); 65 checkfield(md,'fieldname','amr.deviatoricerror_resolution','numel',[1],'>',0,'<',this.hmax,'NaN',1); 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); 68 checkfield(md,'fieldname','amr.deviatoricerror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1); 69 } // }}} 70 this.marshall=function(md,prefix,fid) { //{{{ 71 WriteData(fid,prefix,'name','md.amr.type','data',1,'format','Integer'); 72 WriteData(fid,prefix,'object',this,'fieldname','hmin','format','Double'); 73 WriteData(fid,prefix,'object',this,'fieldname','hmax','format','Double'); 74 WriteData(fid,prefix,'object',this,'fieldname','fieldname','format','String'); 75 WriteData(fid,prefix,'object',this,'fieldname','err','format','Double'); 76 WriteData(fid,prefix,'object',this,'fieldname','keepmetric','format','Integer'); 77 WriteData(fid,prefix,'object',this,'fieldname','gradation','format','Double'); 78 WriteData(fid,prefix,'object',this,'fieldname','groundingline_resolution','format','Double'); 79 WriteData(fid,prefix,'object',this,'fieldname','groundingline_distance','format','Double'); 80 WriteData(fid,prefix,'object',this,'fieldname','icefront_resolution','format','Double'); 81 WriteData(fid,prefix,'object',this,'fieldname','icefront_distance','format','Double'); 82 WriteData(fid,prefix,'object',this,'fieldname','thicknesserror_resolution','format','Double'); 83 WriteData(fid,prefix,'object',this,'fieldname','thicknesserror_threshold','format','Double'); 84 WriteData(fid,prefix,'object',this,'fieldname','thicknesserror_groupthreshold','format','Double'); 85 WriteData(fid,prefix,'object',this,'fieldname','thicknesserror_maximum','format','Double'); 86 WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_resolution','format','Double'); 87 WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_threshold','format','Double'); 88 WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_groupthreshold','format','Double'); 89 WriteData(fid,prefix,'object',this,'fieldname','deviatoricerror_maximum','format','Double'); 90 }//}}} 91 this.fix=function() { //{{{ 92 }//}}} 93 93 //properties 94 94 // {{{ 95 this.hmin 96 this.hmax 97 this.fieldname 98 this.err 95 this.hmin = 0.; 96 this.hmax = 0.; 97 this.fieldname = ""; 98 this.err = 0.; 99 99 this.keepmetric = 0; 100 this.gradation 100 this.gradation = 0.; 101 101 this.groundingline_resolution = 0.; 102 this.groundingline_distance = 0.;102 this.groundingline_distance = 0.; 103 103 this.icefront_resolution = 0.; 104 104 this.icefront_distance = 0.; 105 this.thicknesserror_resolution = 0.;105 this.thicknesserror_resolution = 0.; 106 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.;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 112 this.deviatoricerror_maximum = 0.; 113 113
Note:
See TracChangeset
for help on using the changeset viewer.