Changeset 27940


Ignore:
Timestamp:
10/05/23 05:04:24 (18 months ago)
Author:
Mathieu Morlighem
Message:

CHG: better error messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Element.cpp

    r27939 r27940  
    19031903                /*Are we in transient or static? */
    19041904                if(M==1){
     1905                        if(N!=1) _error_("Size of Input "<<EnumToStringx(vector_enum)<<" "<<M<<"x"<<N<<" not supported");
    19051906                        _assert_(N==1);
    19061907                        this->SetElementInput(inputs,vector_enum,vector[0]);
     
    19081909
    19091910                else if(M==iomodel->numberofvertices){
    1910                         _assert_(N==1);
     1911                        if(N!=1) _error_("Size of Input "<<EnumToStringx(vector_enum)<<" "<<M<<"x"<<N<<" not supported");
    19111912                        for(int i=0;i<NUM_VERTICES;i++) values[i]=vector[vertexids[i]-1];
    19121913                        this->SetElementInput(inputs,NUM_VERTICES,vertexlids,values,vector_enum);
     
    19471948                        }
    19481949                        else{
    1949                                 _error_("Patch interpolation not supported yet");
     1950                                _error_("Size of Input "<<EnumToStringx(vector_enum)<<" "<<M<<"x"<<N<<" not supported");
    19501951                        }
    19511952                        xDelete<IssmDouble>(evalues);
     
    19531954                }
    19541955                else{
    1955                         _error_("nodal vector is either numberofvertices or numberofvertices+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
     1956                        _error_("Size of Input "<<EnumToStringx(vector_enum)<<" "<<M<<"x"<<N<<" not supported");
    19561957                }
    19571958        }
     
    19601961                /*Are we in transient or static? */
    19611962                if(M==1){
    1962                         _assert_(N==1);
     1963                        if(N!=1) _error_("Size of Input "<<EnumToStringx(vector_enum)<<" "<<M<<"x"<<N<<" not supported");
    19631964                        this->SetElementInput(inputs,vector_enum,vector[0]);
    19641965                }
     
    19821983                }
    19831984                else if(M==iomodel->numberofelements){
    1984                         _assert_(N==1);
     1985                        if(N!=1) _error_("Size of Input "<<EnumToStringx(vector_enum)<<" "<<M<<"x"<<N<<" not supported");
    19851986                        if (code==5){ //boolean
    19861987                                this->SetBoolInput(inputs,vector_enum,reCast<bool>(vector[this->Sid()]));
     
    20112012                }
    20122013
    2013                 else _error_("element vector is either numberofelements or numberofelements+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
     2014                else{
     2015                        _error_("Size of Input "<<EnumToStringx(vector_enum)<<" "<<M<<"x"<<N<<" not supported");
     2016                }
    20142017        }
    20152018        else if(vector_type==3){ //Double array matrix
     
    20222025                        xDelete<IssmDouble>(layers);
    20232026                }
    2024                 else _error_("element vector is either numberofelements or numberofelements+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
    2025         }
    2026         else _error_("Cannot add input for vector type " << vector_type << " (not supported)");
     2027                else{
     2028                        _error_("Size of Input "<<EnumToStringx(vector_enum)<<" "<<M<<"x"<<N<<" not supported");
     2029                }
     2030        }
     2031        else{
     2032                _error_("Cannot add input for vector type " << vector_type << " (not supported)");
     2033        }
    20272034}
    20282035/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.