Changeset 15071


Ignore:
Timestamp:
05/21/13 23:56:29 (12 years ago)
Author:
Eric.Larour
Message:

CHG: changes due to grounding line dynamics made the introduction of IssmDouble fractions
into the Gauss routines necessary. Had to adapt the Gauss Points to be able to compile
the Adolc mode of ISSM.

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

Legend:

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

    r14950 r15071  
    3737        int     numgauss_horiz;
    3838        int     numgauss_vert;
    39         double *coords1_horiz = NULL;
    40         double *coords2_horiz = NULL;
    41         double *coords3_horiz = NULL;
    42         double *weights_horiz  = NULL;
     39        IssmDouble *coords1_horiz = NULL;
     40        IssmDouble *coords2_horiz = NULL;
     41        IssmDouble *coords3_horiz = NULL;
     42        IssmDouble *weights_horiz  = NULL;
    4343        double *coords_vert = NULL;
    4444        double *weights_vert   = NULL;
     
    5151        /*Allocate GaussPenta fields*/
    5252        numgauss=numgauss_horiz*numgauss_vert;
    53         coords1=xNew<double>(numgauss);
    54         coords2=xNew<double>(numgauss);
    55         coords3=xNew<double>(numgauss);
    56         coords4=xNew<double>(numgauss);
    57         weights=xNew<double>(numgauss);
     53        coords1=xNew<IssmDouble>(numgauss);
     54        coords2=xNew<IssmDouble>(numgauss);
     55        coords3=xNew<IssmDouble>(numgauss);
     56        coords4=xNew<IssmDouble>(numgauss);
     57        weights=xNew<IssmDouble>(numgauss);
    5858
    5959        /*Combine Horizontal and vertical points*/
     
    7676
    7777        /*Clean up*/
    78         xDelete<double>(coords1_horiz);
    79         xDelete<double>(coords2_horiz);
    80         xDelete<double>(coords3_horiz);
     78        xDelete<IssmDouble>(coords1_horiz);
     79        xDelete<IssmDouble>(coords2_horiz);
     80        xDelete<IssmDouble>(coords3_horiz);
    8181        xDelete<double>(coords_vert);
    82         xDelete<double>(weights_horiz);
     82        xDelete<IssmDouble>(weights_horiz);
    8383        xDelete<double>(weights_vert);
    8484}
     
    9797
    9898        /*Allocate GaussPenta fields*/
    99         coords1=xNew<double>(numgauss);
    100         coords2=xNew<double>(numgauss);
    101         coords3=xNew<double>(numgauss);
    102         coords4=xNew<double>(numgauss);
    103         weights=xNew<double>(numgauss);
     99        coords1=xNew<IssmDouble>(numgauss);
     100        coords2=xNew<IssmDouble>(numgauss);
     101        coords3=xNew<IssmDouble>(numgauss);
     102        coords4=xNew<IssmDouble>(numgauss);
     103        weights=xNew<IssmDouble>(numgauss);
    104104
    105105        if(index1==0 && index2==3){
     
    151151
    152152                /*compute z coordinate*/
    153                 coords4=xNew<double>(numgauss);
     153                coords4=xNew<IssmDouble>(numgauss);
    154154                for(int i=0;i<numgauss;i++) coords4[i]=-1.0;
    155155        }
     
    161161
    162162                /*compute z coordinate*/
    163                 coords4=xNew<double>(numgauss);
     163                coords4=xNew<IssmDouble>(numgauss);
    164164                for(int i=0;i<numgauss;i++) coords4[i]=1.0;
    165165        }
     
    186186        /*Allocate GaussPenta fields*/
    187187        numgauss=order_horiz*order_vert;
    188         coords1=xNew<double>(numgauss);
    189         coords2=xNew<double>(numgauss);
    190         coords3=xNew<double>(numgauss);
    191         coords4=xNew<double>(numgauss);
    192         weights=xNew<double>(numgauss);
     188        coords1=xNew<IssmDouble>(numgauss);
     189        coords2=xNew<IssmDouble>(numgauss);
     190        coords3=xNew<IssmDouble>(numgauss);
     191        coords4=xNew<IssmDouble>(numgauss);
     192        weights=xNew<IssmDouble>(numgauss);
    193193
    194194        /*Quads: get the gauss points using the product of two line rules  */
     
    239239/*FUNCTION GaussPenta::~GaussPenta(){{{*/
    240240GaussPenta::~GaussPenta(){
    241         xDelete<double>(weights);
    242         xDelete<double>(coords1);
    243         xDelete<double>(coords2);
    244         xDelete<double>(coords3);
    245         xDelete<double>(coords4);
     241        xDelete<IssmDouble>(weights);
     242        xDelete<IssmDouble>(coords1);
     243        xDelete<IssmDouble>(coords2);
     244        xDelete<IssmDouble>(coords3);
     245        xDelete<IssmDouble>(coords4);
    246246}
    247247/*}}}*/
     
    361361        if(index1==0 && index2==1 && index3==2){
    362362                GaussLegendreTria(&numgauss,&coords1,&coords2,&coords3,&weights,order);
    363                 coords4=xNew<double>(numgauss);
     363                coords4=xNew<IssmDouble>(numgauss);
    364364                for(int i=0;i<numgauss;i++) coords4[i]=-1.0;
    365365        }
  • issm/trunk-jpl/src/c/classes/gauss/GaussPenta.h

    r14915 r15071  
    1414        private:
    1515                int numgauss;
    16                 double* weights;
    17                 double* coords1;
    18                 double* coords2;
    19                 double* coords3;
    20                 double* coords4;
     16                IssmDouble* weights;
     17                IssmDouble* coords1;
     18                IssmDouble* coords2;
     19                IssmDouble* coords3;
     20                IssmDouble* coords4;
    2121
    2222        public:
    23                 double weight;
    24                 double coord1;
    25                 double coord2;
    26                 double coord3;
    27                 double coord4;
     23                IssmDouble weight;
     24                IssmDouble coord1;
     25                IssmDouble coord2;
     26                IssmDouble coord3;
     27                IssmDouble coord4;
    2828
    2929        public:
  • issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp

    r14950 r15071  
    44
    55#include "./GaussTria.h"
    6 #include "../../shared/io/Print/Print.h"
    7 #include "../../shared/Exceptions/exceptions.h"
    8 #include "../../shared/MemOps/MemOps.h"
    9 #include "../../shared/Numerics/GaussPoints.h"
    10 #include "../../shared/Numerics/constants.h"
     6#include "../../shared/shared.h"
    117
    128/*GaussTria constructors and destructors:*/
     
    5450
    5551        /*Allocate GaussTria fields*/
    56         coords1=xNew<IssmPDouble>(numgauss);
    57         coords2=xNew<IssmPDouble>(numgauss);
    58         coords3=xNew<IssmPDouble>(numgauss);
    59         weights=xNew<IssmPDouble>(numgauss);
     52        coords1=xNew<IssmDouble>(numgauss);
     53        coords2=xNew<IssmDouble>(numgauss);
     54        coords3=xNew<IssmDouble>(numgauss);
     55        weights=xNew<IssmDouble>(numgauss);
    6056
    6157        /*Reverse index1 and 2 if necessary*/
     
    9995/*}}}*/
    10096/*FUNCTION GaussTria::GaussTria(int index,double r1,double r2,int order) {{{*/
    101 GaussTria::GaussTria(int index,IssmPDouble r1,IssmPDouble r2,bool mainlyfloating,int order){
     97GaussTria::GaussTria(int index,IssmDouble r1,IssmDouble r2,bool mainlyfloating,int order){
    10298
    10399        /*
     
    117113         */
    118114        int         ig;
    119         IssmPDouble x,y;
    120         IssmPDouble xy_list[3][2];
     115        IssmDouble x,y;
     116        IssmDouble xy_list[3][2];
    121117
    122118        if(mainlyfloating){
     
    224220
    225221                this->numgauss = gauss1->numgauss + gauss2->numgauss;
    226                 this->coords1=xNew<IssmPDouble>(this->numgauss);
    227                 this->coords2=xNew<IssmPDouble>(this->numgauss);
    228                 this->coords3=xNew<IssmPDouble>(this->numgauss);
    229                 this->weights=xNew<IssmPDouble>(this->numgauss);
     222                this->coords1=xNew<IssmDouble>(this->numgauss);
     223                this->coords2=xNew<IssmDouble>(this->numgauss);
     224                this->coords3=xNew<IssmDouble>(this->numgauss);
     225                this->weights=xNew<IssmDouble>(this->numgauss);
    230226
    231227                for(ig=0;ig<gauss1->numgauss;ig++){ // Add the first triangle gauss points
     
    256252/*FUNCTION GaussTria::~GaussTria(){{{*/
    257253GaussTria::~GaussTria(){
    258         xDelete<IssmPDouble>(weights);
    259         xDelete<IssmPDouble>(coords1);
    260         xDelete<IssmPDouble>(coords2);
    261         xDelete<IssmPDouble>(coords3);
     254        xDelete<IssmDouble>(weights);
     255        xDelete<IssmDouble>(coords1);
     256        xDelete<IssmDouble>(coords2);
     257        xDelete<IssmDouble>(coords3);
    262258}
    263259/*}}}*/
  • issm/trunk-jpl/src/c/classes/gauss/GaussTria.h

    r14915 r15071  
    1313        private:
    1414                int numgauss;
    15                 IssmPDouble* weights;
    16                 IssmPDouble* coords1;
    17                 IssmPDouble* coords2;
    18                 IssmPDouble* coords3;
     15                IssmDouble* weights;
     16                IssmDouble* coords1;
     17                IssmDouble* coords2;
     18                IssmDouble* coords3;
    1919
    2020        public:
    21                 IssmPDouble weight;
     21                IssmDouble weight;
    2222                IssmDouble coord1;
    2323                IssmDouble coord2;
     
    3030                GaussTria(int order);
    3131                GaussTria(int index1,int index2,int order);
    32                 GaussTria(int index,IssmPDouble r1, IssmPDouble r2,bool maintlyfloating,int order);
     32                GaussTria(int index,IssmDouble r1, IssmDouble r2,bool maintlyfloating,int order);
    3333                ~GaussTria();
    3434
  • issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp

    r14979 r15071  
    8888}/*}}}*/
    8989/*FUNCTION GaussLegendreTria{{{*/
    90 void GaussLegendreTria( int* pngaus, IssmPDouble** pl1, IssmPDouble** pl2, IssmPDouble** pl3, IssmPDouble** pwgt, int iord ) {
     90void GaussLegendreTria( int* pngaus, IssmDouble** pl1, IssmDouble** pl2, IssmDouble** pl3, IssmDouble** pwgt, int iord ) {
    9191        /*Gauss quadrature points for the triangle.
    9292
     
    11491149                *pngaus=np[iord-1];
    11501150
    1151                 *pl1  =xNew<IssmPDouble>(*pngaus);
    1152                 *pl2  =xNew<IssmPDouble>(*pngaus);
    1153                 *pl3  =xNew<IssmPDouble>(*pngaus);
    1154                 *pwgt =xNew<IssmPDouble>(*pngaus);
     1151                *pl1  =xNew<IssmDouble>(*pngaus);
     1152                *pl2  =xNew<IssmDouble>(*pngaus);
     1153                *pl3  =xNew<IssmDouble>(*pngaus);
     1154                *pwgt =xNew<IssmDouble>(*pngaus);
    11551155
    11561156                for (i=0; i<*pngaus; i++) {
     
    11671167                *pngaus=nigaus*nigaus;
    11681168
    1169                 *pl1  =xNew<IssmPDouble>(*pngaus);
    1170                 *pl2  =xNew<IssmPDouble>(*pngaus);
    1171                 *pl3  =xNew<IssmPDouble>(*pngaus);
    1172                 *pwgt =xNew<IssmPDouble>(*pngaus);
     1169                *pl1  =xNew<IssmDouble>(*pngaus);
     1170                *pl2  =xNew<IssmDouble>(*pngaus);
     1171                *pl3  =xNew<IssmDouble>(*pngaus);
     1172                *pwgt =xNew<IssmDouble>(*pngaus);
    11731173
    11741174                /*  get the gauss points in each direction  */
  • issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.h

    r14915 r15071  
    1010void GaussLegendreLinear(IssmPDouble** pxgaus, IssmPDouble** pxwgt, int ngaus);
    1111#define MAX_TRIA_SYM_ORD    20
    12 void GaussLegendreTria(int* pngaus, IssmPDouble** pl1, IssmPDouble** pl2, IssmPDouble** pl3, IssmPDouble** pwgt, int iord);
     12void GaussLegendreTria(int* pngaus, IssmDouble** pl1, IssmDouble** pl2, IssmDouble** pl3, IssmDouble** pwgt, int iord);
    1313#define MAX_TETRA_SYM_ORD    6
    1414void GaussLegendreTetra(int* pngaus, IssmPDouble** pl1, IssmPDouble** pl2, IssmPDouble** pl3, IssmPDouble** pl4, IssmPDouble** pwgt, int iord);
Note: See TracChangeset for help on using the changeset viewer.