Changeset 2942
- Timestamp:
- 02/01/10 15:40:00 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Bamgx/Bamgx.cpp
r2941 r2942 24 24 25 25 int 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;33 26 34 27 /*Bamg options*/ … … 36 29 int maxnbv; 37 30 double hmin,hmax; 38 double coef ;31 double coef,maxsubdiv; 39 32 int verbosity; 40 33 int NbSmooth; … … 46 39 int allquad=0; 47 40 double costheta=2; 48 int KeepBackVertices=1;49 41 double hminaniso=1e-100; 50 const double boundmaxsubdiv = 10;51 double maxsubdiv=boundmaxsubdiv;52 42 53 43 Triangles* Thr=NULL; … … 60 50 coef=bamgopts->coef; 61 51 maxnbv=bamgopts->maxnbv; 52 maxsubdiv=bamgopts->maxsubdiv; 62 53 hmin=bamgopts->hmin; 63 54 hmax=bamgopts->hmax; … … 65 56 66 57 // 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)); 69 60 } 70 61 // no metric -> no smoothing … … 164 155 if (verbosity>1) printf(" Generating Mesh...\n"); 165 156 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))); 167 158 if (Thr != &BTh) delete Thr; 168 159 if(costheta<=1.0) Th.MakeQuadrangles(costheta); -
issm/trunk/src/c/Bamgx/Mesh2.h
r2941 r2942 769 769 int SplitElement(int choice); 770 770 void MakeQuadTree(); 771 void NewPoints( Triangles &,int Keep BackVertex=1 );771 void NewPoints( Triangles &,int KeepVertices =1 ); 772 772 Int4 InsertNewPoints(Int4 nbvold,Int4 & NbTSwap) ; 773 void NewPoints(int Keep BackVertex=1){ NewPoints(*this,KeepBackVertex);}773 void NewPoints(int KeepVertices=1){ NewPoints(*this,KeepVertices);} 774 774 void ReNumberingTheTriangleBySubDomain(bool justcompress=false); 775 775 void ReNumberingVertex(Int4 * renu); … … 813 813 int CrackMesh(); 814 814 private: 815 void GeomToTriangles1(Int4 nbvx,int Keep BackVertices=1);// the real constructor mesh adaption815 void GeomToTriangles1(Int4 nbvx,int KeepVertices=1);// the real constructor mesh adaption 816 816 void GeomToTriangles0(Int4 nbvx);// the real constructor mesh generator 817 817 void PreInit(Int4,char * =0 ); -
issm/trunk/src/c/Bamgx/objects/Triangles.cpp
r2941 r2942 2891 2891 /*}}}1*/ 2892 2892 /*FUNCTION Triangles::GeomToTriangles1{{{1*/ 2893 void Triangles::GeomToTriangles1(Int4 inbvx,int Keep BackVertices) {2893 void Triangles::GeomToTriangles1(Int4 inbvx,int KeepVertices) { 2894 2894 Gh.NbRef++;// add a ref to Gh 2895 2895 … … 3227 3227 FindSubDomain(); 3228 3228 3229 NewPoints(BTh,Keep BackVertices) ;3229 NewPoints(BTh,KeepVertices) ; 3230 3230 CurrentTh = 0; 3231 3231 } … … 3256 3256 int verbosity=bamgopts->verbose; 3257 3257 double anisomax =bamgopts->anisomax; 3258 double err =bamgopts->err[0]; //to be changed...3258 double errg =bamgopts->errg; 3259 3259 3260 3260 Real8 ss[2]={0.00001,0.99999}; 3261 Real8 errC = 2*sqrt(2*err );3261 Real8 errC = 2*sqrt(2*errg); 3262 3262 Real8 hmax = Gh.MaximalHmax(); 3263 3263 Real8 hmin = Gh.MinimalHmin(); … … 3662 3662 /*}}}1*/ 3663 3663 /*FUNCTION Triangles::NewPoints{{{1*/ 3664 void Triangles::NewPoints(Triangles & Bh,int Keep BackVertex) {3664 void Triangles::NewPoints(Triangles & Bh,int KeepVertices) { 3665 3665 long int verbosity=2; 3666 3666 Int4 nbtold(nbt),nbvold(nbv); … … 3673 3673 nbtold = nbt; 3674 3674 3675 if (Keep BackVertex&& (&Bh != this) && (nbv+Bh.nbv< nbvx)){3675 if (KeepVertices && (&Bh != this) && (nbv+Bh.nbv< nbvx)){ 3676 3676 // Bh.SetVertexFieldOn(); 3677 3677 for (i=0;i<Bh.nbv;i++) -
issm/trunk/src/c/objects/BamgOpts.h
r2941 r2942 12 12 double MaximalAngleOfCorner; 13 13 int Hessiantype; 14 int Metrictype; 15 int KeepVertices; 16 double maxsubdiv; 14 17 double power; 15 18 double anisomax; 16 19 int NbSmooth; 17 int Metrictype;18 20 int nbjacobi; 19 21 double omega; … … 25 27 int verbose; 26 28 double* err; 29 double errg; 27 30 double coef; 28 31 double* metric; -
issm/trunk/src/m/classes/public/bamg.m
r2941 r2942 77 77 % Bamg Options {{{1 78 78 bamg_options.err=getfieldvalue(options,'err',0.01); 79 bamg_options.errg=getfieldvalue(options,'errg',0.1); 79 80 bamg_options.coef=getfieldvalue(options,'coef',1); 81 bamg_options.maxsubdiv=getfieldvalue(options,'maxsubdiv',10); 80 82 bamg_options.power=getfieldvalue(options,'power',1); 81 83 bamg_options.nbjacobi=getfieldvalue(options,'nbjacobi',1); 82 84 bamg_options.Hessiantype=getfieldvalue(options,'Hessiantype',0); 83 85 bamg_options.Metrictype=getfieldvalue(options,'Metrictype',0); 86 bamg_options.KeepVertices=getfieldvalue(options,'KeepVertices',1); 84 87 bamg_options.NbSmooth=getfieldvalue(options,'NbSmooth',3); 85 88 bamg_options.omega=getfieldvalue(options,'omega',1.8); -
issm/trunk/src/mex/Bamg/Bamg.cpp
r2941 r2942 34 34 int maxnbv,verbose,splitcorners; 35 35 double hmin,hmax,anisomax; 36 double coef ;36 double coef,maxsubdiv; 37 37 double power; 38 38 int Hessiantype,Metrictype,NbSmooth; 39 int nbjacobi ;39 int nbjacobi,KeepVertices; 40 40 double omega; 41 double gradation ;41 double gradation,errg; 42 42 double cutoff; 43 43 double* metric=NULL; … … 111 111 FetchData(&coef,mxGetField(BAMGOPTIONS,0,"coef")); 112 112 bamgopts.coef=coef; 113 FetchData(&maxsubdiv,mxGetField(BAMGOPTIONS,0,"maxsubdiv")); 114 bamgopts.maxsubdiv=maxsubdiv; 113 115 FetchData(&Hessiantype,mxGetField(BAMGOPTIONS,0,"Hessiantype")); 114 116 bamgopts.Hessiantype=Hessiantype; 115 117 FetchData(&Metrictype,mxGetField(BAMGOPTIONS,0,"Metrictype")); 116 118 bamgopts.Metrictype=Metrictype; 119 FetchData(&KeepVertices,mxGetField(BAMGOPTIONS,0,"KeepVertices")); 120 bamgopts.KeepVertices=KeepVertices; 117 121 FetchData(&power,mxGetField(BAMGOPTIONS,0,"power")); 118 122 bamgopts.power=power; 123 FetchData(&errg,mxGetField(BAMGOPTIONS,0,"errg")); 124 bamgopts.errg=errg; 119 125 FetchData(&nbjacobi,mxGetField(BAMGOPTIONS,0,"nbjacobi")); 120 126 bamgopts.nbjacobi=nbjacobi;
Note:
See TracChangeset
for help on using the changeset viewer.