Ignore:
Timestamp:
09/06/11 16:53:02 (14 years ago)
Author:
Mathieu Morlighem
Message:

Added material class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r9632 r9636  
    530530        Input* input=NULL;
    531531
    532         if(enum_type==RheologyBbarEnum){
     532        if(enum_type==MaterialsRheologyBbarEnum){
    533533                if(!IsOnBed()) return;
    534                 input=(Input*)matice->inputs->GetInput(RheologyBEnum);
     534                input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum);
    535535        }
    536536        else{
     
    549549        Input* input=NULL;
    550550
    551         if(enum_type==RheologyBbarEnum){
    552                 input=(Input*)matice->inputs->GetInput(RheologyBEnum);
     551        if(enum_type==MaterialsRheologyBbarEnum){
     552                input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum);
    553553        }
    554554        else{
     
    568568        Input* input=NULL;
    569569
    570         if(enum_type==RheologyBbarEnum){
    571                 input=(Input*)matice->inputs->GetInput(RheologyBEnum);
     570        if(enum_type==MaterialsRheologyBbarEnum){
     571                input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum);
    572572        }
    573573        else{
     
    12241224
    12251225        /*Depth Averaging B*/
    1226         this->InputDepthAverageAtBase(RheologyBEnum,RheologyBbarEnum,MaterialsEnum);
     1226        this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
    12271227
    12281228        /*Call Tria function*/
     
    12321232
    12331233        /*Delete B averaged*/
    1234         this->matice->inputs->DeleteInput(RheologyBbarEnum);
     1234        this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
    12351235
    12361236        /*clean up and return*/
     
    44294429                        break;
    44304430
    4431                 case RheologyBbarEnum:
     4431                case MaterialsRheologyBbarEnum:
    44324432                        inputs->GetParameterValue(&approximation,ApproximationEnum);
    44334433                        switch(approximation){
     
    46694669
    46704670        /*Depth Average B*/
    4671         this->InputDepthAverageAtBase(RheologyBEnum,RheologyBbarEnum,MaterialsEnum);
     4671        this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
    46724672
    46734673        /*Collapse element to the base*/
     
    46774677
    46784678        /*delete Average B*/
    4679         this->matice->inputs->DeleteInput(RheologyBbarEnum);
     4679        this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
    46804680
    46814681} /*}}}*/
     
    46874687
    46884688        /*Depth Average B*/
    4689         this->InputDepthAverageAtBase(RheologyBEnum,RheologyBbarEnum,MaterialsEnum);
     4689        this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
    46904690
    46914691        /*Collapse element to the base*/
     
    46954695
    46964696        /*delete Average B*/
    4697         this->matice->inputs->DeleteInput(RheologyBbarEnum);
     4697        this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
    46984698} /*}}}*/
    46994699/*FUNCTION Penta::GradjBbarStokes {{{1*/
     
    47044704
    47054705        /*Depth Average B*/
    4706         this->InputDepthAverageAtBase(RheologyBEnum,RheologyBbarEnum,MaterialsEnum);
     4706        this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
    47074707
    47084708        /*Collapse element to the base*/
     
    47124712
    47134713        /*delete Average B*/
    4714         this->matice->inputs->DeleteInput(RheologyBbarEnum);
     4714        this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
    47154715} /*}}}*/
    47164716/*FUNCTION Penta::Sid {{{1*/
     
    47854785        for(int i=0;i<num_controls;i++){
    47864786
    4787                 if(control_type[i]==RheologyBbarEnum){
     4787                if(control_type[i]==MaterialsRheologyBbarEnum){
    47884788                        if (!IsOnBed()) goto cleanup_and_return;
    4789                         input=(Input*)matice->inputs->GetInput(RheologyBEnum); _assert_(input);
     4789                        input=(Input*)matice->inputs->GetInput(MaterialsRheologyBEnum); _assert_(input);
    47904790                }
    47914791                else{
     
    47994799                if (save_parameter) ((ControlInput*)input)->SaveValue();
    48004800
    4801                 if(control_type[i]==RheologyBbarEnum){
    4802                         this->InputExtrude(RheologyBEnum,MaterialsEnum);
     4801                if(control_type[i]==MaterialsRheologyBbarEnum){
     4802                        this->InputExtrude(MaterialsRheologyBEnum,MaterialsEnum);
    48034803                }
    48044804        }
     
    50965096
    50975097        /*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */
    5098         if (enum_type==RheologyBbarEnum) input=this->matice->inputs->GetInput(RheologyBEnum);
     5098        if (enum_type==MaterialsRheologyBbarEnum) input=this->matice->inputs->GetInput(MaterialsRheologyBEnum);
    50995099        else input=this->inputs->GetInput(enum_type);
    51005100        //if (!input) _error_("Input %s not found in penta->inputs",EnumToStringx(enum_type)); why error out? if the requested input does not exist, we should still
     
    52045204                                        }
    52055205                                        break;
    5206                                 case RheologyBbarEnum:
     5206                                case MaterialsRheologyBbarEnum:
    52075207                                        /*Matice will take care of it*/ break;
    52085208                                default:
     
    62496249                /*Update Rheology only if converged (we must make sure that the temperature is below melting point
    62506250                 * otherwise the rheology could be negative*/
    6251                 this->parameters->FindParam(&rheology_law,RheologyLawEnum);
     6251                this->parameters->FindParam(&rheology_law,MaterialsRheologyLawEnum);
    62526252                switch(rheology_law){
    62536253                        case NoneEnum:
     
    62576257                                B_average=Paterson((values[0]+values[1]+values[2]+values[3]+values[4]+values[5])/6.0);
    62586258                                for(i=0;i<numdof;i++) B[i]=B_average;
    6259                                 this->matice->inputs->AddInput(new PentaVertexInput(RheologyBEnum,B));
     6259                                this->matice->inputs->AddInput(new PentaVertexInput(MaterialsRheologyBEnum,B));
    62606260                                break;
    62616261                        case ArrheniusEnum:
     
    62656265                                                        matice->GetN());
    62666266                                for(i=0;i<numdof;i++) B[i]=B_average;
    6267                                 this->matice->inputs->AddInput(new PentaVertexInput(RheologyBEnum,B));
     6267                                this->matice->inputs->AddInput(new PentaVertexInput(MaterialsRheologyBEnum,B));
    62686268                                break;
    62696269                        default:
     
    63246324                /*Update Rheology only if converged (we must make sure that the temperature is below melting point
    63256325                 * otherwise the rheology could be negative*/
    6326                 this->parameters->FindParam(&rheology_law,RheologyLawEnum);
     6326                this->parameters->FindParam(&rheology_law,MaterialsRheologyLawEnum);
    63276327                switch(rheology_law){
    63286328                        case NoneEnum:
     
    63326332                                B_average=Paterson((temperatures[0]+temperatures[1]+temperatures[2]+temperatures[3]+temperatures[4]+temperatures[5])/6.0);
    63336333                                for(i=0;i<numdof;i++) B[i]=B_average;
    6334                                 this->matice->inputs->AddInput(new PentaVertexInput(RheologyBEnum,B));
     6334                                this->matice->inputs->AddInput(new PentaVertexInput(MaterialsRheologyBEnum,B));
    63356335                                break;
    63366336                        case ArrheniusEnum:
     
    63406340                                                        matice->GetN());
    63416341                                for(i=0;i<numdof;i++) B[i]=B_average;
    6342                                 this->matice->inputs->AddInput(new PentaVertexInput(RheologyBEnum,B));
     6342                                this->matice->inputs->AddInput(new PentaVertexInput(MaterialsRheologyBEnum,B));
    63436343                                break;
    63446344                        default:
     
    70817081
    70827082        /*We have found the base under this. Call InputDepthAverageAtBase on it: */
    7083         base->InputDepthAverageAtBase(RheologyBEnum,RheologyBbarEnum,MaterialsEnum);
     7083        base->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
    70847084
    70857085        /*Ok, base->matice now has the Bbar. Ask Bbar from this enum: */
     
    75077507        iomodel->Constant(&dakota_analysis,DakotaAnalysisEnum);
    75087508        iomodel->Constant(&isstokes,IsstokesEnum);
    7509         iomodel->Constant(&beta,BetaEnum);
    7510         iomodel->Constant(&heatcapacity,HeatcapacityEnum);
     7509        iomodel->Constant(&beta,MaterialsBetaEnum);
     7510        iomodel->Constant(&heatcapacity,MaterialsHeatcapacityEnum);
    75117511        iomodel->Constant(&referencetemperature,ConstantsReferencetemperatureEnum);
    7512         iomodel->Constant(&meltingpoint,MeltingpointEnum);
    7513         iomodel->Constant(&latentheat,LatentheatEnum);
    7514 
     7512        iomodel->Constant(&meltingpoint,MaterialsMeltingpointEnum);
     7513        iomodel->Constant(&latentheat,MaterialsLatentheatEnum);
    75157514
    75167515        /*Checks if debuging*/
Note: See TracChangeset for help on using the changeset viewer.