Changeset 2934


Ignore:
Timestamp:
01/29/10 14:45:30 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added anisomax option on Bamg

Location:
issm/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Bamgx/Bamgx.cpp

    r2932 r2934  
    140140                        Metric Mhmax(hmax);
    141141                        for (Int4 iv=0;iv<BTh.nbv;iv++) BTh[iv].m = Mhmax;
     142                        // change using hVertices if required
     143                        if (bamgmesh->hVertices){
     144                                for (i=0;i<BTh.nbv;i++){
     145                                        if (!isnan(bamgmesh->hVertices[i])){
     146                                                BTh[i].m=Metric((Real4)bamgmesh->hVertices[i]);
     147                                        }
     148                                }
     149                        }
    142150
    143151                        //use present fields to generate metric if present
  • issm/trunk/src/c/Bamgx/objects/Triangles.cpp

    r2932 r2934  
    869869                        MatVVP2x2 Vp(vertices[i]);
    870870                        double lmax=Vp.lmax();
    871                         h1 =Min(h1,Vp.lmin());
    872                         h2 =Max(h2,Vp.lmax());
    873871                        Vp*=Min(lminaniso,lmax)/lmax;
    874872                        Vp.BoundAniso2(coef);
     
    877875                        //info to be displayed
    878876                        if (verbosity>2){
     877                                h1 =Min(h1,Vp.lmin());
     878                                h2 =Max(h2,Vp.lmax());
    879879                                hn1=Min(hn1,Vp.lmin());
    880880                                hn2=Max(hn2,Vp.lmax());
     
    907907                Real8 hmax1;
    908908                Real8 coef;
    909                 Real8 anisomax=1e30;
     909                Real8 anisomax;
    910910                Real8 CutOff;
    911911                int NbJacobi;
     
    924924                Rescaling=bamgopts->Rescaling; //do normalization
    925925                power=bamgopts->power;
     926                anisomax=bamgopts->anisomax;
    926927
    927928                /*process options*/
     
    13311332                Real8 hmax1;
    13321333                Real8 coef;
    1333                 Real8 anisomax=1e30;
     1334                Real8 anisomax;
    13341335                Real8 CutOff;
    13351336                int NbJacobi;
     
    13481349                Rescaling=bamgopts->Rescaling; //do normalization
    13491350                power=bamgopts->power;
     1351                anisomax=bamgopts->anisomax;
    13501352
    13511353                /*process options*/
     
    18231825                const int dim = 2;
    18241826                double* s=NULL;
    1825                 Int4 nbsol;
    1826                 int* typsols=NULL;
    1827                 int verbosity;
    1828                 Real8 hmin1;
    1829                 Real8 hmax1;
     1827                Int4   nbsol;
     1828                int*   typsols=NULL;
     1829                int    verbosity;
     1830                Real8  hmin1;
     1831                Real8  hmax1;
     1832                double power;
     1833                double anisomax;
     1834
    18301835                int   i,j,k,iA,iB,iC;
    18311836                int   iv,nbfield;
     1837                double coef;
     1838
     1839                /*Recover options*/
     1840                verbosity=bamgopts->verbose;
     1841                power=bamgopts->power;
     1842                hmin1=bamgopts->hmin;
     1843                hmax1=bamgopts->hmax;
    18321844
    18331845                /*Recover options*/
     
    18351847                hmin1=bamgopts->hmin;
    18361848                hmax1=bamgopts->hmax;
    1837 
    1838                 /*Recover options*/
    1839                 verbosity=bamgopts->verbose;
    1840                 hmin1=bamgopts->hmin;
    1841                 hmax1=bamgopts->hmax;
     1849                anisomax=bamgopts->anisomax;
    18421850
    18431851                /*Get and process fields*/
     
    20242032                                        Vp.Abs();
    20252033
     2034                                        //Apply a power if requested by user
     2035                                        if(power!=1.0) Vp.pow(power);
     2036
    20262037                                        //modify eigen values according to hmin and hmax
    20272038                                        Vp.Maxh(hmax);
    20282039                                        Vp.Minh(hmin);
     2040
     2041                                        //Bound anisotropy by 1/(anisomax)^2
     2042                                        Vp.BoundAniso2(1/(anisomax*anisomax));
    20292043
    20302044                                        //rebuild Metric from Vp
  • issm/trunk/src/c/objects/BamgOpts.h

    r2914 r2934  
    1313        int     Hessiantype;
    1414        double  power;
     15        double  anisomax;
    1516        int     NbSmooth;
    1617        int     Rescaling;
  • issm/trunk/src/m/classes/public/bamg.m

    r2914 r2934  
    9191bamg_options.hmin=getfieldvalue(options,'hmin',10^-100);
    9292bamg_options.hmax=getfieldvalue(options,'hmax',10^100);
     93bamg_options.anisomax=getfieldvalue(options,'anisomax',10^30);
    9394bamg_options.gradation=getfieldvalue(options,'gradation',1.5);
    9495bamg_options.cutoff=getfieldvalue(options,'cutoff',10^-5);
  • issm/trunk/src/mex/Bamg/Bamg.cpp

    r2914 r2934  
    3333        /*Options inputs*/
    3434        int    iso,maxnbv,verbose,splitcorners;
    35         double hmin,hmax;
     35        double hmin,hmax,anisomax;
    3636        double err,errg,coef;
    3737        double power;
     
    135135        FetchData(&hmax,mxGetField(BAMGOPTIONS,0,"hmax"));
    136136        bamgopts.hmax=hmax;
     137        FetchData(&anisomax,mxGetField(BAMGOPTIONS,0,"anisomax"));
     138        bamgopts.anisomax=anisomax;
    137139        FetchData(&gradation,mxGetField(BAMGOPTIONS,0,"gradation"));
    138140        bamgopts.gradation=gradation;
Note: See TracChangeset for help on using the changeset viewer.