Changeset 12572


Ignore:
Timestamp:
06/27/12 14:31:45 (13 years ago)
Author:
utke
Message:

reCast

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp

    r11695 r12572  
    1515        int i;
    1616        int      found=0;
    17         double   numberofelements;
     17        IssmDouble   numberofelements;
    1818        Element* element=NULL;
    1919
     
    2525
    2626        /*Allocate sigma on numberofelements: */
    27         sigma=new Vector((int)numberofelements);
     27        sigma=new Vector(reCast<int>(numberofelements));
    2828
    2929        /*Compute basal stress for each element: */
  • issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp

    r12493 r12572  
    3636                for (i=0;i<numberofelements;i++){
    3737                        for (j=0;j<elements_width;j++){
    38                                 *(index+elements_width*i+j)=(int)*(elements+elements_width*i+j)-1; //-1 for C indexing in Metis
     38                                *(index+elements_width*i+j)=reCast<int>(*(elements+elements_width*i+j))-1; //-1 for C indexing in Metis
    3939                        }
    4040                }
     
    6363                for (i=0;i<numberofelements2d;i++){
    6464                        for (j=0;j<3;j++){
    65                                 *(index2d+3*i+j)=(int)*(elements2d+3*i+j)-1; //-1 for C indexing in Metis
     65                                *(index2d+3*i+j)=reCast<int>(*(elements2d+3*i+j))-1; //-1 for C indexing in Metis
    6666                        }
    6767                }
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp

    r12470 r12572  
    5656        for (i=0;i<numberofelements;i++){
    5757                for (j=0;j<elementswidth;j++){
    58                         vertexid=(int)elements[elementswidth*i+j];
     58                        vertexid=reCast<int>(elements[elementswidth*i+j]);
    5959                        _assert_(vertexid>0 && vertexid-1<numberofvertices);
    6060                        connectivity[vertexid-1]+=1;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp

    r12470 r12572  
    5959                if(iomodel->my_elements[i]){
    6060                        for (j=0;j<elementswidth;j++){
    61                                 vertexid=(int)elements[elementswidth*i+j];
     61                                vertexid=reCast<int>(elements[elementswidth*i+j]);
    6262                                _assert_(vertexid>0 && vertexid-1<numberofvertices);
    6363                                connectivity[vertexid-1]=i+1;
  • issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp

    r12493 r12572  
    2727
    2828        /*intermediary: */
    29         IssmPDouble* analyses=NULL;
     29        IssmDouble* analyses=NULL;
    3030        char** strings=NULL;
    3131        int numanalyses;
     
    4848
    4949                /*Now, allocate analyses and strings: */
    50                 analyses=xNew<IssmPDouble>(numanalyses);
     50                analyses=xNew<IssmDouble>(numanalyses);
    5151                strings=xNew<char*>(numanalyses);
    5252                for(i=0;i<numanalyses;i++)strings[i]=NULL;
     
    106106                char* string=strings[i];
    107107                if(my_rank==0){
    108                         if(string==NULL) _error2_("PETSc options for analysis " << EnumToStringx((int)analyses[i]) << " have been declared but were not found");
     108                        if(string==NULL) _error2_("PETSc options for analysis " << EnumToStringx(reCast<int>(analyses[i])) << " have been declared but were not found");
    109109                }
    110110                if(my_rank==0)stringlength=(strlen(string)+1)*sizeof(char);
     
    124124        for(i=0;i<numanalyses;i++) xDelete<char>(strings[i]);
    125125        xDelete<char*>(strings);
    126         xDelete<IssmPDouble>(analyses);
     126        xDelete<IssmDouble>(analyses);
    127127        return;
    128128}
  • issm/trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp

    r12511 r12572  
    5454  PDup = siglimc+PDCUT;
    5555
    56   itm = (int)(2*siglim/DT + 1.5);
     56  itm = reCast<int,IssmDouble>((2*siglim/DT + 1.5));
    5757 
    5858  if (itm >= NPDMAX){
     
    8181  snormfac = 1.0/(signormc*sqrt(2.0*acos(-1.0)));
    8282  siglimc = 2.5*signormc ;
    83   itm = (int)((PDCUT+2.*siglimc)/DT + 1.5);
     83  itm = reCast<int,IssmDouble>((PDCUT+2.*siglimc)/DT + 1.5);
    8484  if (itm >= NPDCMAX){
    8585    _printLine_("'increase NPDCMAX in p35com'");
  • issm/trunk-jpl/src/c/objects/Options/OptionDouble.cpp

    r12534 r12572  
    129129
    130130        /*Assign output pointer*/
    131         *pvalue=(int)this->values[0];
     131        *pvalue=reCast<int>(values[0]);
    132132}
    133133/*}}}*/
  • issm/trunk-jpl/src/c/objects/Options/OptionUtilities.cpp

    r12534 r12572  
    3131        /*calculate the dimensions (being careful of integer division)  */
    3232        for (i=ndims-1; i>=0; i--) {
    33                 aprod=(int)(((IssmDouble)aprod+0.5)/(IssmDouble)size[i]);
    34                 dims[i]=(int)floor(((IssmDouble)index+0.5)/(IssmDouble)aprod);
     33                aprod=reCast<int>(((IssmPDouble)aprod+0.5)/(IssmPDouble)size[i]);
     34                dims[i]=(int)floor(((IssmPDouble)index+0.5)/(IssmPDouble)aprod);
    3535                index-=dims[i]*aprod;
    3636        }
     
    6969        /*calculate the dimensions (being careful of integer division)  */
    7070        for (i=0; i<ndims; i++) {
    71                 aprod=(int)(((IssmDouble)aprod+0.5)/(IssmDouble)size[i]);
    72                 dims[i]=(int)floor(((IssmDouble)index+0.5)/(IssmDouble)aprod);
     71                aprod=(int)(((IssmPDouble)aprod+0.5)/(IssmPDouble)size[i]);
     72                dims[i]=(int)floor(((IssmPDouble)index+0.5)/(IssmPDouble)aprod);
    7373                index-=dims[i]*aprod;
    7474        }
Note: See TracChangeset for help on using the changeset viewer.