Changeset 12572
- Timestamp:
- 06/27/12 14:31:45 (13 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp
r11695 r12572 15 15 int i; 16 16 int found=0; 17 double numberofelements;17 IssmDouble numberofelements; 18 18 Element* element=NULL; 19 19 … … 25 25 26 26 /*Allocate sigma on numberofelements: */ 27 sigma=new Vector( (int)numberofelements);27 sigma=new Vector(reCast<int>(numberofelements)); 28 28 29 29 /*Compute basal stress for each element: */ -
issm/trunk-jpl/src/c/modules/MeshPartitionx/MeshPartitionx.cpp
r12493 r12572 36 36 for (i=0;i<numberofelements;i++){ 37 37 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 Metis38 *(index+elements_width*i+j)=reCast<int>(*(elements+elements_width*i+j))-1; //-1 for C indexing in Metis 39 39 } 40 40 } … … 63 63 for (i=0;i<numberofelements2d;i++){ 64 64 for (j=0;j<3;j++){ 65 *(index2d+3*i+j)= (int)*(elements2d+3*i+j)-1; //-1 for C indexing in Metis65 *(index2d+3*i+j)=reCast<int>(*(elements2d+3*i+j))-1; //-1 for C indexing in Metis 66 66 } 67 67 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp
r12470 r12572 56 56 for (i=0;i<numberofelements;i++){ 57 57 for (j=0;j<elementswidth;j++){ 58 vertexid= (int)elements[elementswidth*i+j];58 vertexid=reCast<int>(elements[elementswidth*i+j]); 59 59 _assert_(vertexid>0 && vertexid-1<numberofvertices); 60 60 connectivity[vertexid-1]+=1; -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp
r12470 r12572 59 59 if(iomodel->my_elements[i]){ 60 60 for (j=0;j<elementswidth;j++){ 61 vertexid= (int)elements[elementswidth*i+j];61 vertexid=reCast<int>(elements[elementswidth*i+j]); 62 62 _assert_(vertexid>0 && vertexid-1<numberofvertices); 63 63 connectivity[vertexid-1]=i+1; -
issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp
r12493 r12572 27 27 28 28 /*intermediary: */ 29 Issm PDouble* analyses=NULL;29 IssmDouble* analyses=NULL; 30 30 char** strings=NULL; 31 31 int numanalyses; … … 48 48 49 49 /*Now, allocate analyses and strings: */ 50 analyses=xNew<Issm PDouble>(numanalyses);50 analyses=xNew<IssmDouble>(numanalyses); 51 51 strings=xNew<char*>(numanalyses); 52 52 for(i=0;i<numanalyses;i++)strings[i]=NULL; … … 106 106 char* string=strings[i]; 107 107 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"); 109 109 } 110 110 if(my_rank==0)stringlength=(strlen(string)+1)*sizeof(char); … … 124 124 for(i=0;i<numanalyses;i++) xDelete<char>(strings[i]); 125 125 xDelete<char*>(strings); 126 xDelete<Issm PDouble>(analyses);126 xDelete<IssmDouble>(analyses); 127 127 return; 128 128 } -
issm/trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp
r12511 r12572 54 54 PDup = siglimc+PDCUT; 55 55 56 itm = (int)(2*siglim/DT + 1.5);56 itm = reCast<int,IssmDouble>((2*siglim/DT + 1.5)); 57 57 58 58 if (itm >= NPDMAX){ … … 81 81 snormfac = 1.0/(signormc*sqrt(2.0*acos(-1.0))); 82 82 siglimc = 2.5*signormc ; 83 itm = (int)((PDCUT+2.*siglimc)/DT + 1.5);83 itm = reCast<int,IssmDouble>((PDCUT+2.*siglimc)/DT + 1.5); 84 84 if (itm >= NPDCMAX){ 85 85 _printLine_("'increase NPDCMAX in p35com'"); -
issm/trunk-jpl/src/c/objects/Options/OptionDouble.cpp
r12534 r12572 129 129 130 130 /*Assign output pointer*/ 131 *pvalue= (int)this->values[0];131 *pvalue=reCast<int>(values[0]); 132 132 } 133 133 /*}}}*/ -
issm/trunk-jpl/src/c/objects/Options/OptionUtilities.cpp
r12534 r12572 31 31 /*calculate the dimensions (being careful of integer division) */ 32 32 for (i=ndims-1; i>=0; i--) { 33 aprod= (int)(((IssmDouble)aprod+0.5)/(IssmDouble)size[i]);34 dims[i]=(int)floor(((Issm Double)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); 35 35 index-=dims[i]*aprod; 36 36 } … … 69 69 /*calculate the dimensions (being careful of integer division) */ 70 70 for (i=0; i<ndims; i++) { 71 aprod=(int)(((Issm Double)aprod+0.5)/(IssmDouble)size[i]);72 dims[i]=(int)floor(((Issm Double)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); 73 73 index-=dims[i]*aprod; 74 74 }
Note:
See TracChangeset
for help on using the changeset viewer.