Ignore:
Timestamp:
05/26/17 19:47:25 (8 years ago)
Author:
Eric.Larour
Message:

CHG: now possible to retrieve without an vector type.

File:
1 edited

Legend:

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

    r21520 r21746  
    5454        *pvector=vector;
    5555}
     56
     57void GetVectorFromInputsx(IssmDouble** pvector,int* pvector_size, FemModel* femmodel,int name){
     58
     59        int interpolation_type;
     60        /*this one is special: we don't specify the type, but let the nature of the inputs dictace.
     61         * P0 -> ElementSIdEnum, P1 ->VertexSIdEnum: */
     62       
     63        /*We go find the input of the first element, and query its interpolation type: */
     64        Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(0));
     65        Input* input=element->GetInput(name);
     66        if (!input) _error_("could not find input: " << name);
     67
     68        interpolation_type=input->GetInputInterpolationType();
     69        if(interpolation_type==P0Enum){
     70                *pvector_size=femmodel->elements->NumberOfElements();
     71                GetVectorFromInputsx(pvector,femmodel,name, ElementSIdEnum);
     72        }
     73        else if(interpolation_type==P1Enum){
     74                *pvector_size=femmodel->vertices->NumberOfVertices();
     75                GetVectorFromInputsx(pvector,femmodel,name, VertexSIdEnum);
     76        }
     77        else _error_("interpolation type : " << interpolation_type << " not supported yet!");
     78}
Note: See TracChangeset for help on using the changeset viewer.