Changeset 3625


Ignore:
Timestamp:
04/27/10 08:57:51 (15 years ago)
Author:
Mathieu Morlighem
Message:

updated ModelProcessor: now the id must be provided to element constructors

Location:
issm/trunk/src/c/ModelProcessorx
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/ModelProcessorx/Balancedthickness/CreateElementsNodesAndMaterialsBalancedthickness.cpp

    r3588 r3625  
    4848
    4949                                /*Create and add tria element to elements dataset: */
    50                                 elements->AddObject(new Tria(i,iomodel));
     50                                elements->AddObject(new Tria(i+1,i,iomodel));
    5151
    5252                                /*Create and add material property to materials dataset: */
    53                                 materials->AddObject(new Matice(i,iomodel,3));
     53                                materials->AddObject(new Matice(i+1,i,iomodel,3));
    5454                        }
    5555                }//for (i=0;i<numberofelements;i++)
     
    7979                        if(iomodel->my_elements[i]){
    8080                                /*Create and add penta element to elements dataset: */
    81                                 elements->AddObject(new Penta(i,iomodel));
     81                                elements->AddObject(new Penta(i+1,i,iomodel));
    8282
    8383                                /*Create and add material property to materials dataset: */
    84                                 materials->AddObject(new Matice(i,iomodel,6));
     84                                materials->AddObject(new Matice(i+1,i,iomodel,6));
    8585                        }
    8686                }//for (i=0;i<numberofelements;i++)
     
    9999
    100100        /*Add new constrant material property to materials, at the end: */
    101         materials->AddObject(new Matpar(iomodel));
     101        materials->AddObject(new Matpar(iomodel->numberofelements+1,iomodel));
    102102
    103103        /*First fetch data: */
     
    122122
    123123                        /*Add vertex to vertices dataset: */
    124                         vertices->AddObject(new Vertex(i,iomodel));
     124                        vertices->AddObject(new Vertex(i+1,i,iomodel));
    125125
    126126                        /*Add node to nodes dataset: */
    127                         nodes->AddObject(new Node(i,iomodel));
     127                        nodes->AddObject(new Node(i+1,i,iomodel));
    128128
    129129                }
  • issm/trunk/src/c/ModelProcessorx/Balancedthickness/CreateLoadsBalancedthickness.cpp

    r3588 r3625  
    1818        loads   = new DataSet(LoadsEnum);
    1919       
    20        
    2120        /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    2221         * datasets, it will not be redone: */
     
    2928
    3029}
    31 
    32 
  • issm/trunk/src/c/ModelProcessorx/Balancedthickness2/CreateElementsNodesAndMaterialsBalancedthickness2.cpp

    r3598 r3625  
    5252
    5353                                /*Create and add tria element to elements dataset: */
    54                                 elements->AddObject(new Tria(i,iomodel));
     54                                elements->AddObject(new Tria(i+1,i,iomodel));
    5555
    5656                                /*Create and add material property to materials dataset: */
    57                                 materials->AddObject(new Matice(i,iomodel,3));
     57                                materials->AddObject(new Matice(i+1,i,iomodel,3));
    5858                        }
    5959                }//for (i=0;i<numberofelements;i++)
     
    7272
    7373        /*Add new constrant material property tgo materials, at the end: */
    74         materials->AddObject(new Matpar(iomodel));
     74        materials->AddObject(new Matpar(iomodel->numberofelements+1,iomodel));
    7575
    7676        /*Create nodes and vertices: */
     
    9797
    9898                        /*Add vertex to vertices dataset: */
    99                         vertices->AddObject(new Vertex(i,iomodel));
     99                        vertices->AddObject(new Vertex(i+1,i,iomodel));
    100100
    101101                }
     
    116116
    117117                                /*Add node to nodes dataset: */
    118                                 nodes->AddObject(new Node(vertex_index,node_index,iomodel));
     118                                nodes->AddObject(new Node(i+1,vertex_index,node_index,iomodel));
    119119
    120120                        }
  • issm/trunk/src/c/ModelProcessorx/Balancedvelocities/CreateElementsNodesAndMaterialsBalancedvelocities.cpp

    r3567 r3625  
    4848
    4949                                /*Create and add tria element to elements dataset: */
    50                                 elements->AddObject(new Tria(i,iomodel));
     50                                elements->AddObject(new Tria(i+1,i,iomodel));
    5151
    5252                                /*Create and add material property to materials dataset: */
    53                                 materials->AddObject(new Matice(i,iomodel,3));
     53                                materials->AddObject(new Matice(i+1,i,iomodel,3));
    5454                        }
    5555
     
    8181                        if(iomodel->my_elements[i]){
    8282                                /*Create and add penta element to elements dataset: */
    83                                 elements->AddObject(new Penta(i,iomodel));
     83                                elements->AddObject(new Penta(i+1,i,iomodel));
    8484
    8585                                /*Create and add material property to materials dataset: */
    86                                 materials->AddObject(new Matice(i,iomodel,6));
     86                                materials->AddObject(new Matice(i+1,i,iomodel,6));
    8787
    8888                        }//if(my_elements[i])
     
    103103
    104104        /*Add new constrant material property to materials, at the end: */
    105         materials->AddObject(new Matpar(iomodel));
     105        materials->AddObject(new Matpar(iomodel->numberofelements+1,iomodel)); //put it at the end of the materials
    106106               
    107107        /*First fetch data: */
     
    126126                       
    127127                        /*Add vertex to vertices dataset: */
    128                         vertices->AddObject(new Vertex(i,iomodel));
     128                        vertices->AddObject(new Vertex(i+1,i,iomodel));
    129129
    130130                        /*Add node to nodes dataset: */
    131                         nodes->AddObject(new Node(i,iomodel));
     131                        nodes->AddObject(new Node(i+1,i,iomodel));
    132132
    133133                }
  • issm/trunk/src/c/ModelProcessorx/Balancedvelocities/CreateLoadsBalancedvelocities.cpp

    r3567 r3625  
    1818        loads   = new DataSet(LoadsEnum);
    1919       
    20        
    2120        /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    2221         * datasets, it will not be redone: */
     
    2928
    3029}
    31 
    32 
  • issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp

    r3612 r3625  
    5959
    6060                                        /*Create and add tria element to elements dataset: */
    61                                         elements->AddObject(new Tria(i,iomodel));
     61                                        elements->AddObject(new Tria(i+1,i,iomodel));
    6262                                       
    6363                                        /*Create and add material property to materials dataset: */
    64                                         materials->AddObject(new Matice(i,iomodel,3));
     64                                        materials->AddObject(new Matice(i+1,i,iomodel,3));
    6565                                }
    6666                        }
     
    104104                                if (*(iomodel->elements_type+2*i+0)==MacAyealFormulationEnum || *(iomodel->elements_type+2*i+0)==PattynFormulationEnum){ //elements of type 1 are Hutter type Tria. Don't create this elements.
    105105                                        /*Create and add penta element to elements dataset: */
    106                                         elements->AddObject(new Penta(i,iomodel));
     106                                        elements->AddObject(new Penta(i+1,i,iomodel));
    107107                                       
    108108                                        /*Create and add material property to materials dataset: */
    109                                         materials->AddObject(new Matice(i,iomodel,6));
     109                                        materials->AddObject(new Matice(i+1,i,iomodel,6));
    110110                                       
    111111                                }
     
    134134       
    135135        /*Add new constrant material property tgo materials, at the end: */
    136         materials->AddObject(new Matpar(iomodel));
     136        materials->AddObject(new Matpar(iomodel->numberofelements+1,iomodel));//put it at the end of the materials
    137137       
    138138        /*Create nodes and vertices: */
     
    158158                       
    159159                        /*Add vertex to vertices dataset: */
    160                         vertices->AddObject(new Vertex(i,iomodel));
     160                        vertices->AddObject(new Vertex(i+1,i,iomodel));
    161161
    162162                        /*Add node to nodes dataset: */
    163                         nodes->AddObject(new Node(i,iomodel));
     163                        nodes->AddObject(new Node(i+1,i,iomodel));
    164164
    165165                }
  • issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp

    r3567 r3625  
    1919        int element;
    2020        int i;
     21        int counter=1;
    2122
    2223        /*Create loads: */
     
    4849
    4950                /*Create and  add load: */
    50                 loads->AddObject(new Icefront(i,iomodel));
     51                loads->AddObject(new Icefront(counter,i,iomodel));
     52                counter++;
    5153
    5254        }
     
    7072                        if(iomodel->my_elements[(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+2)]){
    7173
    72                                 loads->AddObject(new Riftfront(i,iomodel));
     74                                loads->AddObject(new Riftfront(counter,i,iomodel));
     75                                counter++;
    7376                        }
    7477                }
  • issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateElementsNodesAndMaterialsDiagnosticHutter.cpp

    r3567 r3625  
    5858
    5959                                /*Create and add penta element to elements dataset: */
    60                                 elements->AddObject(new Sing(i,iomodel));
     60                                elements->AddObject(new Sing(i+1,i,iomodel));
    6161
    6262                                /*Create and add material property to materials dataset: */
    63                                 materials->AddObject(new Matice(i,iomodel,1));
     63                                materials->AddObject(new Matice(i+1,i,iomodel,1));
    6464
    6565                        }
     
    7676
    7777                                                /*Create and add penta element to elements dataset: */
    78                                                 elements->AddObject(new Beam(i,iomodel));
     78                                                elements->AddObject(new Beam(i+1,i,iomodel));
    7979
    8080                                                /*Create and add material property to materials dataset: */
    81                                                 materials->AddObject(new Matice(i,iomodel,2));
     81                                                materials->AddObject(new Matice(i+1,i,iomodel,2));
    8282
    8383                                        }
     
    102102
    103103        /*Add new constrant material property to materials, at the end: */
    104         materials->AddObject(new Matpar(iomodel));
     104        if (strcmp(iomodel->meshtype,"2d")==0){
     105                materials->AddObject(new Matpar(iomodel->numberofvertices+1,iomodel));                          //put it at the end of the materials
     106        }
     107        else{
     108                materials->AddObject(new Matpar(iomodel->numberofvertices2d*(iomodel->numlayers-1)+1,iomodel)); //put it at the end of the materials
     109        }
     110}
    105111               
    106112        /*First fetch data: */
     
    126132
    127133                        /*Add vertex to vertices dataset: */
    128                         vertices->AddObject(new Vertex(i,iomodel));
     134                        vertices->AddObject(new Vertex(i+1,i,iomodel));
    129135
    130136                        /*Add node to nodes dataset: */
    131                         nodes->AddObject(new Node(i,iomodel));
     137                        nodes->AddObject(new Node(i+1,i,iomodel));
    132138
    133139                }
  • issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp

    r3567 r3625  
    6262
    6363                                 /*Create and add penta element to elements dataset: */
    64                                  elements->AddObject(new Penta(i,iomodel));
     64                                 elements->AddObject(new Penta(i+1,i,iomodel));
    6565
    6666                                 /*Create and add material property to materials dataset: */
    67                                  materials->AddObject(new Matice(i,iomodel,6));
     67                                 materials->AddObject(new Matice(i+1,i,iomodel,6));
    6868                         }
    6969
     
    9191
    9292        /*Add new constrant material property to materials, at the end: */
    93         materials->AddObject(new Matpar(iomodel));
     93        materials->AddObject(new Matpar(iomodel->numberofelements+1,iomodel));
    9494       
    9595        /*First fetch data: */
     
    114114
    115115                        /*Add vertex to vertices dataset: */
    116                         vertices->AddObject(new Vertex(i,iomodel));
     116                        vertices->AddObject(new Vertex(i+1,i,iomodel));
    117117
    118118                        /*Add node to nodes dataset: */
    119                         nodes->AddObject(new Node(i,iomodel));
     119                        nodes->AddObject(new Node(i+1,i,iomodel));
    120120
    121121                }
  • issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateLoadsDiagnosticStokes.cpp

    r3624 r3625  
    2222        /*pengrid intermediary data: */
    2323        int numberofpressureloads;
    24         int count=0;
     24        int counter=1;
    2525
    2626        /*Create loads: */
     
    3737        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
    3838
    39         count=1; //matlab indexing
    4039        /*First load data:*/
    4140        for (i=0;i<numberofpressureloads;i++){
     
    5554                /*Create and  add load: */
    5655                loads->AddObject(new Icefront(i,iomodel));
     56                counter++;
    5757
    5858        }
     
    7676                        if ((iomodel->gridonbed[i]) && (iomodel->gridonicesheet[i]) && (iomodel->gridonstokes[i])){
    7777                               
    78                                 loads->AddObject(new Pengrid(count,i,iomodel));
     78                                loads->AddObject(new Pengrid(counter,i,iomodel));
     79                                counter++;
    7980                        }
    8081                } //if((iomodel->my_vertices[i]==1))
  • issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateElementsNodesAndMaterialsDiagnosticVert.cpp

    r3567 r3625  
    5454
    5555                        /*Create and add penta element to elements dataset: */
    56                         elements->AddObject(new Penta(i,iomodel));
     56                        elements->AddObject(new Penta(i+1,i,iomodel));
    5757
    5858                        /*Create and add material property to materials dataset: */
    59                         materials->AddObject(new Matice(i,iomodel,6));
     59                        materials->AddObject(new Matice(i+1,i,iomodel,6));
    6060
    6161                }
     
    7777
    7878        /*Add new constrant material property to materials, at the end: */
    79         materials->AddObject(new Matpar(iomodel));
     79        materials->AddObject(new Matpar(iomodel->numberofelements+1,iomodel));//put it at the end of the materials
    8080       
    8181        /*First fetch data: */
     
    9898
    9999                        /*Add vertex to vertices dataset: */
    100                         vertices->AddObject(new Vertex(i,iomodel));
     100                        vertices->AddObject(new Vertex(i+1,i,iomodel));
    101101
    102102                        /*Add node to nodes dataset: */
    103                         nodes->AddObject(new Node(i,iomodel));
     103                        nodes->AddObject(new Node(i+1,i,iomodel));
    104104
    105105                }
  • issm/trunk/src/c/ModelProcessorx/Melting/CreateElementsNodesAndMaterialsMelting.cpp

    r3567 r3625  
    5555
    5656                                /*Create and add tria element to elements dataset: */
    57                                 elements->AddObject(new Penta(i,iomodel));
     57                                elements->AddObject(new Penta(i+1,i,iomodel));
    5858
    5959                                /*Create and add material property to materials dataset: */
    60                                 materials->AddObject(new Matice(i,iomodel,6));
     60                                materials->AddObject(new Matice(i+1,i,iomodel,6));
    6161                        }
    6262
     
    8282
    8383        /*Add new constrant material property tgo materials, at the end: */
    84         materials->AddObject(new Matpar(iomodel));
     84        materials->AddObject(new Matpar(iomodel->numberofelements+1,iomodel));//put it at the end of the materials
    8585
    8686        /*First fetch data: */
     
    105105                       
    106106                        /*Add vertex to vertices dataset: */
    107                         vertices->AddObject(new Vertex(i,iomodel));
     107                        vertices->AddObject(new Vertex(i+1,i,iomodel));
    108108
    109109                        /*Add node to nodes dataset: */
    110                         nodes->AddObject(new Node(i,iomodel));
     110                        nodes->AddObject(new Node(i+1,i,iomodel));
    111111
    112112                }
  • issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp

    r3624 r3625  
    4949
    5050}
    51 
    52 
  • issm/trunk/src/c/ModelProcessorx/Prognostic/CreateElementsNodesAndMaterialsPrognostic.cpp

    r3567 r3625  
    4848
    4949                                /*Create and add tria element to elements dataset: */
    50                                 elements->AddObject(new Tria(i,iomodel));
     50                                elements->AddObject(new Tria(i+1,i,iomodel));
    5151
    5252                                /*Create and add material property to materials dataset: */
    53                                 materials->AddObject(new Matice(i,iomodel,3));
     53                                materials->AddObject(new Matice(i+1,i,iomodel,3));
    5454                        }
    5555                }//for (i=0;i<numberofelements;i++)
     
    8080                        if(iomodel->my_elements[i]){
    8181                                /*Create and add penta element to elements dataset: */
    82                                 elements->AddObject(new Penta(i,iomodel));
     82                                elements->AddObject(new Penta(i+1,i,iomodel));
    8383
    8484                                /*Create and add material property to materials dataset: */
    85                                 materials->AddObject(new Matice(i,iomodel,6));
     85                                materials->AddObject(new Matice(i+1,i,iomodel,6));
    8686                        }
    8787                }//for (i=0;i<numberofelements;i++)
     
    100100
    101101        /*Add new constrant material property to materials, at the end: */
    102         materials->AddObject(new Matpar(iomodel));
     102        materials->AddObject(new Matpar(iomodel->numberofelements+1,iomodel));//put it at the end of the materials
    103103
    104104        /*First fetch data: */
     
    123123
    124124                        /*Add vertex to vertices dataset: */
    125                         vertices->AddObject(new Vertex(i,iomodel));
     125                        vertices->AddObject(new Vertex(i+1,i,iomodel));
    126126
    127127                        /*Add node to nodes dataset: */
    128                         nodes->AddObject(new Node(i,iomodel));
     128                        nodes->AddObject(new Node(i+1,i,iomodel));
    129129
    130130                }
  • issm/trunk/src/c/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp

    r3567 r3625  
    2727
    2828}
    29 
    30 
  • issm/trunk/src/c/ModelProcessorx/Prognostic2/CreateElementsNodesAndMaterialsPrognostic2.cpp

    r3570 r3625  
    5252
    5353                                /*Create and add tria element to elements dataset: */
    54                                 elements->AddObject(new Tria(i,iomodel));
     54                                elements->AddObject(new Tria(i+1,i,iomodel));
    5555
    5656                                /*Create and add material property to materials dataset: */
    57                                 materials->AddObject(new Matice(i,iomodel,3));
     57                                materials->AddObject(new Matice(i+1,i,iomodel,3));
    5858                        }
    5959                }//for (i=0;i<numberofelements;i++)
     
    7272
    7373        /*Add new constrant material property tgo materials, at the end: */
    74         materials->AddObject(new Matpar(iomodel));
     74        materials->AddObject(new Matpar(iomodel->numberofelements+1,iomodel));
    7575
    7676        /*Create nodes and vertices: */
     
    9797
    9898                        /*Add vertex to vertices dataset: */
    99                         vertices->AddObject(new Vertex(i,iomodel));
     99                        vertices->AddObject(new Vertex(i+1,i,iomodel));
    100100
    101101                }
     
    116116
    117117                                /*Add node to nodes dataset: */
    118                                 nodes->AddObject(new Node(vertex_index,node_index,iomodel));
     118                                nodes->AddObject(new Node(i+1,vertex_index,node_index,iomodel));
    119119
    120120                        }
  • issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateElementsNodesAndMaterialsSlopeCompute.cpp

    r3567 r3625  
    4646                               
    4747                                /*Create and add tria element to elements dataset: */
    48                                 elements->AddObject(new Tria(i,iomodel));
     48                                elements->AddObject(new Tria(i+1,i,iomodel));
    4949
    5050                                /*Create and add material property to materials dataset: */
    51                                 materials->AddObject(new Matice(i,iomodel,3));
     51                                materials->AddObject(new Matice(i+1,i,iomodel,3));
    5252                        }
    5353
     
    7474                        if(iomodel->my_elements[i]){
    7575                                /*Create and add penta element to elements dataset: */
    76                                 elements->AddObject(new Penta(i,iomodel));
     76                                elements->AddObject(new Penta(i+1,i,iomodel));
    7777
    7878                                /*Create and add material property to materials dataset: */
    79                                 materials->AddObject(new Matice(i,iomodel,6));
     79                                materials->AddObject(new Matice(i+1,i,iomodel,6));
    8080
    8181                        }//if(my_elements[i])
     
    9292
    9393        /*Add new constrant material property tgo materials, at the end: */
    94         materials->AddObject(new Matpar(iomodel));
     94        materials->AddObject(new Matpar(iomodel->numberofelements+1,iomodel)); //put it at the end of the materials
    9595       
    9696        /*First fetch data: */
     
    115115                       
    116116                        /*Add vertex to vertices dataset: */
    117                         vertices->AddObject(new Vertex(i,iomodel));
     117                        vertices->AddObject(new Vertex(i+1,i,iomodel));
    118118
    119119                        /*Add node to nodes dataset: */
    120                         nodes->AddObject(new Node(i,iomodel));
     120                        nodes->AddObject(new Node(i+1,i,iomodel));
    121121
    122122                }
  • issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp

    r3567 r3625  
    5353
    5454                        /*Create and add tria element to elements dataset: */
    55                         elements->AddObject(new Penta(i,iomodel));
     55                        elements->AddObject(new Penta(i+1,i,iomodel));
    5656
    5757                        /*Create and add material property to materials dataset: */
    58                         materials->AddObject(new Matice(i,iomodel,6));
     58                        materials->AddObject(new Matice(i+1,i,iomodel,6));
    5959                }
    6060        }//for (i=0;i<numberofelements;i++)
     
    7878
    7979        /*Add new constrant material property tgo materials, at the end: */
    80         materials->AddObject(new Matpar(iomodel));
     80        materials->AddObject(new Matpar(iomodel->numberofelements+1,iomodel));//put it at the end of the materials
    8181       
    8282        /*Create nodes and vertices: */
     
    101101                       
    102102                        /*Add vertex to vertices dataset: */
    103                         vertices->AddObject(new Vertex(i,iomodel));
     103                        vertices->AddObject(new Vertex(i+1,i,iomodel));
    104104
    105105                        /*Add node to nodes dataset: */
    106                         nodes->AddObject(new Node(i,iomodel));
     106                        nodes->AddObject(new Node(i+1,i,iomodel));
    107107
    108108                }
  • issm/trunk/src/c/ModelProcessorx/Thermal/CreateLoadsThermal.cpp

    r3624 r3625  
    5252
    5353}
    54                                
    55 
Note: See TracChangeset for help on using the changeset viewer.