Changeset 12553
- Timestamp:
- 06/26/12 11:00:01 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/objects/Elements/Tria.cpp
r12551 r12553 1649 1649 1650 1650 if ((code==5) || (code==1)){ //boolean 1651 this->inputs->AddInput(new BoolInput(name, (bool)scalar));1651 this->inputs->AddInput(new BoolInput(name,reCast<bool>(scalar))); 1652 1652 } 1653 1653 else if ((code==6) || (code==2)){ //integer 1654 this->inputs->AddInput(new IntInput(name, (int)scalar));1654 this->inputs->AddInput(new IntInput(name,reCast<int>(scalar))); 1655 1655 } 1656 1656 else if ((code==7) || (code==3)){ //IssmDouble 1657 this->inputs->AddInput(new DoubleInput(name, (int)scalar));1657 this->inputs->AddInput(new DoubleInput(name,reCast<int>(scalar))); 1658 1658 } 1659 1659 else _error2_("could not recognize nature of vector from code " << code); … … 1686 1686 /*Recover vertices ids needed to initialize inputs*/ 1687 1687 for(i=0;i<3;i++){ 1688 tria_vertex_ids[i]= (int)iomodel->Data(MeshElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab1688 tria_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[3*index+i]); //ids for vertices are in the elements array from Matlab 1689 1689 } 1690 1690 … … 1731 1731 1732 1732 if (code==5){ //boolean 1733 this->inputs->AddInput(new BoolInput(vector_enum, (bool)vector[index]));1733 this->inputs->AddInput(new BoolInput(vector_enum,reCast<bool>(vector[index]))); 1734 1734 } 1735 1735 else if (code==6){ //integer 1736 this->inputs->AddInput(new IntInput(vector_enum, (int)vector[index]));1736 this->inputs->AddInput(new IntInput(vector_enum,reCast<int>(vector[index]))); 1737 1737 } 1738 1738 else if (code==7){ //IssmDouble 1739 this->inputs->AddInput(new DoubleInput(vector_enum, (IssmDouble)vector[index]));1739 this->inputs->AddInput(new DoubleInput(vector_enum,vector[index])); 1740 1740 } 1741 1741 else _error2_("could not recognize nature of vector from code " << code); … … 1823 1823 1824 1824 for(i=0;i<NUMVERTICES;i++){ 1825 if ( flags[nodes[i]->Sid()]){1825 if (reCast<bool>(flags[nodes[i]->Sid()])){ 1826 1826 shelf=true; 1827 1827 break; … … 1914 1914 for(i=0;i<NUMVERTICES;i++){ 1915 1915 /*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */ 1916 if( old_floating_ice[nodes[i]->Sid()]){1916 if(reCast<bool>(old_floating_ice[nodes[i]->Sid()])){ 1917 1917 if(b[i]<=ba[i]){ 1918 1918 b[i]=ba[i]; … … 1934 1934 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false)); 1935 1935 } 1936 else if(migration_style==SoftMigrationEnum && sheet_ungrounding[nodes[i]->Sid()]){1936 else if(migration_style==SoftMigrationEnum && reCast<bool>(sheet_ungrounding[nodes[i]->Sid()])){ 1937 1937 s[i]=(1-density)*h[i]; 1938 1938 b[i]=-density*h[i]; … … 2187 2187 if (tstar < PDup){ 2188 2188 pd = 1; 2189 if (tstar >= -siglimc){ pd = pds[ int(tstar/DT + siglim0c)];}}2189 if (tstar >= -siglimc){ pd = pds[reCast<int,IssmDouble>(tstar/DT + siglim0c)];}} 2190 2190 else { 2191 2191 pd = 0;} … … 2207 2207 if (tstar >= siglim) {pdd[i] = pdd[i] + tstar*deltm;} 2208 2208 else if (tstar> -siglim){ 2209 pddsig=pdds[ int(tstar/DT + siglim0)];2209 pddsig=pdds[reCast<int,IssmDouble>(tstar/DT + siglim0)]; 2210 2210 pdd[i] = pdd[i] + pddsig*deltm; 2211 2211 frzndd[i] = frzndd[i] - (tstar-pddsig)*deltm;} … … 2521 2521 /*Recover vertices ids needed to initialize inputs*/ 2522 2522 for(i=0;i<3;i++){ 2523 tria_vertex_ids[i]= (int)iomodel->Data(MeshElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab2523 tria_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[3*index+i]); //ids for vertices are in the elements array from Matlab 2524 2524 } 2525 2525 … … 2534 2534 /*Continuous Galerkin*/ 2535 2535 for(i=0;i<3;i++){ 2536 tria_node_ids[i]=iomodel->nodecounter+ (int)*(iomodel->Data(MeshElementsEnum)+3*index+i); //ids for vertices are in the elements array from Matlab2536 tria_node_ids[i]=iomodel->nodecounter+reCast<int,IssmDouble>(*(iomodel->Data(MeshElementsEnum)+3*index+i)); //ids for vertices are in the elements array from Matlab 2537 2537 } 2538 2538 } … … 2592 2592 /*Go through nodes, and whoever is on the potential_sheet_ungrounding, ends up in nodes_on_iceshelf: */ 2593 2593 for(i=0;i<3;i++){ 2594 if ( vertices_potentially_ungrounding[nodes[i]->Sid()]){2594 if (reCast<bool>(vertices_potentially_ungrounding[nodes[i]->Sid()])){ 2595 2595 vec_nodes_on_iceshelf->SetValue(nodes[i]->Sid(),1,INS_VAL); 2596 2596
Note:
See TracChangeset
for help on using the changeset viewer.