Changeset 17266


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

CHG: removing inputs from NumericalFlux

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

Legend:

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

    r16042 r17266  
    2424
    2525        public:
    26 
    2726                virtual       ~Load(){};
    2827                virtual void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
  • issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp

    r17118 r17266  
    2323/*FUNCTION Numericalflux::Numericalflux(){{{*/
    2424Numericalflux::Numericalflux(){
    25         this->inputs     = NULL;
    2625        this->parameters = NULL;
    2726        this->helement   = NULL;
     
    112111        this->id=numericalflux_id;
    113112        this->analysis_type=in_analysis_type;
     113        this->flux_type = numericalflux_type;
    114114
    115115        /*Hooks: */
     
    118118        this->helement  =new Hook(numericalflux_elem_ids,1); // take only the first element for now
    119119
    120         //intialize  and add as many inputs per element as requested:
    121         this->inputs=new Inputs();
    122         this->inputs->AddInput(new IntInput(NumericalfluxTypeEnum,numericalflux_type));
    123 
    124120        //this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
    125121        this->parameters=NULL;
     
    130126/*FUNCTION Numericalflux::~Numericalflux(){{{*/
    131127Numericalflux::~Numericalflux(){
    132         delete inputs;
    133128        this->parameters=NULL;
    134129        delete helement;
     
    144139        _printf_("   id: " << id << "\n");
    145140        _printf_("   analysis_type: " << EnumToStringx(analysis_type) << "\n");
     141        _printf_("   flux_type: " << this->flux_type<< "\n");
    146142        hnodes->Echo();
    147143        hvertices->Echo();
    148144        helement->Echo();
    149145        _printf_("   parameters: " << parameters << "\n");
    150         _printf_("   inputs: " << inputs << "\n");
    151146}
    152147/*}}}*/
     
    157152        _printf_("   id: " << id << "\n");
    158153        _printf_("   analysis_type: " << EnumToStringx(analysis_type) << "\n");
     154        _printf_("   flux_type: " << this->flux_type<< "\n");
    159155        hnodes->DeepEcho();
    160156        hvertices->DeepEcho();
     
    165161        else
    166162         _printf_("      NULL\n");
    167         _printf_("   inputs\n");
    168         inputs->DeepEcho();
    169 
    170163}               
    171164/*}}}*/
     
    192185        numericalflux->id=this->id;
    193186        numericalflux->analysis_type=this->analysis_type;
    194         if(this->inputs){
    195                 numericalflux->inputs=(Inputs*)this->inputs->Copy();
    196         }
    197         else{
    198                 numericalflux->inputs=new Inputs();
    199         }
     187        numericalflux->flux_type=this->flux_type;
     188
    200189        /*point parameters: */
    201190        numericalflux->parameters=this->parameters;
     
    303292void Numericalflux::GetNodesSidList(int* sidlist){
    304293
    305         int type;
    306         inputs->GetInputValue(&type,NumericalfluxTypeEnum);
    307294        _assert_(sidlist);
    308295        _assert_(nodes);
    309296
    310         switch(type){
     297        switch(this->flux_type){
    311298                case InternalEnum:
    312299                        for(int i=0;i<NUMNODES_INTERNAL;i++) sidlist[i]=nodes[i]->Sid();
     
    316303                        return;
    317304                default:
    318                         _error_("Numericalflux type " << EnumToStringx(type) << " not supported yet");
     305                        _error_("Numericalflux type " << EnumToStringx(this->flux_type) << " not supported yet");
    319306        }
    320307}
     
    323310void Numericalflux::GetNodesLidList(int* lidlist){
    324311
    325         int type;
    326         inputs->GetInputValue(&type,NumericalfluxTypeEnum);
    327312        _assert_(lidlist);
    328313        _assert_(nodes);
    329314
    330         switch(type){
     315        switch(this->flux_type){
    331316                case InternalEnum:
    332317                        for(int i=0;i<NUMNODES_INTERNAL;i++) lidlist[i]=nodes[i]->Lid();
     
    336321                        return;
    337322                default:
    338                         _error_("Numericalflux type " << EnumToStringx(type) << " not supported yet");
     323                        _error_("Numericalflux type " << EnumToStringx(this->flux_type) << " not supported yet");
    339324        }
    340325}
     
    343328int Numericalflux::GetNumberOfNodes(void){
    344329
    345         int type;
    346         inputs->GetInputValue(&type,NumericalfluxTypeEnum);
    347 
    348         switch(type){
     330        switch(this->flux_type){
    349331                case InternalEnum:
    350332                        return NUMNODES_INTERNAL;
     
    352334                        return NUMNODES_BOUNDARY;
    353335                default:
    354                         _error_("Numericalflux type " << EnumToStringx(type) << " not supported yet");
     336                        _error_("Numericalflux type " << EnumToStringx(this->flux_type) << " not supported yet");
    355337        }
    356338
     
    444426ElementMatrix* Numericalflux::CreateKMatrixMasstransport(void){
    445427
    446         int type;
    447         inputs->GetInputValue(&type,NumericalfluxTypeEnum);
    448 
    449         switch(type){
     428        switch(this->flux_type){
    450429                case InternalEnum:
    451430                        return CreateKMatrixMasstransportInternal();
     
    597576ElementMatrix* Numericalflux::CreateKMatrixBalancethickness(void){
    598577
    599         int type;
    600         inputs->GetInputValue(&type,NumericalfluxTypeEnum);
    601 
    602         switch(type){
     578        switch(this->flux_type){
    603579                case InternalEnum:
    604580                        return CreateKMatrixBalancethicknessInternal();
     
    748724ElementMatrix* Numericalflux::CreateKMatrixAdjointBalancethickness(void){
    749725
    750         int type;
    751         inputs->GetInputValue(&type,NumericalfluxTypeEnum);
    752 
    753         switch(type){
     726        switch(this->flux_type){
    754727                case InternalEnum:
    755728                        return CreateKMatrixAdjointBalancethicknessInternal();
     
    780753ElementVector* Numericalflux::CreatePVectorMasstransport(void){
    781754
    782         int type;
    783         inputs->GetInputValue(&type,NumericalfluxTypeEnum);
    784 
    785         switch(type){
     755        switch(this->flux_type){
    786756                case InternalEnum:
    787757                        return CreatePVectorMasstransportInternal();
     
    874844ElementVector* Numericalflux::CreatePVectorBalancethickness(void){
    875845
    876         int type;
    877         inputs->GetInputValue(&type,NumericalfluxTypeEnum);
    878 
    879         switch(type){
     846        switch(this->flux_type){
    880847                case InternalEnum:
    881848                        return CreatePVectorBalancethicknessInternal();
  • issm/trunk-jpl/src/c/classes/Loads/Numericalflux.h

    r16783 r17266  
    2222                int id;
    2323                int analysis_type;
     24                int flux_type;
    2425
    2526                /*Hooks*/
     
    3334                Node       **nodes;
    3435                Parameters  *parameters;
    35                 Inputs      *inputs;
    3636
    3737                /*Numericalflux constructors,destructors {{{*/
  • issm/trunk-jpl/src/c/classes/Materials/Material.h

    r17248 r17266  
    1919        public:
    2020                Inputs*  inputs;
    21                 virtual       ~Material(){};
     21                virtual ~Material(){};
    2222                /*WARNING: input should not be public but it is an easy way to update B from T (using UpdateFromSolution) from Pentas*/
    2323
  • issm/trunk-jpl/src/c/classes/Materials/Matpar.cpp

    r17085 r17266  
    210210                        this->g=constant;
    211211                        break;
    212                 case  SurfaceforcingsDesfacEnum:
     212                case  SurfaceforcingsDesfacEnum:
    213213                        this->desfac=constant;
    214214                        break;
Note: See TracChangeset for help on using the changeset viewer.