Changeset 17269


Ignore:
Timestamp:
02/12/14 15:47:44 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: removing inputs from Riftfront

Location:
issm/trunk-jpl/src/c/classes/Loads
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Loads/Numericalflux.h

    r17266 r17269  
    1010class Hook;
    1111class Parameters;
    12 class Inputs;
    1312class IoModel;
    1413class Element;
  • issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp

    r16539 r17269  
    2222/*FUNCTION Riftfront::Riftfront(){{{*/
    2323Riftfront::Riftfront(){
    24         this->inputs=NULL;
    2524        this->parameters=NULL;
    2625        this->hnodes=NULL;
     
    9089        this->state=reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+11));
    9190
    92         //intialize inputs, and add as many inputs per element as requested:
    93         this->inputs=new Inputs();
    94 
    95         riftfront_type=SegmentRiftfrontEnum;
    96         riftfront_fill = reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+7));
    97         riftfront_friction=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+8);
    98         riftfront_fractionincrement=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+10);
    99         riftfront_shelf=reCast<bool,IssmDouble>(iomodel->Data(MaskGroundediceLevelsetEnum)[node1-1]<0.);
    100 
    101         this->inputs->AddInput(new IntInput(RiftfrontTypeEnum,riftfront_type));
    102         this->inputs->AddInput(new IntInput(FillEnum,riftfront_fill));
    103         this->inputs->AddInput(new DoubleInput(FrictionEnum,riftfront_friction));
    104         this->inputs->AddInput(new DoubleInput(FractionIncrementEnum,riftfront_fractionincrement));
    105         this->inputs->AddInput(new BoolInput(SegmentOnIceShelfEnum,riftfront_shelf));
     91        //intialize properties
     92        this->type=SegmentRiftfrontEnum;
     93        this->fill = reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+7));
     94        this->friction=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+8);
     95        this->fractionincrement=*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+10);
     96        this->shelf=reCast<bool,IssmDouble>(iomodel->Data(MaskGroundediceLevelsetEnum)[node1-1]<0.);
    10697
    10798        //parameters and hooked fields: we still can't point to them, they may not even exist. Configure will handle this.
     
    115106/*FUNCTION Riftfront::~Riftfront(){{{*/
    116107Riftfront::~Riftfront(){
    117         delete inputs;
    118108        this->parameters=NULL;
    119 
    120109        delete hnodes;
    121110        delete helements;
     
    127116/*FUNCTION Riftfront::Echo {{{*/
    128117void Riftfront::Echo(void){
    129 
    130         Input* input=NULL;
    131         int fill;
    132         IssmDouble friction,fractionincrement;
    133 
    134         /*recover some inputs first: */
    135         input=(Input*)this->inputs->GetInput(FillEnum); input->GetInputValue(&fill);
    136         input=(Input*)this->inputs->GetInput(FrictionEnum); input->GetInputValue(&friction);
    137         input=(Input*)this->inputs->GetInput(FractionIncrementEnum); input->GetInputValue(&fractionincrement);
    138118
    139119        _printf_("Riftfront:\n");
     
    144124        _printf_("   hmatpar: " << hmatpar << "\n");
    145125        _printf_("   parameters: " << parameters << "\n");
    146         _printf_("   inputs: " << inputs << "\n");
    147126        _printf_("   internal parameters: \n");
    148127        _printf_("   normal: " << normal[0] << "|" << normal[1] << "\n");
     
    173152        _printf_("   parameters\n");
    174153        if(parameters)parameters->DeepEcho();
    175         _printf_("   inputs\n");
    176         if(inputs)inputs->DeepEcho();
    177154}
    178155/*}}}*/
     
    197174        riftfront->id=this->id;
    198175        riftfront->analysis_type=this->analysis_type;
    199         if(this->inputs){
    200                 riftfront->inputs=(Inputs*)this->inputs->Copy();
    201         }
    202         else{
    203                 riftfront->inputs=new Inputs();
    204         }
     176        riftfront->type=this->type;
     177        riftfront->fill=this->fill;
     178        riftfront->friction=this->friction;
     179        riftfront->fractionincrement=this->fractionincrement;
     180        riftfront->shelf=this->shelf;
     181
    205182        /*point parameters: */
    206183        riftfront->parameters=this->parameters;
     
    237214/*FUNCTION Riftfront::InputUpdateFromConstant(bool constant,int name) {{{*/
    238215void  Riftfront::InputUpdateFromConstant(bool constant,int name){
    239 
    240         /*Check that name is a Riftfront input*/
    241         if (!IsInput(name)) return;
    242 
    243         /*update input*/
    244         this->inputs->AddInput(new BoolInput(name,constant));
    245 
    246216}
    247217/*}}}*/
     
    249219void  Riftfront::InputUpdateFromConstant(IssmDouble constant,int name){
    250220
    251         /*Check that name is a Riftfront input*/
    252         if (!IsInput(name)) return;
    253 
    254         /*update input*/
    255         this->inputs->AddInput(new DoubleInput(name,constant));
    256 
    257221}
    258222/*}}}*/
     
    260224void    Riftfront::InputUpdateFromVector(IssmDouble* vector, int name, int type){
    261225
    262         /*Check that name is a Riftfront input*/
    263         if (!IsInput(name)) return;
    264 
    265         /*update input*/
    266226        _error_("not implemented yet");
    267         //this->inputs->AddInput(new DoubleInput(name,constant));
    268227
    269228}
     
    458417        IssmDouble  h[2];
    459418        IssmDouble  penalty_offset;
    460         IssmDouble  friction;
    461419
    462420        /*Objects: */
     
    475433        /*Get some parameters: */
    476434        this->parameters->FindParam(&penalty_offset,StressbalancePenaltyFactorEnum);
    477         this->inputs->GetInputValue(&friction,FrictionEnum);
    478435        tria1->GetInputValue(&h[0],nodes[0],ThicknessEnum);
    479436        tria2->GetInputValue(&h[1],nodes[1],ThicknessEnum);
     
    547504        IssmDouble pressure_melange;
    548505        IssmDouble pressure_water;
    549         int        fill;
    550         bool       shelf;
    551506
    552507        /*Objects: */
     
    564519
    565520        /*Get some inputs: */
    566         this->inputs->GetInputValue(&fill,FillEnum);
    567         this->inputs->GetInputValue(&shelf,SegmentOnIceShelfEnum);
    568521        rho_ice=matpar->GetRhoIce();
    569522        rho_water=matpar->GetRhoWater();
     
    642595        IssmDouble  vx2;
    643596        IssmDouble  vy2;
    644         IssmDouble  fractionincrement;
    645597
    646598        /*Objects: */
     
    671623                return 1;
    672624        }
    673 
    674         /*recover parameters: */
    675         this->inputs->GetInputValue(&fractionincrement,FractionIncrementEnum);
    676625
    677626        /*First recover velocity: */
     
    734683}
    735684/*}}}*/
    736 /*FUNCTION Riftfront::IsInput{{{*/
    737 bool Riftfront::IsInput(int name){
    738         if (
    739                                 name==ConvergedEnum ||
    740                                 name==ThicknessEnum ||
    741                                 name==SurfaceEnum ||
    742                                 name==BedEnum
    743                 ){
    744                 return true;
    745         }
    746         else return false;
    747 }
    748 /*}}}*/
  • issm/trunk-jpl/src/c/classes/Loads/Riftfront.h

    r16783 r17269  
    1111class Hook;
    1212class Parameters;
    13 class Inputs;
    1413class IoModel;
    1514/*}}}*/
     
    2019                int             id;
    2120                int     analysis_type;
     21
     22                /*properties*/
     23                int        type;
     24                int        fill;
     25                IssmDouble friction;
     26                IssmDouble fractionincrement;
     27                bool       shelf;
    2228
    2329                /*hooks: */
     
    4450
    4551                Parameters *parameters;           //pointer to solution parameters
    46                 Inputs     *inputs;
    4752
    4853                /*Riftfrontconstructors,destructors: {{{*/
     
    8994                void  FreezeConstraints(void);
    9095                bool  IsFrozen(void);
    91                 bool  IsInput(int name);
    9296                /*}}}*/
    9397};
Note: See TracChangeset for help on using the changeset viewer.