Changeset 4575


Ignore:
Timestamp:
07/13/10 21:32:42 (15 years ago)
Author:
Eric.Larour
Message:

New SetCurrentconfiguration routine to configure objects
when running in parallel. This avoids configuring Hooks
again and again.

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

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Container/DataSet.cpp

    r4554 r4575  
    587587}
    588588/*}}}*/
     589/*FUNCTION DataSet::SetCurrentConfiguration{{{1*/
     590void DataSet::SetCurrentConfiguration(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters){
     591
     592        vector<Object*>::iterator object;
     593        Element* element=NULL;
     594        Load* load=NULL;
     595        Node* node=NULL;
     596
     597        for ( object=objects.begin() ; object < objects.end(); object++ ){
     598
     599                if(EnumIsElement((*object)->Enum())){
     600
     601                        element=(Element*)(*object);
     602                        element->SetCurrentConfiguration(elements,loads,nodes,materials,parameters);
     603                }
     604                if(EnumIsLoad((*object)->Enum())){
     605                        load=(Load*)(*object);
     606                        load->SetCurrentConfiguration(elements,loads,nodes,vertices,materials,parameters);
     607                }
     608
     609                if((*object)->Enum()==NodeEnum){
     610                        node=(Node*)(*object);
     611                        node->SetCurrentConfiguration(nodes,vertices);
     612                }
     613        }
     614
     615}
     616/*}}}*/
  • issm/trunk/src/c/Container/DataSet.h

    r4236 r4575  
    5454                void  clear();
    5555                void  Configure(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters);
     56                void  SetCurrentConfiguration(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters);
    5657                Object* GetObjectByOffset(int offset);
    5758                Object* GetObjectById(int* poffset,int eid);
  • issm/trunk/src/c/objects/Elements/Beam.cpp

    r4548 r4575  
    234234/*FUNCTION Beam::Configure {{{1*/
    235235void  Beam::Configure(Elements* elementsin,Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
     236
     237        ISSMERROR(" not supported yet!");
     238
     239}
     240/*}}}*/
     241/*FUNCTION Beam::SetCurrentConfiguration {{{1*/
     242void  Beam::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
    236243
    237244        ISSMERROR(" not supported yet!");
  • issm/trunk/src/c/objects/Elements/Beam.h

    r4250 r4575  
    6666                void       ComputeStrainRate(Vec eps);
    6767                void       Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
     68                void       SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    6869                double     CostFunction(void);
    6970                void       CreateKMatrix(Mat Kgg);
  • issm/trunk/src/c/objects/Elements/Element.h

    r4248 r4575  
    2727       
    2828                virtual void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
     29                virtual void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
    2930                virtual void   CreateKMatrix(Mat Kgg)=0;
    3031                virtual void   CreatePVector(Vec pg)=0;
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r4569 r4575  
    650650
    651651        /*Now, go pick up the objects inside the hooks: */
     652        if (this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp();
     653        else this->nodes=NULL;
     654        this->matice=(Matice*)this->hmatice->delivers();
     655        this->matpar=(Matpar*)this->hmatpar->delivers();
     656        this->neighbors=(Penta**)this->hneighbors->deliverp();
     657
     658        /*point parameters to real dataset: */
     659        this->parameters=parametersin;
     660}
     661/*}}}*/
     662                /*FUNCTION Penta::SetCurrentConfiguration {{{1*/
     663void  Penta::SetCurrentConfiguration(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
     664
     665        int analysis_counter;
     666       
     667        /*go into parameters and get the analysis_counter: */
     668        parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
     669
     670        /*Pick up the objects inside the hooks: */
    652671        if (this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp();
    653672        else this->nodes=NULL;
  • issm/trunk/src/c/objects/Elements/Penta.h

    r4492 r4575  
    6969                void   ComputeStrainRate(Vec eps);
    7070                void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
     71                void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    7172                double CostFunction(void);
    7273                void   CreateKMatrix(Mat Kgg);
  • issm/trunk/src/c/objects/Elements/Sing.cpp

    r4548 r4575  
    204204/*FUNCTION Sing::Configure {{{1*/
    205205void  Sing::Configure(Elements* elementsin,Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
     206
     207        ISSMERROR(" not supported yet!");
     208
     209}
     210/*}}}*/
     211/*FUNCTION Sing::SetCurrentConfiguration {{{1*/
     212void  Sing::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
    206213
    207214        ISSMERROR(" not supported yet!");
  • issm/trunk/src/c/objects/Elements/Sing.h

    r4285 r4575  
    6666                void   ComputeStrainRate(Vec eps);
    6767                void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
     68                void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    6869                double CostFunction(void);
    6970                void   CreateKMatrix(Mat Kgg);
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r4572 r4575  
    495495        ISSMERROR("Not Implemented yet");
    496496        //VecSetValues(eps,1,2,(const double*)&value,INSERT_VALUES);
     497
     498}
     499/*}}}*/
     500/*FUNCTION Tria::SetCurrentConfiguration {{{1*/
     501void  Tria::SetCurrentConfiguration(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
     502
     503        int analysis_counter;
     504       
     505        /*go into parameters and get the analysis_counter: */
     506        parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
     507
     508        /*Pick up the objects inside the hooks: */
     509        if(this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp();
     510        else this->nodes=NULL;
     511        this->matice=(Matice*)this->hmatice->delivers();
     512        this->matpar=(Matpar*)this->hmatpar->delivers();
     513
     514        /*point parameters to real dataset: */
     515        this->parameters=parametersin;
    497516
    498517}
  • issm/trunk/src/c/objects/Elements/Tria.h

    r4492 r4575  
    6666                void   ComputeStrainRate(Vec eps);
    6767                void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
     68                void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    6869                double CostFunction(void);
    6970                void   CreateKMatrix(Mat Kgg);
  • issm/trunk/src/c/objects/FemModel.cpp

    r4573 r4575  
    174174
    175175        /*configure elements, loads and nodes, for this new analysis: */
    176         this->elements->  Configure(elements,loads, nodes,vertices, materials,parameters);
    177         this->nodes->     Configure(elements,loads, nodes,vertices, materials,parameters);
    178         this->loads->     Configure(elements, loads, nodes,vertices, materials,parameters);
     176        this->elements->SetCurrentConfiguration(elements,loads, nodes,vertices, materials,parameters);
     177        this->nodes->SetCurrentConfiguration(elements,loads, nodes,vertices, materials,parameters);
     178        this->loads->SetCurrentConfiguration(elements, loads, nodes,vertices, materials,parameters);
    179179
    180180}
  • issm/trunk/src/c/objects/Loads/Icefront.cpp

    r4546 r4575  
    271271/*FUNCTION Icefront::Configure {{{1*/
    272272void  Icefront::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
     273
     274        /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
     275         * datasets, using internal ids and offsets hidden in hooks: */
     276        hnodes->configure(nodesin);
     277        helement->configure(elementsin);
     278        hmatpar->configure(materialsin);
     279
     280        /*point parameters to real dataset: */
     281        this->parameters=parametersin;
     282}
     283/*}}}*/
     284/*FUNCTION Icefront::SetCurrentConfiguration {{{1*/
     285void  Icefront::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
    273286
    274287        /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
  • issm/trunk/src/c/objects/Loads/Icefront.h

    r4396 r4575  
    6060                /*Load virtual functions definitions: {{{1*/
    6161                void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
     62                void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    6263                void  CreateKMatrix(Mat Kgg);
    6364                void  CreatePVector(Vec pg);
  • issm/trunk/src/c/objects/Loads/Load.h

    r4248 r4575  
    2525                /*Virtual functions: {{{1*/
    2626                virtual void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
     27                virtual void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
    2728                virtual void  CreateKMatrix(Mat Kgg)=0;
    2829                virtual void  CreatePVector(Vec pg)=0;
  • issm/trunk/src/c/objects/Loads/Numericalflux.cpp

    r4546 r4575  
    291291}
    292292/*}}}*/
     293/*FUNCTION Numericalflux::SetCurrentConfiguration {{{1*/
     294void  Numericalflux::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
     295
     296        /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
     297         * datasets, using internal ids and offsets hidden in hooks: */
     298        hnodes->configure(nodesin);
     299        helement->configure(elementsin);
     300
     301        /*point parameters to real dataset: */
     302        this->parameters=parametersin;
     303
     304}
     305/*}}}*/
    293306/*FUNCTION Numericalflux::CreateKMatrix {{{1*/
    294307void  Numericalflux::CreateKMatrix(Mat Kgg){
  • issm/trunk/src/c/objects/Loads/Numericalflux.h

    r4433 r4575  
    5555                /*Load virtual functions definitions: {{{1*/
    5656                void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
     57                void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    5758                void  CreateKMatrix(Mat Kgg);
    5859                void  CreatePVector(Vec pg);
  • issm/trunk/src/c/objects/Loads/Pengrid.cpp

    r4546 r4575  
    243243/*FUNCTION Pengrid::Configure {{{1*/
    244244void  Pengrid::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
     245
     246        /*Take care of hooking up all objects for this load, ie links the objects in the hooks to their respective
     247         * datasets, using internal ids and offsets hidden in hooks: */
     248        hnode->configure(nodesin);
     249        helement->configure(elementsin);
     250        hmatpar->configure(materialsin);
     251
     252        /*point parameters to real dataset: */
     253        this->parameters=parametersin;
     254}
     255/*}}}1*/
     256/*FUNCTION Pengrid::SetCurrentConfiguration {{{1*/
     257void  Pengrid::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
    245258
    246259        /*Take care of hooking up all objects for this load, ie links the objects in the hooks to their respective
  • issm/trunk/src/c/objects/Loads/Pengrid.h

    r4492 r4575  
    6161                /*Load virtual functions definitions: {{{1*/
    6262                void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
     63                void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    6364                void  CreateKMatrix(Mat Kgg);
    6465                void  CreatePVector(Vec pg);
  • issm/trunk/src/c/objects/Loads/Penpair.cpp

    r4546 r4575  
    180180}
    181181/*}}}1*/
     182/*FUNCTION Penpair::SetCurrentConfiguration {{{1*/
     183void  Penpair::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
     184
     185        /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
     186         * datasets, using internal ids and offsets hidden in hooks: */
     187        hnodes->configure(nodesin);
     188
     189}
     190/*}}}1*/
    182191/*FUNCTION Penpair::CreateKMatrix {{{1*/
    183192void  Penpair::CreateKMatrix(Mat Kgg){
  • issm/trunk/src/c/objects/Loads/Penpair.h

    r4396 r4575  
    5252                        /*Load virtual functions definitions: {{{1*/
    5353                void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
     54                void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    5455                void  CreateKMatrix(Mat Kgg);
    5556                void  CreatePVector(Vec pg);
  • issm/trunk/src/c/objects/Loads/Riftfront.cpp

    r4546 r4575  
    281281/*FUNCTION Riftfront::Configure {{{1*/
    282282void  Riftfront::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
     283
     284        /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
     285         * datasets, using internal ids and offsets hidden in hooks: */
     286        hnodes->configure(nodesin);
     287        hmatpar->configure(materialsin);
     288
     289        /*point parameters to real dataset: */
     290        this->parameters=parametersin;
     291
     292}
     293/*}}}*/
     294/*FUNCTION Riftfront::SetCurrentConfiguration {{{1*/
     295void  Riftfront::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
    283296
    284297        /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
  • issm/trunk/src/c/objects/Loads/Riftfront.h

    r4396 r4575  
    7070                /*Load virtual functions definitions: {{{1*/
    7171                void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
     72                void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    7273                void  CreateKMatrix(Mat Kgg);
    7374                void  CreatePVector(Vec pg);
  • issm/trunk/src/c/objects/Node.cpp

    r4546 r4575  
    336336
    337337}
     338/*FUNCTION Node::SetCurrentConfiguration {{{1*/
     339void  Node::SetCurrentConfiguration(DataSet* nodesin,Vertices* verticesin){
     340
     341        int i;
     342
     343        /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
     344         * datasets, using internal ids and offsets hidden in hooks: */
     345        hvertex->configure(verticesin);
     346        hupper_node->configure(nodesin);
     347
     348}
    338349/*FUNCTION Node::GetDof {{{1*/
    339350int   Node::GetDof(int dofindex){
  • issm/trunk/src/c/objects/Node.h

    r4396 r4575  
    6363                /*Node numerical routines {{{1*/
    6464                void  Configure(DataSet* nodes,Vertices* vertices);
     65                void  SetCurrentConfiguration(DataSet* nodes,Vertices* vertices);
    6566                int   Sid(void);
    6667                int   GetVertexDof(void);
Note: See TracChangeset for help on using the changeset viewer.