Changeset 2914


Ignore:
Timestamp:
01/26/10 15:57:09 (15 years ago)
Author:
Mathieu Morlighem
Message:

fixed metric computation Bamg

Location:
issm/trunk/src
Files:
6 edited

Legend:

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

    r2913 r2914  
    3737        double hmin,hmax;
    3838        double err,errg,coef;
    39         double cutoff;
    4039        int    verbosity;
    41         int    Hessiantype,NbSmooth;
    42         double power;
     40        int    NbSmooth;
    4341        double omega;
    4442
     
    4644        int noerr=1;
    4745        int i,j,num;
    48         int AbsError=0,nbjacoby=1,allquad=0;
     46        int allquad=0;
    4947        double costheta=2;
    5048        double anisomax = 1e6;
     
    5351        const double  boundmaxsubdiv = 10;
    5452        double  maxsubdiv=boundmaxsubdiv;
    55         int Rescaling=1;
    5653
    5754        Triangles* Thr=NULL;
     
    6259        err=bamgopts->err;
    6360        errg=bamgopts->errg;
    64         Hessiantype=bamgopts->Hessiantype;
    65         power=bamgopts->power;
    6661        NbSmooth=bamgopts->NbSmooth;
    6762        omega=bamgopts->omega;
     
    7065        hmin=bamgopts->hmin;
    7166        hmax=bamgopts->hmax;
    72         cutoff=bamgopts->cutoff;
    7367        verbosity=bamgopts->verbose;
    7468
     
    150144                        if (bamgopts->field){
    151145                                if (verbosity>1) printf("   Generating Metric from solution field...\n");
    152                                 BTh.IntersectConsMetric(bamgopts->field,1,0,hmin,hmax,sqrt(err)*coef,1e30,AbsError?0.0:cutoff,nbjacoby,Rescaling,power,Hessiantype);
     146                                BTh.IntersectConsMetric(bamgopts);
    153147                        }
    154148                }
  • issm/trunk/src/c/Bamgx/Mesh2.h

    r2899 r2914  
    794794                                                 void ReadMetric(BamgOpts* bamgopts,const Real8 hmin,const Real8 hmax,const Real8 coef);
    795795                                                 void WriteMetric(BamgOpts* bamgopts);
    796                                                  void IntersectConsMetric(const double * s,const Int4 nbsol,const int * typsols,
    797                                                                          const  Real8 hmin,const Real8 hmax, const Real8 coef,
    798                                                                          const Real8  anisomax,const Real8 CutOff=1.e-4,const int NbJacobi=1,
    799                                                                          const int DoNormalisation=1,
    800                                                                          const double power=1.0,
    801                                                                          const int choise=0);
     796                                                 void IntersectConsMetric(BamgOpts* bamgopts);
    802797                                                 void IntersectGeomMetric(const Real8 err,const int iso);
    803798
  • issm/trunk/src/c/Bamgx/objects/Triangles.cpp

    r2913 r2914  
    27282728        /*}}}1*/
    27292729/*FUNCTION Triangles::IntersectConsMetric{{{1*/
    2730 void Triangles::IntersectConsMetric(const double* s,const Int4 nbsol,const int * typsols,
    2731                         const  Real8 hmin1,const Real8 hmax1,const Real8 coef,
    2732                         const Real8 anisomax ,const Real8 CutOff,const int NbJacobi,
    2733                         const int DoNormalisation,const double power,const int choice){
     2730void Triangles::IntersectConsMetric(BamgOpts* bamgopts){
     2731           /*const double* s,const Int4 nbsol,const int * typsols,
     2732                 *      const  Real8 hmin1,const Real8 hmax1,const Real8 coef,
     2733                 *           const Real8 anisomax ,const Real8 CutOff,const int NbJacobi,
     2734                 *                const int Rescaling,const double power,const int Hessiantype)*/
    27342735        //  the array of solution s is store   
    27352736        // sol0,sol1,...,soln    on vertex 0
     
    27392740        //  otherwise  =>  H is computed from P2 on 4T
    27402741
     2742        /*Options*/
    27412743        const int dim = 2;
    2742         long int verbosity=0;
     2744        int AbsError;
     2745        double* s;
     2746        Int4 nbsol;
     2747        int * typsols;
     2748        Real8 hmin1;
     2749        Real8 hmax1;
     2750        Real8 coef;
     2751        Real8 anisomax=1e30;
     2752        Real8 CutOff;
     2753        int NbJacobi;
     2754        int Rescaling;
     2755        double power;
     2756        int Hessiantype;
     2757        int verbosity;
     2758
     2759        /*Recover options*/
     2760        verbosity=bamgopts->verbose;
     2761        s=bamgopts->field;
     2762        nbsol=1;   //for now, only one field
     2763        typsols=0; // only one dof per node
     2764        AbsError=bamgopts->AbsError;   
     2765        CutOff=bamgopts->cutoff;
     2766        hmin1=bamgopts->hmin;
     2767        hmax1=bamgopts->hmax;
     2768        coef=bamgopts->coef;
     2769        NbJacobi=bamgopts->nbjacobi;
     2770        Rescaling=bamgopts->Rescaling; //do normalization
     2771        power=bamgopts->power;
     2772        Hessiantype=bamgopts->Hessiantype;
     2773
     2774        /*process options*/
     2775        if (AbsError) CutOff=0.0;
     2776        coef=sqrt(bamgopts->err)*coef;
    27432777
    27442778        int sizeoftype[] = { 1, dim ,dim * (dim+1) / 2, dim * dim } ;
     
    28232857                 Mmass[iC] += dett;
    28242858
    2825                  if((nbb==0)|| !choice){
     2859                 if((nbb==0)|| !Hessiantype){
    28262860                         Mmassxx[iA] += dett;
    28272861                         Mmassxx[iB] += dett;
     
    28592893                Real8 sdelta = smax-smin;
    28602894                Real8 absmax=Max(Abs(smin),Abs(smax));
    2861                 Real8 cnorm = DoNormalisation ? coef2/sdelta : coef2;
     2895                Real8 cnorm = Rescaling ? coef2/sdelta : coef2;
    28622896
    28632897                if(verbosity>2) printf("      Solution %i, Min = %g, Max = %g, Delta = %g, cnorm = %g, number of fields = %i\n",nusol,smin,smax,sdelta,cnorm,nbfield);
     
    29052939
    29062940                                 R2 Grads = (nAB * sC + nBC * sA + nCA * sB ) /detT[i] ;
    2907                                  if(choice){
     2941                                 if(Hessiantype){
    29082942                                         int nbb = 0;
    29092943                                         Real8 dd = detT[i];
  • issm/trunk/src/c/objects/BamgOpts.h

    r2913 r2914  
    1414        double  power;
    1515        int     NbSmooth;
     16        int     Rescaling;
     17        int     nbjacobi;
     18        int     AbsError;
    1619        double  omega;
    1720        double  hmin;
  • issm/trunk/src/m/classes/public/bamg.m

    r2913 r2914  
    8181bamg_options.coef=getfieldvalue(options,'coef',1);
    8282bamg_options.power=getfieldvalue(options,'power',1);
     83bamg_options.Rescaling=getfieldvalue(options,'Rescaling',1);
     84bamg_options.nbjacobi=getfieldvalue(options,'nbjacobi',1);
     85bamg_options.AbsError=getfieldvalue(options,'AbsError',0);
    8386bamg_options.Hessiantype=getfieldvalue(options,'Hessiantype',0);
    8487bamg_options.NbSmooth=getfieldvalue(options,'NbSmooth',3);
  • issm/trunk/src/mex/Bamg/Bamg.cpp

    r2913 r2914  
    3737        double power;
    3838        int    Hessiantype,NbSmooth;
     39        int    Rescaling,nbjacobi,AbsError;
    3940        double omega;
    4041        double gradation;
     
    118119        FetchData(&power,mxGetField(BAMGOPTIONS,0,"power"));
    119120        bamgopts.power=power;
     121        FetchData(&Rescaling,mxGetField(BAMGOPTIONS,0,"Rescaling"));
     122        bamgopts.Rescaling=Rescaling;
     123        FetchData(&nbjacobi,mxGetField(BAMGOPTIONS,0,"nbjacobi"));
     124        bamgopts.nbjacobi=nbjacobi;
     125        FetchData(&AbsError,mxGetField(BAMGOPTIONS,0,"AbsError"));
     126        bamgopts.AbsError=AbsError;
    120127        FetchData(&NbSmooth,mxGetField(BAMGOPTIONS,0,"NbSmooth"));
    121128        bamgopts.NbSmooth=NbSmooth;
Note: See TracChangeset for help on using the changeset viewer.