Changeset 3214
- Timestamp:
- 03/08/10 11:57:54 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/mex/Bamg/Bamg.cpp
r3211 r3214 48 48 BamgOptsInit(&bamgopts); 49 49 FetchData(&bamgopts.coef,mxGetField(BAMGOPTIONS,0,"coef")); 50 if (bamgopts.coef==0) throw ErrorException(__FUNCT__,exprintf("'coef' should be positive"));51 50 FetchData(&bamgopts.maxsubdiv,mxGetField(BAMGOPTIONS,0,"maxsubdiv")); 52 if (bamgopts.maxsubdiv<1) throw ErrorException(__FUNCT__,exprintf("'maxsubdiv' should be >=1"));53 51 FetchData(&bamgopts.Hessiantype,mxGetField(BAMGOPTIONS,0,"Hessiantype")); 54 if (bamgopts.Hessiantype!=0 && bamgopts.Hessiantype!=1) throw ErrorException(__FUNCT__,exprintf("'Hessiantype' supported options are 0 and 1"));55 52 FetchData(&bamgopts.Metrictype,mxGetField(BAMGOPTIONS,0,"Metrictype")); 56 if (bamgopts.Metrictype!=0 && bamgopts.Metrictype!=1 && bamgopts.Metrictype!=2) throw ErrorException(__FUNCT__,exprintf("'Metrictype' supported options are 0, 1 and 2"));57 53 FetchData(&bamgopts.KeepVertices,mxGetField(BAMGOPTIONS,0,"KeepVertices")); 58 if (bamgopts.KeepVertices!=0 && bamgopts.KeepVertices!=1) throw ErrorException(__FUNCT__,exprintf("'KeepVertices' supported options are 0 and 1"));59 54 FetchData(&bamgopts.renumber,mxGetField(BAMGOPTIONS,0,"renumber")); 60 if (bamgopts.renumber!=0 && bamgopts.renumber!=1 && bamgopts.renumber!=2) throw ErrorException(__FUNCT__,exprintf("'renumber' supported options are 0, 1 and 2"));61 55 FetchData(&bamgopts.power,mxGetField(BAMGOPTIONS,0,"power")); 62 56 FetchData(&bamgopts.errg,mxGetField(BAMGOPTIONS,0,"errg")); 63 if (bamgopts.errg<0) throw ErrorException(__FUNCT__,exprintf("'errg' option should be >0"));64 57 FetchData(&bamgopts.nbjacobi,mxGetField(BAMGOPTIONS,0,"nbjacobi")); 65 if (bamgopts.nbjacobi<=0) throw ErrorException(__FUNCT__,exprintf("'nbjacobi' option should be >0"));66 58 FetchData(&bamgopts.NbSmooth,mxGetField(BAMGOPTIONS,0,"NbSmooth")); 67 if (bamgopts.NbSmooth<=0) throw ErrorException(__FUNCT__,exprintf("'NbSmooth' option should be >0"));68 59 FetchData(&bamgopts.omega,mxGetField(BAMGOPTIONS,0,"omega")); 69 60 FetchData(&bamgopts.maxnbv,mxGetField(BAMGOPTIONS,0,"maxnbv")); 70 if (bamgopts.maxnbv<3) throw ErrorException(__FUNCT__,exprintf("'maxnbv' option should be >3"));71 61 FetchData(&bamgopts.hmin,mxGetField(BAMGOPTIONS,0,"hmin")); 72 if (bamgopts.hmin<=0) throw ErrorException(__FUNCT__,exprintf("'hmin' option should be >0"));73 62 FetchData(&bamgopts.hmax,mxGetField(BAMGOPTIONS,0,"hmax")); 74 if (bamgopts.hmax<=0 || bamgopts.hmax<bamgopts.hmin) throw ErrorException(__FUNCT__,exprintf("'hmax' option should be between 0 and hmin=%g",bamgopts.hmin));75 63 FetchData(&bamgopts.anisomax,mxGetField(BAMGOPTIONS,0,"anisomax")); 76 if (bamgopts.anisomax<1) throw ErrorException(__FUNCT__,exprintf("'anisomax' option should be >=1"));77 64 FetchData(&bamgopts.gradation,mxGetField(BAMGOPTIONS,0,"gradation")); 78 if (bamgopts.gradation<1) throw ErrorException(__FUNCT__,exprintf("'gradation' option should be >=1"));79 65 FetchData(&bamgopts.cutoff,mxGetField(BAMGOPTIONS,0,"cutoff")); 80 66 FetchData(&bamgopts.verbose,mxGetField(BAMGOPTIONS,0,"verbose")); … … 87 73 FetchData(&bamgopts.err,NULL,&cols,mxGetField(BAMGOPTIONS,0,"err")); 88 74 if (bamgopts.numfields!=0 && cols!=bamgopts.numfields){throw ErrorException(__FUNCT__,exprintf("the size of 'err' should be the same as 'field'"));} 89 for (i=0;i<bamgopts.numfields;i++) {if (bamgopts.err[i]<=0) throw ErrorException(__FUNCT__,exprintf("'err' option should be >0"));};75 BamgOptsCheck(&bamgopts); 90 76 91 77 /*!Generate internal degree of freedom numbers: */
Note:
See TracChangeset
for help on using the changeset viewer.