Changeset 12535


Ignore:
Timestamp:
06/25/12 14:53:16 (13 years ago)
Author:
utke
Message:

deal with explicit or implicit casting to non-floating point types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/objects/Node.cpp

    r12529 r12535  
    5757        //intialize inputs, and add as many inputs per element as requested:
    5858        this->inputs=new Inputs();
    59         if (iomodel->Data(MeshVertexonbedEnum))
     59        if (iomodel->Data(MeshVertexonbedEnum)) {
     60#ifndef _HAVE_ADOLC_
    6061         this->inputs->AddInput(new BoolInput(MeshVertexonbedEnum,(IssmBool)iomodel->Data(MeshVertexonbedEnum)[io_index]));
    61         if (iomodel->Data(MeshVertexonsurfaceEnum))
     62#else
     63         this->inputs->AddInput(new BoolInput(MeshVertexonbedEnum,(IssmBool)((iomodel->Data(MeshVertexonbedEnum)[io_index]).getValue())));
     64#endif
     65        }
     66        if (iomodel->Data(MeshVertexonsurfaceEnum)) {
     67#ifndef _HAVE_ADOLC_
    6268         this->inputs->AddInput(new BoolInput(MeshVertexonsurfaceEnum,(IssmBool)iomodel->Data(MeshVertexonsurfaceEnum)[io_index]));
    63         if (iomodel->Data(MaskVertexonfloatingiceEnum))
     69#else
     70         this->inputs->AddInput(new BoolInput(MeshVertexonsurfaceEnum,(IssmBool)((iomodel->Data(MeshVertexonsurfaceEnum)[io_index]).getValue())));
     71#endif
     72        }
     73        if (iomodel->Data(MaskVertexonfloatingiceEnum)) {
     74#ifndef _HAVE_ADOLC_
    6475         this->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,(IssmBool)iomodel->Data(MaskVertexonfloatingiceEnum)[io_index]));
    65         if (iomodel->Data(MaskVertexongroundediceEnum))
    66          this->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,(IssmBool)iomodel->Data(MaskVertexongroundediceEnum)[io_index]));
    67         if (analysis_type==DiagnosticHorizAnalysisEnum)
     76#else
     77         this->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,(IssmBool)((iomodel->Data(MaskVertexonfloatingiceEnum)[io_index]).getValue())));
     78#endif
     79        }
     80        if (iomodel->Data(MaskVertexongroundediceEnum)) {
     81#ifndef _HAVE_ADOLC_
     82          this->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,(IssmBool)iomodel->Data(MaskVertexongroundediceEnum)[io_index]));
     83#else
     84          this->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,(IssmBool)((iomodel->Data(MaskVertexongroundediceEnum)[io_index]).getValue())));
     85#endif
     86        }
     87        if (analysis_type==DiagnosticHorizAnalysisEnum) {
     88#ifndef _HAVE_ADOLC_
    6889         this->inputs->AddInput(new IntInput(ApproximationEnum,(IssmInt)iomodel->Data(FlowequationVertexEquationEnum)[io_index]));
    69        
     90#else
     91         this->inputs->AddInput(new IntInput(ApproximationEnum,(IssmInt)((iomodel->Data(FlowequationVertexEquationEnum)[io_index]).getValue())));
     92#endif
     93        }
    7094        /*set single point constraints: */
    7195
    7296        /*spc all nodes on water*/
    7397        if (!iomodel->Data(MaskVertexonwaterEnum)) _error2_("iomodel->nodeonwater is NULL");
    74         if (iomodel->Data(MaskVertexonwaterEnum)[io_index]){
     98        IssmBool maskVertexOnWater;
     99#ifndef _HAVE_ADOLC_
     100        maskVertexOnWater=iomodel->Data(MaskVertexonwaterEnum)[io_index];
     101#else
     102        maskVertexOnWater=(IssmBool)((iomodel->Data(MaskVertexonwaterEnum)[io_index]).getValue());
     103#endif
     104        if (maskVertexOnWater){
    75105                for(k=1;k<=gsize;k++){
    76106                        this->FreezeDof(k);
     
    117147                if (!iomodel->Data(FlowequationVertexEquationEnum)) _error2_("iomodel->vertices_type is NULL");
    118148                /*Constrain all nodes that are not Hutter*/
    119                 if (!iomodel->Data(FlowequationVertexEquationEnum)[io_index]==HutterApproximationEnum){
     149#ifndef _HAVE_ADOLC_
     150                if (!(iomodel->Data(FlowequationVertexEquationEnum)[io_index]==HutterApproximationEnum)){
     151#else
     152                if (!((iomodel->Data(FlowequationVertexEquationEnum)[io_index]).getValue()==HutterApproximationEnum)){
     153#endif
    120154                        for(k=1;k<=gsize;k++){
    121155                                this->FreezeDof(k);
     
    135169                        /*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
    136170                        _assert_(iomodel->Data(MeshVertexonbedEnum));
    137                         if (!iomodel->Data(MeshVertexonbedEnum)[io_index]){
     171                        IssmBool meshVertexOnBed;
     172#ifndef _HAVE_ADOLC_
     173                        meshVertexOnBed=iomodel->Data(MeshVertexonbedEnum)[io_index];
     174#else
     175                        meshVertexOnBed=(IssmBool)((iomodel->Data(MeshVertexonbedEnum)[io_index]).getValue());
     176#endif
     177                        if (!meshVertexOnBed){
    138178                                for(k=1;k<=gsize;k++){
    139179                                        this->FreezeDof(k);
Note: See TracChangeset for help on using the changeset viewer.