Changeset 25446


Ignore:
Timestamp:
08/21/20 20:09:49 (5 years ago)
Author:
Mathieu Morlighem
Message:

CHG: removing loop on gauss points

Location:
issm/trunk-jpl/src/c
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Cfsurfacelogvel.cpp

    r25411 r25446  
    168168        /* Start  looping on the number of gaussian points: */
    169169        Gauss* gauss=topelement->NewGauss(2);
    170         for(int ig=gauss->begin();ig<gauss->end();ig++){
    171 
    172                 gauss->GaussPoint(ig);
     170        while(gauss->next()){
    173171
    174172                /* Get Jacobian determinant: */
  • issm/trunk-jpl/src/c/classes/Cfsurfacesquare.cpp

    r25379 r25446  
    172172        /* Start  looping on the number of gaussian points: */
    173173        Gauss* gauss=topelement->NewGauss(2);
    174         for(int ig=gauss->begin();ig<gauss->end();ig++){
    175 
    176                 gauss->GaussPoint(ig);
     174        while(gauss->next()){
    177175
    178176                /* Get Jacobian determinant: */
  • issm/trunk-jpl/src/c/classes/Elements/Element.cpp

    r25420 r25446  
    736736
    737737        Gauss* gauss=this->NewGauss(5);
    738         for(int ig=gauss->begin();ig<gauss->end();ig++){
    739                 gauss->GaussPoint(ig);
     738        while(gauss->next()){
    740739                this->JacobianDeterminant(&Jdet,xyz_list,gauss);
    741740
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r25389 r25446  
    990990                /* Start  looping on the number of gaussian points: */
    991991                Gauss* gauss=element->NewGauss(2);
    992                 for(int ig=gauss->begin();ig<gauss->end();ig++){
    993 
    994                         gauss->GaussPoint(ig);
     992                while(gauss->next()){
    995993
    996994                        /* Get Jacobian determinant: */
     
    20802078                /* Start  looping on the number of gaussian points: */
    20812079                Gauss* gauss=element->NewGauss(2);
    2082                 for(int ig=gauss->begin();ig<gauss->end();ig++){
    2083 
    2084                         gauss->GaussPoint(ig);
     2080                while(gauss->next()){
    20852081
    20862082                        /* Get Jacobian determinant: */
     
    21382134                /* Start  looping on the number of gaussian points: */
    21392135                Gauss* gauss=element->NewGauss(2);
    2140                 for(int ig=gauss->begin();ig<gauss->end();ig++){
    2141 
    2142                         gauss->GaussPoint(ig);
     2136                while(gauss->next()){
    21432137
    21442138                        /* Get Jacobian determinant: */
     
    26972691                 /* Start  looping on the number of gaussian points: */
    26982692                 Gauss* gauss=element->NewGauss(2);
    2699                  for(int ig=gauss->begin();ig<gauss->end();ig++){
    2700 
    2701                          gauss->GaussPoint(ig);
     2693                 while(gauss->next()){
    27022694
    27032695                         /* Get Jacobian determinant: */
     
    27522744                /* Start  looping on the number of gaussian points: */
    27532745                Gauss* gauss=element->NewGauss(2);
    2754                 for(int ig=gauss->begin();ig<gauss->end();ig++){
    2755 
    2756                         gauss->GaussPoint(ig);
     2746                while(gauss->next()){
    27572747
    27582748                        /* Get Jacobian determinant: */
     
    28712861                /* Start  looping on the number of gaussian points: */
    28722862                Gauss* gauss=element->NewGauss(2);
    2873                 for(int ig=gauss->begin();ig<gauss->end();ig++){
    2874 
    2875                         gauss->GaussPoint(ig);
     2863                while(gauss->next()){
    28762864
    28772865                        /* Get Jacobian determinant: */
     
    41484136                Gauss* gauss=element->NewGauss(2);
    41494137        error=0.;
    4150                 for(int ig=gauss->begin();ig<gauss->end();ig++){
    4151         gauss->GaussPoint(ig);
     4138                while(gauss->next()){
    41524139                        element->JacobianDeterminant(&Jdet,xyz_list,gauss);
    41534140                        element->NodalFunctions(basis,gauss);
     
    42124199      /*Get the gradient of thickness at the center point (in fact, GradH is constante over the element)*/
    42134200      Gauss* gauss=element->NewGauss(1);
    4214       gauss->GaussPoint(gauss->begin());
     4201      gauss->GaussPoint(0);
    42154202      element->ValueP1DerivativesOnGauss(GradH,H,xyz_list,gauss);
    42164203
     
    42954282      /*Get the gradient of thickness*/
    42964283      Gauss* gaussH=element->NewGauss(1);
    4297       gaussH->GaussPoint(gaussH->begin());
     4284      gaussH->GaussPoint(0);
    42984285      element->ValueP1DerivativesOnGauss(GradH,H,xyz_list,gaussH);
    42994286      /*Integrate*/
    43004287      Gauss* gauss=element->NewGauss(2);
    43014288      error=0.;
    4302       for(int ig=gauss->begin();ig<gauss->end();ig++){
    4303          gauss->GaussPoint(ig);
     4289                while(gauss->next()){
    43044290         element->JacobianDeterminant(&Jdet,xyz_list,gauss);
    43054291         element->NodalFunctions(basis,gauss);
  • issm/trunk-jpl/src/c/classes/Loads/Channel.cpp

    r25386 r25446  
    403403        /* Start  looping on the number of gaussian points: */
    404404        Gauss* gauss=new GaussTria(index1,index2,2);
    405         for(int ig=gauss->begin();ig<gauss->end();ig++){
    406                 gauss->GaussPoint(ig);
     405        while(gauss->next()){
    407406
    408407                tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
     
    534533        /* Start  looping on the number of gaussian points: */
    535534        Gauss* gauss=new GaussTria(index1,index2,2);
    536         for(int ig=gauss->begin();ig<gauss->end();ig++){
    537                 gauss->GaussPoint(ig);
     535        while(gauss->next()){
    538536
    539537                tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
  • issm/trunk-jpl/src/c/classes/Loads/Neumannflux.cpp

    r25386 r25446  
    368368        /* Start  looping on the number of gaussian points: */
    369369        GaussTria* gauss=new GaussTria(index1,index2,2);
    370         for(int ig=gauss->begin();ig<gauss->end();ig++){
    371 
    372                 gauss->GaussPoint(ig);
     370        while(gauss->next()){
    373371
    374372                tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
     
    412410        /* Start  looping on the number of gaussian points: */
    413411        GaussTria* gauss=new GaussTria(index1,index2,2);
    414         for(int ig=gauss->begin();ig<gauss->end();ig++){
    415 
    416                 gauss->GaussPoint(ig);
     412        while(gauss->next()){
    417413
    418414                tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
  • issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp

    r25386 r25446  
    541541        /* Start  looping on the number of gaussian points: */
    542542        gauss=new GaussTria(index1,index2,2);
    543         for(int ig=gauss->begin();ig<gauss->end();ig++){
    544 
    545                 gauss->GaussPoint(ig);
     543        while(gauss->next()){
    546544
    547545                tria->GetSegmentNodalFunctions(&basis[0],gauss,index1,index2,tria->FiniteElement());
     
    598596        int index2=tria->GetVertexIndex(vertices[1]);
    599597        GaussTria* gauss=new GaussTria(index1,index2,2);
    600         for(int ig=gauss->begin();ig<gauss->end();ig++){
    601 
    602                 gauss->GaussPoint(ig);
     598        while(gauss->next()){
    603599
    604600                tria->GetSegmentNodalFunctions(&basis_plus[0] ,gauss,index1,index2,tria->FiniteElement());
     
    713709        /* Start  looping on the number of gaussian points: */
    714710        gauss=new GaussTria(index1,index2,2);
    715         for(int ig=gauss->begin();ig<gauss->end();ig++){
    716 
    717                 gauss->GaussPoint(ig);
     711        while(gauss->next()){
    718712
    719713                tria->GetSegmentNodalFunctions(&basis[0],gauss,index1,index2,tria->FiniteElement());
     
    771765        int index2=tria->GetVertexIndex(vertices[1]);
    772766        GaussTria* gauss=new GaussTria(index1,index2,2);
    773         for(int ig=gauss->begin();ig<gauss->end();ig++){
    774 
    775                 gauss->GaussPoint(ig);
     767        while(gauss->next()){
    776768
    777769                tria->GetSegmentNodalFunctions(&basis_plus[0] ,gauss,index1,index2,tria->FiniteElement());
     
    890882        /* Start  looping on the number of gaussian points: */
    891883        gauss=new GaussTria(index1,index2,2);
    892         for(int ig=gauss->begin();ig<gauss->end();ig++){
    893 
    894                 gauss->GaussPoint(ig);
     884        while(gauss->next()){
    895885
    896886                tria->GetSegmentNodalFunctions(&basis[0],gauss,index1,index2,tria->FiniteElement());
     
    971961        /* Start  looping on the number of gaussian points: */
    972962        gauss=new GaussTria(index1,index2,2);
    973         for(int ig=gauss->begin();ig<gauss->end();ig++){
    974 
    975                 gauss->GaussPoint(ig);
     963        while(gauss->next()){
    976964
    977965                tria->GetSegmentNodalFunctions(&basis[0],gauss,index1,index2,tria->FiniteElement());
  • issm/trunk-jpl/src/c/classes/gauss/Gauss.h

    r25438 r25446  
    1212
    1313                virtual      ~Gauss(){};
    14                 virtual int  begin(void)=0;
    1514                virtual void Echo(void)=0;
    16                 virtual int  end(void)=0;
    1715                virtual void Reset(void)=0;
    1816                virtual bool next(void)=0;
  • issm/trunk-jpl/src/c/classes/gauss/GaussPenta.cpp

    r25438 r25446  
    466466
    467467/*Methods*/
    468 int GaussPenta::begin(void){/*{{{*/
    469 
    470         /*Check that this has been initialized*/
    471         _assert_(numgauss>0);
    472         _assert_(weights);
    473         _assert_(coords1);
    474         _assert_(coords2);
    475         _assert_(coords3);
    476         _assert_(coords4);
    477 
    478         /*return first gauss index*/
    479         return 0;
    480 }
    481 /*}}}*/
    482468void GaussPenta::Echo(void){/*{{{*/
    483469
     
    522508        _printf_("   coord4 = " << coord4 << "\n");
    523509
    524 }
    525 /*}}}*/
    526 int GaussPenta::end(void){/*{{{*/
    527 
    528         /*Check that this has been initialized*/
    529         _assert_(numgauss>0);
    530         _assert_(weights);
    531         _assert_(coords1);
    532         _assert_(coords2);
    533         _assert_(coords3);
    534         _assert_(coords4);
    535 
    536         /*return last gauss index +1*/
    537         return numgauss;
    538510}
    539511/*}}}*/
  • issm/trunk-jpl/src/c/classes/gauss/GaussPenta.h

    r25438 r25446  
    4343                /*Methods*/
    4444                bool next(void);
    45                 int  begin(void);
    4645                void Echo(void);
    47                 int  end(void);
    4846                int  Enum(void);
    4947                void GaussFaceTria(int index1, int index2, int index3, int order);
  • issm/trunk-jpl/src/c/classes/gauss/GaussSeg.cpp

    r25438 r25446  
    7777
    7878/*Methods*/
    79 int GaussSeg::begin(void){/*{{{*/
    80 
    81         /*Check that this has been initialized*/
    82         _assert_(numgauss>0);
    83         _assert_(weights);
    84         _assert_(coords1);
    85 
    86         /*return first gauss index*/
    87         return 0;
    88 }
    89 /*}}}*/
    9079void GaussSeg::Echo(void){/*{{{*/
    9180
     
    10796        _printf_("   coord1 = " << coord1 << "\n");
    10897
    109 }
    110 /*}}}*/
    111 int GaussSeg::end(void){/*{{{*/
    112 
    113         /*Check that this has been initialized*/
    114         _assert_(numgauss>0);
    115         _assert_(weights);
    116         _assert_(coords1);
    117 
    118         /*return last gauss index +1*/
    119         return numgauss;
    12098}
    12199/*}}}*/
  • issm/trunk-jpl/src/c/classes/gauss/GaussSeg.h

    r25438 r25446  
    3131                /*Methods*/
    3232                bool next(void);
    33                 int  begin(void);
    3433                void Echo(void);
    35                 int  end(void);
    3634                int  Enum(void);
    3735                void GaussPoint(int ig);
  • issm/trunk-jpl/src/c/classes/gauss/GaussTetra.cpp

    r25438 r25446  
    9797
    9898/*Methods*/
    99 int GaussTetra::begin(void){/*{{{*/
    100 
    101         /*Check that this has been initialized*/
    102         _assert_(numgauss>0);
    103         _assert_(weights);
    104         _assert_(coords1);
    105         _assert_(coords2);
    106         _assert_(coords3);
    107         _assert_(coords4);
    108 
    109         /*return first gauss index*/
    110         return 0;
    111 }
    112 /*}}}*/
    11399void GaussTetra::Echo(void){/*{{{*/
    114100
     
    153139        _printf_("   coord4 = " << coord4 << "\n");
    154140
    155 }
    156 /*}}}*/
    157 int GaussTetra::end(void){/*{{{*/
    158 
    159         /*Check that this has been initialized*/
    160         _assert_(numgauss>0);
    161         _assert_(weights);
    162         _assert_(coords1);
    163         _assert_(coords2);
    164         _assert_(coords3);
    165         _assert_(coords4);
    166 
    167         /*return last gauss index +1*/
    168         return numgauss;
    169141}
    170142/*}}}*/
  • issm/trunk-jpl/src/c/classes/gauss/GaussTetra.h

    r25438 r25446  
    3737                /*Methods*/
    3838                bool next(void);
    39                 int  begin(void);
    4039                void Echo(void);
    41                 int  end(void);
    4240                int  Enum(void);
    4341                void GaussPoint(int ig);
  • issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp

    r25442 r25446  
    426426
    427427/*Methods*/
    428 int GaussTria::begin(void){/*{{{*/
    429 
    430         /*Check that this has been initialized*/
    431         _assert_(numgauss>0);
    432         _assert_(weights);
    433         _assert_(coords1);
    434         _assert_(coords2);
    435         _assert_(coords3);
    436 
    437         /*return first gauss index*/
    438         return 0;
    439 }
    440 /*}}}*/
    441428void GaussTria::Echo(void){/*{{{*/
    442429
     
    474461        _printf_("   coord3 = " << coord3 << "\n");
    475462
    476 }
    477 /*}}}*/
    478 int GaussTria::end(void){/*{{{*/
    479 
    480         /*Check that this has been initialized*/
    481         _assert_(numgauss>0);
    482         _assert_(weights);
    483         _assert_(coords1);
    484         _assert_(coords2);
    485         _assert_(coords3);
    486 
    487         /*return last gauss index +1*/
    488         return numgauss;
    489463}
    490464/*}}}*/
  • issm/trunk-jpl/src/c/classes/gauss/GaussTria.h

    r25442 r25446  
    3939                /*Methods*/
    4040                bool next(void);
    41                 int  begin(void);
    4241                void Echo(void);
    43                 int  end(void);
    4442                int  Enum(void);
    4543                void GaussEdgeCenter(int index1,int index2);
  • issm/trunk-jpl/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp

    r25379 r25446  
    7777        /* Start  looping on the number of gaussian points: */
    7878        Gauss* gauss=basalelement->NewGauss(2);
    79         for(int ig=gauss->begin();ig<gauss->end();ig++){
    80 
    81                 gauss->GaussPoint(ig);
     79        while(gauss->next()){
    8280
    8381                /* Get Jacobian determinant: */
  • issm/trunk-jpl/src/c/modules/RheologyBAbsGradientx/RheologyBAbsGradientx.cpp

    r25379 r25446  
    5959        /* Start  looping on the number of gaussian points: */
    6060        Gauss* gauss=element->NewGauss(2);
    61         for(int ig=gauss->begin();ig<gauss->end();ig++){
    62 
    63                 gauss->GaussPoint(ig);
     61        while(gauss->next()){
    6462
    6563                /* Get Jacobian determinant: */
     
    131129        /* Start  looping on the number of gaussian points: */
    132130        Gauss* gauss=element->NewGauss(2);
    133         for(int ig=gauss->begin();ig<gauss->end();ig++){
    134 
    135                 gauss->GaussPoint(ig);
     131        while(gauss->next()){
    136132
    137133                /* Get Jacobian determinant: */
  • issm/trunk-jpl/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp

    r25379 r25446  
    6565        /* Start  looping on the number of gaussian points: */
    6666        Gauss* gauss=basalelement->NewGauss(2);
    67         for(int ig=gauss->begin();ig<gauss->end();ig++){
    68 
    69                 gauss->GaussPoint(ig);
     67        while(gauss->next()){
    7068
    7169                /* Get Jacobian determinant: */
  • issm/trunk-jpl/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp

    r25379 r25446  
    7272        /* Start  looping on the number of gaussian points: */
    7373        Gauss* gauss=topelement->NewGauss(2);
    74         for(int ig=gauss->begin();ig<gauss->end();ig++){
    75 
    76                 gauss->GaussPoint(ig);
     74        while(gauss->next()){
    7775
    7876                /* Get Jacobian determinant: */
  • issm/trunk-jpl/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp

    r25379 r25446  
    8080        /* Start  looping on the number of gaussian points: */
    8181        Gauss* gauss=topelement->NewGauss(3);
    82         for(int ig=gauss->begin();ig<gauss->end();ig++){
    83 
    84                 gauss->GaussPoint(ig);
     82        while(gauss->next()){
    8583
    8684                /* Get Jacobian determinant: */
  • issm/trunk-jpl/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp

    r25379 r25446  
    7474        /* Start  looping on the number of gaussian points: */
    7575        Gauss* gauss=topelement->NewGauss(4);
    76         for(int ig=gauss->begin();ig<gauss->end();ig++){
    77 
    78                 gauss->GaussPoint(ig);
     76        while(gauss->next()){
    7977
    8078                /* Get Jacobian determinant: */
  • issm/trunk-jpl/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp

    r25379 r25446  
    7474        /* Start  looping on the number of gaussian points: */
    7575        Gauss* gauss=topelement->NewGauss(4);
    76         for(int ig=gauss->begin();ig<gauss->end();ig++){
    77 
    78                 gauss->GaussPoint(ig);
     76        while(gauss->next()){
    7977
    8078                /* Get Jacobian determinant: */
  • issm/trunk-jpl/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp

    r25379 r25446  
    7474        /* Start  looping on the number of gaussian points: */
    7575        Gauss* gauss=topelement->NewGauss(4);
    76         for(int ig=gauss->begin();ig<gauss->end();ig++){
    77 
    78                 gauss->GaussPoint(ig);
     76        while(gauss->next()){
    7977
    8078                /* Get Jacobian determinant: */
  • issm/trunk-jpl/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp

    r25379 r25446  
    5050        /* Start  looping on the number of gaussian points: */
    5151        Gauss* gauss=element->NewGauss(2);
    52         for(int ig=gauss->begin();ig<gauss->end();ig++){
    53 
    54                 gauss->GaussPoint(ig);
     52        while(gauss->next()){
    5553
    5654                /* Get Jacobian determinant: */
  • issm/trunk-jpl/src/c/modules/ThicknessAcrossGradientx/ThicknessAcrossGradientx.cpp

    r25379 r25446  
    5353        /* Start  looping on the number of gaussian points: */
    5454        Gauss* gauss=element->NewGauss(2);
    55         for(int ig=gauss->begin();ig<gauss->end();ig++){
    56 
    57                 gauss->GaussPoint(ig);
     55        while(gauss->next()){
    5856
    5957                /* Get Jacobian determinant: */
  • issm/trunk-jpl/src/c/modules/ThicknessAlongGradientx/ThicknessAlongGradientx.cpp

    r25379 r25446  
    5353        /* Start  looping on the number of gaussian points: */
    5454        Gauss* gauss=element->NewGauss(2);
    55         for(int ig=gauss->begin();ig<gauss->end();ig++){
    56 
    57                 gauss->GaussPoint(ig);
     55        while(gauss->next()){
    5856
    5957                /* Get Jacobian determinant: */
Note: See TracChangeset for help on using the changeset viewer.