Changeset 5714


Ignore:
Timestamp:
09/09/10 09:00:34 (15 years ago)
Author:
Mathieu Morlighem
Message:

IceFront now has its hooks and also their corresponding object to avoid calling deliver

Location:
issm/trunk/src/c/objects/Loads
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Loads/Icefront.cpp

    r5713 r5714  
    3030/*FUNCTION Icefront::Icefront() {{{1*/
    3131Icefront::Icefront(){
     32
    3233        this->inputs=NULL;
    3334        this->parameters=NULL;
     35
    3436        this->hnodes=NULL;
     37        this->nodes= NULL;
    3538        this->helement=NULL;
     39        this->element= NULL;
    3640        this->hmatpar=NULL;
     41        this->matpar= NULL;
    3742}
    3843/*}}}*/
     
    9398        this->inputs->AddInput(new IntInput(TypeEnum,in_icefront_type));
    9499       
    95         //this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
     100        //parameters and hooked fields: we still can't point to them, they may not even exist. Configure will handle this.
    96101        this->parameters=NULL;
     102        this->nodes= NULL;
     103        this->element= NULL;
     104        this->matpar= NULL;
    97105}
    98106
     
    218226        hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
    219227       
     228        /*pointers are garbabe, until configuration is carried out: */
     229        nodes=NULL;
     230        element=NULL;
     231        matpar=NULL;
     232
    220233        /*demarshall inputs: */
    221234        inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
     
    260273        icefront->hmatpar=(Hook*)this->hmatpar->copy();
    261274
     275        /*corresponding fields*/
     276        icefront->nodes  =(Node**)icefront->hnodes->deliverp();
     277        icefront->element=(Element*)icefront->helement->delivers();
     278        icefront->matpar =(Matpar*)icefront->hmatpar->delivers();
     279
    262280        return icefront;
    263281
     
    275293        hmatpar->configure(materialsin);
    276294
     295        /*Initialize hooked fields*/
     296        this->nodes  =(Node**)hnodes->deliverp();
     297        this->element=(Element*)helement->delivers();
     298        this->matpar =(Matpar*)hmatpar->delivers();
     299
    277300        /*point parameters to real dataset: */
    278301        this->parameters=parametersin;
     
    281304/*FUNCTION Icefront::SetCurrentConfiguration {{{1*/
    282305void  Icefront::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
    283 
    284306}
    285307/*}}}*/
     
    295317void  Icefront::CreatePVector(Vec pg){
    296318
     319        /*Checks in debugging mode*/
     320        ISSMASSERT(nodes);
     321        ISSMASSERT(element);
     322        ISSMASSERT(matpar);
     323
     324        /*Retrieve parameters: */
    297325        int analysis_type;
    298 
    299         /*Retrieve parameters: */
    300326        this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
    301327
     
    404430        /*Objects: */
    405431        double    pe_g[numdofs] = {0.0};
    406         Matpar   *matpar        = NULL;
    407         Node    **nodes         = NULL;
    408         Element  *element       = NULL;
    409432
    410433        /*Segment*/
     
    429452        Penta*  penta=NULL;
    430453
    431         /*Recover hook objects: */
    432         matpar =(Matpar*)hmatpar->delivers();
    433         element=(Element*)helement->delivers();
    434         nodes  =(Node**)hnodes->deliverp();
    435454        BeamRef* beam=NULL;
    436455
     
    539558        /*Objects: */
    540559        double  pe_g[numdofs]={0.0};
    541         Matpar* matpar=NULL;
    542560        Node**  element_nodes=NULL;
    543         Node**   nodes=NULL;
    544         Element* element=NULL;
    545561        int    element_type;
    546562               
     
    559575        double v45[3];
    560576
    561         /*Recover hook objects: */
    562         matpar=(Matpar*)hmatpar->delivers();
    563         element=(Element*)helement->delivers();
    564         nodes=(Node**)hnodes->deliverp();
    565577
    566578        element_type=element->Enum();
     
    675687        /*Objects: */
    676688        double  pe_g[numdofs]={0.0};
    677         Matpar* matpar=NULL;
    678689        Node**  element_nodes=NULL;
    679         Node**   nodes=NULL;
    680         Element* element=NULL;
    681690        Penta*   penta=NULL;
    682691
     
    696705        int approximation;
    697706
    698         /*Recover hook objects: */
    699         matpar=(Matpar*)hmatpar->delivers();
    700         element=(Element*)helement->delivers();
    701         nodes=(Node**)hnodes->deliverp();
    702 
    703707        /*check icefront is associated to a pentaelem: */
    704708        if(element->Enum()!=PentaEnum) ISSMERROR("Only Penta supported yet");
     
    806810        int* doflist=NULL;
    807811
    808         /*pointers: */
    809         Node**   nodes=NULL;
    810        
    811         /*recover pointers: */
    812         nodes=(Node**)hnodes->deliverp();
    813812       
    814813        /*recover type: */
     
    13681367        double value;
    13691368
    1370         /*dynamic objects pointed to by hooks: */
    1371         Element* element=NULL;
    1372         Node**   nodes=NULL;
    1373 
    1374         /*recover objects from hooks: */
    1375         element=(Element*)helement->delivers();
    1376         nodes=(Node**)hnodes->deliverp();
    1377 
    13781369        /*Get value on Element 1*/
    13791370        element->GetParameterValue(&value,nodes[0],nodes[1],gauss_coord,input_in);
  • issm/trunk/src/c/objects/Loads/Icefront.h

    r5713 r5714  
    1212class Inputs;
    1313class Parameters;
     14class Matpar;
     15class Node;
     16class Element;
    1417class IoModel;
    1518/*}}}*/
     
    2528                Hook* helement;
    2629                Hook* hmatpar;
     30
     31                /*Corresponding fields*/
     32                Matpar   *matpar;
     33                Node    **nodes;
     34                Element  *element;
    2735
    2836                /*inputs and parameters: */
Note: See TracChangeset for help on using the changeset viewer.