Changeset 1835


Ignore:
Timestamp:
08/24/09 17:54:12 (16 years ago)
Author:
Eric.Larour
Message:

Brachning back from issm.controlstatic, by hand

Location:
issm/trunk/src/c/ModelProcessorx/DiagnosticHutter
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp

    r741 r1835  
    1111#include "../../objects/objects.h"
    1212#include "../../shared/shared.h"
    13 #include "../Model.h"
     13#include "../IoModel.h"
    1414
    1515
    16 void    CreateConstraintsDiagnosticHutter(DataSet** pconstraints, Model* model,ConstDataHandle model_handle){
     16void    CreateConstraintsDiagnosticHutter(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){
    1717
    1818        int i,j;
     
    4040
    4141        /*Now, is the flag ishutter on? otherwise, do nothing: */
    42         if (!model->ishutter)goto cleanup_and_return;
     42        if (!iomodel->ishutter)goto cleanup_and_return;
    4343
    4444        count=0;
    4545       
    4646        /*Fetch data: */
    47         ModelFetchData((void**)&model->gridonhutter,NULL,NULL,model_handle,"gridonhutter","Matrix","Mat");
     47        IoModelFetchData((void**)&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","Matrix","Mat");
    4848
    4949        /*vx and vy are spc'd if we are not on gridonhutter: */
    50         for (i=0;i<model->numberofnodes;i++){
     50        for (i=0;i<iomodel->numberofnodes;i++){
    5151        #ifdef _PARALLEL_
    5252        /*keep only this partition's nodes:*/
    53         if((model->my_grids[i])){
     53        if((iomodel->my_grids[i])){
    5454        #endif
    5555
    56                 if (!(int)model->gridonhutter[i]){
     56                if (!(int)iomodel->gridonhutter[i]){
    5757       
    5858                        spc_sid=count;
     
    8181
    8282        /*Free data: */
    83         xfree((void**)&model->gridonhutter);
     83        xfree((void**)&iomodel->gridonhutter);
    8484
    8585        /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
  • issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateElementsNodesAndMaterialsDiagnosticHutter.cpp

    r1648 r1835  
    1212#include "../../shared/shared.h"
    1313#include "../../MeshPartitionx/MeshPartitionx.h"
    14 #include "../Model.h"
    15 
    16 
    17 void    CreateElementsNodesAndMaterialsDiagnosticHutter(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, Model* model,ConstDataHandle model_handle){
     14#include "../IoModel.h"
     15
     16
     17void    CreateElementsNodesAndMaterialsDiagnosticHutter(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){
    1818
    1919
     
    113113
    114114        /*Now, is the flag ishutter on? otherwise, do nothing: */
    115         if (!model->ishutter)goto cleanup_and_return;
     115        if (!iomodel->ishutter)goto cleanup_and_return;
    116116
    117117        /*Width of elements: */
    118         if(strcmp(model->meshtype,"2d")==0){
     118        if(strcmp(iomodel->meshtype,"2d")==0){
    119119                elements_width=3; //tria elements
    120120        }
     
    125125        #ifdef _PARALLEL_
    126126        /*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/
    127         if(strcmp(model->meshtype,"2d")==0){
     127        if(strcmp(iomodel->meshtype,"2d")==0){
    128128                /*load elements: */
    129                 ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat");
     129                IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
    130130        }
    131131        else{
    132132                /*load elements2d: */
    133                 ModelFetchData((void**)&model->elements2d,NULL,NULL,model_handle,"elements2d","Matrix","Mat");
    134         }
    135 
    136         MeshPartitionx(&epart, &npart,model->numberofelements,model->numberofnodes,model->elements, model->numberofelements2d,model->numberofnodes2d,model->elements2d,model->numlayers,elements_width, model->meshtype,num_procs);
     133                IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
     134        }
     135
     136        MeshPartitionx(&epart, &npart,iomodel->numberofelements,iomodel->numberofnodes,iomodel->elements, iomodel->numberofelements2d,iomodel->numberofnodes2d,iomodel->elements2d,iomodel->numlayers,elements_width, iomodel->meshtype,num_procs);
    137137
    138138        /*Free elements and elements2d: */
    139         xfree((void**)&model->elements);
    140         xfree((void**)&model->elements2d);
     139        xfree((void**)&iomodel->elements);
     140        xfree((void**)&iomodel->elements2d);
    141141
    142142        /*Used later on: */
    143         my_grids=(int*)xcalloc(model->numberofnodes,sizeof(int));
    144         #endif
    145 
    146         #ifdef _PARALLEL_
    147         if(strcmp(model->meshtype,"2d")==0){
    148                 ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat");
    149                 for (i=0;i<model->numberofelements;i++){
     143        my_grids=(int*)xcalloc(iomodel->numberofnodes,sizeof(int));
     144        #endif
     145
     146        #ifdef _PARALLEL_
     147        if(strcmp(iomodel->meshtype,"2d")==0){
     148                IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
     149                for (i=0;i<iomodel->numberofelements;i++){
    150150                        if(my_rank==epart[i]){
    151151                                /*Now that we are here, we can also start building the list of grids belonging to this node partition: we use
     
    154154                                 will hold which grids belong to this partition*/
    155155
    156                                 my_grids[(int)*(model->elements+elements_width*i+0)-1]=1;
    157                                 my_grids[(int)*(model->elements+elements_width*i+1)-1]=1;
    158                                 my_grids[(int)*(model->elements+elements_width*i+2)-1]=1;
     156                                my_grids[(int)*(iomodel->elements+elements_width*i+0)-1]=1;
     157                                my_grids[(int)*(iomodel->elements+elements_width*i+1)-1]=1;
     158                                my_grids[(int)*(iomodel->elements+elements_width*i+2)-1]=1;
    159159                        }
    160160                }
    161161        }
    162162        else{
    163                 ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat");
    164                 for (i=0;i<model->numberofelements;i++){
     163                IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
     164                for (i=0;i<iomodel->numberofelements;i++){
    165165                        if(my_rank==epart[i]){
    166                                 my_grids[(int)*(model->elements+elements_width*i+0)-1]=1;
    167                                 my_grids[(int)*(model->elements+elements_width*i+1)-1]=1;
    168                                 my_grids[(int)*(model->elements+elements_width*i+2)-1]=1;
    169                                 my_grids[(int)*(model->elements+elements_width*i+3)-1]=1;
    170                                 my_grids[(int)*(model->elements+elements_width*i+4)-1]=1;
    171                                 my_grids[(int)*(model->elements+elements_width*i+5)-1]=1;
     166                                my_grids[(int)*(iomodel->elements+elements_width*i+0)-1]=1;
     167                                my_grids[(int)*(iomodel->elements+elements_width*i+1)-1]=1;
     168                                my_grids[(int)*(iomodel->elements+elements_width*i+2)-1]=1;
     169                                my_grids[(int)*(iomodel->elements+elements_width*i+3)-1]=1;
     170                                my_grids[(int)*(iomodel->elements+elements_width*i+4)-1]=1;
     171                                my_grids[(int)*(iomodel->elements+elements_width*i+5)-1]=1;
    172172                        }
    173173                }
     
    176176        /*From the element partitioning, we can determine which grids are on the inside of this cpu's
    177177         *element partition, and which are on its border with other nodes:*/
    178         gridborder=NewVec(model->numberofnodes);
    179 
    180         for (i=0;i<model->numberofnodes;i++){
     178        gridborder=NewVec(iomodel->numberofnodes);
     179
     180        for (i=0;i<iomodel->numberofnodes;i++){
    181181                if(my_grids[i])VecSetValue(gridborder,i,1,ADD_VALUES);
    182182        }
     
    192192        #ifdef _DEBUG_
    193193        if(my_rank==0){
    194                 for (i=0;i<model->numberofnodes;i++){
     194                for (i=0;i<iomodel->numberofnodes;i++){
    195195                        printf("Grid id %i Border grid %lf\n",i+1,my_bordergrids[i]);
    196196                }
     
    203203
    204204        /*Fetch data temporarily needed: */
    205         ModelFetchData((void**)&model->gridonhutter,NULL,NULL,model_handle,"gridonhutter","Matrix","Mat");
    206         ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
    207         ModelFetchData((void**)&model->surface,NULL,NULL,model_handle,"surface","Matrix","Mat");
    208         ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
    209         ModelFetchData((void**)&model->gridonsurface,NULL,NULL,model_handle,"gridonsurface","Matrix","Mat");
    210         ModelFetchData((void**)&model->gridonbed,NULL,NULL,model_handle,"gridonbed","Matrix","Mat");
    211         ModelFetchData((void**)&model->uppernodes,NULL,NULL,model_handle,"uppergrids","Matrix","Mat");
    212         ModelFetchData((void**)&model->drag,NULL,NULL,model_handle,"drag","Matrix","Mat");
    213         ModelFetchData((void**)&model->B,NULL,NULL,model_handle,"B","Matrix","Mat");
    214         ModelFetchData((void**)&model->n,NULL,NULL,model_handle,"n","Matrix","Mat");
     205        IoModelFetchData((void**)&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","Matrix","Mat");
     206        IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
     207        IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
     208        IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
     209        IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
     210        IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
     211        IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
     212        IoModelFetchData((void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");
     213        IoModelFetchData((void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");
     214        IoModelFetchData((void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");
    215215
    216216        /*2d mesh: */
    217         if (strcmp(model->meshtype,"2d")==0){
    218 
    219                 for (i=0;i<model->numberofnodes;i++){
     217        if (strcmp(iomodel->meshtype,"2d")==0){
     218
     219                for (i=0;i<iomodel->numberofnodes;i++){
    220220                #ifdef _PARALLEL_
    221221                /*keep only this partition's nodes:*/
     
    223223                #endif
    224224
    225                         if(model->gridonhutter[i]){
     225                        if(iomodel->gridonhutter[i]){
    226226                               
    227227                                /*Deal with sing element: */
    228228                                sing_id=i+1;
    229229                                sing_mid=i+1; //refers to the corresponding material property card
    230                                 sing_mparid=model->numberofnodes+1;//refers to the corresponding matpar property card
     230                                sing_mparid=iomodel->numberofnodes+1;//refers to the corresponding matpar property card
    231231                                sing_g=i+1;
    232                                 sing_h=model->thickness[i];
    233                                 sing_k=model->drag[i];
     232                                sing_h=iomodel->thickness[i];
     233                                sing_k=iomodel->drag[i];
    234234
    235235                                /*Create sing element using its constructor:*/
     
    241241                                /*Deal with material property card: */
    242242                                matice_mid=i+1; //same as the material id from the geom2 elements.
    243                                 matice_B=model->B[i];   
    244                                 matice_n=(double)model->n[1]; //n defined on elements not grids, so take the first value everywhere
     243                                matice_B=iomodel->B[i];
     244                                matice_n=(double)iomodel->n[1]; //n defined on elements not grids, so take the first value everywhere
    245245                       
    246246                                /*Create matice using its constructor:*/
     
    255255                #endif
    256256
    257                 } //for (i=0;i<model->numberofnodes;i++)
    258         } //if (strcmp(model->meshtype,"2d")==0)
     257                } //for (i=0;i<iomodel->numberofnodes;i++)
     258        } //if (strcmp(iomodel->meshtype,"2d")==0)
    259259        else{
    260260
    261                 for (i=0;i<model->numberofnodes;i++){
     261                for (i=0;i<iomodel->numberofnodes;i++){
    262262                #ifdef _PARALLEL_
    263263                /*keep only this partition's nodes:*/
     
    265265                #endif
    266266
    267                         if(model->gridonhutter[i]){
    268 
    269                                 if(!model->gridonsurface[i]){
     267                        if(iomodel->gridonhutter[i]){
     268
     269                                if(!iomodel->gridonsurface[i]){
    270270                                       
    271271                                        /*Deal with sing element: */
    272272                                        beam_id=i+1;
    273273                                        beam_mid=i+1; //refers to the corresponding material property card
    274                                         beam_mparid=model->numberofnodes-model->numberofnodes2d+1;//refers to the corresponding matpar property card
     274                                        beam_mparid=iomodel->numberofnodes-iomodel->numberofnodes2d+1;//refers to the corresponding matpar property card
    275275                                        beam_g[0]=i+1;
    276                                         beam_g[1]=(int)model->uppernodes[i]; //grid that lays right on top
    277                                         beam_h[0]=model->thickness[i];
    278                                         beam_h[1]=model->thickness[(int)(model->uppernodes[i]-1)];
    279                                         beam_s[0]=model->surface[i];
    280                                         beam_s[1]=model->surface[(int)(model->uppernodes[i]-1)];
    281                                         beam_b[0]=model->bed[i];
    282                                         beam_b[1]=model->bed[(int)(model->uppernodes[i]-1)];
    283                                         beam_k[0]=model->drag[i];
    284                                         beam_k[1]=model->drag[(int)(model->uppernodes[i]-1)];
    285 
    286                                         beam_onbed=(bool)model->gridonbed[i];
     276                                        beam_g[1]=(int)iomodel->uppernodes[i]; //grid that lays right on top
     277                                        beam_h[0]=iomodel->thickness[i];
     278                                        beam_h[1]=iomodel->thickness[(int)(iomodel->uppernodes[i]-1)];
     279                                        beam_s[0]=iomodel->surface[i];
     280                                        beam_s[1]=iomodel->surface[(int)(iomodel->uppernodes[i]-1)];
     281                                        beam_b[0]=iomodel->bed[i];
     282                                        beam_b[1]=iomodel->bed[(int)(iomodel->uppernodes[i]-1)];
     283                                        beam_k[0]=iomodel->drag[i];
     284                                        beam_k[1]=iomodel->drag[(int)(iomodel->uppernodes[i]-1)];
     285
     286                                        beam_onbed=(bool)iomodel->gridonbed[i];
    287287
    288288                                        /*Create beam element ubeam its constructor:*/
     
    294294                                        /*Deal with material property card: */
    295295                                        matice_mid=i+1; //same as the material id from the geom2 elements.
    296                                         matice_B=model->B[i];   
    297                                         matice_n=(double)model->n[1]; //n defined on elements not grids, so take the first value everywhere
     296                                        matice_B=iomodel->B[i];
     297                                        matice_n=(double)iomodel->n[1]; //n defined on elements not grids, so take the first value everywhere
    298298                               
    299299                                        /*Create matice ubeam its constructor:*/
     
    309309                #endif
    310310
    311                 } //for (i=0;i<model->numberofnodes;i++)
    312 
    313         } //if (strcmp(model->meshtype,"2d")==0)
     311                } //for (i=0;i<iomodel->numberofnodes;i++)
     312
     313        } //if (strcmp(iomodel->meshtype,"2d")==0)
    314314       
    315315
    316316        /*Free data: */
    317         xfree((void**)&model->elements);
    318         xfree((void**)&model->gridonhutter);
    319         xfree((void**)&model->thickness);
    320         xfree((void**)&model->surface);
    321         xfree((void**)&model->bed);
    322         xfree((void**)&model->gridonsurface);
    323         xfree((void**)&model->uppernodes);
    324         xfree((void**)&model->drag);
    325         xfree((void**)&model->B);
    326         xfree((void**)&model->n);
     317        xfree((void**)&iomodel->elements);
     318        xfree((void**)&iomodel->gridonhutter);
     319        xfree((void**)&iomodel->thickness);
     320        xfree((void**)&iomodel->surface);
     321        xfree((void**)&iomodel->bed);
     322        xfree((void**)&iomodel->gridonsurface);
     323        xfree((void**)&iomodel->uppernodes);
     324        xfree((void**)&iomodel->drag);
     325        xfree((void**)&iomodel->B);
     326        xfree((void**)&iomodel->n);
    327327       
    328328
    329329        /*Add one constant material property to materials: */
    330         matpar_mid=model->numberofnodes-model->numberofnodes2d+1; //put it at the end of the materials
    331         matpar_g=model->g;
    332         matpar_rho_ice=model->rho_ice;
    333         matpar_rho_water=model->rho_water;
    334         matpar_thermalconductivity=model->thermalconductivity;
    335         matpar_heatcapacity=model->heatcapacity;
    336         matpar_latentheat=model->latentheat;
    337         matpar_beta=model->beta;
    338         matpar_meltingpoint=model->meltingpoint;
    339         matpar_mixed_layer_capacity=model->mixed_layer_capacity;
    340         matpar_thermal_exchange_velocity=model->thermal_exchange_velocity;
     330        matpar_mid=iomodel->numberofnodes-iomodel->numberofnodes2d+1; //put it at the end of the materials
     331        matpar_g=iomodel->g;
     332        matpar_rho_ice=iomodel->rho_ice;
     333        matpar_rho_water=iomodel->rho_water;
     334        matpar_thermalconductivity=iomodel->thermalconductivity;
     335        matpar_heatcapacity=iomodel->heatcapacity;
     336        matpar_latentheat=iomodel->latentheat;
     337        matpar_beta=iomodel->beta;
     338        matpar_meltingpoint=iomodel->meltingpoint;
     339        matpar_mixed_layer_capacity=iomodel->mixed_layer_capacity;
     340        matpar_thermal_exchange_velocity=iomodel->thermal_exchange_velocity;
    341341
    342342        /*Create matpar object using its constructor: */
     
    351351               
    352352        /*First fetch data: */
    353         if (strcmp(model->meshtype,"3d")==0){
    354                 ModelFetchData((void**)&model->deadgrids,NULL,NULL,model_handle,"deadgrids","Matrix","Mat");
    355                 ModelFetchData((void**)&model->uppernodes,NULL,NULL,model_handle,"uppergrids","Matrix","Mat");
    356         }
    357         ModelFetchData((void**)&model->x,NULL,NULL,model_handle,"x","Matrix","Mat");
    358         ModelFetchData((void**)&model->y,NULL,NULL,model_handle,"y","Matrix","Mat");
    359         ModelFetchData((void**)&model->z,NULL,NULL,model_handle,"z","Matrix","Mat");
    360         ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat");
    361         ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat");
    362         ModelFetchData((void**)&model->gridonbed,NULL,NULL,model_handle,"gridonbed","Matrix","Mat");
    363         ModelFetchData((void**)&model->gridonsurface,NULL,NULL,model_handle,"gridonsurface","Matrix","Mat");
    364         ModelFetchData((void**)&model->gridonhutter,NULL,NULL,model_handle,"gridonhutter","Matrix","Mat");
    365         ModelFetchData((void**)&model->gridonicesheet,NULL,NULL,model_handle,"gridonicesheet","Matrix","Mat");
    366         ModelFetchData((void**)&model->gridoniceshelf,NULL,NULL,model_handle,"gridoniceshelf","Matrix","Mat");
     353        if (strcmp(iomodel->meshtype,"3d")==0){
     354                IoModelFetchData((void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");
     355                IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
     356        }
     357        IoModelFetchData((void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");
     358        IoModelFetchData((void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");
     359        IoModelFetchData((void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");
     360        IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
     361        IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
     362        IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
     363        IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
     364        IoModelFetchData((void**)&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","Matrix","Mat");
     365        IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
     366        IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
    367367       
    368368        /*Get number of dofs per node: */
    369         DistributeNumDofs(&node_numdofs,model->analysis_type,model->sub_analysis_type);
    370 
    371         for (i=0;i<model->numberofnodes;i++){
     369        DistributeNumDofs(&node_numdofs,iomodel->analysis_type,iomodel->sub_analysis_type);
     370
     371        for (i=0;i<iomodel->numberofnodes;i++){
    372372        #ifdef _PARALLEL_
    373373        /*keep only this partition's nodes:*/
     
    389389                #endif
    390390
    391                 node_x[0]=model->x[i];
    392                 node_x[1]=model->y[i];
    393                 node_x[2]=model->z[i];
    394                 node_sigma=(model->z[i]-model->bed[i])/(model->thickness[i]);
     391                node_x[0]=iomodel->x[i];
     392                node_x[1]=iomodel->y[i];
     393                node_x[2]=iomodel->z[i];
     394                node_sigma=(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]);
    395395               
    396                 node_onbed=(int)model->gridonbed[i];
    397                 node_onsurface=(int)model->gridonsurface[i];   
    398                 node_onshelf=(int)model->gridoniceshelf[i];     
    399                 node_onsheet=(int)model->gridonicesheet[i];     
    400 
    401                 if (strcmp(model->meshtype,"3d")==0){
    402                         if (isnan(model->uppernodes[i])){
     396                node_onbed=(int)iomodel->gridonbed[i];
     397                node_onsurface=(int)iomodel->gridonsurface[i]; 
     398                node_onshelf=(int)iomodel->gridoniceshelf[i];   
     399                node_onsheet=(int)iomodel->gridonicesheet[i];   
     400
     401                if (strcmp(iomodel->meshtype,"3d")==0){
     402                        if (isnan(iomodel->uppernodes[i])){
    403403                                node_upper_node_id=node_id;  //nodes on surface do not have upper nodes, only themselves.
    404404                        }
    405405                        else{
    406                                 node_upper_node_id=(int)model->uppernodes[i];
     406                                node_upper_node_id=(int)iomodel->uppernodes[i];
    407407                        }
    408408                }
     
    416416
    417417                /*set single point constraints.: */
    418                 if (!model->gridonhutter[i]){
     418                if (!iomodel->gridonhutter[i]){
    419419                        for(k=1;k<=node_numdofs;k++){
    420420                                node->FreezeDof(k);
     
    437437
    438438        /*Clean fetched data: */
    439         xfree((void**)&model->deadgrids);
    440         xfree((void**)&model->x);
    441         xfree((void**)&model->y);
    442         xfree((void**)&model->z);
    443         xfree((void**)&model->thickness);
    444         xfree((void**)&model->bed);
    445         xfree((void**)&model->gridonbed);
    446         xfree((void**)&model->gridonsurface);
    447         xfree((void**)&model->gridonhutter);
    448         xfree((void**)&model->uppernodes);
    449         xfree((void**)&model->gridonicesheet);
    450         xfree((void**)&model->gridoniceshelf);
    451        
    452 
    453         /*Keep partitioning information into model*/
    454         model->epart=epart;
    455         model->my_grids=my_grids;
    456         model->my_bordergrids=my_bordergrids;
    457 
    458         /*Keep partitioning information into model*/
     439        xfree((void**)&iomodel->deadgrids);
     440        xfree((void**)&iomodel->x);
     441        xfree((void**)&iomodel->y);
     442        xfree((void**)&iomodel->z);
     443        xfree((void**)&iomodel->thickness);
     444        xfree((void**)&iomodel->bed);
     445        xfree((void**)&iomodel->gridonbed);
     446        xfree((void**)&iomodel->gridonsurface);
     447        xfree((void**)&iomodel->gridonhutter);
     448        xfree((void**)&iomodel->uppernodes);
     449        xfree((void**)&iomodel->gridonicesheet);
     450        xfree((void**)&iomodel->gridoniceshelf);
     451       
     452
     453        /*Keep partitioning information into iomodel*/
     454        iomodel->epart=epart;
     455        iomodel->my_grids=my_grids;
     456        iomodel->my_bordergrids=my_bordergrids;
     457
     458        /*Keep partitioning information into iomodel*/
    459459        #ifdef _PARALLEL_
    460460        xfree((void**)&all_numgrids);
     
    462462        VecFree(&gridborder);
    463463        #endif
    464         model->npart=npart;
     464        iomodel->npart=npart;
    465465
    466466        cleanup_and_return:
  • issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateLoadsDiagnosticHutter.cpp

    r308 r1835  
    1111#include "../../shared/shared.h"
    1212#include "../../include/macros.h"
    13 #include "../Model.h"
     13#include "../IoModel.h"
    1414
    1515
    16 void    CreateLoadsDiagnosticHutter(DataSet** ploads, Model* model,ConstDataHandle model_handle){
     16void    CreateLoadsDiagnosticHutter(DataSet** ploads, IoModel* iomodel,ConstDataHandle iomodel_handle){
    1717
    1818        DataSet*    loads    = NULL;
     
    2222
    2323        /*Now, is the flag ishutter on? otherwise, do nothing: */
    24         if (!model->ishutter)goto cleanup_and_return;
     24        if (!iomodel->ishutter)goto cleanup_and_return;
    2525
    2626        cleanup_and_return:
Note: See TracChangeset for help on using the changeset viewer.