Changeset 3213


Ignore:
Timestamp:
03/08/10 11:57:50 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added BamgOpts check

Location:
issm/trunk/src/c/objects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/BamgOpts.cpp

    r3212 r3213  
    11#include "stdio.h"
     2#include "../shared/shared.h"
    23#include "./BamgOpts.h"
    34
     
    3132
    3233}
     34
     35void BamgOptsCheck(BamgOpts* bamgopts){
     36
     37        int i;
     38
     39        if (bamgopts->coef==0) throw ErrorException(__FUNCT__,exprintf("'coef' should be positive"));
     40        if (bamgopts->maxsubdiv<1) throw ErrorException(__FUNCT__,exprintf("'maxsubdiv' should be >=1"));
     41        if (bamgopts->Hessiantype!=0  && bamgopts->Hessiantype!=1) throw ErrorException(__FUNCT__,exprintf("'Hessiantype' supported options are 0 and 1"));
     42        if (bamgopts->Metrictype!=0   && bamgopts->Metrictype!=1 && bamgopts->Metrictype!=2) throw ErrorException(__FUNCT__,exprintf("'Metrictype' supported options are 0, 1 and 2"));
     43        if (bamgopts->KeepVertices!=0 && bamgopts->KeepVertices!=1) throw ErrorException(__FUNCT__,exprintf("'KeepVertices' supported options are 0 and 1"));
     44        if (bamgopts->renumber!=0     && bamgopts->renumber!=1   && bamgopts->renumber!=2)   throw ErrorException(__FUNCT__,exprintf("'renumber' supported options are 0, 1 and 2"));
     45        if (bamgopts->errg<0) throw ErrorException(__FUNCT__,exprintf("'errg' option should be >0"));
     46        if (bamgopts->nbjacobi<=0) throw ErrorException(__FUNCT__,exprintf("'nbjacobi' option should be >0"));
     47        if (bamgopts->NbSmooth<=0) throw ErrorException(__FUNCT__,exprintf("'NbSmooth' option should be >0"));
     48        if (bamgopts->maxnbv<3) throw ErrorException(__FUNCT__,exprintf("'maxnbv' option should be >3"));
     49        if (bamgopts->hmin<=0) throw ErrorException(__FUNCT__,exprintf("'hmin' option should be >0"));
     50        if (bamgopts->hmax<=0 || bamgopts->hmax<bamgopts->hmin) throw ErrorException(__FUNCT__,exprintf("'hmax' option should be between 0 and hmin=%g",bamgopts->hmin));
     51        if (bamgopts->anisomax<1) throw ErrorException(__FUNCT__,exprintf("'anisomax' option should be >=1"));
     52        if (bamgopts->gradation<1) throw ErrorException(__FUNCT__,exprintf("'gradation' option should be >=1"));
     53        for (i=0;i<bamgopts->numfields;i++) {if (bamgopts->err[i]<=0) throw ErrorException(__FUNCT__,exprintf("'err' option should be >0"));};
     54
     55}
  • issm/trunk/src/c/objects/BamgOpts.h

    r3212 r3213  
    3838void BamgOptsInit(BamgOpts* bamgopts);
    3939
     40void BamgOptsCheck(BamgOpts* bamgopts);
     41
    4042#endif
Note: See TracChangeset for help on using the changeset viewer.