Changeset 2942


Ignore:
Timestamp:
02/01/10 15:40:00 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added KeepVertices option

Location:
issm/trunk/src
Files:
6 edited

Legend:

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

    r2941 r2942  
    2424
    2525int Bamgx(BamgMesh* bamgmesh,BamgGeom* bamggeom,BamgOpts* bamgopts){
    26        
    27 
    28         /*output: */
    29         double* VerticesOut=NULL;
    30         double* TrianglesOut=NULL;
    31         int     NumVerticesOut;
    32         int     NumTrianglesOut;
    3326
    3427        /*Bamg options*/
     
    3629        int    maxnbv;
    3730        double hmin,hmax;
    38         double coef;
     31        double coef,maxsubdiv;
    3932        int    verbosity;
    4033        int    NbSmooth;
     
    4639        int allquad=0;
    4740        double costheta=2;
    48         int KeepBackVertices=1;
    4941        double hminaniso=1e-100;
    50         const double  boundmaxsubdiv = 10;
    51         double  maxsubdiv=boundmaxsubdiv;
    5242
    5343        Triangles* Thr=NULL;
     
    6050        coef=bamgopts->coef;
    6151        maxnbv=bamgopts->maxnbv;
     52        maxsubdiv=bamgopts->maxsubdiv;
    6253        hmin=bamgopts->hmin;
    6354        hmax=bamgopts->hmax;
     
    6556
    6657        // some verification
    67         if ( maxsubdiv > boundmaxsubdiv || maxsubdiv <= 1.0){
    68                 throw ErrorException(__FUNCT__,exprintf("maxsubdiv %g is should be in ]1,%g]",maxsubdiv,boundmaxsubdiv));
     58        if ( maxsubdiv > 10 || maxsubdiv <= 1.0){
     59                throw ErrorException(__FUNCT__,exprintf("maxsubdiv (%g) should be in ]1,10]",maxsubdiv));
    6960        }
    7061        // no metric -> no smoothing
     
    164155                if (verbosity>1) printf("   Generating Mesh...\n");
    165156                Thr=&BTh,Thb=0;
    166                 Triangles & Th( *(0 ?  new Triangles(*Thr,&Thr->Gh,Thb,maxnbv) :  new Triangles(maxnbv,BTh,KeepBackVertices)));
     157                Triangles & Th( *(0 ?  new Triangles(*Thr,&Thr->Gh,Thb,maxnbv) :  new Triangles(maxnbv,BTh,bamgopts->KeepVertices)));
    167158                if (Thr != &BTh) delete Thr;
    168159                if(costheta<=1.0) Th.MakeQuadrangles(costheta);
  • issm/trunk/src/c/Bamgx/Mesh2.h

    r2941 r2942  
    769769                                                 int SplitElement(int choice);
    770770                                                 void MakeQuadTree();
    771                                                  void NewPoints( Triangles &,int KeepBackVertex =1 );
     771                                                 void NewPoints( Triangles &,int KeepVertices =1 );
    772772                                                 Int4 InsertNewPoints(Int4 nbvold,Int4 & NbTSwap) ;
    773                                                  void NewPoints(int KeepBackVertex=1){ NewPoints(*this,KeepBackVertex);}
     773                                                 void NewPoints(int KeepVertices=1){ NewPoints(*this,KeepVertices);}
    774774                                                 void ReNumberingTheTriangleBySubDomain(bool justcompress=false);
    775775                                                 void ReNumberingVertex(Int4 * renu);
     
    813813                                                 int CrackMesh();
    814814                private:
    815                                                  void GeomToTriangles1(Int4 nbvx,int KeepBackVertices=1);// the  real constructor mesh adaption
     815                                                 void GeomToTriangles1(Int4 nbvx,int KeepVertices=1);// the  real constructor mesh adaption
    816816                                                 void GeomToTriangles0(Int4 nbvx);// the  real constructor mesh generator
    817817                                                 void PreInit(Int4,char * =0 );
  • issm/trunk/src/c/Bamgx/objects/Triangles.cpp

    r2941 r2942  
    28912891        /*}}}1*/
    28922892        /*FUNCTION Triangles::GeomToTriangles1{{{1*/
    2893         void Triangles::GeomToTriangles1(Int4 inbvx,int KeepBackVertices) {
     2893        void Triangles::GeomToTriangles1(Int4 inbvx,int KeepVertices) {
    28942894                Gh.NbRef++;// add a ref to Gh
    28952895
     
    32273227                FindSubDomain();
    32283228
    3229                 NewPoints(BTh,KeepBackVertices) ;
     3229                NewPoints(BTh,KeepVertices) ;
    32303230                CurrentTh = 0;
    32313231        }
     
    32563256        int    verbosity=bamgopts->verbose;
    32573257        double anisomax =bamgopts->anisomax;
    3258         double err      =bamgopts->err[0]; //to be changed...
     3258        double errg     =bamgopts->errg;
    32593259
    32603260        Real8 ss[2]={0.00001,0.99999};
    3261         Real8 errC = 2*sqrt(2*err);
     3261        Real8 errC = 2*sqrt(2*errg);
    32623262        Real8 hmax = Gh.MaximalHmax();
    32633263        Real8 hmin = Gh.MinimalHmin();
     
    36623662/*}}}1*/
    36633663        /*FUNCTION Triangles::NewPoints{{{1*/
    3664         void  Triangles::NewPoints(Triangles & Bh,int KeepBackVertex) {
     3664        void  Triangles::NewPoints(Triangles & Bh,int KeepVertices) {
    36653665                long int verbosity=2;
    36663666                Int4 nbtold(nbt),nbvold(nbv);
     
    36733673                nbtold = nbt;
    36743674
    3675                 if (KeepBackVertex && (&Bh != this) && (nbv+Bh.nbv< nbvx)){
     3675                if (KeepVertices && (&Bh != this) && (nbv+Bh.nbv< nbvx)){
    36763676                        //   Bh.SetVertexFieldOn();
    36773677                        for (i=0;i<Bh.nbv;i++)
  • issm/trunk/src/c/objects/BamgOpts.h

    r2941 r2942  
    1212        double  MaximalAngleOfCorner;
    1313        int     Hessiantype;
     14        int     Metrictype;
     15        int     KeepVertices;
     16        double  maxsubdiv;
    1417        double  power;
    1518        double  anisomax;
    1619        int     NbSmooth;
    17         int     Metrictype;
    1820        int     nbjacobi;
    1921        double  omega;
     
    2527        int     verbose;
    2628        double*  err;
     29        double   errg;
    2730        double  coef;
    2831        double* metric;
  • issm/trunk/src/m/classes/public/bamg.m

    r2941 r2942  
    7777% Bamg Options {{{1
    7878bamg_options.err=getfieldvalue(options,'err',0.01);
     79bamg_options.errg=getfieldvalue(options,'errg',0.1);
    7980bamg_options.coef=getfieldvalue(options,'coef',1);
     81bamg_options.maxsubdiv=getfieldvalue(options,'maxsubdiv',10);
    8082bamg_options.power=getfieldvalue(options,'power',1);
    8183bamg_options.nbjacobi=getfieldvalue(options,'nbjacobi',1);
    8284bamg_options.Hessiantype=getfieldvalue(options,'Hessiantype',0);
    8385bamg_options.Metrictype=getfieldvalue(options,'Metrictype',0);
     86bamg_options.KeepVertices=getfieldvalue(options,'KeepVertices',1);
    8487bamg_options.NbSmooth=getfieldvalue(options,'NbSmooth',3);
    8588bamg_options.omega=getfieldvalue(options,'omega',1.8);
  • issm/trunk/src/mex/Bamg/Bamg.cpp

    r2941 r2942  
    3434        int    maxnbv,verbose,splitcorners;
    3535        double hmin,hmax,anisomax;
    36         double coef;
     36        double coef,maxsubdiv;
    3737        double power;
    3838        int    Hessiantype,Metrictype,NbSmooth;
    39         int    nbjacobi;
     39        int    nbjacobi,KeepVertices;
    4040        double omega;
    41         double gradation;
     41        double gradation,errg;
    4242        double cutoff;
    4343        double* metric=NULL;
     
    111111        FetchData(&coef,mxGetField(BAMGOPTIONS,0,"coef"));
    112112        bamgopts.coef=coef;
     113        FetchData(&maxsubdiv,mxGetField(BAMGOPTIONS,0,"maxsubdiv"));
     114        bamgopts.maxsubdiv=maxsubdiv;
    113115        FetchData(&Hessiantype,mxGetField(BAMGOPTIONS,0,"Hessiantype"));
    114116        bamgopts.Hessiantype=Hessiantype;
    115117        FetchData(&Metrictype,mxGetField(BAMGOPTIONS,0,"Metrictype"));
    116118        bamgopts.Metrictype=Metrictype;
     119        FetchData(&KeepVertices,mxGetField(BAMGOPTIONS,0,"KeepVertices"));
     120        bamgopts.KeepVertices=KeepVertices;
    117121        FetchData(&power,mxGetField(BAMGOPTIONS,0,"power"));
    118122        bamgopts.power=power;
     123        FetchData(&errg,mxGetField(BAMGOPTIONS,0,"errg"));
     124        bamgopts.errg=errg;
    119125        FetchData(&nbjacobi,mxGetField(BAMGOPTIONS,0,"nbjacobi"));
    120126        bamgopts.nbjacobi=nbjacobi;
Note: See TracChangeset for help on using the changeset viewer.