Changeset 2914
- Timestamp:
- 01/26/10 15:57:09 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Bamgx/Bamgx.cpp
r2913 r2914 37 37 double hmin,hmax; 38 38 double err,errg,coef; 39 double cutoff;40 39 int verbosity; 41 int Hessiantype,NbSmooth; 42 double power; 40 int NbSmooth; 43 41 double omega; 44 42 … … 46 44 int noerr=1; 47 45 int i,j,num; 48 int AbsError=0,nbjacoby=1,allquad=0;46 int allquad=0; 49 47 double costheta=2; 50 48 double anisomax = 1e6; … … 53 51 const double boundmaxsubdiv = 10; 54 52 double maxsubdiv=boundmaxsubdiv; 55 int Rescaling=1;56 53 57 54 Triangles* Thr=NULL; … … 62 59 err=bamgopts->err; 63 60 errg=bamgopts->errg; 64 Hessiantype=bamgopts->Hessiantype;65 power=bamgopts->power;66 61 NbSmooth=bamgopts->NbSmooth; 67 62 omega=bamgopts->omega; … … 70 65 hmin=bamgopts->hmin; 71 66 hmax=bamgopts->hmax; 72 cutoff=bamgopts->cutoff;73 67 verbosity=bamgopts->verbose; 74 68 … … 150 144 if (bamgopts->field){ 151 145 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); 153 147 } 154 148 } -
issm/trunk/src/c/Bamgx/Mesh2.h
r2899 r2914 794 794 void ReadMetric(BamgOpts* bamgopts,const Real8 hmin,const Real8 hmax,const Real8 coef); 795 795 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); 802 797 void IntersectGeomMetric(const Real8 err,const int iso); 803 798 -
issm/trunk/src/c/Bamgx/objects/Triangles.cpp
r2913 r2914 2728 2728 /*}}}1*/ 2729 2729 /*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){ 2730 void 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)*/ 2734 2735 // the array of solution s is store 2735 2736 // sol0,sol1,...,soln on vertex 0 … … 2739 2740 // otherwise => H is computed from P2 on 4T 2740 2741 2742 /*Options*/ 2741 2743 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; 2743 2777 2744 2778 int sizeoftype[] = { 1, dim ,dim * (dim+1) / 2, dim * dim } ; … … 2823 2857 Mmass[iC] += dett; 2824 2858 2825 if((nbb==0)|| ! choice){2859 if((nbb==0)|| !Hessiantype){ 2826 2860 Mmassxx[iA] += dett; 2827 2861 Mmassxx[iB] += dett; … … 2859 2893 Real8 sdelta = smax-smin; 2860 2894 Real8 absmax=Max(Abs(smin),Abs(smax)); 2861 Real8 cnorm = DoNormalisation? coef2/sdelta : coef2;2895 Real8 cnorm = Rescaling ? coef2/sdelta : coef2; 2862 2896 2863 2897 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); … … 2905 2939 2906 2940 R2 Grads = (nAB * sC + nBC * sA + nCA * sB ) /detT[i] ; 2907 if( choice){2941 if(Hessiantype){ 2908 2942 int nbb = 0; 2909 2943 Real8 dd = detT[i]; -
issm/trunk/src/c/objects/BamgOpts.h
r2913 r2914 14 14 double power; 15 15 int NbSmooth; 16 int Rescaling; 17 int nbjacobi; 18 int AbsError; 16 19 double omega; 17 20 double hmin; -
issm/trunk/src/m/classes/public/bamg.m
r2913 r2914 81 81 bamg_options.coef=getfieldvalue(options,'coef',1); 82 82 bamg_options.power=getfieldvalue(options,'power',1); 83 bamg_options.Rescaling=getfieldvalue(options,'Rescaling',1); 84 bamg_options.nbjacobi=getfieldvalue(options,'nbjacobi',1); 85 bamg_options.AbsError=getfieldvalue(options,'AbsError',0); 83 86 bamg_options.Hessiantype=getfieldvalue(options,'Hessiantype',0); 84 87 bamg_options.NbSmooth=getfieldvalue(options,'NbSmooth',3); -
issm/trunk/src/mex/Bamg/Bamg.cpp
r2913 r2914 37 37 double power; 38 38 int Hessiantype,NbSmooth; 39 int Rescaling,nbjacobi,AbsError; 39 40 double omega; 40 41 double gradation; … … 118 119 FetchData(&power,mxGetField(BAMGOPTIONS,0,"power")); 119 120 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; 120 127 FetchData(&NbSmooth,mxGetField(BAMGOPTIONS,0,"NbSmooth")); 121 128 bamgopts.NbSmooth=NbSmooth;
Note:
See TracChangeset
for help on using the changeset viewer.