Ignore:
Timestamp:
10/08/10 16:49:12 (14 years ago)
Author:
Mathieu Morlighem
Message:

Prepared ISSM for multivariable CM, Added modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Materials/Matice.cpp

    r6200 r6213  
    5757
    5858                /*Control Inputs*/
    59                 if (iomodel->control_analysis){
    60                         switch(iomodel->control_type){
    61                                 case RheologyBbarEnum:
    62                                         if (iomodel->rheology_B){
    63                                                 for(i=0;i<num_vertices;i++)nodeinputs[i]=iomodel->rheology_B[int(iomodel->elements[num_vertices*index+i]-1)];
    64                                                 this->inputs->AddInput(new ControlInput(RheologyBbarEnum,TriaVertexInputEnum,nodeinputs));
    65                                         }
    66                                         break;
    67                                 default:
    68                                         /*Nothing*/;
     59                if (iomodel->control_analysis && iomodel->control_type){
     60                        for(i=0;i<iomodel->num_control_type;i++){
     61                                switch((int)iomodel->control_type[i]){
     62                                        case RheologyBbarEnum:
     63                                                if (iomodel->rheology_B){
     64                                                        for(i=0;i<num_vertices;i++)nodeinputs[i]=iomodel->rheology_B[int(iomodel->elements[num_vertices*index+i]-1)];
     65                                                        this->inputs->AddInput(new ControlInput(RheologyBbarEnum,TriaVertexInputEnum,nodeinputs));
     66                                                }
     67                                                break;
     68                                }
    6969                        }
    7070                }
     
    9191
    9292                /*Control Inputs*/
    93                 if (iomodel->control_analysis){
    94                         switch(iomodel->control_type){
    95                                 case RheologyBbarEnum:
    96                                         if (iomodel->rheology_B){
    97                                                 for(i=0;i<num_vertices;i++)nodeinputs[i]=iomodel->rheology_B[int(iomodel->elements[num_vertices*index+i]-1)];
    98                                                 this->inputs->AddInput(new ControlInput(RheologyBEnum,PentaVertexInputEnum,nodeinputs));
    99                                         }
    100                                         break;
     93                if (iomodel->control_analysis && iomodel->control_type){
     94                        for(i=0;i<iomodel->num_control_type;i++){
     95                                switch((int)iomodel->control_type[i]){
     96                                        case RheologyBbarEnum:
     97                                                if (iomodel->rheology_B){
     98                                                        for(i=0;i<num_vertices;i++)nodeinputs[i]=iomodel->rheology_B[int(iomodel->elements[num_vertices*index+i]-1)];
     99                                                        this->inputs->AddInput(new ControlInput(RheologyBEnum,PentaVertexInputEnum,nodeinputs));
     100                                                }
     101                                                break;
     102                                }
    101103                        }
    102104                }
     
    246248
    247249        return matice;
     250}
     251/*}}}*/
     252/*FUNCTION Matice::Update{{{1*/
     253void Matice::Update(int index, IoModel* iomodel){
     254
     255        int i,j;
     256
     257        /*if 2d*/
     258        if(iomodel->dim==2){
     259
     260                /*Intermediaries*/
     261                const int num_vertices = 3; //Tria has 3 vertices
     262                double    nodeinputs[num_vertices];
     263
     264                /*Control Inputs*/
     265                if (iomodel->control_analysis && iomodel->control_type){
     266                        for(i=0;i<iomodel->num_control_type;i++){
     267                                switch((int)iomodel->control_type[i]){
     268                                        case RheologyBbarEnum:
     269                                                if (iomodel->rheology_B){
     270                                                        for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->rheology_B[int(iomodel->elements[num_vertices*index+j]-1)];
     271                                                        this->inputs->AddInput(new ControlInput(RheologyBbarEnum,TriaVertexInputEnum,nodeinputs));
     272                                                }
     273                                                break;
     274                                }
     275                        }
     276                }
     277        }
     278
     279        /*if 3d*/
     280        else if(iomodel->dim==3){
     281
     282                /*Intermediaries*/
     283                const int num_vertices = 6; //Penta has 6 vertices
     284                double    nodeinputs[num_vertices];
     285
     286                /*Control Inputs*/
     287                if (iomodel->control_analysis && iomodel->control_type){
     288                        for(i=0;i<iomodel->num_control_type;i++){
     289                                switch((int)iomodel->control_type[i]){
     290                                        case RheologyBbarEnum:
     291                                                if (iomodel->rheology_B){
     292                                                        for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->rheology_B[int(iomodel->elements[num_vertices*index+j]-1)];
     293                                                        this->inputs->AddInput(new ControlInput(RheologyBEnum,PentaVertexInputEnum,nodeinputs));
     294                                                }
     295                                                break;
     296                                }
     297                        }
     298                }
     299        }
     300        else{
     301                ISSMERROR(" Mesh type not supported yet!");
     302        }
     303
     304        return;
    248305}
    249306/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.