Ignore:
Timestamp:
04/04/10 23:08:44 (15 years ago)
Author:
Eric.Larour
Message:

New Hook and Element Properties, to simplify element framework. This is a massive commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/ModelProcessorx/Prognostic/CreateElementsNodesAndMaterialsPrognostic.cpp

    r3332 r3383  
    1010#include "../../shared/shared.h"
    1111#include "../../MeshPartitionx/MeshPartitionx.h"
     12#include "../../include/typedefs.h"
    1213#include "../IoModel.h"
    1314
     
    3435        Matice*     matice  = NULL;
    3536        Matpar*     matpar  = NULL;
     37        ElementProperties* tria_properties=NULL;
     38        ElementProperties* penta_properties=NULL;
    3639
    3740        /*output: */
     
    4851        /*tria constructor input: */
    4952        int tria_id;
    50         int tria_mid;
    51         int tria_mparid;
    52         int tria_numparid;
    53         int tria_g[3];
     53        int tria_matice_id;
     54        int tria_matpar_id;
     55        int tria_numpar_id;
     56        int tria_node_ids[3];
    5457        double tria_h[3];
    5558        double tria_s[3];
    5659        double tria_b[3];
    57         double tria_k[3];
    58         double tria_melting[3];
    59         double tria_accumulation[3];
    60         double tria_geothermalflux[3];
    61         int    tria_friction_type;
    62         double tria_p;
    63         double tria_q;
    6460        int    tria_shelf;
    6561        bool   tria_onwater;
     
    7369
    7470        int penta_id;
    75         int penta_mid;
    76         int penta_mparid;
    77         int penta_numparid;
    78         int penta_g[6];
     71        int penta_matice_id;
     72        int penta_matpar_id;
     73        int penta_numpar_id;
     74        int penta_node_ids[6];
    7975        double penta_h[6];
    8076        double penta_s[6];
    8177        double penta_b[6];
    82         double penta_k[6];
    83         int penta_friction_type;
    84         double penta_p;
    85         double penta_q;
    8678        int penta_shelf;
    8779        int penta_onbed;
    8880        int penta_onsurface;
    8981        int penta_collapse;
    90         double penta_melting[6];
    91         double penta_accumulation[6];
    92         double penta_geothermalflux[6];
    93         int penta_thermal_steadystate;
    9482        bool   penta_onwater;
    9583
     
    191179                        /*ids: */
    192180                        tria_id=i+1; //matlab indexing.
    193                         tria_mid=-1; //no need for materials
    194                         tria_mparid=-1; //no need for materials
    195                         tria_numparid=1;
     181                        tria_matice_id=-1; //no need for materials
     182                        tria_matpar_id=-1; //no need for materials
     183                        tria_numpar_id=1;
    196184
    197185                        /*vertices offsets: */
    198                         tria_g[0]=(int)*(iomodel->elements+elements_width*i+0);
    199                         tria_g[1]=(int)*(iomodel->elements+elements_width*i+1);
    200                         tria_g[2]=(int)*(iomodel->elements+elements_width*i+2);
     186                        tria_node_ids[0]=(int)*(iomodel->elements+elements_width*i+0);
     187                        tria_node_ids[1]=(int)*(iomodel->elements+elements_width*i+1);
     188                        tria_node_ids[2]=(int)*(iomodel->elements+elements_width*i+2);
    201189
    202190                        /*thickness,surface and bed:*/
     
    217205                        tria_onwater=(bool)*(iomodel->elementonwater+i);
    218206
     207                        /*Create properties: */
     208                        tria_properties=new ElementProperties(3,tria_h, tria_s, tria_b, NULL, NULL, NULL, NULL, UNDEF, UNDEF, UNDEF, tria_shelf, UNDEF, tria_onwater, UNDEF, UNDEF, UNDEF);
     209
    219210                        /*Create tria element using its constructor:*/
    220                         tria=new Tria(tria_id, tria_mid, tria_mparid, tria_numparid,tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_onwater);
     211                        tria=new Tria(tria_id, tria_node_ids, tria_matice_id, tria_matpar_id, tria_numpar_id, tria_properties);
     212
     213                        /*Delete properties: */
     214                        delete tria_properties;
    221215
    222216                        /*Add tria element to elements dataset: */
     
    270264                        /*name and id: */
    271265                        penta_id=i+1; //matlab indexing.
    272                         penta_mid=-1;
    273                         penta_mparid=-1; //no need for materials
    274                         penta_numparid=1;
     266                        penta_matice_id=-1;
     267                        penta_matpar_id=-1; //no need for materials
     268                        penta_numpar_id=1;
    275269
    276270                        /*vertices,thickness,surface,bed and drag: */
    277271                        for(j=0;j<6;j++){
    278                                 penta_g[j]=(int)*(iomodel->elements+elements_width*i+j);
     272                                penta_node_ids[j]=(int)*(iomodel->elements+elements_width*i+j);
    279273                                penta_h[j]=*(iomodel->thickness+    ((int)*(iomodel->elements+elements_width*i+j)-1));
    280274                                penta_s[j]=*(iomodel->surface+    ((int)*(iomodel->elements+elements_width*i+j)-1));
     
    289283                        penta_onwater=(bool)*(iomodel->elementonwater+i);
    290284       
     285                        /*Create properties: */
     286                        penta_properties=new ElementProperties(6,penta_h, penta_s, penta_b, NULL, NULL, NULL, NULL, UNDEF, UNDEF, UNDEF, penta_shelf, penta_onbed, penta_onwater, penta_onsurface, penta_collapse, UNDEF);
    291287
    292288                        /*Create Penta using its constructor:*/
    293                         penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
    294                                         penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,
    295                                         penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,
    296                                         penta_thermal_steadystate,penta_onwater);
     289                        penta=new Penta(penta_id, penta_node_ids, penta_matice_id, penta_matpar_id, penta_numpar_id, penta_properties);
     290
     291                        /*Delete properties: */
     292                        delete penta_properties;
    297293
    298294                        /*Add penta element to elements dataset: */
Note: See TracChangeset for help on using the changeset viewer.