Changeset 12475


Ignore:
Timestamp:
06/20/12 12:10:48 (13 years ago)
Author:
utke
Message:

type renames

Location:
issm/trunk-jpl/src/c/shared
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/shared/Elements/Arrhenius.cpp

    r7848 r12475  
    66#include <math.h>
    77
    8 double Arrhenius(double temperature,double depth,double n){
     8IssmDouble Arrhenius(IssmDouble temperature,IssmDouble depth,IssmDouble n){
    99        /*Use EISMINT Parameterization for the rheology: Payne2000
    1010         *
     
    2525
    2626        /*Some physical constants (Payne2000)*/
    27         double beta=8.66*pow(10.,-4.);
    28         double R=8.314;
     27        IssmDouble beta=8.66*pow(10.,-4.);
     28        IssmDouble R=8.314;
    2929
    3030        /*Intermediaries*/
    31         double A,B,Tstar;
     31        IssmDouble A,B,Tstar;
    3232
    3333        /*convert temperature to absolute temperature*/
  • issm/trunk-jpl/src/c/shared/Elements/CoordinateSystemTransform.cpp

    r12435 r12475  
    55#include <math.h>
    66
    7 void CoordinateSystemTransform(double** ptransform,Node** nodes,int numnodes,int* cs_array){
     7void CoordinateSystemTransform(IssmDouble** ptransform,Node** nodes,int numnodes,int* cs_array){
    88
    99        int     i,counter;
    1010        int     numdofs           = 0;
    11         double  norm;
    12         double *transform         = NULL;
    13         double *values            = NULL;
    14         double  coord_system[3][3];
     11        IssmDouble  norm;
     12        IssmDouble *transform         = NULL;
     13        IssmDouble *values            = NULL;
     14        IssmDouble  coord_system[3][3];
    1515
    1616        /*Some checks in debugging mode*/
     
    2727
    2828        /*Allocate and initialize transform matrix*/
    29         transform=xNew<double>(numdofs*numdofs);
     29        transform=xNew<IssmDouble>(numdofs*numdofs);
    3030        for(i=0;i<numdofs*numdofs;i++) transform[i]=0.0;
    3131
  • issm/trunk-jpl/src/c/shared/Elements/GetVerticesCoordinates.cpp

    r11197 r12475  
    55#include "./elements.h"
    66
    7 void GetVerticesCoordinates(double* xyz,  Node** nodes, int numvertices){
     7void GetVerticesCoordinates(IssmDouble* xyz,  Node** nodes, int numvertices){
    88
    99        /*In debugging mode, check that nodes is not a NULL pointer*/
  • issm/trunk-jpl/src/c/shared/Elements/Paterson.cpp

    r6966 r12475  
    77#include <math.h>
    88
    9 double Paterson(double temperature){
     9#include "../../include/include.h"
     10
     11IssmDouble Paterson(IssmDouble temperature){
    1012       
    1113        /*output: */
    12         double B;
    13         double T;
     14        IssmDouble B;
     15        IssmDouble T;
    1416
    1517        /*Switch to celsius from Kelvin: */
     
    3032
    3133        if(T<=-45.0){
    32                 B=pow((double)10,(double)8)*(-0.000292866376675*pow(T+50,3)+ 0.011672640664130*pow(T+50,2)  -0.325004442485481*(T+50)+  6.524779401948101);
     34                B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.000292866376675*pow(T+50,3)+ 0.011672640664130*pow(T+50,2)  -0.325004442485481*(T+50)+  6.524779401948101);
    3335        }
    3436        else if((T>=-45.0) && (T<=-40.0)){
    35                 B=pow((double)10,(double)8)*(-0.000292866376675*pow(T+45,3)+ 0.007279645014004*pow(T+45,2)  -0.230243014094813*(T+45)+  5.154964909039554);
     37                B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.000292866376675*pow(T+45,3)+ 0.007279645014004*pow(T+45,2)  -0.230243014094813*(T+45)+  5.154964909039554);
    3638        }
    3739        else if((T>=-40.0) && (T<=-35.0)){
    38                 B=pow((double)10,(double)8)*(0.000072737147457*pow(T+40,3)+  0.002886649363879*pow(T+40,2)  -0.179411542205399*(T+40)+  4.149132666831214);
     40                B=pow((IssmPDouble)10,(IssmPDouble)8)*(0.000072737147457*pow(T+40,3)+  0.002886649363879*pow(T+40,2)  -0.179411542205399*(T+40)+  4.149132666831214);
    3941        }
    4042        else if((T>=-35.0) && (T<=-30.0)){
    41                 B=pow((double)10,(double)8)*(-0.000086144770023*pow(T+35,3)+ 0.003977706575736*pow(T+35,2)  -0.145089762507325*(T+35)+  3.333333333333331);
     43                B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.000086144770023*pow(T+35,3)+ 0.003977706575736*pow(T+35,2)  -0.145089762507325*(T+35)+  3.333333333333331);
    4244        }
    4345        else if((T>=-30.0) && (T<=-25.0)){
    44                 B=pow((double)10,(double)8)*(-0.000043984685769*pow(T+30,3)+ 0.002685535025386*pow(T+30,2)  -0.111773554501713*(T+30)+  2.696559088937191);
     46                B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.000043984685769*pow(T+30,3)+ 0.002685535025386*pow(T+30,2)  -0.111773554501713*(T+30)+  2.696559088937191);
    4547        }
    4648        else if((T>=-25.0) && (T<=-20.0)){
    47                 B=pow((double)10,(double)8)*(-0.000029799523463*pow(T+25,3)+ 0.002025764738854*pow(T+25,2)  -0.088217055680511*(T+25)+  2.199331606342181);
     49                B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.000029799523463*pow(T+25,3)+ 0.002025764738854*pow(T+25,2)  -0.088217055680511*(T+25)+  2.199331606342181);
    4850        }
    4951        else if((T>=-20.0) && (T<=-15.0)){
    50                 B=pow((double)10,(double)8)*(0.000136920904777*pow(T+20,3)+  0.001578771886910*pow(T+20,2)  -0.070194372551690*(T+20)+  1.805165505978111);
     52                B=pow((IssmPDouble)10,(IssmPDouble)8)*(0.000136920904777*pow(T+20,3)+  0.001578771886910*pow(T+20,2)  -0.070194372551690*(T+20)+  1.805165505978111);
    5153        }
    5254        else if((T>=-15.0) && (T<=-10.0)){
    53                 B=pow((double)10,(double)8)*(-0.000899763781026*pow(T+15,3)+ 0.003632585458564*pow(T+15,2)  -0.044137585824322*(T+15)+  1.510778053489523);
     55                B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.000899763781026*pow(T+15,3)+ 0.003632585458564*pow(T+15,2)  -0.044137585824322*(T+15)+  1.510778053489523);
    5456        }
    5557        else if((T>=-10.0) && (T<=-5.0)){
    56                 B=pow((double)10,(double)8)*(0.001676964325070*pow(T+10,3)-  0.009863871256831*pow(T+10,2)  -0.075294014815659*(T+10)+  1.268434288203714);
     58                B=pow((IssmPDouble)10,(IssmPDouble)8)*(0.001676964325070*pow(T+10,3)-  0.009863871256831*pow(T+10,2)  -0.075294014815659*(T+10)+  1.268434288203714);
    5759        }
    5860        else if((T>=-5.0) && (T<=-2.0)){
    59                 B=pow((double)10,(double)8)*(-0.003748937622487*pow(T+5,3)+0.015290593619213*pow(T+5,2)  -0.048160403003748*(T+5)+  0.854987973338348);
     61                B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.003748937622487*pow(T+5,3)+0.015290593619213*pow(T+5,2)  -0.048160403003748*(T+5)+  0.854987973338348);
    6062        }
    6163        else if(T>=-2.0){
    62                 B=pow((double)10,(double)8)*(-0.003748937622488*pow(T+2,3)-0.018449844983174*pow(T+2,2)  -0.057638157095631*(T+2)+  0.746900791092860);
     64                B=pow((IssmPDouble)10,(IssmPDouble)8)*(-0.003748937622488*pow(T+2,3)-0.018449844983174*pow(T+2,2)  -0.057638157095631*(T+2)+  0.746900791092860);
    6365        }
    6466
    6567        /*B cannot be negative!*/
    66         if(B<0) B=pow((double)10,(double)6);
     68        if(B<0) B=pow((IssmPDouble)10,(IssmPDouble)6);
    6769
    6870        return B;
  • issm/trunk-jpl/src/c/shared/Elements/TransformInvStiffnessMatrixCoord.cpp

    r12435 r12475  
    2323        int     i,j;
    2424        int     numdofs   = 0;
    25         double *transform = NULL;
    26         double *values    = NULL;
     25        IssmDouble *transform = NULL;
     26        IssmDouble *values    = NULL;
    2727
    2828        /*Get total number of dofs*/
     
    3636
    3737        /*Copy current stiffness matrix*/
    38         values=xNew<double>(Ke->nrows*Ke->ncols);
     38        values=xNew<IssmDouble>(Ke->nrows*Ke->ncols);
    3939        for(i=0;i<Ke->nrows;i++) for(j=0;j<Ke->ncols;j++) values[i*Ke->ncols+j]=Ke->values[i*Ke->ncols+j];
    4040
     
    4949
    5050        /*Free Matrix*/
    51         xDelete<double>(transform);
    52         xDelete<double>(values);
     51        xDelete<IssmDouble>(transform);
     52        xDelete<IssmDouble>(values);
    5353}
  • issm/trunk-jpl/src/c/shared/Elements/TransformLoadVectorCoord.cpp

    r12437 r12475  
    2222        int     i,j;
    2323        int     numdofs   = 0;
    24         double *transform = NULL;
    25         double *values    = NULL;
     24        IssmDouble *transform = NULL;
     25        IssmDouble *values    = NULL;
    2626
    2727        /*Get total number of dofs*/
     
    3535
    3636        /*Copy current load vector*/
    37         values=xNew<double>(pe->nrows);
     37        values=xNew<IssmDouble>(pe->nrows);
    3838        for(i=0;i<pe->nrows;i++) values[i]=pe->values[i];
    3939
     
    4747
    4848        /*Free Matrices*/
    49         xDelete<double>(transform);
    50         xDelete<double>(values);
     49        xDelete<IssmDouble>(transform);
     50        xDelete<IssmDouble>(values);
    5151}
  • issm/trunk-jpl/src/c/shared/Elements/TransformSolutionCoord.cpp

    r12437 r12475  
    44#include "./elements.h"
    55
    6 void TransformSolutionCoord(double* solution,Node** nodes,int numnodes,int cs_enum){
     6void TransformSolutionCoord(IssmDouble* solution,Node** nodes,int numnodes,int cs_enum){
    77
    88        int* cs_array=NULL;
     
    1919}
    2020
    21 void TransformSolutionCoord(double* solution,Node** nodes,int numnodes,int* cs_array){
     21void TransformSolutionCoord(IssmDouble* solution,Node** nodes,int numnodes,int* cs_array){
    2222
    2323        int     i,j;
    2424        int     numdofs   = 0;
    25         double *transform = NULL;
    26         double *values    = NULL;
     25        IssmDouble *transform = NULL;
     26        IssmDouble *values    = NULL;
    2727
    2828        /*Get total number of dofs*/
     
    3636
    3737        /*Copy current solution vector*/
    38         values=xNew<double>(numdofs);
     38        values=xNew<IssmDouble>(numdofs);
    3939        for(i=0;i<numdofs;i++) values[i]=solution[i];
    4040
     
    4848
    4949        /*Free Matrices*/
    50         xDelete<double>(transform);
    51         xDelete<double>(values);
     50        xDelete<IssmDouble>(transform);
     51        xDelete<IssmDouble>(values);
    5252}
  • issm/trunk-jpl/src/c/shared/Elements/TransformStiffnessMatrixCoord.cpp

    r12435 r12475  
    2323        int     i,j;
    2424        int     numdofs   = 0;
    25         double *transform = NULL;
    26         double *values    = NULL;
     25        IssmDouble *transform = NULL;
     26        IssmDouble *values    = NULL;
    2727
    2828        /*Get total number of dofs*/
     
    3636
    3737        /*Copy current stiffness matrix*/
    38         values=xNew<double>(Ke->nrows*Ke->ncols);
     38        values=xNew<IssmDouble>(Ke->nrows*Ke->ncols);
    3939        for(i=0;i<Ke->nrows;i++) for(j=0;j<Ke->ncols;j++) values[i*Ke->ncols+j]=Ke->values[i*Ke->ncols+j];
    4040
     
    4949
    5050        /*Free Matrix*/
    51         xDelete<double>(transform);
    52         xDelete<double>(values);
     51        xDelete<IssmDouble>(transform);
     52        xDelete<IssmDouble>(values);
    5353}
  • issm/trunk-jpl/src/c/shared/Elements/elements.h

    r12248 r12475  
    1111class ElementVector;
    1212
    13 double Paterson(double temperature);
    14 double Arrhenius(double temperature,double depth,double n);
    15 void   GetVerticesCoordinates(double* xyz,  Node** nodes, int numvertices);
     13IssmDouble Paterson(IssmDouble temperature);
     14IssmDouble Arrhenius(IssmDouble temperature,IssmDouble depth,IssmDouble n);
     15void   GetVerticesCoordinates(IssmDouble* xyz,  Node** nodes, int numvertices);
    1616int    GetNumberOfDofs( Node** nodes,int numnodes,int setenum,int approximation_enum);
    1717int*   GetLocalDofList( Node** nodes,int numnodes,int setenum,int approximation_enum);
    1818int*   GetGlobalDofList(Node** nodes,int numnodes,int setenum,int approximation_enum);
    1919#ifdef _HAVE_DIAGNOSTIC_
    20 void   CoordinateSystemTransform(double** ptransform,Node** nodes,int numnodes,int* cs_array);
     20void   CoordinateSystemTransform(IssmDouble** ptransform,Node** nodes,int numnodes,int* cs_array);
    2121void   TransformInvStiffnessMatrixCoord(ElementMatrix* Ke,Node** nodes,int numnodes,int cs_enum);
    2222void   TransformInvStiffnessMatrixCoord(ElementMatrix* Ke,Node** nodes,int numnodes,int* cs_array);
     
    2525void   TransformLoadVectorCoord(ElementVector* pe,Node** nodes,int numnodes,int cs_enum);
    2626void   TransformLoadVectorCoord(ElementVector* pe,Node** nodes,int numnodes,int* cs_array);
    27 void   TransformSolutionCoord(double* solution,Node** nodes,int numnodes,int cs_enum);
    28 void   TransformSolutionCoord(double* solution,Node** nodes,int numnodes,int* cs_array);
     27void   TransformSolutionCoord(IssmDouble* solution,Node** nodes,int numnodes,int cs_enum);
     28void   TransformSolutionCoord(IssmDouble* solution,Node** nodes,int numnodes,int* cs_array);
    2929#endif
    3030
    31 inline void printarray(double* array,int lines,int cols=1){
     31inline void printarray(IssmDouble* array,int lines,int cols=1){
    3232        printf("\n");
    3333        for(int i=0;i<lines;i++){ 
  • issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp

    r12441 r12475  
    1717
    1818/*FUNCTION TripleMultiply {{{*/
    19 int TripleMultiply( double* a, int nrowa, int ncola, int itrna, double* b, int nrowb, int ncolb, int itrnb, double* c, int nrowc, int ncolc, int itrnc, double* d, int iaddd){
     19int TripleMultiply( IssmDouble* a, int nrowa, int ncola, int itrna, IssmDouble* b, int nrowb, int ncolb, int itrnb, IssmDouble* c, int nrowc, int ncolc, int itrnc, IssmDouble* d, int iaddd){
    2020        /*TripleMultiply    Perform triple matrix product a*b*c+d.*/
    2121       
    2222        int idima,idimb,idimc,idimd;
    23         double* dtemp;
     23        IssmDouble* dtemp;
    2424
    2525/*  set up dimensions for triple product  */
     
    6262/*  perform the matrix triple product in the order that minimizes the
    6363        number of multiplies and the temporary space used, noting that
    64         (a*b)*c requires ac(b+d) multiplies and ac doubles, and a*(b*c)
    65         requires bd(a+c) multiplies and bd doubles (both are the same for
     64        (a*b)*c requires ac(b+d) multiplies and ac IssmDoubles, and a*(b*c)
     65        requires bd(a+c) multiplies and bd IssmDoubles (both are the same for
    6666        a symmetric triple product)  */
    6767
     
    6969
    7070        if (idima*idimc*(idimb+idimd) <= idimb*idimd*(idima+idimc)) {
    71                 dtemp=xNew<double>(idima*idimc);
     71                dtemp=xNew<IssmDouble>(idima*idimc);
    7272
    7373                MatrixMultiply(a,nrowa,ncola,itrna,b,nrowb,ncolb,itrnb,dtemp,0);
    7474                MatrixMultiply(dtemp,idima,idimc,0,c,nrowc,ncolc,itrnc,d,iaddd);
    75                 xDelete<double>(dtemp);
     75                xDelete<IssmDouble>(dtemp);
    7676        }
    7777
     
    7979
    8080        else {
    81                 dtemp=xNew<double>(idimb*idimd);
     81                dtemp=xNew<IssmDouble>(idimb*idimd);
    8282
    8383                MatrixMultiply(b,nrowb,ncolb,itrnb,c,nrowc,ncolc,itrnc,dtemp,0);
    8484                MatrixMultiply(a,nrowa,ncola,itrna,dtemp,idimb,idimd,0,d,iaddd);
    85                 xDelete<double>(dtemp);
     85                xDelete<IssmDouble>(dtemp);
    8686        }
    8787
     
    8989}/*}}}*/
    9090/*FUNCTION MatrixMuliply {{{*/
    91 int MatrixMultiply( double* a, int nrowa, int ncola, int itrna, double* b, int nrowb, int ncolb, int itrnb, double* c, int iaddc ){
     91int MatrixMultiply( IssmDouble* a, int nrowa, int ncola, int itrna, IssmDouble* b, int nrowb, int ncolb, int itrnb, IssmDouble* c, int iaddc ){
    9292        /*MatrixMultiply    Perform matrix multiplication a*b+c.*/
    9393        int noerr=1;
     
    158158}/*}}}*/
    159159/*FUNCTION MatrixInverse {{{*/
    160 int MatrixInverse( double* a, int ndim, int nrow, double* b, int nvec, double* pdet ){
     160int MatrixInverse( IssmDouble* a, int ndim, int nrow, IssmDouble* b, int nvec, IssmDouble* pdet ){
    161161/* MatrixInverse    Perform matrix inversion and linear equation solution.
    162162
     
    172172        int i,j,k,ipt,jpt,irow,icol,ipiv,ncol;
    173173        int *pivrc1,*pivrc2,*pindx;
    174         double pivot,det,dtemp;
     174        IssmDouble pivot,det,dtemp;
    175175
    176176        if (!b && nvec) {
     
    333333        return noerr;
    334334}/*}}}*/
    335 /*FUNCTION Matrix2x2Determinant(double* Adet,double* A) {{{*/
    336 void Matrix2x2Determinant(double* Adet,double* A){
     335/*FUNCTION Matrix2x2Determinant(IssmDouble* Adet,IssmDouble* A) {{{*/
     336void Matrix2x2Determinant(IssmDouble* Adet,IssmDouble* A){
    337337        /*Compute determinant of a 2x2 matrix*/
    338338
     
    341341}
    342342/*}}}*/
    343 /*FUNCTION Matrix2x2Invert(double* Ainv,double* A) {{{*/
    344 void Matrix2x2Invert(double* Ainv,double* A){
     343/*FUNCTION Matrix2x2Invert(IssmDouble* Ainv,IssmDouble* A) {{{*/
     344void Matrix2x2Invert(IssmDouble* Ainv,IssmDouble* A){
    345345
    346346        /*Intermediaries*/
    347         double det;
     347        IssmDouble det;
    348348
    349349        /*Compute determinant*/
     
    358358
    359359}/*}}}*/
    360 /*FUNCTION Matrix3x3Determinant(double* Adet,double* A) {{{*/
    361 void Matrix3x3Determinant(double* Adet,double* A){
     360/*FUNCTION Matrix3x3Determinant(IssmDouble* Adet,IssmDouble* A) {{{*/
     361void Matrix3x3Determinant(IssmDouble* Adet,IssmDouble* A){
    362362        /*Compute determinant of a 3x3 matrix*/
    363363
     
    366366}
    367367/*}}}*/
    368 /*FUNCTION Matrix3x3Invert(double* Ainv,double* A) {{{*/
    369 void Matrix3x3Invert(double* Ainv,double* A){
     368/*FUNCTION Matrix3x3Invert(IssmDouble* Ainv,IssmDouble* A) {{{*/
     369void Matrix3x3Invert(IssmDouble* Ainv,IssmDouble* A){
    370370
    371371        /*Intermediaries*/
    372         double det;
     372        IssmDouble det;
    373373
    374374        /*Compute determinant*/
     
    388388
    389389}/*}}}*/
    390 /*FUNCTION MatrixTranspose(double* Adet,double* A) {{{*/
    391 void MatrixTranspose(double* tA,double* A, int nrows, int ncols){
     390/*FUNCTION MatrixTranspose(IssmDouble* Adet,IssmDouble* A) {{{*/
     391void MatrixTranspose(IssmDouble* tA,IssmDouble* A, int nrows, int ncols){
    392392        /*Transpose a n*m matrix*/
    393393
  • issm/trunk-jpl/src/c/shared/Matrix/matrix.h

    r5371 r12475  
    66#define _MATRIXUTILS_H_
    77
    8 int  TripleMultiply( double* a, int nrowa, int ncola, int itrna, double* b, int nrowb, int ncolb, int itrnb, double* c, int nrowc, int ncolc, int itrnc, double* d, int iaddd);
    9 int  MatrixMultiply( double* a, int nrowa, int ncola, int itrna, double* b, int nrowb, int ncolb, int itrnb, double* c, int iaddc );
    10 int  MatrixInverse( double* a, int ndim, int nrow, double* b, int nvec, double* pdet );
    11 void Matrix2x2Invert(double* Ainv, double* A);
    12 void Matrix2x2Determinant(double* Adet,double* A);
    13 void Matrix3x3Invert(double* Ainv, double* A);
    14 void Matrix3x3Determinant(double* Adet,double* A);
    15 void MatrixTranspose(double* tA,double* A,int nrows, int ncols);
     8#include "../../include/include.h"
     9
     10int  TripleMultiply( IssmDouble* a, int nrowa, int ncola, int itrna, IssmDouble* b, int nrowb, int ncolb, int itrnb, IssmDouble* c, int nrowc, int ncolc, int itrnc, IssmDouble* d, int iaddd);
     11int  MatrixMultiply( IssmDouble* a, int nrowa, int ncola, int itrna, IssmDouble* b, int nrowb, int ncolb, int itrnb, IssmDouble* c, int iaddc );
     12int  MatrixInverse( IssmDouble* a, int ndim, int nrow, IssmDouble* b, int nvec, IssmDouble* pdet );
     13void Matrix2x2Invert(IssmDouble* Ainv, IssmDouble* A);
     14void Matrix2x2Determinant(IssmDouble* Adet,IssmDouble* A);
     15void Matrix3x3Invert(IssmDouble* Ainv, IssmDouble* A);
     16void Matrix3x3Determinant(IssmDouble* Adet,IssmDouble* A);
     17void MatrixTranspose(IssmDouble* tA,IssmDouble* A,int nrows, int ncols);
    1618
    1719#endif //ifndef _MATRIXUTILS_H_
Note: See TracChangeset for help on using the changeset viewer.