Changeset 5150 for issm/trunk


Ignore:
Timestamp:
08/11/10 11:47:52 (15 years ago)
Author:
seroussi
Message:

Bamg: put some functions in .ccp

Location:
issm/trunk/src/c/objects/Bamg
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Bamg/BamgVertex.cpp

    r5143 r5150  
    99
    1010        /*Methods*/
     11        /*FUNCTION BamgVertex::Echo {{{1*/
     12
     13        void BamgVertex::Echo(void){
     14
     15                printf("Vertex:\n");
     16                printf("  integer   coordinates i.x: %i, i.y: %i\n",i.x,i.y);
     17                printf("  Euclidean coordinates r.x: %g, r.y: %g\n",r.x,r.y);
     18                printf("  ReferenceNumber = %i\n",ReferenceNumber);
     19                m.Echo();
     20
     21                return;
     22        }
     23        /*}}}*/
     24        /*FUNCTION BamgVertex::GetReferenceNumber{{{1*/
     25        int  BamgVertex::GetReferenceNumber() const {
     26                return ReferenceNumber;
     27        }
     28        /*}}}*/
     29        /*FUNCTION BamgVertex::MetricFromHessian{{{1*/
     30        void BamgVertex::MetricFromHessian(const double Hxx,const double Hyx, const double Hyy,const double smin,const double smax,const double s,double err,BamgOpts* bamgopts){
     31                /*Compute Metric from Hessian*/
     32
     33                /*get options*/
     34                double power=(bamgopts->power);
     35                double anisomax=(bamgopts->anisomax);
     36                double CutOff=bamgopts->cutoff;
     37                double hmin=(bamgopts->hmin);
     38                double hmax=(bamgopts->hmax);
     39                double coef=bamgopts->coeff;
     40                int    Metrictype=(bamgopts->Metrictype);
     41
     42                /*Intermediary*/
     43                double ci;
     44
     45                /*compute multiplicative coefficient depending on Metric Type (2/9 because it is 2d)*/
     46
     47                //Absolute Error
     48                /*
     49                 *            2         1       
     50                 *Metric M = ---  ------------   Abs(Hessian)
     51                 *            9   err * coeff^2 
     52                 */
     53                if (Metrictype==0){
     54                        ci= 2.0/9.0 * 1/(err*coef*coef);
     55                }
     56
     57                //Relative Error
     58                /*
     59                 *            2         1            Abs(Hessian)
     60                 *Metric M = ---  ------------  ----------------------
     61                 *            9   err * coeff^2  max( |s| , cutoff*max(|s|) )
     62                 *
     63                 */
     64                else if (Metrictype==1){
     65                        ci= 2.0/9.0 * 1/(err*coef*coef) * 1/Max( Abs(s), CutOff*(Max(Abs(smin),Abs(smax))));
     66                }
     67
     68                //Rescaled absolute error
     69                /*
     70                 *            2         1            Abs(Hessian)
     71                 *Metric M = ---  ------------  ----------------------
     72                 *            9   err * coeff^2       (smax-smin)
     73                 */
     74                else if (Metrictype==2){
     75                        ci= 2.0/9.0 * 1/(err*coef*coef) * 1/(smax-smin);
     76                }
     77                else{
     78                        ISSMERROR("Metrictype %i not supported yet (use 0,1 or 2(default))",Metrictype);
     79                }
     80
     81                //initialize metric Miv with ci*H
     82                Metric Miv(Hxx*ci,Hyx*ci,Hyy*ci);
     83
     84                //Get eigen values and vectors of Miv
     85                MatVVP2x2 Vp(Miv);
     86
     87                //move eigen valuse to their absolute values
     88                Vp.Abs();
     89
     90                //Apply a power if requested by user
     91                if(power!=1.0) Vp.pow(power);
     92
     93                //modify eigen values according to hmin and hmax
     94                Vp.Maxh(hmax);
     95                Vp.Minh(hmin);
     96
     97                //Bound anisotropy by 1/(anisomax)^2
     98                Vp.BoundAniso2(1/(anisomax*anisomax));
     99
     100                //rebuild Metric from Vp
     101                Metric MVp(Vp);
     102
     103                //Apply Metric to vertex
     104                m.IntersectWith(MVp);
     105
     106        }
     107        /*}}}1*/
     108        /*FUNCTION BamgVertex::Optim {{{1*/
     109        long BamgVertex::Optim(int i,int koption){
     110                long ret=0;
     111                if ( t && (vint >= 0 ) && (vint <3) ){
     112                        ret = t->Optim(vint,koption);
     113                        if(!i){
     114                                t =0; // for no future optime
     115                                vint= 0;
     116                        }
     117                }
     118                return ret;
     119        }
     120        /*}}}*/
    11121        /*FUNCTION BamgVertex::Smoothing{{{1*/
    12122        double  BamgVertex::Smoothing(Mesh &Th,const Mesh &BTh,Triangle* &tstart ,double omega){
     
    113223        }
    114224        /*}}}1*/
    115         /*FUNCTION BamgVertex::MetricFromHessian{{{1*/
    116         void BamgVertex::MetricFromHessian(const double Hxx,const double Hyx, const double Hyy,const double smin,const double smax,const double s,double err,BamgOpts* bamgopts){
    117                 /*Compute Metric from Hessian*/
    118 
    119                 /*get options*/
    120                 double power=(bamgopts->power);
    121                 double anisomax=(bamgopts->anisomax);
    122                 double CutOff=bamgopts->cutoff;
    123                 double hmin=(bamgopts->hmin);
    124                 double hmax=(bamgopts->hmax);
    125                 double coef=bamgopts->coeff;
    126                 int    Metrictype=(bamgopts->Metrictype);
    127 
    128                 /*Intermediary*/
    129                 double ci;
    130 
    131                 /*compute multiplicative coefficient depending on Metric Type (2/9 because it is 2d)*/
    132 
    133                 //Absolute Error
    134                 /*
    135                  *            2         1       
    136                  *Metric M = ---  ------------   Abs(Hessian)
    137                  *            9   err * coeff^2 
    138                  */
    139                 if (Metrictype==0){
    140                         ci= 2.0/9.0 * 1/(err*coef*coef);
    141                 }
    142 
    143                 //Relative Error
    144                 /*
    145                  *            2         1            Abs(Hessian)
    146                  *Metric M = ---  ------------  ----------------------
    147                  *            9   err * coeff^2  max( |s| , cutoff*max(|s|) )
    148                  *
    149                  */
    150                 else if (Metrictype==1){
    151                         ci= 2.0/9.0 * 1/(err*coef*coef) * 1/Max( Abs(s), CutOff*(Max(Abs(smin),Abs(smax))));
    152                 }
    153 
    154                 //Rescaled absolute error
    155                 /*
    156                  *            2         1            Abs(Hessian)
    157                  *Metric M = ---  ------------  ----------------------
    158                  *            9   err * coeff^2       (smax-smin)
    159                  */
    160                 else if (Metrictype==2){
    161                         ci= 2.0/9.0 * 1/(err*coef*coef) * 1/(smax-smin);
    162                 }
    163                 else{
    164                         ISSMERROR("Metrictype %i not supported yet (use 0,1 or 2(default))",Metrictype);
    165                 }
    166 
    167                 //initialize metric Miv with ci*H
    168                 Metric Miv(Hxx*ci,Hyx*ci,Hyy*ci);
    169 
    170                 //Get eigen values and vectors of Miv
    171                 MatVVP2x2 Vp(Miv);
    172 
    173                 //move eigen valuse to their absolute values
    174                 Vp.Abs();
    175 
    176                 //Apply a power if requested by user
    177                 if(power!=1.0) Vp.pow(power);
    178 
    179                 //modify eigen values according to hmin and hmax
    180                 Vp.Maxh(hmax);
    181                 Vp.Minh(hmin);
    182 
    183                 //Bound anisotropy by 1/(anisomax)^2
    184                 Vp.BoundAniso2(1/(anisomax*anisomax));
    185 
    186                 //rebuild Metric from Vp
    187                 Metric MVp(Vp);
    188 
    189                 //Apply Metric to vertex
    190                 m.IntersectWith(MVp);
    191 
    192         }
    193         /*}}}1*/
    194         /*FUNCTION BamgVertex::Echo {{{1*/
    195 
    196         void BamgVertex::Echo(void){
    197 
    198                 printf("Vertex:\n");
    199                 printf("  integer   coordinates i.x: %i, i.y: %i\n",i.x,i.y);
    200                 printf("  Euclidean coordinates r.x: %g, r.y: %g\n",r.x,r.y);
    201                 printf("  ReferenceNumber = %i\n",ReferenceNumber);
    202                 m.Echo();
    203 
    204                 return;
    205         }
    206         /*}}}*/
    207         /*FUNCTION BamgVertex::Optim {{{1*/
    208         long BamgVertex::Optim(int i,int koption){
    209                 long ret=0;
    210                 if ( t && (vint >= 0 ) && (vint <3) ){
    211                         ret = t->Optim(vint,koption);
    212                         if(!i){
    213                                 t =0; // for no future optime
    214                                 vint= 0;
    215                         }
    216                 }
    217                 return ret;
    218         }
    219         /*}}}*/
    220225
    221226        /*Intermediary*/
  • issm/trunk/src/c/objects/Bamg/BamgVertex.h

    r5148 r5150  
    4646                        void   MetricFromHessian(const double Hxx,const double Hyx, const double Hyy, const double smin,const double smax,const double s,const double err,BamgOpts* bamgopts);
    4747                        void   Echo();
    48                         int    GetReferenceNumber() const { return ReferenceNumber;}
     48                        int    GetReferenceNumber() const;
    4949                        long   Optim(int =1,int =0);
    5050
  • issm/trunk/src/c/objects/Bamg/Mesh.cpp

    r5149 r5150  
    26302630        }
    26312631        /*}}}1*/
     2632        /*FUNCTION Mesh::GetId(const Triangle & t) const{{{1*/
     2633        long Mesh::GetId(const Triangle & t) const  {
     2634                return &t - triangles;
     2635        }
     2636        /*}}}1*/
     2637        /*FUNCTION Mesh::GetId(const Triangle * t) const{{{1*/
     2638        long Mesh::GetId(const Triangle * t) const  {
     2639                return t - triangles;
     2640        }
     2641        /*}}}1*/
     2642        /*FUNCTION Mesh::GetId(const BamgVertex & t) const{{{1*/
     2643        long Mesh::GetId(const BamgVertex & t) const  {
     2644                return &t - vertices;
     2645        }
     2646        /*}}}1*/
     2647        /*FUNCTION Mesh::GetId(const BamgVertex * t) const{{{1*/
     2648        long Mesh::GetId(const BamgVertex * t) const  {
     2649                return t - vertices;
     2650        }
     2651        /*}}}1*/
     2652        /*FUNCTION Mesh::GetId(const Edge & t) const{{{1*/
     2653        long Mesh::GetId(const Edge & t) const  {
     2654                return &t - edges;
     2655        }
     2656        /*}}}1*/
     2657        /*FUNCTION Mesh::GetId(const Edge * t) const{{{1*/
     2658        long Mesh::GetId(const Edge * t) const  {
     2659                return t - edges;
     2660        }
     2661        /*}}}1*/
    26322662        /*FUNCTION Mesh::Init{{{1*/
    26332663        void Mesh::Init(long maxnbv_in) {
     
    29092939        }
    29102940        /*}}}1*/
     2941        /*FUNCTION Mesh::isCracked{{{1*/
     2942        int Mesh::isCracked() const {
     2943                return NbCrackedVertices != 0;
     2944        }
     2945        /*}}}1*/
    29112946        /*FUNCTION Mesh::MakeGeometricalEdgeToEdge{{{1*/
    29122947        Edge** Mesh::MakeGeometricalEdgeToEdge() {
     
    30023037                if (  !quadtree )  quadtree = new QuadTree(this);
    30033038
     3039        }
     3040        /*}}}1*/
     3041        /*FUNCTION Mesh::MaxinalHmax{{{1*/
     3042        double Mesh::MaximalHmax() {
     3043                return Max(pmax.x-pmin.x,pmax.y-pmin.y);
    30043044        }
    30053045        /*}}}1*/
     
    30793119        }
    30803120        /*}}}1*/
     3121        /*FUNCTION Mesh::MininalHmin{{{1*/
     3122        double Mesh::MinimalHmin() {
     3123                return 2.0/coefIcoor;
     3124        }
     3125        /*}}}1*/
    30813126/*FUNCTION Mesh::NearestVertex{{{1*/
    30823127BamgVertex* Mesh::NearestVertex(Icoor1 i,Icoor1 j) {
     
    32033248                 NbSwapf += vertices[i].Optim(0);
    32043249                NbTSwap +=  NbSwapf ;
     3250        }
     3251        /*}}}1*/
     3252        /*FUNCTION Mesh::Number2{{{1*/
     3253        long Mesh::Number2(const Triangle * t) const{
     3254                return t - triangles;
    32053255        }
    32063256        /*}}}1*/
     
    46564706}
    46574707/*}}}1*/
     4708/*FUNCTION Mesh::ToI2{{{1*/
     4709I2 Mesh::toI2(const R2 & P) const {
     4710        return  I2( (Icoor1) (coefIcoor*(P.x-pmin.x)),(Icoor1) (coefIcoor*(P.y-pmin.y)) );
     4711}
     4712/*}}}1*/
     4713/*FUNCTION Mesh::ToR2{{{1*/
     4714R2 Mesh::toR2(const I2 & P) const {
     4715        return  R2( (double) P.x/coefIcoor+pmin.x, (double) P.y/coefIcoor+pmin.y);
     4716}
     4717/*}}}1*/
    46584718/*FUNCTION Mesh::TriangleFindFromCoord{{{1*/
    46594719Triangle * Mesh::TriangleFindFromCoord(const I2 & B,Icoor2 dete[3], Triangle *tstart) const {
  • issm/trunk/src/c/objects/Bamg/Mesh.h

    r5149 r5150  
    1 #ifndef _TRIANGLES_H_
    2 #define _TRIANGLES_H_
     1#ifndef _MESH_H_
     2#define _MESH_H_
    33
    44#include "./include.h"
     
    7373                        //Methods
    7474                        void SetIntCoor(const char * from =0);
    75                         double MinimalHmin() {return 2.0/coefIcoor;}
    76                         double MaximalHmax() {return Max(pmax.x-pmin.x,pmax.y-pmin.y);}
    77                         I2 toI2(const R2 & P) const {
    78                                 return  I2( (Icoor1) (coefIcoor*(P.x-pmin.x))
    79                                                         ,(Icoor1) (coefIcoor*(P.y-pmin.y)) );}
    80                         R2 toR2(const I2 & P) const {
    81                                 return  R2( (double) P.x/coefIcoor+pmin.x, (double) P.y/coefIcoor+pmin.y);
    82                         }
     75                        double MinimalHmin();
     76                        double MaximalHmax();
     77                        I2 toI2(const R2 & P) const;
     78                        R2 toR2(const I2 & P) const;
    8379                        void AddVertex(BamgVertex & s,Triangle * t,Icoor2 *  =0) ;
    8480                        void Insert();
     
    105101                        Metric MetricAt (const R2 &) const;
    106102                        GeometricalEdge* ProjectOnCurve( Edge & AB, BamgVertex &  A, BamgVertex & B,double theta, BamgVertex & R,VertexOnEdge & BR,VertexOnGeom & GR);
    107                         long GetId(const Triangle & t) const  { return &t - triangles;}
    108                         long GetId(const Triangle * t) const  { return t - triangles;}
    109                         long GetId(const BamgVertex & t) const  { return &t - vertices;}
    110                         long GetId(const BamgVertex * t) const  { return t - vertices;}
    111                         long GetId(const Edge & t) const  { return &t - edges;}
    112                         long GetId(const Edge * t) const  { return t - edges;}
    113                         long Number2(const Triangle * t) const  { return t - triangles; }
     103                        long GetId(const Triangle & t) const;
     104                        long GetId(const Triangle * t) const;
     105                        long GetId(const BamgVertex & t) const;
     106                        long GetId(const BamgVertex * t) const;
     107                        long GetId(const Edge & t) const;
     108                        long GetId(const Edge * t) const;
     109                        long Number2(const Triangle * t) const;
    114110                        BamgVertex* NearestVertex(Icoor1 i,Icoor1 j) ;
    115111                        Triangle* TriangleFindFromCoord(const I2 & ,Icoor2 [3],Triangle *tstart=0) const;
     
    123119                        void BuildMetric1(BamgOpts* bamgopts);
    124120                        void AddGeometryMetric(BamgOpts* bamgopts);
    125                         int  isCracked() const {return NbCrackedVertices != 0;}
     121                        int  isCracked() const;
    126122                        void BuildGeometryFromMesh(BamgOpts* bamgopts=NULL);
    127123                        void ReconstructExistingMesh();
  • issm/trunk/src/c/objects/Bamg/QuadTree.cpp

    r5148 r5150  
    455455        }
    456456        /*}}}1*/
     457        /*FUNCTION QuadTree::SizeOf{{{1*/
     458        long QuadTree::SizeOf() const {
     459                return sizeof(QuadTree)+sb->SizeOf();
     460        }
     461        /*}}}1*/
    457462        /*FUNCTION QuadTree::StorageQuadTreeBox::StorageQuadTreeBox{{{1*/
    458463        QuadTree::StorageQuadTreeBox::StorageQuadTreeBox(long ll,StorageQuadTreeBox *nn) {
     
    472477        /*}}}1*/
    473478        /*FUNCTION QuadTree::ToClose {{{1*/
    474         BamgVertex *   QuadTree::ToClose(BamgVertex & v,double seuil,Icoor1 hx,Icoor1 hy){
     479        BamgVertex*   QuadTree::ToClose(BamgVertex & v,double seuil,Icoor1 hx,Icoor1 hy){
    475480                /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, QuadTree.cpp/ToClose)*/
    476481
  • issm/trunk/src/c/objects/Bamg/QuadTree.h

    r5120 r5150  
    1414
    1515        class QuadTree{
     16
    1617                private:
    17                         class QuadTreeBox {
     18
     19                        class QuadTreeBox{
    1820                                public:
    1921                                        long n;
     
    2527                                        };
    2628                        };
    27                         class StorageQuadTreeBox {
     29                        class StorageQuadTreeBox{
    2830                                public:
    2931                                        QuadTreeBox *b,*bc,*be;
     
    4143
    4244                public:
     45
    4346                        //fields
    4447                        QuadTreeBox* root;
    4548                        Mesh*   th;
     49
    4650                        //functions
    4751                        ~QuadTree();
     
    5357                        BamgVertex* NearestVertexWithNormal(Icoor1 i,Icoor1 j);
    5458                        BamgVertex* ToClose(BamgVertex & ,double ,Icoor1,Icoor1);
    55                         long    SizeOf() const {return sizeof(QuadTree)+sb->SizeOf();}
     59                        long    SizeOf() const;
    5660                        void    Add( BamgVertex & w);
    57                         QuadTreeBox* NewQuadTreeBox(){
     61
     62                        /*The following function cannot be in the cpp file because QuadTreeBox is
     63                         * a private class and is declared before QuadTree::*/
     64                        QuadTreeBox* NewQuadTreeBox(void){
    5865                                if(! (sb->bc<sb->be)) sb=new StorageQuadTreeBox(lenStorageQuadTreeBox,sb);
    5966                                if (!sb || (sb->bc->n != 0)){ISSMERROR("!sb || (sb->bc->n != 0)");}
  • issm/trunk/src/c/objects/Bamg/SetOfE4.cpp

    r3913 r5150  
    2626
    2727        /*Methods*/
    28         /*FUNCTION  SetOfEdges4::find {{{1*/
    29         long SetOfEdges4::find(long ii,long jj) {
    30                 /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, SetOfEdges4.cpp/find)*/
    31 
    32                 /*Intermediary*/
    33                 int n;
    34 
    35                 //check that head is not empty
    36                 ISSMASSERT(head);
    37 
    38                 //get n from h (usually h=ii)
    39                 n=head[Abs(ii)%nx];
    40 
    41                 //go through the existing edges that holds h (=ii) and return position in Edge
    42                 while (n >= 0){
    43 
    44                         //if the edge ii jj is already in Edges, return n
    45                         if (ii == Edges[n].i && jj == Edges[n].j) return n;
    46 
    47                         //else go to next edge that holds ii
    48                         else n = Edges[n].next;
    49                 }
    50 
    51                 //if we reach this point, the edge does not exist return -1
    52                 return -1;
    53         }
    54         /*}}}1*/
    5528        /*FUNCTION  SetOfEdges4::add{{{1*/
    5629        long SetOfEdges4::add(long ii,long jj) {
     
    8861        }
    8962        /*}}}1*/
     63        /*FUNCTION  SetOfEdges4::find {{{1*/
     64        long SetOfEdges4::find(long ii,long jj) {
     65                /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, SetOfEdges4.cpp/find)*/
     66
     67                /*Intermediary*/
     68                int n;
     69
     70                //check that head is not empty
     71                ISSMASSERT(head);
     72
     73                //get n from h (usually h=ii)
     74                n=head[Abs(ii)%nx];
     75
     76                //go through the existing edges that holds h (=ii) and return position in Edge
     77                while (n >= 0){
     78
     79                        //if the edge ii jj is already in Edges, return n
     80                        if (ii == Edges[n].i && jj == Edges[n].j) return n;
     81
     82                        //else go to next edge that holds ii
     83                        else n = Edges[n].next;
     84                }
     85
     86                //if we reach this point, the edge does not exist return -1
     87                return -1;
     88        }
     89        /*}}}1*/
     90        /*FUNCTION  SetOfEdges4::i{{{1*/
     91        long SetOfEdges4::i(long k){
     92                return Edges[k].i;
     93        }
     94        /*}}}1*/
     95        /*FUNCTION  SetOfEdges4::j{{{1*/
     96        long SetOfEdges4::j(long k){
     97                return Edges[k].j;
     98        }
     99        /*}}}1*/
     100        /*FUNCTION  SetOfEdges4::nb{{{1*/
     101        long SetOfEdges4::nb(){
     102                return NbOfEdges;
     103        }
     104        /*}}}1*/
     105        /*FUNCTION  SetOfEdges4::newarete{{{1*/
     106        long SetOfEdges4::newarete(long k){
     107                return NbOfEdges == k+1;
     108        }
     109        /*}}}1*/
     110        /*FUNCTION  SetOfEdges4::SortAndAdd{{{1*/
     111        long SetOfEdges4::SortAndAdd (long ii,long jj) {
     112                return ii <=jj ? add (ii,jj)  : add (jj,ii) ;
     113        }
     114        /*}}}1*/
     115        /*FUNCTION  SetOfEdges4::SortAndFind{{{1*/
     116        long SetOfEdges4::SortAndFind (long ii,long jj) {
     117                return ii <=jj ? find (ii,jj)  : find (jj,ii) ;
     118        }
     119        /*}}}1*/
    90120}
  • issm/trunk/src/c/objects/Bamg/SetOfE4.h

    r3913 r5150  
    3131                        //Methods
    3232                        long add (long ii,long jj);
    33                         long SortAndAdd (long ii,long jj) {return ii <=jj ? add (ii,jj)  : add (jj,ii) ;}
    34                         long nb(){return NbOfEdges;}
     33                        long SortAndAdd (long ii,long jj);
     34                        long nb();
    3535                        long find (long ii,long jj);
    36                         long SortAndFind (long ii,long jj) {return ii <=jj ? find (ii,jj)  : find (jj,ii) ;}
    37                         long i(long k){return Edges[k].i;}
    38                         long j(long k){return Edges[k].j;}
    39                         long newarete(long k){return NbOfEdges == k+1;}
     36                        long SortAndFind (long ii,long jj);
     37                        long i(long k);
     38                        long j(long k);
     39                        long newarete(long k);
    4040        };
    4141}
  • issm/trunk/src/c/objects/Bamg/VertexOnEdge.cpp

    r5149 r5150  
    1818        }
    1919        /*}}}*/
     20        /*FUNCTION VertexOnEdge::SetOnBTh{{{1*/
     21        void VertexOnEdge::SetOnBTh(){
     22                v->BackgroundEdgeHook=this;
     23                v->vint=IsVertexOnEdge; 
     24        }
     25        /*}}}*/
    2026
    2127}
  • issm/trunk/src/c/objects/Bamg/VertexOnEdge.h

    r5148 r5150  
    2929
    3030                        //Methods
    31                         void SetOnBTh(){v->BackgroundEdgeHook=this;v->vint=IsVertexOnEdge;} 
     31                        void SetOnBTh();
    3232                        void Set(const Mesh &,long,Mesh &); 
    3333        };
  • issm/trunk/src/c/objects/Bamg/VertexOnGeom.cpp

    r5149 r5150  
    1111
    1212        /*Constructors/Destructors*/
     13        /*FUNCTION VertexOnGeom::constructor{{{1*/
     14        VertexOnGeom::VertexOnGeom(): mv(0),abscisse(0){
     15                gv=0;
     16        }
     17        /*}}}*/
     18        /*FUNCTION VertexOnGeom::constructor{{{1*/
     19        VertexOnGeom::VertexOnGeom(BamgVertex & m,GeometricalVertex &g) : mv(&m),abscisse(-1){
     20                gv=&g;
     21        }
     22        /*}}}*/
     23        /*FUNCTION VertexOnGeom::constructor{{{1*/
     24        VertexOnGeom::VertexOnGeom(BamgVertex & m,GeometricalEdge &g,double s) : mv(&m),abscisse(s){
     25                ge=&g;
     26        }
     27        /*}}}*/
    1328
    1429        /*Methods*/
     
    2540        }
    2641        /*}}}*/
     42        /*FUNCTION VertexOnGeom::OnGeomVertex{{{1*/
     43        int VertexOnGeom::OnGeomVertex()const{
     44                return this? abscisse <0 :0;
     45        }
     46        /*}}}*/
     47        /*FUNCTION VertexOnGeom::OnGeomEdge{{{1*/
     48        int VertexOnGeom::OnGeomEdge() const{
     49                return this? abscisse >=0 :0;
     50        }
     51        /*}}}*/
     52        /*FUNCTION VertexOnGeom::IsRequiredVertex{{{1*/
     53        int VertexOnGeom::IsRequiredVertex() {
     54                return this? ((abscisse<0 ? (gv?gv->Required():0):0 )) : 0;
     55        }
     56        /*}}}*/
     57        /*FUNCTION VertexOnGeom::SetOn{{{1*/
     58        void VertexOnGeom::SetOn(){
     59                mv->GeometricalEdgeHook=this;
     60                mv->vint=IsVertexOnGeom;
     61        }
     62        /*}}}*/
    2763
    2864}
  • issm/trunk/src/c/objects/Bamg/VertexOnGeom.h

    r5148 r5150  
    2424
    2525                        //Constructors/Destructors
    26                         VertexOnGeom(): mv(0),abscisse(0){gv=0;}
    27                         VertexOnGeom(BamgVertex & m,GeometricalVertex &g) : mv(&m),abscisse(-1){gv=&g;}
    28                         VertexOnGeom(BamgVertex & m,GeometricalEdge &g,double s) : mv(&m),abscisse(s){ge=&g;}
     26                        VertexOnGeom();
     27                        VertexOnGeom(BamgVertex & m,GeometricalVertex &g);
     28                        VertexOnGeom(BamgVertex & m,GeometricalEdge &g,double s);
    2929
    3030                        //Operators
     
    3535
    3636                        //Methods
    37                         int  OnGeomVertex()const{return this? abscisse <0 :0;}
    38                         int  OnGeomEdge() const {return this? abscisse >=0 :0;}
    39                         int  IsRequiredVertex() {return this? ((abscisse<0 ? (gv?gv->Required():0):0 )) : 0;}
    40                         void SetOn(){mv->GeometricalEdgeHook=this;mv->vint=IsVertexOnGeom;}
     37                        int  OnGeomVertex()const;
     38                        int  OnGeomEdge() const;
     39                        int  IsRequiredVertex();
     40                        void SetOn();
    4141
    4242                        //Inline methods
Note: See TracChangeset for help on using the changeset viewer.