Changeset 9362


Ignore:
Timestamp:
08/19/11 20:01:40 (14 years ago)
Author:
Eric.Larour
Message:

Before computer shutdown, commiting changes to the almost final interface for dynamic I/O

Location:
issm/trunk/src/c
Files:
59 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp

    r9356 r9362  
    3333
    3434        /*Fetch parameters: */
    35         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     35        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
    3636
    3737        /*First of, find the record for the enum, and get code  of data type: */
  • issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp

    r9356 r9362  
    1313       
    1414        /*Fetch parameters: */
    15         iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
     15        iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
    1616
    1717        /*Output*/
  • issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp

    r9356 r9362  
    2020
    2121        /*Fetch parameters: */
    22         iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
     22        iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
    2323
    2424        /*Output*/
  • issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp

    r9356 r9362  
    3030
    3131        /*Fetch parameters: */
    32         iomodel->parameters->FindParam(&dim,DimEnum);
    33         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
    34         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
    35         iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
     32        iomodel->constants->FindParam(&dim,DimEnum);
     33        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
     34        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
     35        iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
    3636
    3737        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp

    r9356 r9362  
    2020
    2121        /*Fetch data needed: */
    22         iomodel->parameters->FindParam(&dim,DimEnum);
     22        iomodel->constants->FindParam(&dim,DimEnum);
    2323        iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
    24         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
     24        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
    2525
    2626        /*Update elements: */
  • issm/trunk/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp

    r9356 r9362  
    2424
    2525        /*Fetch parameters: */
    26         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     26        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
    2727
    2828        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp

    r9356 r9362  
    2020
    2121        /*Fetch data needed: */
    22         iomodel->parameters->FindParam(&dim,DimEnum);
     22        iomodel->constants->FindParam(&dim,DimEnum);
    2323        iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
    24         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
     24        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
    2525
    2626        /*Update elements: */
  • issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp

    r9356 r9362  
    2727       
    2828        /*Fetch parameters: */
    29         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
    30         iomodel->parameters->FindParam(&control_analysis,ControlAnalysisEnum);
    31         iomodel->parameters->FindParam(&num_control_type,NumControlTypeEnum);
     29        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
     30        iomodel->constants->FindParam(&control_analysis,ControlAnalysisEnum);
     31        iomodel->constants->FindParam(&num_control_type,NumControlTypeEnum);
    3232
    3333        /*Now, return if no control*/
  • issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp

    r9356 r9362  
    2727
    2828        /*Fetch parameters: */
    29         iomodel->parameters->FindParam(&dim,DimEnum);
    30         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
    31         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     29        iomodel->constants->FindParam(&dim,DimEnum);
     30        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
     31        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
    3232
    3333        /*Did we already create the elements? : */
     
    4343       
    4444        /*Fetch data needed: */
    45         iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
    46         iomodel->FetchData(&iomodel->elementconnectivity,NULL,NULL,ElementconnectivityEnum);
    47         iomodel->FetchData(&iomodel->upperelements,NULL,NULL,UpperelementsEnum);
    48         iomodel->FetchData(&iomodel->lowerelements,NULL,NULL,LowerelementsEnum);
    49         iomodel->FetchData(&iomodel->rheology_B,NULL,NULL,RheologyBEnum);
    50         iomodel->FetchData(&iomodel->rheology_n,NULL,NULL,RheologyNEnum);
    51         iomodel->FetchData(&iomodel->control_type,NULL,NULL,ControlTypeEnum);
    52         iomodel->FetchData(&iomodel->cm_min,NULL,NULL,CmMinEnum);
    53         iomodel->FetchData(&iomodel->cm_max,NULL,NULL,CmMaxEnum);
     45        iomodel->FetchData(9,ElementsEnum,ElementconnectivityEnum,UpperelementsEnum,LowerelementsEnum,RheologyBEnum,RheologyNEnum,ControlTypeEnum,CmMinEnum,CmMaxEnum);
    5446       
    5547        /*Create elements and materials: */
     
    5951
    6052                        /*Create and add tria element to elements dataset: */
    61                         if(dim==2)
    62                          elements->AddObject(new Tria(i+1,i,i,iomodel,nummodels));
    63                         else
    64                          elements->AddObject(new Penta(i+1,i,i,iomodel,nummodels));
     53                        if(dim==2) elements->AddObject(new Tria(i+1,i,i,iomodel,nummodels));
     54                        else       elements->AddObject(new Penta(i+1,i,i,iomodel,nummodels));
    6555
    6656                        /*Create and add material property to materials dataset: */
     
    7060       
    7161        /*Free data: */
    72         xfree((void**)&iomodel->elements);
    73         xfree((void**)&iomodel->elementconnectivity);
    74         xfree((void**)&iomodel->upperelements);
    75         xfree((void**)&iomodel->lowerelements);
    76         xfree((void**)&iomodel->rheology_B);
    77         xfree((void**)&iomodel->rheology_n);
    78         xfree((void**)&iomodel->control_type);
    79         xfree((void**)&iomodel->cm_min);
    80         xfree((void**)&iomodel->cm_max);
     62        iomodel->DeleteData(9,ElementsEnum,ElementconnectivityEnum,UpperelementsEnum,LowerelementsEnum,RheologyBEnum,RheologyNEnum,ControlTypeEnum,CmMinEnum,CmMaxEnum);
    8163
    8264        /*Add new constrant material property tgo materials, at the end: */
     
    8466       
    8567        /*Create vertices: */
    86         iomodel->FetchData(&iomodel->x,NULL,NULL,XEnum);
    87         iomodel->FetchData(&iomodel->y,NULL,NULL,YEnum);
    88         iomodel->FetchData(&iomodel->z,NULL,NULL,ZEnum);
    89         iomodel->FetchData(&iomodel->bed,NULL,NULL,BedEnum);
    90         iomodel->FetchData(&iomodel->thickness,NULL,NULL,ThicknessEnum);
     68
     69        /*Fetch data:*/
     70        iomodel->FetchData(5,XEnum,YEnum,ZEnum,BedEnum,ThicknessEnum);
    9171       
    9272        for (i=0;i<numberofvertices;i++){
     
    10080        }
    10181
    102         /*Clean fetched data: */
    103         xfree((void**)&iomodel->x);
    104         xfree((void**)&iomodel->y);
    105         xfree((void**)&iomodel->z);
    106         xfree((void**)&iomodel->bed);
    107         xfree((void**)&iomodel->thickness);
     82        /*Free data: */
     83        iomodel->DeleteData(5,XEnum,YEnum,ZEnum,BedEnum,ThicknessEnum);
    10884
    109         cleanup_and_return:
    110        
    11185        /*Assign output pointer: */
    11286        *pelements=elements;
  • issm/trunk/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp

    r9356 r9362  
    2323        int    numberofelements;
    2424        int    numberofvertices;
     25        double* elements=NULL;
    2526
    2627        /*output*/
     
    2829
    2930        /*Fetch parameters: */
    30         iomodel->parameters->FindParam(&dim,DimEnum);
    31         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
    32         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     31        iomodel->constants->FindParam(&dim,DimEnum);
     32        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
     33        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
     34        elements=iomodel->f(ElementsEnum);
    3335
    3436        /*Some checks if debugging*/
    3537        _assert_(numberofvertices);
    3638        _assert_(numberofelements);
    37         _assert_(iomodel->elements);
     39        _assert_(elements);
    3840
    3941        /*Allocate ouput*/
     
    5153        for (i=0;i<numberofelements;i++){
    5254                for (j=0;j<elementswidth;j++){
    53                         vertexid=(int)iomodel->elements[elementswidth*i+j];
     55                        vertexid=(int)elements[elementswidth*i+j];
    5456                        _assert_(vertexid>0 && vertexid-1<numberofvertices);
    5557                        connectivity[vertexid-1]+=1;
  • issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp

    r9356 r9362  
    2424               
    2525        /*Initialize dataset: */
    26         parameters = (Parameters*)iomodel->parameters->Copy();
     26        parameters = (Parameters*)iomodel->constants->Copy();
    2727
    2828        /*some parameters that did not come with the iomodel: */
  • issm/trunk/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp

    r9356 r9362  
    2323        int    numberofelements;
    2424        int    numberofvertices;
     25        double* elements=NULL;
    2526
    2627        /*output*/
     
    2829
    2930        /*Fetch parameters: */
    30         iomodel->parameters->FindParam(&dim,DimEnum);
    31         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
    32         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     31        iomodel->constants->FindParam(&dim,DimEnum);
     32        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
     33        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
     34        elements=iomodel->f(ElementsEnum);
    3335
    3436        /*Some checks if debugging*/
     
    3638        _assert_(numberofelements);
    3739        _assert_(iomodel->my_elements);
    38         _assert_(iomodel->elements);
     40        _assert_(elements);
    3941
    4042        /*Allocate ouput*/
     
    5456                if(iomodel->my_elements[i]){
    5557                        for (j=0;j<elementswidth;j++){
    56                                 vertexid=(int)iomodel->elements[elementswidth*i+j];
     58                                vertexid=(int)elements[elementswidth*i+j];
    5759                                _assert_(vertexid>0 && vertexid-1<numberofvertices);
    5860                                connectivity[vertexid-1]=i+1;
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp

    r9356 r9362  
    3030
    3131        /*Fetch parameters: */
    32         iomodel->parameters->FindParam(&dim,DimEnum);
    33         iomodel->parameters->FindParam(&yts,YtsEnum);
    34         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
    35         iomodel->parameters->FindParam(&g,GEnum);
    36         iomodel->parameters->FindParam(&rho_ice,RhoIceEnum);
    37         iomodel->parameters->FindParam(&stokesreconditioning,StokesreconditioningEnum);
    38         iomodel->parameters->FindParam(&isstokes,IsstokesEnum);
    39         iomodel->parameters->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
     32        iomodel->constants->FindParam(&dim,DimEnum);
     33        iomodel->constants->FindParam(&yts,YtsEnum);
     34        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
     35        iomodel->constants->FindParam(&g,GEnum);
     36        iomodel->constants->FindParam(&rho_ice,RhoIceEnum);
     37        iomodel->constants->FindParam(&stokesreconditioning,StokesreconditioningEnum);
     38        iomodel->constants->FindParam(&isstokes,IsstokesEnum);
     39        iomodel->constants->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
    4040
    4141        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp

    r9356 r9362  
    3131
    3232        /*Fetch parameters: */
    33         iomodel->parameters->FindParam(&dim,DimEnum);
    34         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
    35         iomodel->parameters->FindParam(&isstokes,IsstokesEnum);
    36         iomodel->parameters->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
     33        iomodel->constants->FindParam(&dim,DimEnum);
     34        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
     35        iomodel->constants->FindParam(&isstokes,IsstokesEnum);
     36        iomodel->constants->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
    3737
    3838        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp

    r9356 r9362  
    2525
    2626        /*Fetch parameters: */
    27         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
    28         iomodel->parameters->FindParam(&isstokes,IsstokesEnum);
    29         iomodel->parameters->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
     27        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
     28        iomodel->constants->FindParam(&isstokes,IsstokesEnum);
     29        iomodel->constants->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
    3030
    3131        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp

    r9356 r9362  
    2727        iomodel->FetchData(&iomodel->elements_type,NULL,NULL,ElementsTypeEnum);
    2828
    29         iomodel->parameters->FindParam(&isstokes,IsstokesEnum);
    30         iomodel->parameters->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
    31         iomodel->parameters->FindParam(&dim,DimEnum);
    32         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
    33         iomodel->parameters->FindParam(&control_analysis,ControlAnalysisEnum);
    34         iomodel->parameters->FindParam(&qmu_analysis,QmuAnalysisEnum);
     29        iomodel->constants->FindParam(&isstokes,IsstokesEnum);
     30        iomodel->constants->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);
     31        iomodel->constants->FindParam(&dim,DimEnum);
     32        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
     33        iomodel->constants->FindParam(&control_analysis,ControlAnalysisEnum);
     34        iomodel->constants->FindParam(&qmu_analysis,QmuAnalysisEnum);
    3535
    3636
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp

    r9356 r9362  
    2828
    2929        /*Fetch parameters: */
    30         iomodel->parameters->FindParam(&yts,YtsEnum);
    31         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
    32         iomodel->parameters->FindParam(&ishutter,IshutterEnum);
     30        iomodel->constants->FindParam(&yts,YtsEnum);
     31        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
     32        iomodel->constants->FindParam(&ishutter,IshutterEnum);
    3333
    3434        /*Create constraints if they do not exist yet*/
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp

    r9356 r9362  
    2525
    2626        /*Fetch parameters: */
    27         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
    28         iomodel->parameters->FindParam(&ishutter,IshutterEnum);
     27        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
     28        iomodel->constants->FindParam(&ishutter,IshutterEnum);
    2929
    3030        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp

    r9356 r9362  
    2323        iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
    2424        iomodel->FetchData(&iomodel->elements_type,NULL,NULL,ElementsTypeEnum);
    25         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
    26         iomodel->parameters->FindParam(&ishutter,IshutterEnum);
     25        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
     26        iomodel->constants->FindParam(&ishutter,IshutterEnum);
    2727
    2828        /*Now, is the flag hutter on? otherwise, do nothing: */
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp

    r9356 r9362  
    2424
    2525        /*Fetch parameters: */
    26         iomodel->parameters->FindParam(&dim,DimEnum);
    27         iomodel->parameters->FindParam(&yts,YtsEnum);
     26        iomodel->constants->FindParam(&dim,DimEnum);
     27        iomodel->constants->FindParam(&yts,YtsEnum);
    2828
    2929        /*Recover pointer: */
     
    3939        iomodel->FetchData(&iomodel->spcvz,NULL,NULL,SpcvzEnum);
    4040        iomodel->FetchData(&iomodel->nodeonstokes,NULL,NULL,NodeOnStokesEnum);
    41         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     41        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
    4242
    4343        /*Initialize counter*/
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp

    r9356 r9362  
    2525
    2626        /*Fetch parameters: */
    27         iomodel->parameters->FindParam(&dim,DimEnum);
    28         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     27        iomodel->constants->FindParam(&dim,DimEnum);
     28        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
    2929
    3030        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp

    r9356 r9362  
    2020
    2121        /*Fetch parameters: */
    22         iomodel->parameters->FindParam(&dim,DimEnum);
    23         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
     22        iomodel->constants->FindParam(&dim,DimEnum);
     23        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
    2424
    2525        /*Now, is the model 3d? otherwise, do nothing: */
  • issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp

    r9356 r9362  
    4242        int  el1,el2;
    4343        int    dim;
     44        double* elements=NULL;
     45        double* elements2d=NULL;
     46        double* riftinfo=NULL;
     47        double* penalties=NULL;
    4448
    4549        /*Fetch parameters: */
    46         iomodel->parameters->FindParam(&dim,DimEnum);
    47         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
    48         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
    49         iomodel->parameters->FindParam(&numberofelements2d,NumberOfElements2DEnum);
    50         iomodel->parameters->FindParam(&numberofvertices2d,NumberOfNodes2DEnum);
    51         iomodel->parameters->FindParam(&numlayers,NumlayersEnum);
    52         iomodel->parameters->FindParam(&numrifts,NumRiftsEnum);
     50        iomodel->constants->FindParam(&dim,DimEnum);
     51        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
     52        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
     53        iomodel->constants->FindParam(&numberofelements2d,NumberOfElements2DEnum);
     54        iomodel->constants->FindParam(&numberofvertices2d,NumberOfNodes2DEnum);
     55        iomodel->constants->FindParam(&numlayers,NumlayersEnum);
     56        iomodel->constants->FindParam(&numrifts,NumRiftsEnum);
    5357
    5458        /*First, check that partitioning has not yet been carryed out. Just check whether my_elements pointers is not already assigned a value: */
     
    6367        if(dim==2){
    6468                /*load elements: */
    65                 iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
     69                iomodel->FetchData(&elements,NULL,NULL,ElementsEnum);
    6670        }
    6771        else{
    6872                /*load elements2d: */
    69                 iomodel->FetchData(&iomodel->elements2d,NULL,NULL,Elements2DEnum);
     73                iomodel->FetchData(&elements2d,NULL,NULL,Elements2DEnum);
    7074        }
    7175
    72         MeshPartitionx(&epart, &npart,numberofelements,numberofvertices,iomodel->elements, numberofelements2d,numberofvertices2d,iomodel->elements2d,numlayers,elements_width, dim,num_procs);
     76        MeshPartitionx(&epart, &npart,numberofelements,numberofvertices,elements, numberofelements2d,numberofvertices2d,elements2d,numlayers,elements_width, dim,num_procs);
    7377
    7478        /*Free elements and elements2d: */
    75         xfree((void**)&iomodel->elements);
    76         xfree((void**)&iomodel->elements2d);
     79        xfree((void**)&elements);
     80        xfree((void**)&elements2d);
    7781
    7882        #else
     
    8286
    8387        /*Deal with rifts, they have to be included into one partition only, not several: */
    84         iomodel->FetchData(&iomodel->riftinfo,&numrifts,NULL,RiftinfoEnum);
     88        iomodel->FetchData(&riftinfo,&numrifts,NULL,RiftinfoEnum);
    8589
    8690        for(i=0;i<numrifts;i++){
    87                 el1=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+2)-1; //matlab indexing to c indexing
    88                 el2=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+3)-1; //matlab indexing to c indexing
     91                el1=(int)*(riftinfo+RIFTINFOSIZE*i+2)-1; //matlab indexing to c indexing
     92                el2=(int)*(riftinfo+RIFTINFOSIZE*i+3)-1; //matlab indexing to c indexing
    8993                epart[el2]=epart[el1]; //ensures that this pair of elements will be in the same partition, as well as the corresponding vertices;
    9094        }
    9195
    9296        /*Free rifts: */
    93         xfree((void**)&iomodel->riftinfo);
     97        xfree((void**)&riftinfo);
    9498
    9599        /*Used later on: */
     
    98102
    99103        /*Start figuring out, out of the partition, which elements belong to this cpu: */
    100         iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
     104        iomodel->FetchData(&elements,NULL,NULL,ElementsEnum);
    101105        for (i=0;i<numberofelements;i++){
    102106
     
    110114                         into the vertices coordinates. If we start plugging 1 into my_vertices for each index[n][i] (i=0:2), then my_vertices
    111115                         will hold which vertices belong to this partition*/
    112                         my_vertices[(int)*(iomodel->elements+elements_width*i+0)-1]=1;
    113                         my_vertices[(int)*(iomodel->elements+elements_width*i+1)-1]=1;
    114                         my_vertices[(int)*(iomodel->elements+elements_width*i+2)-1]=1;
     116                        my_vertices[(int)*(elements+elements_width*i+0)-1]=1;
     117                        my_vertices[(int)*(elements+elements_width*i+1)-1]=1;
     118                        my_vertices[(int)*(elements+elements_width*i+2)-1]=1;
    115119                       
    116120                        if(elements_width==6){
    117                                 my_vertices[(int)*(iomodel->elements+elements_width*i+3)-1]=1;
    118                                 my_vertices[(int)*(iomodel->elements+elements_width*i+4)-1]=1;
    119                                 my_vertices[(int)*(iomodel->elements+elements_width*i+5)-1]=1;
     121                                my_vertices[(int)*(elements+elements_width*i+3)-1]=1;
     122                                my_vertices[(int)*(elements+elements_width*i+4)-1]=1;
     123                                my_vertices[(int)*(elements+elements_width*i+5)-1]=1;
    120124                        }
    121125                }
    122126        }//for (i=0;i<numberofelements;i++)
    123127        /*Free data : */
    124         xfree((void**)&iomodel->elements);
     128        xfree((void**)&elements);
    125129
    126130        /*We might have penalties in which case, some vertices have to be cloned:
    127131         * penpair has 2 nodes that are poointing toward 2 vertices.
    128132         * The 2 vertices must be in the same cpu as the penpair*/
    129         iomodel->FetchData(&iomodel->penalties,&numpenalties,NULL,PenaltiesEnum);
     133        iomodel->FetchData(&penalties,&numpenalties,NULL,PenaltiesEnum);
    130134        for(i=0;i<numpenalties;i++){
    131                 if(my_vertices[(int)iomodel->penalties[2*i+0]-1] && !my_vertices[(int)iomodel->penalties[2*i+1]-1]){
    132                         my_vertices[(int)iomodel->penalties[2*i+1]-1]=2; //to know that these elements are not on the partition
     135                if(my_vertices[(int)penalties[2*i+0]-1] && !my_vertices[(int)penalties[2*i+1]-1]){
     136                        my_vertices[(int)penalties[2*i+1]-1]=2; //to know that these elements are not on the partition
    133137                }
    134138        }
    135         xfree((void**)&iomodel->penalties);
     139        xfree((void**)&penalties);
    136140
    137141        /*Free ressources:*/
  • issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp

    r9356 r9362  
    2626
    2727        /*Fetch parameters: */
    28         iomodel->parameters->FindParam(&dim,DimEnum);
    29         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
    30         iomodel->parameters->FindParam(&heatcapacity,HeatcapacityEnum);
    31         iomodel->parameters->FindParam(&referencetemperature,ReferencetemperatureEnum);
     28        iomodel->constants->FindParam(&dim,DimEnum);
     29        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
     30        iomodel->constants->FindParam(&heatcapacity,HeatcapacityEnum);
     31        iomodel->constants->FindParam(&referencetemperature,ReferencetemperatureEnum);
    3232
    3333        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp

    r9356 r9362  
    2424
    2525        /*Fetch parameters: */
    26         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     26        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
    2727       
    2828        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp

    r9356 r9362  
    2020
    2121        /*Fetch parameters: */
    22         iomodel->parameters->FindParam(&dim,DimEnum);
    23         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
     22        iomodel->constants->FindParam(&dim,DimEnum);
     23        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
    2424
    2525        /*Now, is the model 3d? otherwise, do nothing: */
  • issm/trunk/src/c/modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp

    r9356 r9362  
    2424
    2525        /*Fetch parameters: */
    26         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     26        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
    2727       
    2828        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp

    r9356 r9362  
    2020        /*Fetch data needed: */
    2121        iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
    22         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
     22        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
    2323
    2424        /*Update elements: */
  • issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp

    r9356 r9362  
    2222
    2323        /*Fetch parameters: */
    24         iomodel->parameters->FindParam(&dim,DimEnum);
    25         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     24        iomodel->constants->FindParam(&dim,DimEnum);
     25        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
    2626
    2727        /*if 2d: Error*/
  • issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp

    r9356 r9362  
    2424       
    2525        /*Fetch parameters: */
    26         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     26        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
    2727
    2828        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp

    r9356 r9362  
    2020
    2121        /*Fetch parameters: */
    22         iomodel->parameters->FindParam(&dim,DimEnum);
    23         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
     22        iomodel->constants->FindParam(&dim,DimEnum);
     23        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
    2424
    2525        /*Now, is the model 3d? otherwise, do nothing: */
  • issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp

    r9356 r9362  
    3737
    3838        /*Fetch parameters: */
    39         iomodel->parameters->FindParam(&dim,DimEnum);
    40         iomodel->parameters->FindParam(&verbose,VerboseEnum);
     39        iomodel->constants->FindParam(&dim,DimEnum);
     40        iomodel->constants->FindParam(&verbose,VerboseEnum);
    4141       
    4242        SetVerbosityLevel(verbose);
  • issm/trunk/src/c/modules/ModelProcessorx/NodesPartitioning.cpp

    r9356 r9362  
    4242
    4343        /*Fetch parameters: */
    44         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     44        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
    4545
    4646        my_nodes=(bool*)xmalloc(numberofvertices*sizeof(bool));
     
    5757
    5858        /*Fetch parameters: */
    59         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
     59        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
    6060
    6161        /*each element has it own nodes (as many as vertices) + additional nodes from neighbouring elements for each edge. This yields to a very different partition for
     
    7474        int     pos;
    7575        int     numberofedges;
     76        double* edges=NULL;
     77        double* elements=NULL;
    7678
    7779        /*Fetch parameters: */
    78         iomodel->parameters->FindParam(&dim,DimEnum);
     80        iomodel->constants->FindParam(&dim,DimEnum);
    7981
    8082        /*Build discontinuous node partitioning
     
    107109
    108110        /*Get edges and elements*/
    109         iomodel->FetchData(&iomodel->edges,&numberofedges,&cols,EdgesEnum);
    110         iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
     111        iomodel->FetchData(&edges,&numberofedges,&cols,EdgesEnum);
     112        iomodel->FetchData(&elements,NULL,NULL,ElementsEnum);
    111113        if (cols!=4) _error_("field edges should have 4 columns");
    112114
     
    115117
    116118                /*Get left and right elements*/
    117                 e1=iomodel->edges[4*i+2]-1; //edges are [node1 node2 elem1 elem2]
    118                 e2=iomodel->edges[4*i+3]-1; //edges are [node1 node2 elem1 elem2]
     119                e1=edges[4*i+2]-1; //edges are [node1 node2 elem1 elem2]
     120                e2=edges[4*i+3]-1; //edges are [node1 node2 elem1 elem2]
    119121
    120122                /* 1) If the element e1 is in the current partition
     
    126128
    127129                        /*1: Get vertices ids*/
    128                         i1=(int)iomodel->edges[4*i+0];
    129                         i2=(int)iomodel->edges[4*i+1];
     130                        i1=(int)edges[4*i+0];
     131                        i2=(int)edges[4*i+1];
    130132
    131133                        /*2: Get the column where these ids are located in the index*/
    132134                        pos=UNDEF;
    133135                        for(j=0;j<3;j++){
    134                                 if ((int)iomodel->elements[3*(int)e2+j]==i1) pos=j;
     136                                if ((int)elements[3*(int)e2+j]==i1) pos=j;
    135137                        }
    136138
     
    156158
    157159        /*Free data: */
    158         xfree((void**)&iomodel->elements);
    159         xfree((void**)&iomodel->edges);
     160        xfree((void**)&elements);
     161        xfree((void**)&edges);
    160162
    161163        /*Assign output pointers:*/
  • issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp

    r9356 r9362  
    1313       
    1414        /*Fetch parameters: */
    15         iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
     15        iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
    1616
    1717        /*Output*/
  • issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp

    r9356 r9362  
    2626       
    2727        /*Fetch parameters: */
    28         iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
     28        iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
    2929
    3030        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp

    r9356 r9362  
    3030
    3131        /*Fetch parameters: */
    32         iomodel->parameters->FindParam(&dim,DimEnum);
    33         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
    34         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
    35         iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
     32        iomodel->constants->FindParam(&dim,DimEnum);
     33        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
     34        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
     35        iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
    3636
    3737        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp

    r9356 r9362  
    2121
    2222        /*Fetch data needed: */
    23         iomodel->parameters->FindParam(&dim,DimEnum);
     23        iomodel->constants->FindParam(&dim,DimEnum);
    2424        iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
    25         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
    26         iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
     25        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
     26        iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
    2727
    2828        /*Update elements: */
  • issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp

    r9356 r9362  
    2424
    2525        /*Fetch parameters: */
    26         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     26        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
    2727
    2828        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp

    r9356 r9362  
    2020
    2121        /*Fetch data needed: */
    22         iomodel->parameters->FindParam(&dim,DimEnum);
     22        iomodel->constants->FindParam(&dim,DimEnum);
    2323        iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum);
    24         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
     24        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
    2525
    2626        /*Update elements: */
  • issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp

    r9356 r9362  
    2323
    2424        /*Fetch parameters: */
    25         iomodel->parameters->FindParam(&dim,DimEnum);
     25        iomodel->constants->FindParam(&dim,DimEnum);
    2626
    2727        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp

    r9356 r9362  
    2626
    2727        /*Fetch parameters: */
    28         iomodel->parameters->FindParam(&dim,DimEnum);
    29         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     28        iomodel->constants->FindParam(&dim,DimEnum);
     29        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
    3030
    3131        /*Create loads if they do not exist yet*/
  • issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp

    r9356 r9362  
    2424
    2525        /*Fetch parameters: */
    26         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     26        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
    2727
    2828        /*Recover pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp

    r9356 r9362  
    2121
    2222        /*Fetch parameters: */
    23         iomodel->parameters->FindParam(&dim,DimEnum);
    24         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
    25         iomodel->parameters->FindParam(&qmu_analysis,QmuAnalysisEnum);
     23        iomodel->constants->FindParam(&dim,DimEnum);
     24        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
     25        iomodel->constants->FindParam(&qmu_analysis,QmuAnalysisEnum);
    2626
    2727        /*Now, is the model 3d? otherwise, do nothing: */
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r9356 r9362  
    5757        /*Checks in debugging mode*/
    5858        /*{{{2*/
    59         _assert_(iomodel->upperelements);
    60         _assert_(iomodel->lowerelements);
     59        _assert_(iomodel->f(UpperelementsEnum));
     60        _assert_(iomodel->f(LowerelementsEnum));
    6161        /*}}}*/
    6262
     
    6666
    6767        /*Build neighbors list*/
    68         if (isnan(iomodel->upperelements[index])) penta_elements_ids[1]=this->id; //upper penta is the same penta
    69         else                                    penta_elements_ids[1]=(int)(iomodel->upperelements[index]);
    70         if (isnan(iomodel->lowerelements[index])) penta_elements_ids[0]=this->id; //lower penta is the same penta
    71         else                                    penta_elements_ids[0]=(int)(iomodel->lowerelements[index]);
     68        if (isnan(iomodel->f(UpperelementsEnum)[index])) penta_elements_ids[1]=this->id; //upper penta is the same penta
     69        else                                    penta_elements_ids[1]=(int)(iomodel->f(UpperelementsEnum)[index]);
     70        if (isnan(iomodel->f(LowerelementsEnum)[index])) penta_elements_ids[0]=this->id; //lower penta is the same penta
     71        else                                    penta_elements_ids[0]=(int)(iomodel->f(LowerelementsEnum)[index]);
    7272        this->InitHookNeighbors(penta_elements_ids);
    7373
    7474        /*Build horizontalneighborsids list: */
    75         _assert_(iomodel->elementconnectivity);
    76         for(i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel->elementconnectivity[3*index+i]-1;
     75        _assert_(iomodel->f(ElementconnectivityEnum));
     76        for(i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel->f(ElementconnectivityEnum)[3*index+i]-1;
    7777
    7878        //this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
     
    48594859
    48604860        /*Fetch parameters: */
    4861         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
    4862         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
    4863         iomodel->parameters->FindParam(&yts,YtsEnum);
     4861        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
     4862        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
     4863        iomodel->constants->FindParam(&yts,YtsEnum);
    48644864
    48654865        /*Branch on type of vector: nodal or elementary: */
     
    48684868                /*Recover vertices ids needed to initialize inputs*/
    48694869                for(i=0;i<6;i++){
    4870                         penta_vertex_ids[i]=(int)iomodel->elements[6*index+i]; //ids for vertices are in the elements array from Matlab
     4870                        penta_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
    48714871                }
    48724872
     
    51685168
    51695169        /*Fetch parameters: */
    5170         iomodel->parameters->FindParam(&yts,YtsEnum);
    5171         iomodel->parameters->FindParam(&control_analysis,ControlAnalysisEnum);
    5172         iomodel->parameters->FindParam(&num_control_type,NumControlTypeEnum);
    5173         iomodel->parameters->FindParam(&num_cm_responses,NumCmResponsesEnum);
     5170        iomodel->constants->FindParam(&yts,YtsEnum);
     5171        iomodel->constants->FindParam(&control_analysis,ControlAnalysisEnum);
     5172        iomodel->constants->FindParam(&num_control_type,NumControlTypeEnum);
     5173        iomodel->constants->FindParam(&num_cm_responses,NumCmResponsesEnum);
    51745174
    51755175        /*Checks if debuging*/
    51765176        /*{{{2*/
    5177         _assert_(iomodel->elements);
     5177        _assert_(iomodel->f(ElementEnum));
    51785178        /*}}}*/
    51795179
    51805180        /*Recover vertices ids needed to initialize inputs*/
    51815181        for(i=0;i<6;i++){
    5182                 penta_vertex_ids[i]=(int)iomodel->elements[6*index+i]; //ids for vertices are in the elements array from Matlab
     5182                penta_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
    51835183        }
    51845184
    51855185       
    51865186        /*Control Inputs*/
    5187         if (control_analysis && iomodel->control_type){
     5187        if (control_analysis && iomodel->f(ControlTypeEnum)){
    51885188                for(i=0;i<num_control_type;i++){
    5189                         switch((int)iomodel->control_type[i]){
     5189                        switch((int)iomodel->f(ControlTypeEnum)[i]){
    51905190                                case DhdtEnum:
    5191                                         if (iomodel->dhdt){
    5192                                                 for(j=0;j<6;j++)nodeinputs[j]=iomodel->dhdt[penta_vertex_ids[j]-1]/yts;
    5193                                                 for(j=0;j<6;j++)cmmininputs[j]=iomodel->cm_min[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
    5194                                                 for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->cm_max[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
     5191                                        if (iomodel->f(DhdtEnum)){
     5192                                                for(j=0;j<6;j++)nodeinputs[j]=iomodel->f(DhdtEnum)[penta_vertex_ids[j]-1]/yts;
     5193                                                for(j=0;j<6;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
     5194                                                for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
    51955195                                                this->inputs->AddInput(new ControlInput(DhdtEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
    51965196                                        }
    51975197                                        break;
    51985198                                case VxEnum:
    5199                                         if (iomodel->vx){
    5200                                                 for(j=0;j<6;j++)nodeinputs[j]=iomodel->vx[penta_vertex_ids[j]-1]/yts;
    5201                                                 for(j=0;j<6;j++)cmmininputs[j]=iomodel->cm_min[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
    5202                                                 for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->cm_max[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
     5199                                        if (iomodel->f(VxEnum)){
     5200                                                for(j=0;j<6;j++)nodeinputs[j]=iomodel->f(VxEnum)[penta_vertex_ids[j]-1]/yts;
     5201                                                for(j=0;j<6;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
     5202                                                for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
    52035203                                                this->inputs->AddInput(new ControlInput(VxEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
    52045204                                        }
    52055205                                        break;
    52065206                                case VyEnum:
    5207                                         if (iomodel->vy){
    5208                                                 for(j=0;j<6;j++)nodeinputs[j]=iomodel->vy[penta_vertex_ids[j]-1]/yts;
    5209                                                 for(j=0;j<6;j++)cmmininputs[j]=iomodel->cm_min[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
    5210                                                 for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->cm_max[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
     5207                                        if (iomodel->f(VyEnum)){
     5208                                                for(j=0;j<6;j++)nodeinputs[j]=iomodel->f(VyEnum)[penta_vertex_ids[j]-1]/yts;
     5209                                                for(j=0;j<6;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
     5210                                                for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
    52115211                                                this->inputs->AddInput(new ControlInput(VyEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
    52125212                                        }
    52135213                                        break;
    52145214                                case DragCoefficientEnum:
    5215                                         if (iomodel->drag_coefficient){
    5216                                                 for(j=0;j<6;j++)nodeinputs[j]=iomodel->drag_coefficient[penta_vertex_ids[j]-1];
    5217                                                 for(j=0;j<6;j++)cmmininputs[j]=iomodel->cm_min[(penta_vertex_ids[j]-1)*num_control_type+i];
    5218                                                 for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->cm_max[(penta_vertex_ids[j]-1)*num_control_type+i];
     5215                                        if (iomodel->f(DragCoefficientEnum)){
     5216                                                for(j=0;j<6;j++)nodeinputs[j]=iomodel->f(DragCoefficientEnum)[penta_vertex_ids[j]-1];
     5217                                                for(j=0;j<6;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(penta_vertex_ids[j]-1)*num_control_type+i];
     5218                                                for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(penta_vertex_ids[j]-1)*num_control_type+i];
    52195219                                                this->inputs->AddInput(new ControlInput(DragCoefficientEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
    52205220                                        }
     
    52235223                                        /*Matice will take care of it*/ break;
    52245224                                default:
    5225                                         _error_("Control %s not implemented yet",EnumToStringx((int)iomodel->control_type[i]));
     5225                                        _error_("Control %s not implemented yet",EnumToStringx((int)iomodel->f(ControlTypeEnum)[i]));
    52265226                        }
    52275227                }
     
    52295229
    52305230        //Need to know the type of approximation for this element
    5231         if(iomodel->elements_type){
    5232                 if (*(iomodel->elements_type+index)==MacAyealApproximationEnum){
     5231        if(iomodel->f(ElementsTypeEnum)){
     5232                if (*(iomodel->f(ElementsTypeEnum)+index)==MacAyealApproximationEnum){
    52335233                        this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealApproximationEnum));
    52345234                }
    5235                 else if (*(iomodel->elements_type+index)==PattynApproximationEnum){
     5235                else if (*(iomodel->f(ElementsTypeEnum)+index)==PattynApproximationEnum){
    52365236                        this->inputs->AddInput(new IntInput(ApproximationEnum,PattynApproximationEnum));
    52375237                }
    5238                 else if (*(iomodel->elements_type+index)==MacAyealPattynApproximationEnum){
     5238                else if (*(iomodel->f(ElementsTypeEnum)+index)==MacAyealPattynApproximationEnum){
    52395239                        this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealPattynApproximationEnum));
    52405240                }
    5241                 else if (*(iomodel->elements_type+index)==HutterApproximationEnum){
     5241                else if (*(iomodel->f(ElementsTypeEnum)+index)==HutterApproximationEnum){
    52425242                        this->inputs->AddInput(new IntInput(ApproximationEnum,HutterApproximationEnum));
    52435243                }
    5244                 else if (*(iomodel->elements_type+index)==StokesApproximationEnum){
     5244                else if (*(iomodel->f(ElementsTypeEnum)+index)==StokesApproximationEnum){
    52455245                        this->inputs->AddInput(new IntInput(ApproximationEnum,StokesApproximationEnum));
    52465246                }
    5247                 else if (*(iomodel->elements_type+index)==MacAyealStokesApproximationEnum){
     5247                else if (*(iomodel->f(ElementsTypeEnum)+index)==MacAyealStokesApproximationEnum){
    52485248                        this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealStokesApproximationEnum));
    52495249                }
    5250                 else if (*(iomodel->elements_type+index)==PattynStokesApproximationEnum){
     5250                else if (*(iomodel->f(ElementsTypeEnum)+index)==PattynStokesApproximationEnum){
    52515251                        this->inputs->AddInput(new IntInput(ApproximationEnum,PattynStokesApproximationEnum));
    52525252                }
    5253                 else if (*(iomodel->elements_type+index)==NoneApproximationEnum){
     5253                else if (*(iomodel->f(ElementsTypeEnum)+index)==NoneApproximationEnum){
    52545254                        this->inputs->AddInput(new IntInput(ApproximationEnum,NoneApproximationEnum));
    52555255                }
    52565256                else{
    5257                         _error_("Approximation type %s not supported yet",EnumToStringx((int)*(iomodel->elements_type+index)));
     5257                        _error_("Approximation type %s not supported yet",EnumToStringx((int)*(iomodel->f(ElementsTypeEnum)+index)));
    52585258                }
    52595259        }
    52605260
    52615261        /*DatasetInputs*/
    5262         if (iomodel->weights) {
     5262        if (iomodel->f(WeightsEnum)) {
    52635263
    52645264                /*Create inputs and add to DataSetInput*/
    52655265                DatasetInput* datasetinput=new DatasetInput(WeightsEnum);
    52665266                for(i=0;i<num_cm_responses;i++){
    5267                         for(j=0;j<6;j++)nodeinputs[j]=iomodel->weights[(penta_vertex_ids[j]-1)*num_cm_responses+i];
     5267                        for(j=0;j<6;j++)nodeinputs[j]=iomodel->f(WeightsEnum)[(penta_vertex_ids[j]-1)*num_cm_responses+i];
    52685268                        datasetinput->inputs->AddObject(new PentaVertexInput(WeightsEnum,nodeinputs));
    52695269                }
     
    75207520
    75217521        /*Fetch parameters: */
    7522         iomodel->parameters->FindParam(&yts,YtsEnum);
    7523         iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
    7524         iomodel->parameters->FindParam(&qmu_analysis,QmuAnalysisEnum);
    7525         iomodel->parameters->FindParam(&isstokes,IsstokesEnum);
    7526         iomodel->parameters->FindParam(&beta,BetaEnum);
    7527         iomodel->parameters->FindParam(&heatcapacity,HeatcapacityEnum);
    7528         iomodel->parameters->FindParam(&referencetemperature,ReferencetemperatureEnum);
    7529         iomodel->parameters->FindParam(&meltingpoint,MeltingpointEnum);
    7530         iomodel->parameters->FindParam(&latentheat,LatentheatEnum);
     7522        iomodel->constants->FindParam(&yts,YtsEnum);
     7523        iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
     7524        iomodel->constants->FindParam(&qmu_analysis,QmuAnalysisEnum);
     7525        iomodel->constants->FindParam(&isstokes,IsstokesEnum);
     7526        iomodel->constants->FindParam(&beta,BetaEnum);
     7527        iomodel->constants->FindParam(&heatcapacity,HeatcapacityEnum);
     7528        iomodel->constants->FindParam(&referencetemperature,ReferencetemperatureEnum);
     7529        iomodel->constants->FindParam(&meltingpoint,MeltingpointEnum);
     7530        iomodel->constants->FindParam(&latentheat,LatentheatEnum);
    75317531
    75327532
    75337533        /*Checks if debuging*/
    75347534        /*{{{2*/
    7535         _assert_(iomodel->elements);
     7535        _assert_(iomodel->f(ElementsEnum));
    75367536        /*}}}*/
    75377537
     
    75487548
    75497549        /*Recover vertices ids needed to initialize inputs*/
    7550         for(i=0;i<6;i++) penta_vertex_ids[i]=(int)iomodel->elements[6*index+i]; //ids for vertices are in the elements array from Matlab
     7550        for(i=0;i<6;i++) penta_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
    75517551
    75527552        /*Recover nodes ids needed to initialize the node hook.*/
     
    75547554                //go recover node ids, needed to initialize the node hook.
    75557555                //WARNING: We assume P1 elements here!!!!!
    7556                 penta_node_ids[i]=iomodel->nodecounter+(int)iomodel->elements[6*index+i]; //ids for vertices are in the elements array from Matlab
     7556                penta_node_ids[i]=iomodel->nodecounter+(int)iomodel->f(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab
    75577557        }
    75587558
     
    75697569
    75707570                        /*default vx,vy and vz: either observation or 0 */
    7571                         if(!iomodel->vx){
    7572                                 if (iomodel->vx_obs) for(i=0;i<6;i++)nodeinputs[i]=iomodel->vx_obs[penta_vertex_ids[i]-1]/yts;
     7571                        if(!iomodel->f(VxEnum)){
     7572                                if (iomodel->f(VxObsEnum)) for(i=0;i<6;i++)nodeinputs[i]=iomodel->f(VxObsEnum)[penta_vertex_ids[i]-1]/yts;
    75737573                                else                 for(i=0;i<6;i++)nodeinputs[i]=0;
    75747574                                this->inputs->AddInput(new PentaVertexInput(VxEnum,nodeinputs));
     
    75767576                                if(qmu_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVxEnum,nodeinputs));
    75777577                        }
    7578                         if(!iomodel->vy){
    7579                                 if (iomodel->vy_obs) for(i=0;i<6;i++)nodeinputs[i]=iomodel->vy_obs[penta_vertex_ids[i]-1]/yts;
     7578                        if(!iomodel->f(VyEnum)){
     7579                                if (iomodel->f(VyObsEnum)) for(i=0;i<6;i++)nodeinputs[i]=iomodel->f(VyObsEnum)[penta_vertex_ids[i]-1]/yts;
    75807580                                else                 for(i=0;i<6;i++)nodeinputs[i]=0;
    75817581                                this->inputs->AddInput(new PentaVertexInput(VyEnum,nodeinputs));
     
    75837583                                if(qmu_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVyEnum,nodeinputs));
    75847584                        }
    7585                         if(!iomodel->vz){
    7586                                 if (iomodel->vz_obs) for(i=0;i<6;i++)nodeinputs[i]=iomodel->vz_obs[penta_vertex_ids[i]-1]/yts;
     7585                        if(!iomodel->f(VzEnum)){
     7586                                if (iomodel->f(VzObsEnum)) for(i=0;i<6;i++)nodeinputs[i]=iomodel->f(VzObsEnum)[penta_vertex_ids[i]-1]/yts;
    75877587                                else                 for(i=0;i<6;i++)nodeinputs[i]=0;
    75887588                                this->inputs->AddInput(new PentaVertexInput(VzEnum,nodeinputs));
     
    75907590                                if(qmu_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVzEnum,nodeinputs));
    75917591                        }
    7592                         if(!iomodel->pressure){
     7592                        if(!iomodel->f(PressureEnum)){
    75937593                                for(i=0;i<6;i++)nodeinputs[i]=0;
    75947594                                if(qmu_analysis){
     
    76017601                                }
    76027602                        }
    7603                         if(*(iomodel->elements_type+index)==PattynStokesApproximationEnum){
     7603                        if(*(iomodel->f(ElementsTypeEnum)+index)==PattynStokesApproximationEnum){
    76047604                                /*Create VzPattyn and VzStokes Enums*/
    7605                                 if(iomodel->vz && iomodel->nodeonstokes){
    7606                                         for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/yts*iomodel->nodeonstokes[penta_vertex_ids[i]-1];
     7605                                if(iomodel->f(VzEnum) && iomodel->f(NodeOnStokesEnum)){
     7606                                        for(i=0;i<6;i++) nodeinputs[i]=iomodel->f(VzEnum)[penta_vertex_ids[i]-1]/yts*iomodel->f(NodeOnStokesEnum)[penta_vertex_ids[i]-1];
    76077607                                        this->inputs->AddInput(new PentaVertexInput(VzStokesEnum,nodeinputs));
    7608                                         for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/yts*(1-iomodel->nodeonstokes[penta_vertex_ids[i]-1]);
     7608                                        for(i=0;i<6;i++) nodeinputs[i]=iomodel->f(VzEnum)[penta_vertex_ids[i]-1]/yts*(1-iomodel->f(NodeOnStokesEnum)[penta_vertex_ids[i]-1]);
    76097609                                        this->inputs->AddInput(new PentaVertexInput(VzPattynEnum,nodeinputs));
    76107610                                }
     
    76157615                                }
    76167616                        }
    7617                         if(*(iomodel->elements_type+index)==MacAyealStokesApproximationEnum){
     7617                        if(*(iomodel->f(ElementsTypeEnum)+index)==MacAyealStokesApproximationEnum){
    76187618                                /*Create VzMacAyeal and VzStokes Enums*/
    7619                                 if(iomodel->vz && iomodel->nodeonstokes){
    7620                                         for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/yts*iomodel->nodeonstokes[penta_vertex_ids[i]-1];
     7619                                if(iomodel->f(VzEnum) && iomodel->f(NodeOnStokesEnum)){
     7620                                        for(i=0;i<6;i++) nodeinputs[i]=iomodel->f(VzEnum)[penta_vertex_ids[i]-1]/yts*iomodel->f(NodeOnStokesEnum)[penta_vertex_ids[i]-1];
    76217621                                        this->inputs->AddInput(new PentaVertexInput(VzStokesEnum,nodeinputs));
    7622                                         for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/yts*(1-iomodel->nodeonstokes[penta_vertex_ids[i]-1]);
     7622                                        for(i=0;i<6;i++) nodeinputs[i]=iomodel->f(VzEnum)[penta_vertex_ids[i]-1]/yts*(1-iomodel->f(NodeOnStokesEnum)[penta_vertex_ids[i]-1]);
    76237623                                        this->inputs->AddInput(new PentaVertexInput(VzMacAyealEnum,nodeinputs));
    76247624                                }
     
    76457645                        this->inputs->AddInput(new PentaVertexInput(VyMeshEnum,nodeinputs));
    76467646                        this->inputs->AddInput(new PentaVertexInput(VzMeshEnum,nodeinputs));
    7647                         if (iomodel->temperature && iomodel->waterfraction) {
     7647                        if (iomodel->f(TemperatureEnum) && iomodel->f(WaterfractionEnum)) {
    76487648                                for(i=0;i<6;i++){
    7649                                         if(iomodel->temperature[penta_vertex_ids[i]-1] < meltingpoint-beta*iomodel->pressure[penta_vertex_ids[i]-1]){
    7650                                                 nodeinputs[i]=heatcapacity*(iomodel->temperature[penta_vertex_ids[i]-1]-referencetemperature);
     7649                                        if(iomodel->f(TemperatureEnum)[penta_vertex_ids[i]-1] < meltingpoint-beta*iomodel->f(PressureEnum)[penta_vertex_ids[i]-1]){
     7650                                                nodeinputs[i]=heatcapacity*(iomodel->f(TemperatureEnum)[penta_vertex_ids[i]-1]-referencetemperature);
    76517651                                        }
    76527652                                        else nodeinputs[i]=heatcapacity*
    7653                                          (meltingpoint-beta*iomodel->pressure[penta_vertex_ids[i]-1]-referencetemperature)
    7654                                                 +latentheat*iomodel->waterfraction[penta_vertex_ids[i]-1];
     7653                                         (meltingpoint-beta*iomodel->f(PressureEnum)[penta_vertex_ids[i]-1]-referencetemperature)
     7654                                                +latentheat*iomodel->f(WaterfractionEnum)[penta_vertex_ids[i]-1];
    76557655                                }
    76567656                                this->inputs->AddInput(new PentaVertexInput(EnthalpyEnum,nodeinputs));
  • issm/trunk/src/c/objects/Elements/PentaHook.cpp

    r9356 r9362  
    5151       
    5252        /*retrieve parameters: */
    53         iomodel->parameters->FindParam(&matpar_id,NumberOfElementsEnum); matpar_id++;
     53        iomodel->constants->FindParam(&matpar_id,NumberOfElementsEnum); matpar_id++;
    5454
    5555        this->numanalyses=in_numanalyses;
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r9356 r9362  
    5252
    5353                /*Build horizontalneighborsids list: */
    54                 _assert_(iomodel->elementconnectivity);
     54                _assert_(iomodel->f(ElementconnectivityEnum));
    5555                //for (i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel->elementconnectivity[3*index+i]-1;
    5656
     
    32793279        /*Checks if debuging*/
    32803280        /*{{{2*/
    3281         _assert_(iomodel->elements);
     3281        _assert_(iomodel->f(ElementEnum));
    32823282        /*}}}*/
    32833283
    32843284        /*Get parameters: */
    3285         iomodel->parameters->FindParam(&control_analysis,ControlAnalysisEnum);
    3286         iomodel->parameters->FindParam(&num_control_type,NumControlTypeEnum);
    3287         iomodel->parameters->FindParam(&yts,YtsEnum);
    3288         iomodel->parameters->FindParam(&num_cm_responses,NumCmResponsesEnum);
     3285        iomodel->constants->FindParam(&control_analysis,ControlAnalysisEnum);
     3286        iomodel->constants->FindParam(&num_control_type,NumControlTypeEnum);
     3287        iomodel->constants->FindParam(&yts,YtsEnum);
     3288        iomodel->constants->FindParam(&num_cm_responses,NumCmResponsesEnum);
    32893289
    32903290        /*Recover vertices ids needed to initialize inputs*/
    32913291        for(i=0;i<3;i++){
    3292                 tria_vertex_ids[i]=(int)iomodel->elements[3*index+i]; //ids for vertices are in the elements array from Matlab
     3292                tria_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab
    32933293        }
    32943294
    32953295        /*Control Inputs*/
    3296         if (control_analysis && iomodel->control_type){
     3296        if (control_analysis && iomodel->f(ControlTypeEnum)){
    32973297                for(i=0;i<num_control_type;i++){
    3298                         switch((int)iomodel->control_type[i]){
     3298                        switch((int)iomodel->f(ControlTypeEnum)[i]){
    32993299                                case DhdtEnum:
    3300                                         if (iomodel->dhdt){
    3301                                                 for(j=0;j<3;j++)nodeinputs[j]=iomodel->dhdt[tria_vertex_ids[j]-1]/yts;
    3302                                                 for(j=0;j<3;j++)cmmininputs[j]=iomodel->cm_min[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
    3303                                                 for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->cm_max[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
     3300                                        if (iomodel->f(DhdtEnum)){
     3301                                                for(j=0;j<3;j++)nodeinputs[j]=iomodel->f(DhdtEnum)[tria_vertex_ids[j]-1]/yts;
     3302                                                for(j=0;j<3;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
     3303                                                for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
    33043304                                                this->inputs->AddInput(new ControlInput(DhdtEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
    33053305                                        }
    33063306                                        break;
    33073307                                case VxEnum:
    3308                                         if (iomodel->vx){
    3309                                                 for(j=0;j<3;j++)nodeinputs[j]=iomodel->vx[tria_vertex_ids[j]-1]/yts;
    3310                                                 for(j=0;j<3;j++)cmmininputs[j]=iomodel->cm_min[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
    3311                                                 for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->cm_max[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
     3308                                        if (iomodel->f(VxEnum)){
     3309                                                for(j=0;j<3;j++)nodeinputs[j]=iomodel->f(VxEnum)[tria_vertex_ids[j]-1]/yts;
     3310                                                for(j=0;j<3;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
     3311                                                for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
    33123312                                                this->inputs->AddInput(new ControlInput(VxEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
    33133313                                        }
    33143314                                        break;
    33153315                                case VyEnum:
    3316                                         if (iomodel->vy){
    3317                                                 for(j=0;j<3;j++)nodeinputs[j]=iomodel->vy[tria_vertex_ids[j]-1]/yts;
    3318                                                 for(j=0;j<3;j++)cmmininputs[j]=iomodel->cm_min[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
    3319                                                 for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->cm_max[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
     3316                                        if (iomodel->f(VyEnum)){
     3317                                                for(j=0;j<3;j++)nodeinputs[j]=iomodel->f(VyEnum)[tria_vertex_ids[j]-1]/yts;
     3318                                                for(j=0;j<3;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
     3319                                                for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
    33203320                                                this->inputs->AddInput(new ControlInput(VyEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
    33213321                                        }
    33223322                                        break;
    33233323                                case DragCoefficientEnum:
    3324                                         if (iomodel->drag_coefficient){
    3325                                                 for(j=0;j<3;j++)nodeinputs[j]=iomodel->drag_coefficient[tria_vertex_ids[j]-1];
    3326                                                 for(j=0;j<3;j++)cmmininputs[j]=iomodel->cm_min[(tria_vertex_ids[j]-1)*num_control_type+i];
    3327                                                 for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->cm_max[(tria_vertex_ids[j]-1)*num_control_type+i];
     3324                                        if (iomodel->f(DragCoefficientEnum)){
     3325                                                for(j=0;j<3;j++)nodeinputs[j]=iomodel->f(DragCoefficientEnum)[tria_vertex_ids[j]-1];
     3326                                                for(j=0;j<3;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];
     3327                                                for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];
    33283328                                                this->inputs->AddInput(new ControlInput(DragCoefficientEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
    33293329                                        }
     
    33323332                                        /*Matice will take care of it*/ break;
    33333333                                default:
    3334                                         _error_("Control %s not implemented yet",EnumToStringx((int)iomodel->control_type[i]));
     3334                                        _error_("Control %s not implemented yet",EnumToStringx((int)iomodel->f(ControlTypeEnum)[i]));
    33353335                        }
    33363336                }
     
    33383338
    33393339        /*DatasetInputs*/
    3340         if (iomodel->weights) {
     3340        if (iomodel->f(WeightsEnum)) {
    33413341
    33423342                /*Create inputs and add to DataSetInput*/
    33433343                DatasetInput* datasetinput=new DatasetInput(WeightsEnum);
    33443344                for(i=0;i<num_cm_responses;i++){
    3345                         for(j=0;j<3;j++)nodeinputs[j]=iomodel->weights[(tria_vertex_ids[j]-1)*num_cm_responses+i];
     3345                        for(j=0;j<3;j++)nodeinputs[j]=iomodel->f(WeightsEnum)[(tria_vertex_ids[j]-1)*num_cm_responses+i];
    33463346                        datasetinput->inputs->AddObject(new TriaVertexInput(WeightsEnum,nodeinputs));
    33473347                }
     
    39103910
    39113911        /*Fetch parameters: */
    3912         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
    3913         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
    3914         iomodel->parameters->FindParam(&yts,YtsEnum);
     3912        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
     3913        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
     3914        iomodel->constants->FindParam(&yts,YtsEnum);
    39153915
    39163916        /*Branch on type of vector: nodal or elementary: */
     
    39193919                /*Recover vertices ids needed to initialize inputs*/
    39203920                for(i=0;i<3;i++){
    3921                         tria_vertex_ids[i]=(int)iomodel->elements[3*index+i]; //ids for vertices are in the elements array from Matlab
     3921                        tria_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab
    39223922                }
    39233923
     
    52275227        /*Checks if debuging*/
    52285228        /*{{{2*/
    5229         _assert_(iomodel->elements);
     5229        _assert_(iomodel->f(ElementsEnum));
    52305230        /*}}}*/
    52315231
    52325232        /*Fetch parameters: */
    5233         iomodel->parameters->FindParam(&yts,YtsEnum);
    5234         iomodel->parameters->FindParam(&prognostic_DG,PrognosticDGEnum);
    5235         iomodel->parameters->FindParam(&qmu_analysis,QmuAnalysisEnum);
     5233        iomodel->constants->FindParam(&yts,YtsEnum);
     5234        iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum);
     5235        iomodel->constants->FindParam(&qmu_analysis,QmuAnalysisEnum);
    52365236
    52375237        /*Recover element type*/
     
    52485248        /*Recover vertices ids needed to initialize inputs*/
    52495249        for(i=0;i<3;i++){
    5250                 tria_vertex_ids[i]=(int)iomodel->elements[3*index+i]; //ids for vertices are in the elements array from Matlab
     5250                tria_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab
    52515251        }
    52525252
     
    52615261                /*Continuous Galerkin*/
    52625262                for(i=0;i<3;i++){
    5263                         tria_node_ids[i]=iomodel->nodecounter+(int)*(iomodel->elements+3*index+i); //ids for vertices are in the elements array from Matlab
     5263                        tria_node_ids[i]=iomodel->nodecounter+(int)*(iomodel->f(ElementsEnum)+3*index+i); //ids for vertices are in the elements array from Matlab
    52645264                }
    52655265        }
     
    52775277
    52785278                        /*default vx,vy and vz: either observation or 0 */
    5279                         if(!iomodel->vx){
    5280                                 if (iomodel->vx_obs) for(i=0;i<3;i++)nodeinputs[i]=iomodel->vx_obs[tria_vertex_ids[i]-1]/yts;
     5279                        if(!iomodel->f(VxEnum)){
     5280                                if (iomodel->f(VxObsEnum)) for(i=0;i<3;i++)nodeinputs[i]=iomodel->f(VxObsEnum)[tria_vertex_ids[i]-1]/yts;
    52815281                                else                 for(i=0;i<3;i++)nodeinputs[i]=0;
    52825282                                this->inputs->AddInput(new TriaVertexInput(VxEnum,nodeinputs));
     
    52845284                                if(qmu_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVxEnum,nodeinputs));
    52855285                        }
    5286                         if(!iomodel->vy){
    5287                                 if (iomodel->vy_obs) for(i=0;i<3;i++)nodeinputs[i]=iomodel->vy_obs[tria_vertex_ids[i]-1]/yts;
     5286                        if(!iomodel->f(VyEnum)){
     5287                                if (iomodel->f(VyObsEnum)) for(i=0;i<3;i++)nodeinputs[i]=iomodel->f(VyObsEnum)[tria_vertex_ids[i]-1]/yts;
    52885288                                else                 for(i=0;i<3;i++)nodeinputs[i]=0;
    52895289                                this->inputs->AddInput(new TriaVertexInput(VyEnum,nodeinputs));
     
    52915291                                if(qmu_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVyEnum,nodeinputs));
    52925292                        }
    5293                         if(!iomodel->vz){
    5294                                 if (iomodel->vz_obs) for(i=0;i<3;i++)nodeinputs[i]=iomodel->vz_obs[tria_vertex_ids[i]-1]/yts;
     5293                        if(!iomodel->f(VzEnum)){
     5294                                if (iomodel->f(VzObsEnum)) for(i=0;i<3;i++)nodeinputs[i]=iomodel->f(VzObsEnum)[tria_vertex_ids[i]-1]/yts;
    52955295                                else                 for(i=0;i<3;i++)nodeinputs[i]=0;
    52965296                                this->inputs->AddInput(new TriaVertexInput(VzEnum,nodeinputs));
     
    52985298                                if(qmu_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVzEnum,nodeinputs));
    52995299                        }
    5300                         if(!iomodel->pressure){
     5300                        if(!iomodel->f(PressureEnum)){
    53015301                                for(i=0;i<3;i++)nodeinputs[i]=0;
    53025302                                if(qmu_analysis){
  • issm/trunk/src/c/objects/Elements/TriaHook.cpp

    r9356 r9362  
    4949
    5050        /*retrieve parameters: */
    51         iomodel->parameters->FindParam(&matpar_id,NumberOfElementsEnum); matpar_id++;
     51        iomodel->constants->FindParam(&matpar_id,NumberOfElementsEnum); matpar_id++;
    5252       
    5353        this->numanalyses=in_numanalyses;
  • issm/trunk/src/c/objects/IoModel.cpp

    r9356 r9362  
    1212#include <string.h>
    1313#include <stdio.h>
     14#include <stdlib.h>
     15#include <stdarg.h>
     16
    1417#include "./objects.h"
    1518#include "./Container/Parameters.h"
     
    2124IoModel::IoModel(){
    2225        this->fid=NULL;
    23         this->parameters=NULL;
    24 }
    25 /*}}}*/
    26 /*FUNCTION IoModel::IoModel(FILE*  iomodel_handle){{{1*/
    27 IoModel::IoModel(FILE* iomodel_handle){
    28        
    29         int i,j;
    30 
    31         /*First, keep track of the file handle: */
    32         this->fid=iomodel_handle;
    33 
    34         /*Initialize and read parameters:*/
    35         this->parameters=new Parameters();
    36         this->FetchParameters(this->parameters); /*this routine goes through the input file, and fetches bools, ints, doubles and strings only, nothing memory intensive*/
    37 
    38         /*Initialize the structure: */
    39         this->IoModelInit();
    40 
    41 }
    42 /*}}}*/
    43 /*FUNCTION IoModel::~IoModel(){{{1*/
    44 IoModel::~IoModel(){
    45        
    46         int i;
    47 
    48         /*!Two cases here:
    49          * - serial mode: matlab's memory manager will take care of delete iomodel when returning from Imp. Do nothing here, so as not to confuse
    50          *                the memory manager.
    51      * - in parallel, anything the io layer does (FetchData) did needs to be erased explicitely in the iomodel.
    52          */
    53 
    54         #ifdef _PARALLEL_
    55         xfree((void**)&this->x);
    56         xfree((void**)&this->y);
    57         xfree((void**)&this->z);
    58         xfree((void**)&this->elements);
    59         xfree((void**)&this->elementconnectivity);
    60         xfree((void**)&this->elements_type);
    61         xfree((void**)&this->vertices_type);
    62         xfree((void**)&this->nodeonhutter);
    63         xfree((void**)&this->nodeonmacayeal);
    64         xfree((void**)&this->elements2d);
    65         xfree((void**)&this->upperelements);
    66         xfree((void**)&this->lowerelements);
    67         xfree((void**)&this->nodeonpattyn);
    68         xfree((void**)&this->elementonbed);
    69         xfree((void**)&this->elementonsurface);
    70         xfree((void**)&this->nodeonbed);
    71         xfree((void**)&this->nodeonsurface);
    72         xfree((void**)&this->nodeonstokes);
    73         xfree((void**)&this->borderstokes);
    74         xfree((void**)&this->thickness_obs);
    75         xfree((void**)&this->thickness_coeff);
    76         xfree((void**)&this->thickness);
    77         xfree((void**)&this->surface);
    78         xfree((void**)&this->bed);
    79         xfree((void**)&this->bathymetry);
    80         xfree((void**)&this->vx_obs);
    81         xfree((void**)&this->vy_obs);
    82         xfree((void**)&this->vz_obs);
    83         xfree((void**)&this->vx);
    84         xfree((void**)&this->vy);
    85         xfree((void**)&this->vz);
    86         xfree((void**)&this->pressure);
    87         xfree((void**)&this->temperature);
    88         xfree((void**)&this->waterfraction);
    89         xfree((void**)&this->drag_coefficient);
    90         xfree((void**)&this->drag_p);
    91         xfree((void**)&this->drag_q);
    92         xfree((void**)&this->elementoniceshelf);
    93         xfree((void**)&this->elementonwater);
    94         xfree((void**)&this->nodeonicesheet);
    95         xfree((void**)&this->nodeoniceshelf);
    96         xfree((void**)&this->nodeonwater);
    97         xfree((void**)&this->pressureload);
    98         xfree((void**)&this->spcvx);
    99         xfree((void**)&this->spcvy);
    100         xfree((void**)&this->spcvz);
    101         xfree((void**)&this->spcthickness);
    102         xfree((void**)&this->spcwatercolumn);
    103         xfree((void**)&this->spctemperature);
    104         xfree((void**)&this->diagnostic_ref);
    105         xfree((void**)&this->edges);
    106         xfree((void**)&this->geothermalflux);
    107         xfree((void**)&this->basal_melting_rate);
    108         xfree((void**)&this->watercolumn);
    109         xfree((void**)&this->basal_melting_rate_correction);
    110         xfree((void**)&this->surface_accumulation_rate);
    111         xfree((void**)&this->surface_ablation_rate);
    112         xfree((void**)&this->surface_mass_balance);
    113         xfree((void**)&this->dhdt);
    114         xfree((void**)&this->rheology_B);
    115         xfree((void**)&this->rheology_n);
    116         xfree((void**)&this->control_type);
    117         xfree((void**)&this->cm_responses);
    118         xfree((void**)&this->weights);
    119         xfree((void**)&this->cm_jump);
    120         xfree((void**)&this->cm_min);
    121         xfree((void**)&this->cm_max);
    122         xfree((void**)&this->optscal);
    123         xfree((void**)&this->maxiter);
    124 
    125 
    126         /*!Delete structure fields: */
    127         xfree((void**)&this->riftinfo);
    128         xfree((void**)&this->penalties);
    129        
    130         /*exterior data: */
    131         xfree((void**)&this->my_elements);
    132         xfree((void**)&this->my_vertices);
    133         xfree((void**)&this->my_nodes);
    134         xfree((void**)&this->singlenodetoelementconnectivity);
    135         xfree((void**)&this->numbernodetoelementconnectivity);
    136         #endif
    137 }
    138 /*}}}*/
    139 /*FUNCTION IoModel::IoModelInit{{{1*/
    140 void IoModel::IoModelInit(void){
    141 
    142         /*exterior data: */
     26        this->constants=NULL;
     27       
     28        this->my_elements=NULL;
     29        this->my_nodes=NULL;
     30        this->my_vertices=NULL;
     31        this->singlenodetoelementconnectivity=NULL;
     32        this->numbernodetoelementconnectivity=NULL;
     33       
    14334        this->nodecounter=0;
    14435        this->loadcounter=0;
    14536        this->constraintcounter=0;
    146        
    147         /*!initialize all pointers to 0: */
    148         this->x=NULL;
    149         this->y=NULL;
    150         this->z=NULL;
    151         this->elements=NULL;
    152         this->elementconnectivity=NULL;
    153         this->elements_type=NULL;
    154         this->vertices_type=NULL;
    155         this->elements2d=NULL;
    156         this->upperelements=NULL;
    157         this->lowerelements=NULL;
    158         this->nodeonhutter=NULL;
    159         this->nodeonmacayeal=NULL;
    160         this->nodeonpattyn=NULL;
    161        
    162         this->vx_obs=NULL;
    163         this->vy_obs=NULL;
    164         this->vz_obs=NULL;
    165         this->vx=NULL;
    166         this->vy=NULL;
    167         this->vz=NULL;
    168         this->pressure=NULL;
    169         this->temperature=NULL;
    170         this->waterfraction=NULL;
    171         this->basal_melting_rate=NULL;
    172         this->watercolumn=NULL;
    173         this->basal_melting_rate_correction=NULL;
    174         this->geothermalflux=NULL;
    175         this->elementonbed=NULL;
    176         this->elementonsurface=NULL;
    177         this->nodeonbed=NULL;
    178         this->nodeonsurface=NULL;
    179         this->nodeonstokes=NULL;
    180         this->borderstokes=NULL;
    181         this->thickness_obs=NULL;
    182         this->thickness_coeff=NULL;
    183         this->thickness=NULL;
    184         this->surface=NULL;
    185         this->bed=NULL;
    186         this->bathymetry=NULL;
    187         this->elementoniceshelf=NULL;
    188         this->elementonwater=NULL;
    189         this->nodeonicesheet=NULL;
    190         this->nodeoniceshelf=NULL;
    191         this->nodeonwater=NULL;
    192 
    193         this->drag_coefficient=NULL;
    194         this->drag_p=NULL;
    195         this->drag_q=NULL;
    196        
    197        
    198         this->pressureload=NULL;
    199         this-> spcvx=NULL;
    200         this-> spcvy=NULL;
    201         this-> spcvz=NULL;
    202         this-> spctemperature=NULL;
    203         this-> spcthickness=NULL;
    204         this-> spcwatercolumn=NULL;
    205         this-> diagnostic_ref=NULL;
    206         this->edges=NULL;
    207        
    208         /*!materials: */
    209         this->rheology_n=NULL;
    210         this->rheology_B=NULL;
    211 
    212         /*!solution parameters: */
    213         this->control_type=NULL;
    214         this->cm_responses=NULL;
    215         this->weights=NULL;
    216         this->cm_jump=NULL;
    217         this->maxiter=NULL;
    218         this->cm_min=NULL;
    219         this->cm_max=NULL;
    220         this->optscal=NULL;
    221 
    222         this->riftinfo=NULL;
    223 
    224         /*!penalties: */
    225         this->penalties=NULL;
    226 
    227         /*!surface: */
    228         this->surface_mass_balance=NULL;
    229    this->surface_accumulation_rate=NULL;
    230         this->surface_ablation_rate=NULL;
    231         this->dhdt=NULL;
    232 
    233         /*exterior data: */
     37
     38}
     39/*}}}*/
     40/*FUNCTION IoModel::IoModel(FILE*  iomodel_handle){{{1*/
     41IoModel::IoModel(FILE* iomodel_handle){
     42       
     43        /*First, keep track of the file handle: */
     44        this->fid=iomodel_handle;
     45
     46        /*Initialize and read constants:*/
     47        this->constants=new Parameters();
     48        this->FetchParameters(this->constants); /*this routine goes through the input file, and fetches bools, ints, doubles and strings only, nothing memory intensive*/
     49
     50        /*Initialize data: */
     51        this->data=new Parameters();
     52       
     53        /*Initialize permanent data: */
    23454        this->my_elements=NULL;
     55        this->my_nodes=NULL;
    23556        this->my_vertices=NULL;
    236         this->my_nodes=NULL;
    23757        this->singlenodetoelementconnectivity=NULL;
    23858        this->numbernodetoelementconnectivity=NULL;
     59       
     60        this->nodecounter=0;
     61        this->loadcounter=0;
     62        this->constraintcounter=0;
     63
     64
     65}
     66/*}}}*/
     67/*FUNCTION IoModel::~IoModel(){{{1*/
     68IoModel::~IoModel(){
     69
     70        delete this->constants;
     71        delete this->data;
     72
     73        xfree((void**)&this->my_elements);
     74        xfree((void**)&this->my_nodes);
     75        xfree((void**)&this->my_vertices);
     76        xfree((void**)&this->singlenodetoelementconnectivity);
     77        xfree((void**)&this->numbernodetoelementconnectivity);
    23978}
    24079/*}}}*/
     
    638477        *pndims=ndims;
    639478        *pnumrecords=numrecords;
     479}
     480/*}}}*/
     481/*FUNCTION IoModel::FetchData(int num,...){{{1*/
     482void  IoModel::FetchData(int num,...){
     483
     484
     485        va_list ap;
     486        int     dataenum;
     487        double* matrix=NULL;
     488        int     M,N;
     489        int     i;
     490
     491        /*Go through the entire list of enums and fetch the corresponding data. Add it to the iomodel->data dataset. Everything
     492         *we fetch is a double* : */
     493       
     494        va_start(ap,num);
     495
     496        for(i = 0; i <num; i++){
     497               
     498                dataenum=va_arg(ap, int);
     499                this->FetchData(&matrix,&M,&N,dataenum);
     500
     501                /*Add to this->data: */
     502                this->data->AddObject(new DoubleMatParam(dataenum,matrix,M,N));
     503               
     504                /*Free ressources:*/
     505                xfree((void**)&matrix);
     506        }
     507        va_end(ap);
     508
     509}
     510/*}}}*/
     511/*FUNCTION IoModel::DeleteData(int num,...){{{1*/
     512void  IoModel::DeleteData(int num,...){
     513
     514
     515        va_list ap;
     516        int     dataenum;
     517        int     i;
     518        DoubleMatParam* parameter=NULL;
     519
     520        /*Go through the entire list of enums and delete the corresponding data from the iomodel-data dataset: */
     521       
     522        va_start(ap,num);
     523
     524        for(i = 0; i <num; i++){
     525               
     526                dataenum=va_arg(ap, int);
     527       
     528                parameter=(DoubleMatParam*)this->data->FindParamObject(dataenum);
     529                if(parameter){
     530                        this->data->DeleteObject((Object*)parameter);
     531                }
     532                else{
     533                        /*do nothing, we did not find the data, but this is no reason to error out: */
     534                }
     535        }
     536        va_end(ap);
     537
     538}
     539/*}}}*/
     540/*FUNCTION IoModel::get(int dataenum){{{1*/
     541double* IoModel::f(int dataenum){
     542
     543        DoubleMatParam* parameter=NULL;
     544               
     545        parameter=(DoubleMatParam*)this->data->FindParamObject(dataenum);
     546
     547        if (parameter==NULL)return NULL; //might be legitimate
     548        else{
     549                return parameter->GetPointer();
     550        }
    640551}
    641552/*}}}*/
     
    935846
    936847        /*Fetch parameters: */
    937         this->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
     848        this->constants->FindParam(&numberofelements,NumberOfElementsEnum);
    938849
    939850        /*First of, find the record for the enum, and get code  of data type: */
  • issm/trunk/src/c/objects/IoModel.h

    r9356 r9362  
    1212
    1313class Elements;
     14
     15
    1416class IoModel {
    1517
     
    1820
    1921        public:
    20                 Parameters* parameters; //this dataset holds all double, int, bool and char* parameters read in from the input file.*
    21                 /*Data: {{{1*/
     22                Parameters* constants; //this dataset holds all double, int, bool and char* parameters read in from the input file.*
     23                Parameters* data; //this dataset holds temporary data, memory intensive.
    2224
    23                 int     nodecounter; //keep track of how many nodes are being created in each analysis type
    24                 int     loadcounter; //keep track of how many loads are being created in each analysis type
    25                 int     constraintcounter; //keep track of how many constraints are being created in each analysis type
    26 
    27                 /*2d mesh: */
    28                 double* x;
    29                 double* y;
    30                 double* z;
    31                 double* elements;
    32                 double* elements_type;
    33                 double* vertices_type;
    34                 double* elementconnectivity;
    35 
    36                 /*3d mesh: */
    37                 double* elements2d;
    38                 double* upperelements;
    39                 double* lowerelements;
    40 
    41                 /*elements type: */
    42                 double* nodeonhutter;
    43                 double* nodeonmacayeal;
    44                 double* nodeonpattyn;
    45 
    46                 /*results: */
    47                 double* vx;
    48                 double* vy;
    49                 double* vz;
    50                 double* pressure;
    51                 double* temperature;
    52                 double* waterfraction;
    53 
    54                 /*observations: */
    55                 double*  thickness_obs;
    56                 double*  vx_obs;
    57                 double*  vy_obs;
    58                 double*  vz_obs;
    59 
    60                 /*geometry: */
    61                 double* elementonbed;
    62                 double* elementonsurface;
    63                 double* nodeonbed;
    64                 double* nodeonsurface;
    65                 double* nodeonstokes;
    66                 double* borderstokes;
    67                 double* thickness;
    68                 double* thickness_coeff;
    69                 double* surface;
    70                 double* bed;
    71                 double* bathymetry;
    72                 double* elementoniceshelf;
    73                 double* elementonwater;
    74                 double* nodeonicesheet;
    75                 double* nodeoniceshelf;
    76                 double* nodeonwater;
    77 
    78                 /*friction: */
    79                 double* drag_coefficient;
    80                 double* drag_p;
    81                 double* drag_q;
    82 
    83                 /*boundary conditions: */
    84                 double* pressureload;
    85                 double* spcvx;
    86                 double* spcvy;
    87                 double* spcvz;
    88                 double* spctemperature;
    89                 double* spcthickness;
    90                 double* spcwatercolumn;
    91                 double* diagnostic_ref;
    92                 double* geothermalflux;
    93                 double* edges;
    94 
    95                 /*materials: */
    96                 double* rheology_B;
    97                 double* rheology_n;
    98 
    99                 /*numerical parameters: */
    100                 double* cm_min;
    101                 double* cm_max;
    102 
    103                 /*control methods: */
    104                 double*  control_type;
    105 
    106                 /*solution parameters: */
    107                 double* cm_responses;
    108                 double* weights;
    109                 double* cm_jump;
    110                 double* maxiter;
    111                 double* optscal;
    112 
    113                 /*rifts: */
    114                 double*  riftinfo;
    115 
    116                 /*penalties: */
    117                 double*  penalties;
    118 
    119                 /*basal: */
    120                 double*  basal_melting_rate;
    121                 double*  watercolumn;
    122                 double*  basal_melting_rate_correction;
    123                 double*  surface_mass_balance;
    124                 double*  surface_accumulation_rate;
    125                 double*  surface_ablation_rate;
    126 
    127                 double*  dhdt;
    128 
    129                 /*exterior partitioning data, to be carried around: */
     25                /*This data needs to stay memory resident at all time, even if it's memory intensive: */
    13026                bool*   my_elements;
    13127                bool*   my_nodes;
     
    13430                int*    numbernodetoelementconnectivity;
    13531
    136                  /*}}}*/
     32                /*Data to synchronize through low level object drivers: */
     33                int     nodecounter; //keep track of how many nodes are being created in each analysis type
     34                int     loadcounter; //keep track of how many loads are being created in each analysis type
     35                int     constraintcounter; //keep track of how many constraints are being created in each analysis type
     36
    13737                /*Methods: {{{1*/
    13838                ~IoModel();
    13939                IoModel();
    14040                IoModel(FILE* iomodel_handle);
    141                 void IoModelInit(void);
    14241                /*}}}*/
    14342                /*Input/Output:{{{1*/
     
    15352                FILE* SetFilePointerToData(int* pcode,int* pvector_type, int data_enum);
    15453                void  FetchDataToInput(Elements* elements,int vector_enum,int default_vector_enum=NoneEnum,double default_value=0);
     54                void  FetchData(int num,...);
     55                double* f(int dataenum);
     56                void  DeleteData(int num,...);
    15557                /*}}}*/
    15658
  • issm/trunk/src/c/objects/Loads/Icefront.cpp

    r9356 r9362  
    5454       
    5555        /*find parameters: */
    56         iomodel->parameters->FindParam(&dim,DimEnum);
    57         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
     56        iomodel->constants->FindParam(&dim,DimEnum);
     57        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
    5858
    5959        /*First, retrieve element index and element type: */
     
    6464                segment_width=6;
    6565        }
    66         element=(int)(*(iomodel->pressureload+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill)
     66        element=(int)(*(iomodel->f(PressureloadEnum)+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill)
    6767
    6868        /*Build ids for hook constructors: */
    69         icefront_eid=(int) *(iomodel->pressureload+segment_width*i+segment_width-2); //matlab indexing
     69        icefront_eid=(int) *(iomodel->f(PressureloadEnum)+segment_width*i+segment_width-2); //matlab indexing
    7070        icefront_mparid=numberofelements+1; //matlab indexing
    7171
    7272        if (in_icefront_type==MacAyeal2dIceFrontEnum || in_icefront_type==MacAyeal3dIceFrontEnum){
    73                 icefront_node_ids[0]=iomodel->nodecounter+(int)*(iomodel->pressureload+segment_width*i+0);
    74                 icefront_node_ids[1]=iomodel->nodecounter+(int)*(iomodel->pressureload+segment_width*i+1);
     73                icefront_node_ids[0]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+0);
     74                icefront_node_ids[1]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+1);
    7575        }
    7676        else if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum){
    77                 icefront_node_ids[0]=iomodel->nodecounter+(int)*(iomodel->pressureload+segment_width*i+0);
    78                 icefront_node_ids[1]=iomodel->nodecounter+(int)*(iomodel->pressureload+segment_width*i+1);
    79                 icefront_node_ids[2]=iomodel->nodecounter+(int)*(iomodel->pressureload+segment_width*i+2);
    80                 icefront_node_ids[3]=iomodel->nodecounter+(int)*(iomodel->pressureload+segment_width*i+3);
     77                icefront_node_ids[0]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+0);
     78                icefront_node_ids[1]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+1);
     79                icefront_node_ids[2]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+2);
     80                icefront_node_ids[3]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+3);
    8181        }
    8282        else _error_("in_icefront_type %s not supported yet!",EnumToStringx(in_icefront_type));
     
    8484        if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum) num_nodes=4;
    8585        else num_nodes=2;
    86         icefront_fill=(int)*(iomodel->pressureload+segment_width*i+segment_width-1);
     86        icefront_fill=(int)*(iomodel->f(PressureloadEnum)+segment_width*i+segment_width-1);
    8787       
    8888        /*Ok, we have everything to build the object: */
  • issm/trunk/src/c/objects/Loads/Numericalflux.cpp

    r9356 r9362  
    5454
    5555        /*Fetch parameters: */
    56         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
     56        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
    5757
    5858        /* Get MatPar id */
     
    6060
    6161        /*First, see wether this is an internal or boundary edge (if e2=NaN)*/
    62         if (isnan((double)iomodel->edges[4*i+3])){ //edges are [node1 node2 elem1 elem2]
     62        if (isnan((double)iomodel->f(EdgesEnum)[4*i+3])){ //edges are [node1 node2 elem1 elem2]
    6363                /* Boundary edge, only one element */
    64                 e1=(int)iomodel->edges[4*i+2];
     64                e1=(int)iomodel->f(EdgesEnum)[4*i+2];
    6565                e2=(int)UNDEF;
    6666                num_elems=1;
     
    7171        else{
    7272                /* internal edge: connected to 2 elements */
    73                 e1=(int)iomodel->edges[4*i+2];
    74                 e2=(int)iomodel->edges[4*i+3];
     73                e1=(int)iomodel->f(EdgesEnum)[4*i+2];
     74                e2=(int)iomodel->f(EdgesEnum)[4*i+3];
    7575                num_elems=2;
    7676                num_nodes=4;
     
    8181
    8282        /*1: Get vertices ids*/
    83         i1=(int)iomodel->edges[4*i+0];
    84         i2=(int)iomodel->edges[4*i+1];
     83        i1=(int)iomodel->f(EdgesEnum)[4*i+0];
     84        i2=(int)iomodel->f(EdgesEnum)[4*i+1];
    8585
    8686        if (numericalflux_type==InternalEnum){
     
    9191                pos1=pos2=pos3=pos4=UNDEF;
    9292                for(j=0;j<3;j++){
    93                         if (iomodel->elements[3*(e1-1)+j]==i1) pos1=j+1;
    94                         if (iomodel->elements[3*(e1-1)+j]==i2) pos2=j+1;
    95                         if (iomodel->elements[3*(e2-1)+j]==i1) pos3=j+1;
    96                         if (iomodel->elements[3*(e2-1)+j]==i2) pos4=j+1;
     93                        if (iomodel->f(ElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
     94                        if (iomodel->f(ElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
     95                        if (iomodel->f(ElementsEnum)[3*(e2-1)+j]==i1) pos3=j+1;
     96                        if (iomodel->f(ElementsEnum)[3*(e2-1)+j]==i2) pos4=j+1;
    9797                }
    9898                _assert_(pos1!=UNDEF && pos2!=UNDEF && pos3!=UNDEF && pos4!=UNDEF);
     
    110110                pos1=pos2=UNDEF;
    111111                for(j=0;j<3;j++){
    112                         if (iomodel->elements[3*(e1-1)+j]==i1) pos1=j+1;
    113                         if (iomodel->elements[3*(e1-1)+j]==i2) pos2=j+1;
     112                        if (iomodel->f(ElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1;
     113                        if (iomodel->f(ElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1;
    114114                }
    115115                _assert_(pos1!=UNDEF && pos2!=UNDEF);
  • issm/trunk/src/c/objects/Loads/Pengrid.cpp

    r9356 r9362  
    5353
    5454        /*Fetch parameters: */
    55         iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
    56         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
     55        iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum);
     56        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
    5757
    5858        /*Some checks if debugging activated*/
  • issm/trunk/src/c/objects/Loads/Riftfront.cpp

    r9356 r9362  
    5656
    5757        /*Fetch parameters: */
    58         iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
    59         iomodel->parameters->FindParam(&penalty_lock,PenaltyLockEnum);
     58        iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum);
     59        iomodel->constants->FindParam(&penalty_lock,PenaltyLockEnum);
    6060
    6161        /*Ok, retrieve all the data needed to add a penalty between the two nodes: */
    62         el1=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+2);
    63         el2=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+3);
    64 
    65         node1=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+0);
    66         node2=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+1);
     62        el1=(int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+2);
     63        el2=(int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+3);
     64
     65        node1=(int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+0);
     66        node2=(int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+1);
    6767
    6868        /*id: */
     
    8989        this->penalty_lock=penalty_lock;
    9090        this->material_converged=0;
    91         this->normal[0]=*(iomodel->riftinfo+RIFTINFOSIZE*i+4);
    92         this->normal[1]=*(iomodel->riftinfo+RIFTINFOSIZE*i+5);
    93         this->length=*(iomodel->riftinfo+RIFTINFOSIZE*i+6);
    94         this->fraction=*(iomodel->riftinfo+RIFTINFOSIZE*i+9);
    95         this->state=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+11);
     91        this->normal[0]=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+4);
     92        this->normal[1]=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+5);
     93        this->length=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+6);
     94        this->fraction=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+9);
     95        this->state=(int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+11);
    9696
    9797        //intialize inputs, and add as many inputs per element as requested:
     
    9999               
    100100        riftfront_type=SegmentRiftfrontEnum;
    101         riftfront_fill = (int)*(iomodel->riftinfo+RIFTINFOSIZE*i+7);
    102         riftfront_friction=*(iomodel->riftinfo+RIFTINFOSIZE*i+8);
    103         riftfront_fractionincrement=*(iomodel->riftinfo+RIFTINFOSIZE*i+10);
    104         riftfront_shelf=(bool)iomodel->nodeoniceshelf[node1-1];
     101        riftfront_fill = (int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+7);
     102        riftfront_friction=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+8);
     103        riftfront_fractionincrement=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+10);
     104        riftfront_shelf=(bool)iomodel->f(NodeOnIceShelfEnum)[node1-1];
    105105
    106106        this->inputs->AddInput(new IntInput(TypeEnum,riftfront_type));
  • issm/trunk/src/c/objects/Materials/Matice.cpp

    r9356 r9362  
    660660
    661661        /*Fetch parameters: */
    662         iomodel->parameters->FindParam(&dim,DimEnum);
    663         iomodel->parameters->FindParam(&control_analysis,ControlAnalysisEnum);
    664         iomodel->parameters->FindParam(&num_control_type,NumControlTypeEnum);
     662        iomodel->constants->FindParam(&dim,DimEnum);
     663        iomodel->constants->FindParam(&control_analysis,ControlAnalysisEnum);
     664        iomodel->constants->FindParam(&num_control_type,NumControlTypeEnum);
    665665
    666666
     
    675675
    676676                /*Get B*/
    677                 if (iomodel->rheology_B) {
    678                         for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->rheology_B[int(iomodel->elements[num_vertices*index+i]-1)];
     677                if (iomodel->f(RheologyBEnum)) {
     678                        for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->f(RheologyBEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+i]-1)];
    679679                        this->inputs->AddInput(new TriaVertexInput(RheologyBbarEnum,nodeinputs));
    680680                }
    681681
    682682                /*Get n*/
    683                 if (iomodel->rheology_n) {
    684                         for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->rheology_n[index];
     683                if (iomodel->f(RheologyNEnum)) {
     684                        for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->f(RheologyNEnum)[index];
    685685                        this->inputs->AddInput(new TriaVertexInput(RheologyNEnum,nodeinputs));
    686686                }
    687687
    688688                /*Control Inputs*/
    689                 if (control_analysis && iomodel->control_type){
     689                if (control_analysis && iomodel->f(ControlTypeEnum)){
    690690                        for(i=0;i<num_control_type;i++){
    691                                 switch((int)iomodel->control_type[i]){
     691                                switch((int)iomodel->f(ControlTypeEnum)[i]){
    692692                                        case RheologyBbarEnum:
    693                                                 if (iomodel->rheology_B){
    694                                                         _assert_(iomodel->rheology_B);_assert_(iomodel->cm_min); _assert_(iomodel->cm_max);
    695                                                         for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->rheology_B[int(iomodel->elements[num_vertices*index+j]-1)];
    696                                                         for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->cm_min[int(iomodel->elements[num_vertices*index+j]-1)*num_control_type+i];
    697                                                         for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->cm_max[int(iomodel->elements[num_vertices*index+j]-1)*num_control_type+i];
     693                                                if (iomodel->f(RheologyBEnum)){
     694                                                        _assert_(iomodel->f(RheologyBEnum));_assert_(iomodel->f(CmMinEnum)); _assert_(iomodel->f(CmMaxEnum));
     695                                                        for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->f(RheologyBEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)];
     696                                                        for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
     697                                                        for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
    698698                                                        this->inputs->AddInput(new ControlInput(RheologyBbarEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
    699699                                                }
     
    714714
    715715                /*Get B*/
    716                 if (iomodel->rheology_B) {
    717                         for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->rheology_B[int(iomodel->elements[num_vertices*index+i]-1)];
     716                if (iomodel->f(RheologyBEnum)) {
     717                        for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->f(RheologyBEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+i]-1)];
    718718                        this->inputs->AddInput(new PentaVertexInput(RheologyBEnum,nodeinputs));
    719719                }
    720720
    721721                /*Get n*/
    722                 if (iomodel->rheology_n) {
    723                         for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->rheology_n[index];
     722                if (iomodel->f(RheologyNEnum)) {
     723                        for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->f(RheologyNEnum)[index];
    724724                        this->inputs->AddInput(new PentaVertexInput(RheologyNEnum,nodeinputs));
    725725                }
    726726
    727727                /*Control Inputs*/
    728                 if (control_analysis && iomodel->control_type){
     728                if (control_analysis && iomodel->f(ControlTypeEnum)){
    729729                        for(i=0;i<num_control_type;i++){
    730                                 switch((int)iomodel->control_type[i]){
     730                                switch((int)iomodel->f(ControlTypeEnum)[i]){
    731731                                        case RheologyBbarEnum:
    732                                                 if (iomodel->rheology_B){
    733                                                         _assert_(iomodel->rheology_B);_assert_(iomodel->cm_min); _assert_(iomodel->cm_max);
    734                                                         for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->rheology_B[int(iomodel->elements[num_vertices*index+j]-1)];
    735                                                         for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->cm_min[int(iomodel->elements[num_vertices*index+j]-1)*num_control_type+i];
    736                                                         for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->cm_max[int(iomodel->elements[num_vertices*index+j]-1)*num_control_type+i];
     732                                                if (iomodel->f(RheologyBEnum)){
     733                                                        _assert_(iomodel->f(RheologyBEnum));_assert_(iomodel->f(CmMinEnum)); _assert_(iomodel->f(CmMaxEnum));
     734                                                        for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->f(RheologyBEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)];
     735                                                        for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
     736                                                        for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
    737737                                                        this->inputs->AddInput(new ControlInput(RheologyBEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
    738738                                                }
  • issm/trunk/src/c/objects/Materials/Matpar.cpp

    r9356 r9362  
    2626
    2727        this->mid                       = matpar_mid;
    28         iomodel->parameters->FindParam(&this->rho_ice,RhoIceEnum);
    29         iomodel->parameters->FindParam(&this->rho_water,RhoWaterEnum);
    30         iomodel->parameters->FindParam(&this->heatcapacity,HeatcapacityEnum);
    31         iomodel->parameters->FindParam(&this->thermalconductivity,ThermalconductivityEnum);
    32         iomodel->parameters->FindParam(&this->latentheat,LatentheatEnum);
    33         iomodel->parameters->FindParam(&this->beta,BetaEnum);
    34         iomodel->parameters->FindParam(&this->meltingpoint,MeltingpointEnum);
    35         iomodel->parameters->FindParam(&this->referencetemperature,ReferencetemperatureEnum);
    36         iomodel->parameters->FindParam(&this->mixed_layer_capacity,MixedLayerCapacityEnum);
    37         iomodel->parameters->FindParam(&this->thermal_exchange_velocity,ThermalExchangeVelocityEnum);
    38         iomodel->parameters->FindParam(&this->g,GEnum);
    39        
    40         iomodel->parameters->FindParam(&this->kn,HydroKnEnum);
    41         iomodel->parameters->FindParam(&this->hydro_p,HydroPEnum);
    42         iomodel->parameters->FindParam(&this->hydro_q,HydroQEnum);
    43         iomodel->parameters->FindParam(&this->hydro_CR,HydroCREnum);
    44         iomodel->parameters->FindParam(&this->hydro_n,HydroNEnum);
     28        iomodel->constants->FindParam(&this->rho_ice,RhoIceEnum);
     29        iomodel->constants->FindParam(&this->rho_water,RhoWaterEnum);
     30        iomodel->constants->FindParam(&this->heatcapacity,HeatcapacityEnum);
     31        iomodel->constants->FindParam(&this->thermalconductivity,ThermalconductivityEnum);
     32        iomodel->constants->FindParam(&this->latentheat,LatentheatEnum);
     33        iomodel->constants->FindParam(&this->beta,BetaEnum);
     34        iomodel->constants->FindParam(&this->meltingpoint,MeltingpointEnum);
     35        iomodel->constants->FindParam(&this->referencetemperature,ReferencetemperatureEnum);
     36        iomodel->constants->FindParam(&this->mixed_layer_capacity,MixedLayerCapacityEnum);
     37        iomodel->constants->FindParam(&this->thermal_exchange_velocity,ThermalExchangeVelocityEnum);
     38        iomodel->constants->FindParam(&this->g,GEnum);
     39       
     40        iomodel->constants->FindParam(&this->kn,HydroKnEnum);
     41        iomodel->constants->FindParam(&this->hydro_p,HydroPEnum);
     42        iomodel->constants->FindParam(&this->hydro_q,HydroQEnum);
     43        iomodel->constants->FindParam(&this->hydro_CR,HydroCREnum);
     44        iomodel->constants->FindParam(&this->hydro_n,HydroNEnum);
    4545}
    4646/*}}}1*/
  • issm/trunk/src/c/objects/Node.cpp

    r9356 r9362  
    3737
    3838        /*Fetch parameters: */
    39         iomodel->parameters->FindParam(&dim,DimEnum);
     39        iomodel->constants->FindParam(&dim,DimEnum);
    4040
    4141        /*id: */
     
    4646
    4747        /*indexing:*/
    48         DistributeNumDofs(&this->indexing,analysis_type,iomodel->vertices_type+io_index); //number of dofs per node
     48        DistributeNumDofs(&this->indexing,analysis_type,iomodel->f(VerticesTypeEnum)+io_index); //number of dofs per node
    4949        gsize=this->indexing.gsize;
    5050
     
    5454        //intialize inputs, and add as many inputs per element as requested:
    5555        this->inputs=new Inputs();
    56         if (iomodel->nodeonbed)      this->inputs->AddInput(new BoolInput(NodeOnBedEnum,(IssmBool)iomodel->nodeonbed[io_index]));
    57         if (iomodel->nodeonsurface)  this->inputs->AddInput(new BoolInput(NodeOnSurfaceEnum,(IssmBool)iomodel->nodeonsurface[io_index]));
    58         if (iomodel->nodeoniceshelf) this->inputs->AddInput(new BoolInput(NodeOnIceShelfEnum,(IssmBool)iomodel->nodeoniceshelf[io_index]));
    59         if (iomodel->nodeonicesheet) this->inputs->AddInput(new BoolInput(NodeOnIceSheetEnum,(IssmBool)iomodel->nodeonicesheet[io_index]));
     56        if (iomodel->f(NodeOnBedEnum))      this->inputs->AddInput(new BoolInput(NodeOnBedEnum,(IssmBool)iomodel->f(NodeOnBedEnum)[io_index]));
     57        if (iomodel->f(NodeOnSurfaceEnum))  this->inputs->AddInput(new BoolInput(NodeOnSurfaceEnum,(IssmBool)iomodel->f(NodeOnSurfaceEnum)[io_index]));
     58        if (iomodel->f(NodeOnIceShelfEnum)) this->inputs->AddInput(new BoolInput(NodeOnIceShelfEnum,(IssmBool)iomodel->f(NodeOnIceShelfEnum)[io_index]));
     59        if (iomodel->f(NodeOnIceSheetEnum)) this->inputs->AddInput(new BoolInput(NodeOnIceSheetEnum,(IssmBool)iomodel->f(NodeOnIceSheetEnum)[io_index]));
    6060        if (iomodel->numbernodetoelementconnectivity) this->inputs->AddInput(new IntInput(NumberNodeToElementConnectivityEnum,(IssmInt)iomodel->numbernodetoelementconnectivity[io_index]));
    61         if (analysis_type==DiagnosticHorizAnalysisEnum) this->inputs->AddInput(new IntInput(ApproximationEnum,(IssmInt)iomodel->vertices_type[io_index]));
     61        if (analysis_type==DiagnosticHorizAnalysisEnum) this->inputs->AddInput(new IntInput(ApproximationEnum,(IssmInt)iomodel->f(VerticesTypeEnum)[io_index]));
    6262       
    6363        /*set single point constraints: */
    6464
    6565        /*spc all nodes on water*/
    66         if (!iomodel->nodeonwater) _error_("iomodel->nodeonwater is NULL");
    67         if (iomodel->nodeonwater[io_index]){
     66        if (!iomodel->f(NodeOnWaterEnum)) _error_("iomodel->nodeonwater is NULL");
     67        if (iomodel->f(NodeOnWaterEnum)[io_index]){
    6868                for(k=1;k<=gsize;k++){
    6969                        this->FreezeDof(k);
     
    7575                if (dim==3){
    7676                        /*We have a  3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
    77                         if (!iomodel->nodeonbed) _error_("iomodel->nodeonbed is NULL");
    78                         if (!iomodel->vertices_type) _error_("iomodel->vertices_type is NULL");
    79                         if (iomodel->vertices_type[io_index]==MacAyealApproximationEnum && !iomodel->nodeonbed[io_index]){
     77                        if (!iomodel->f(NodeOnBedEnum)) _error_("iomodel->nodeonbed is NULL");
     78                        if (!iomodel->f(VerticesTypeEnum)) _error_("iomodel->vertices_type is NULL");
     79                        if (iomodel->f(VerticesTypeEnum)[io_index]==MacAyealApproximationEnum && !iomodel->f(NodeOnBedEnum)[io_index]){
    8080                                for(k=1;k<=gsize;k++) this->FreezeDof(k);
    8181                        }
    82                         if (iomodel->vertices_type[io_index]==MacAyealPattynApproximationEnum && iomodel->nodeonmacayeal[io_index]){
    83                                 if(!iomodel->nodeonbed[io_index]){
     82                        if (iomodel->f(VerticesTypeEnum)[io_index]==MacAyealPattynApproximationEnum && iomodel->f(NodeOnMacayealEnum)[io_index]){
     83                                if(!iomodel->f(NodeOnBedEnum)[io_index]){
    8484                                        for(k=1;k<=gsize;k++) this->FreezeDof(k);
    8585                                }
    8686                        }
    87                         if (iomodel->vertices_type[io_index]==MacAyealStokesApproximationEnum && iomodel->nodeonmacayeal[io_index]){
    88                                 if(!iomodel->nodeonbed[io_index]){
     87                        if (iomodel->f(VerticesTypeEnum)[io_index]==MacAyealStokesApproximationEnum && iomodel->f(NodeOnMacayealEnum)[io_index]){
     88                                if(!iomodel->f(NodeOnBedEnum)[io_index]){
    8989                                        for(k=1;k<=2;k++) this->FreezeDof(k);
    9090                                }
     
    9292                }
    9393                /*spc all nodes on hutter*/
    94                 if (!iomodel->nodeonhutter) _error_("iomodel->nodeonhutter is NULL");
    95                 if (iomodel->nodeonhutter[io_index]){
     94                if (!iomodel->f(NodeOnHutterEnum)) _error_("iomodel->nodeonhutter is NULL");
     95                if (iomodel->f(NodeOnHutterEnum)[io_index]){
    9696                        for(k=1;k<=gsize;k++){
    9797                                this->FreezeDof(k);
     
    104104        if (analysis_type==DiagnosticHutterAnalysisEnum){
    105105                /*Constrain all nodes that are not Hutter*/
    106                 if (!iomodel->nodeonhutter) _error_("iomodel->nodeonhutter is NULL");
    107                 if (!iomodel->nodeonhutter[io_index]){
     106                if (!iomodel->f(NodeOnHutterEnum)) _error_("iomodel->nodeonhutter is NULL");
     107                if (!iomodel->f(NodeOnHutterEnum)[io_index]){
    108108                        for(k=1;k<=gsize;k++){
    109109                                this->FreezeDof(k);
     
    122122                if (dim==3){
    123123                        /*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
    124                         _assert_(iomodel->nodeonbed);
    125                         if (!iomodel->nodeonbed[io_index]){
     124                        _assert_(iomodel->f(NodeOnBedEnum));
     125                        if (!iomodel->f(NodeOnBedEnum)[io_index]){
    126126                                for(k=1;k<=gsize;k++){
    127127                                        this->FreezeDof(k);
  • issm/trunk/src/c/objects/Params/DoubleMatParam.cpp

    r9356 r9362  
    229229}
    230230/*}}}*/
     231               
     232/*diverse: */
     233/*FUNCTION DoubleMatParam::GetPointer{{{1*/
     234double* DoubleMatParam::GetPointer(void){
     235        return this->value;
     236}
     237/*}}}*/
  • issm/trunk/src/c/objects/Params/DoubleMatParam.h

    r9356 r9362  
    7979                void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("DoubleMat param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
    8080                void  UnitConversion(int direction_enum);
     81                double* GetPointer(void);
    8182
    8283                char* GetParameterName(void);
  • issm/trunk/src/c/objects/Vertex.cpp

    r9320 r9362  
    3131Vertex::Vertex(int vertex_id, int vertex_sid,int i, IoModel* iomodel){
    3232
    33         this->Init(vertex_id, vertex_sid, iomodel->x[i],iomodel->y[i],iomodel->z[i],(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]));
     33        this->Init(vertex_id, vertex_sid, iomodel->f(XEnum)[i],iomodel->f(YEnum)[i],iomodel->f(ZEnum)[i],(iomodel->f(ZEnum)[i]-iomodel->f(BedEnum)[i])/(iomodel->f(ThicknessEnum)[i]));
    3434
    3535}
Note: See TracChangeset for help on using the changeset viewer.