Changeset 3732


Ignore:
Timestamp:
05/12/10 08:19:37 (15 years ago)
Author:
Eric.Larour
Message:

Bulk of solutions

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

Legend:

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

    r3717 r3732  
    13651365}
    13661366/*}}}*/
     1367/*FUNCTION DataSet::UpdateInputsFromConstant{{{1*/
     1368void  DataSet::UpdateInputsFromConstant(double constant, int name){
     1369
     1370        vector<Object*>::iterator object;
     1371        for ( object=objects.begin() ; object < objects.end(); object++ ){
     1372                (*object)->UpdateInputsFromConstant(constant,name);
     1373        }
     1374}
     1375/*}}}*/
     1376/*FUNCTION DataSet::UpdateInputsFromConstant{{{1*/
     1377void  DataSet::UpdateInputsFromConstant(int constant, int name){
     1378
     1379        vector<Object*>::iterator object;
     1380        for ( object=objects.begin() ; object < objects.end(); object++ ){
     1381                (*object)->UpdateInputsFromConstant(constant,name);
     1382        }
     1383}
     1384/*}}}*/
     1385/*FUNCTION DataSet::UpdateInputsFromConstant{{{1*/
     1386void  DataSet::UpdateInputsFromConstant(bool constant, int name){
     1387
     1388        vector<Object*>::iterator object;
     1389        for ( object=objects.begin() ; object < objects.end(); object++ ){
     1390                (*object)->UpdateInputsFromConstant(constant,name);
     1391        }
     1392}
     1393/*}}}*/
    13671394/*FUNCTION DataSet::UpdateInputsFromVector{{{1*/
    13681395void  DataSet::UpdateInputsFromVector(double* vec, int name, int type){
    13691396
    13701397        vector<Object*>::iterator object;
    1371        
    1372         Element* element=NULL;
    1373         Node* node=NULL;
    1374         Vertex* vertex=NULL;
    1375         Load* load=NULL;
    1376         Material* material=NULL;
    1377         Param* param=NULL;
    1378 
    1379         for ( object=objects.begin() ; object < objects.end(); object++ ){
    1380 
    1381                 if(EnumIsElement((*object)->Enum())){
    1382 
    1383                         element=(Element*)(*object);
    1384                         element->UpdateInputsFromVector(vec,name,type);
    1385                 }
    1386                 else if(((*object)->Enum()==NodeEnum)){
    1387 
    1388                         node=(Node*)(*object);
    1389                         node->UpdateInputsFromVector(vec,name,type);
    1390                 }
    1391                 else if(((*object)->Enum()==VertexEnum)){
    1392 
    1393                         vertex=(Vertex*)(*object);
    1394                         vertex->UpdateInputsFromVector(vec,name,type);
    1395                 }
    1396                 else if(EnumIsLoad((*object)->Enum())){
    1397 
    1398                         load=(Load*)(*object);
    1399                         load->UpdateInputsFromVector(vec,name,type);
    1400                 }
    1401                 else if(EnumIsMaterial((*object)->Enum())){
    1402 
    1403                         material=(Material*)(*object);
    1404                         material->UpdateInputsFromVector(vec,name,type);
    1405                 }
    1406                 else if(((*object)->Enum()==ParamEnum)){
    1407 
    1408                         param=(Param*)(*object);
    1409                         param->UpdateInputsFromVector(vec,name,type);
    1410                 }
    1411                 else ISSMERROR("%s%i%s"," object with id: ",(*object)->Id()," is not an element, in a function that deals only with elements!");
     1398        for ( object=objects.begin() ; object < objects.end(); object++ ){
     1399
     1400                (*object)->UpdateInputsFromVector(vec,name,type);
    14121401        }
    14131402}
  • issm/trunk/src/c/DataSet/DataSet.h

    r3717 r3732  
    7171                void  CreateKMatrix(Mat Kgg, int analysis_type,int sub_analysis_type);
    7272                void  CreatePVector(Vec pg, int analysis_type,int sub_analysis_type);
     73                void  UpdateInputsFromConstant(double constant, int name);
     74                void  UpdateInputsFromConstant(int constant, int name);
     75                void  UpdateInputsFromConstant(bool constant, int name);
    7376                void  UpdateInputsFromVector(double* vector,int name, int type);
    7477                void  UpdateInputsFromSolution(double* solution,int analysis_type,int sub_analysis_type);
     
    137140                void GetStrainRate(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum);
    138141                void GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int yenum);
     142
     143                void ChangeEnum(int enumtype,int new_enumtype);
    139144                /*}}}*/
    140145
     
    154159                /*}}}*/
    155160                /*numerics: {{{1*/
     161                int   FindParam(bool* pinteger,int enum_type);
     162                int   FindParam(int* pinteger,int enum_type);
    156163                int   FindParam(double* pscalar, int enum_type);
    157                 int   FindParam(int* pinteger,int enum_type);
    158164                int   FindParam(char** pstring,int enum_type);
    159165                int   FindParam(char*** pstringarray,int* pM,int enum_type);
  • issm/trunk/src/c/DataSet/Inputs.cpp

    r3702 r3732  
    2323using namespace std;
    2424/*}}}*/
    25 /*Inputs: {{{1*/
    2625
    2726/*Object constructors and destructor*/
    28 /*FUNCTION Inputs::Inputs(){{{2*/
     27/*FUNCTION Inputs::Inputs(){{{1*/
    2928Inputs::Inputs(){
    3029        return;
    3130}
    3231/*}}}*/
    33 /*FUNCTION Inputs::Inputs(int in_enum){{{2*/
     32/*FUNCTION Inputs::Inputs(int in_enum){{{1*/
    3433Inputs::Inputs(int in_enum): DataSet(in_enum) {
    3534        //do nothing;
     
    3736}
    3837/*}}}*/
    39 /*FUNCTION Inputs::~Inputs(){{{2*/
     38/*FUNCTION Inputs::~Inputs(){{{1*/
    4039Inputs::~Inputs(){
    4140        return;
     
    4443
    4544/*Object management*/
    46 /*FUNCTION Inputs::GetParameterValue(double* pvalue,double* gauss,int enum_type){{{2*/
     45/*FUNCTION Inputs::GetParameterValue(double* pvalue,double* gauss,int enum_type){{{1*/
    4746void Inputs::GetParameterValue(double* pvalue,double* gauss, int enum_type){
    4847
     
    6867}
    6968/*}}}*/
    70 /*FUNCTION Inputs::GetParameterValue(double* pvalue,double* gauss,int enum_type,double defaultvalue){{{2*/
     69/*FUNCTION Inputs::GetParameterValue(double* pvalue,double* gauss,int enum_type,double defaultvalue){{{1*/
    7170void Inputs::GetParameterValue(double* pvalue,double* gauss, int enum_type,double defaultvalue){
    7271
     
    9089}
    9190/*}}}*/
    92 /*FUNCTION Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type){{{2*/
     91/*FUNCTION Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type){{{1*/
    9392void Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type){
    9493
     
    114113}
    115114/*}}}*/
    116 /*FUNCTION Inputs::GetParameterValue(double* pvalue, Node* node, int enum_type){{{2*/
     115/*FUNCTION Inputs::GetParameterValue(double* pvalue, Node* node, int enum_type){{{1*/
    117116void Inputs::GetParameterValue(double* pvalue,Node* node,int enum_type){
    118117
     
    139138}
    140139/*}}}*/
    141 /*FUNCTION Inputs::GetParameterValue(double* pvalue, Node* node1, Node* node2,int enum_type){{{2*/
     140/*FUNCTION Inputs::GetParameterValue(double* pvalue, Node* node1, Node* node2,int enum_type){{{1*/
    142141void Inputs::GetParameterValue(double* pvalue,Node* node1, Node* node2,double gauss_coord,int enum_type){
    143142
     
    164163}
    165164/*}}}*/
    166 /*FUNCTION Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){{{2*/
     165/*FUNCTION Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){{{1*/
    167166void Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){
    168167
     
    188187}
    189188/*}}}*/
    190 /*FUNCTION Inputs::GetParameterValue(bool* pvalue,int enum-type){{{2*/
     189/*FUNCTION Inputs::GetParameterValue(bool* pvalue,int enum-type){{{1*/
    191190void Inputs::GetParameterValue(bool* pvalue,int enum_type){
    192191
     
    212211}
    213212/*}}}*/
    214 /*FUNCTION Inputs::GetParameterValue(int* pvalue,int enum-type){{{2*/
     213/*FUNCTION Inputs::GetParameterValue(int* pvalue,int enum-type){{{1*/
    215214void Inputs::GetParameterValue(int* pvalue,int enum_type){
    216215
     
    236235}
    237236/*}}}*/
    238 /*FUNCTION Inputs::GetParameterValue(double* pvalue,int enum-type){{{2*/
     237/*FUNCTION Inputs::GetParameterValue(double* pvalue,int enum-type){{{1*/
    239238void Inputs::GetParameterValue(double* pvalue,int enum_type){
    240239
     
    260259}
    261260/*}}}*/
    262 /*FUNCTION Inputs::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss,int enum_type){{{2*/
     261/*FUNCTION Inputs::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss,int enum_type){{{1*/
    263262void Inputs::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss,int enum_type){
    264263
     
    283282}
    284283/*}}}*/
    285 /*FUNCTION Inputs::GetStrainRate(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum){{{2*/
     284/*FUNCTION Inputs::GetStrainRate(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum){{{1*/
    286285void Inputs::GetStrainRate(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum){
    287286
     
    312311}
    313312/*}}}*/
    314 /*FUNCTION Inputs::GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){{{2*/
     313/*FUNCTION Inputs::GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){{{1*/
    315314void Inputs::GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){
    316315
     
    347346}
    348347/*}}}*/
    349 /*FUNCTION Inputs::AddInput{{{2*/
     348/*FUNCTION Inputs::AddInput{{{1*/
    350349int  Inputs::AddInput(Input* in_input){
    351350
     
    368367}
    369368/*}}}*/
    370 
    371 /*Object functions*/
    372 
    373 
    374 /*}}}*/
     369/*FUNCTION Inputs::ChangeEnum{{{1*/
     370void  Inputs::ChangeEnum(int enumtype,int newenumtype){
     371
     372        /*Go through dataset of inputs and look for input with
     373         * same enum as input enum, once found, just change its name */
     374        vector<Object*>::iterator object;
     375        Input* input=NULL;
     376
     377        for ( object=objects.begin() ; object < objects.end(); object++ ){
     378
     379                input=(Input*)(*object);
     380
     381                if (input->EnumType()==enumtype){
     382                        input->ChangeEnum(newenumtype);
     383                        break;
     384                }
     385        }
     386}
     387/*}}}*/
  • issm/trunk/src/c/DataSet/Parameters.cpp

    r3702 r3732  
    4545
    4646/*Object management*/
     47/*FUNCTION Parameters::FindParam(bool* pbool,int enum_type){{{2*/
     48int   Parameters::FindParam(bool* pbool,int enum_type){
     49       
     50       
     51        /*Go through a dataset, and find a Param* object
     52         *which parameter name is "name" : */
     53       
     54        vector<Object*>::iterator object;
     55        Param* param=NULL;
     56
     57        int found=0;
     58
     59        for ( object=objects.begin() ; object < objects.end(); object++ ){
     60
     61                /*Find param type objects: */
     62                if((*object)->Enum()==ParamEnum){
     63
     64                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     65                        param=(Param*)(*object);
     66
     67                        if(param->EnumType()==enum_type){
     68                                /*Ok, this is the one! Recover the value of this parameter: */
     69                                param->GetParameterValue(pbool);
     70                                found=1;
     71                                break;
     72                        }
     73                }
     74        }
     75        return found;
     76}
     77/*}}}*/
     78/*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{2*/
     79int   Parameters::FindParam(int* pinteger,int enum_type){
     80       
     81       
     82        /*Go through a dataset, and find a Param* object
     83         *which parameter name is "name" : */
     84       
     85        vector<Object*>::iterator object;
     86        Param* param=NULL;
     87
     88        int found=0;
     89
     90        for ( object=objects.begin() ; object < objects.end(); object++ ){
     91
     92                /*Find param type objects: */
     93                if((*object)->Enum()==ParamEnum){
     94
     95                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     96                        param=(Param*)(*object);
     97
     98                        if(param->EnumType()==enum_type){
     99                                /*Ok, this is the one! Recover the value of this parameter: */
     100                                param->GetParameterValue(pinteger);
     101                                found=1;
     102                                break;
     103                        }
     104                }
     105        }
     106        return found;
     107}
     108/*}}}*/
    47109/*FUNCTION Parameters::FindParam(double* pscalar, int enum_type){{{2*/
    48110int   Parameters::FindParam(double* pscalar, int enum_type){
     
    75137}
    76138/*}}}*/
    77 /*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{2*/
    78 int   Parameters::FindParam(int* pinteger,int enum_type){
    79        
    80        
    81         /*Go through a dataset, and find a Param* object
    82          *which parameter name is "name" : */
    83        
    84         vector<Object*>::iterator object;
    85         Param* param=NULL;
    86 
    87         int found=0;
    88 
    89         for ( object=objects.begin() ; object < objects.end(); object++ ){
    90 
    91                 /*Find param type objects: */
    92                 if((*object)->Enum()==ParamEnum){
    93 
    94                         /*Ok, this object is a parameter, recover it and ask which name it has: */
    95                         param=(Param*)(*object);
    96 
    97                         if(param->EnumType()==enum_type){
    98                                 /*Ok, this is the one! Recover the value of this parameter: */
    99                                 param->GetParameterValue(pinteger);
    100                                 found=1;
    101                                 break;
    102                         }
    103                 }
    104         }
    105         return found;
    106 }
    107 /*}}}*/
    108139/*FUNCTION Parameters::FindParam(char** pstring,int enum_type){{{2*/
    109140int   Parameters::FindParam(char** pstring,int enum_type){
  • issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp

    r3725 r3732  
    2424        parameters->AddObject(new   BoolParam(ControlAnalysisEnum,iomodel->control_analysis));
    2525        if(iomodel->control_analysis){
    26                 parameters->AddObject(new   StringParam(ControlTypeEnum,iomodel->control_type));
    2726
    28                 if (strcmp(iomodel->control_type,"drag")==0)
    29                  parameters->AddObject(new BoolParam(ExtrudeParamEnum,false));
    30                 else  if (strcmp(iomodel->control_type,"B")==0)
    31                  parameters->AddObject(new BoolParam(ExtrudeParamEnum,true));
     27                if (strcmp(iomodel->control_type,"drag")==0){
     28                        parameters->AddObject(new BoolParam(ExtrudeParamEnum,false));
     29                        parameters->AddObject(new IntParam(ControlTypeEnum,DragCoefficientEnum));
     30                }
     31                else  if (strcmp(iomodel->control_type,"B")==0){
     32                        parameters->AddObject(new BoolParam(ExtrudeParamEnum,true));
     33                        parameters->AddObject(new IntParam(ControlTypeEnum,RheologyBEnum));
     34                }
    3235                else
    3336                 ISSMERROR("control_type %s not supported yet!",iomodel->control_type);
  • issm/trunk/src/c/Qmux/DakotaResponses.cpp

    r3722 r3732  
    252252
    253253                        /*Recover some parameters: */
    254                         femmodel->parameters->FindParam(&numberofdofspernode,NumberOfDofsPernodeEnum);
     254                        femmodel->parameters->FindParam(&numberofdofspernode,NumberOfDofsPerNodeEnum);
    255255                        femmodel->parameters->FindParam(&numberofnodes,NumberOfNodesEnum);
    256256                        femmodel->parameters->FindParam(&fit,NULL,NULL,FitEnum);
     
    267267                        femmodel->elements->UpdateInputsFromVector(vy,VyEnum,VertexEnum);
    268268                        femmodel->elements->UpdateInputsFromVector(vz,VzEnum,VertexEnum);
    269                         femmodel->elements->UpdateInputsFromVector(fit[0],FitEnum,ConstantEnum);
     269                        femmodel->elements->UpdateInputsFromVector(&fit[0],FitEnum,ConstantEnum);
    270270
    271271                        /*Compute misfit: */
     
    317317
    318318                        /*retrieve qmu_mass_flux_segments: */
    319                         param=(Param*)femmodel->parameters->FindParamObject(QmuMassFluxSegmentsEnum);
    320                         if(!param)ISSMERROR(" could not find qmu_mass_flux_segments to compute mass_flux");
    321                        
    322                         param->GetParameterValue(&segments);
    323                         num_segments=param->GetM();
     319                        femmodel->parameters->FindParam(&segments,&num_segments,QmuMassFluxSegmentsEnum);
    324320
    325321                        /*call mass flux module: */
  • issm/trunk/src/c/Qmux/SpawnCoreParallel.cpp

    r3703 r3732  
    4343
    4444        char** responses_descriptors=NULL;
    45         Param* param=NULL;
     45        int    num_responses_descriptors;
    4646        char*  string=NULL;
    4747        int    string_length;
     
    4949        int     qmu_npart;
    5050        int     verbose=0;
     51        int     dummy;
    5152
    5253        extern int my_rank;
     
    6061               
    6162        /*First off, recover the response descriptors for the response functions: */
    62         param=(Param*)model->GetFormulation(DiagnosticAnalysisEnum,HorizAnalysisEnum)->parameters->FindParamObject(ResponseDescriptorsEnum);
    63         if(!param)ISSMERROR(" could not find response descriptors!");
    64 
    65         param->GetParameterValue(&responses_descriptors);
     63        model->GetFormulation(DiagnosticAnalysisEnum,HorizAnalysisEnum)->parameters->FindParam(&responses_descriptors,&num_responses_descriptors,ResponseDescriptorsEnum);
    6664
    6765        /*Recover partitioning for dakota: */
    68         model->FindParam(&qmu_npart,QmuNpartEnum);
    69         model->FindParam(&qmu_part,NULL,NULL,QmuPartEnum);
     66        model->FindParam(&qmu_npart,QmuNPartEnum);
     67        model->FindParam(&qmu_part,&dummy,QmuPartEnum);
    7068
    7169        /*broadcast variables: only cpu 0 has correct values*/
  • issm/trunk/src/c/objects/Constraints/Rgb.h

    r3703 r3732  
    3535                int    MyRank();
    3636                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     37                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     38                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     39                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     40
    3741                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    3842
  • issm/trunk/src/c/objects/Constraints/Spc.h

    r3703 r3732  
    4040                Object* copy();
    4141                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     42                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     43                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     44                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     45
    4246                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4347
  • issm/trunk/src/c/objects/DofVec.h

    r3703 r3732  
    4848                int   Size();
    4949                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     50                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     51                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     52                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
    5053                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    5154                Object* copy();
  • issm/trunk/src/c/objects/Elements/Beam.cpp

    r3717 r3732  
    124124                nodeinputs[0]=iomodel->vx_obs[index];
    125125                nodeinputs[1]=iomodel->vx_obs[(int)(iomodel->uppernodes[index]-1)];
    126                 this->inputs->AddInput(new BeamVertexInput(VxEnum,nodeinputs));
     126                this->inputs->AddInput(new BeamVertexInput(VxObsEnum,nodeinputs));
    127127        }
    128128        if (iomodel->vy_obs) {
    129129                nodeinputs[0]=iomodel->vy_obs[index];
    130130                nodeinputs[1]=iomodel->vy_obs[(int)(iomodel->uppernodes[index]-1)];
    131                 this->inputs->AddInput(new BeamVertexInput(VyEnum,nodeinputs));
     131                this->inputs->AddInput(new BeamVertexInput(VyObsEnum,nodeinputs));
    132132        }
    133133        if (iomodel->vz_obs) {
    134134                nodeinputs[0]=iomodel->vz_obs[index];
    135135                nodeinputs[1]=iomodel->vz_obs[(int)(iomodel->uppernodes[index]-1)];
    136                 this->inputs->AddInput(new BeamVertexInput(VzEnum,nodeinputs));
     136                this->inputs->AddInput(new BeamVertexInput(VzObsEnum,nodeinputs));
    137137        }
    138138        if (iomodel->weights) {
     
    142142        }       
    143143        if (iomodel->gridonbed) this->inputs->AddInput(new BoolInput(ElementOnBedEnum,(IssmBool)iomodel->gridonbed[index]));
     144
     145        /*default vx,vy and vz: */
     146        if (!iomodel->vx && iomodel->vx_obs) {
     147                nodeinputs[0]=iomodel->vx_obs[index];
     148                nodeinputs[1]=iomodel->vx_obs[(int)(iomodel->uppernodes[index]-1)];
     149                this->inputs->AddInput(new BeamVertexInput(VxEnum,nodeinputs));
     150                this->inputs->AddInput(new BeamVertexInput(VxOldEnum,nodeinputs));
     151        }
     152        if (!iomodel->vy && iomodel->vy_obs) {
     153                nodeinputs[0]=iomodel->vy_obs[index];
     154                nodeinputs[1]=iomodel->vy_obs[(int)(iomodel->uppernodes[index]-1)];
     155                this->inputs->AddInput(new BeamVertexInput(VyEnum,nodeinputs));
     156                this->inputs->AddInput(new BeamVertexInput(VyOldEnum,nodeinputs));
     157        }
     158        if (!iomodel->vz && iomodel->vz_obs) {
     159                nodeinputs[0]=iomodel->vz_obs[index];
     160                nodeinputs[1]=iomodel->vz_obs[(int)(iomodel->uppernodes[index]-1)];
     161                this->inputs->AddInput(new BeamVertexInput(VzEnum,nodeinputs));
     162                this->inputs->AddInput(new BeamVertexInput(VzOldEnum,nodeinputs));
     163        }
    144164
    145165        //this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
  • issm/trunk/src/c/objects/Elements/Beam.h

    r3717 r3732  
    5454                void  SetClone(int* minranks);
    5555                void    UpdateInputsFromVector(double* vector, int name, int type);
     56                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     57                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     58                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     59
    5660                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type);
    5761
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r3717 r3732  
    159159                for(i=0;i<6;i++)nodeinputs[i]=iomodel->weights[penta_node_ids[i]-1];
    160160                this->inputs->AddInput(new PentaVertexInput(WeightsEnum,nodeinputs));
     161        }
     162
     163        /*default vx,vy and vz: */
     164        if (!iomodel->vx && iomodel->vx_obs) {
     165                for(i=0;i<6;i++)nodeinputs[i]=iomodel->vx_obs[penta_node_ids[i]-1];
     166                this->inputs->AddInput(new PentaVertexInput(VxEnum,nodeinputs));
     167                this->inputs->AddInput(new PentaVertexInput(VxOldEnum,nodeinputs));
     168        }
     169        if (!iomodel->vy && iomodel->vy_obs) {
     170                for(i=0;i<6;i++)nodeinputs[i]=iomodel->vy_obs[penta_node_ids[i]-1];
     171                this->inputs->AddInput(new PentaVertexInput(VyEnum,nodeinputs));
     172                this->inputs->AddInput(new PentaVertexInput(VyOldEnum,nodeinputs));
     173        }
     174        if (!iomodel->vz && iomodel->vz_obs) {
     175                for(i=0;i<6;i++)nodeinputs[i]=iomodel->vz_obs[penta_node_ids[i]-1];
     176                this->inputs->AddInput(new PentaVertexInput(VzEnum,nodeinputs));
     177                this->inputs->AddInput(new PentaVertexInput(VzOldEnum,nodeinputs));
    161178        }
    162179
     
    447464                vy[i]=values[i*numdofpervertex+1];
    448465        }
     466
     467        /*Now, we have to move the previous Vx and Vy inputs  to old
     468         * status, otherwise, we'll wipe them off: */
     469        this->inputs->ChangeEnum(VxEnum,VxOldEnum);
     470        this->inputs->ChangeEnum(VyEnum,VyOldEnum);
    449471
    450472        /*Add vx and vy as inputs to the tria element: */
  • issm/trunk/src/c/objects/Elements/Penta.h

    r3717 r3732  
    141141                void  UpdateInputsFromSolutionBalancedvelocities( double* solution,int analysis_type,int sub_analysis_type);
    142142                void  UpdateInputsFromVector(double* vector, int name, int type);
     143                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     144                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     145                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     146
    143147
    144148                /*}}}*/
  • issm/trunk/src/c/objects/Elements/Sing.cpp

    r3717 r3732  
    9090        if (iomodel->vy) this->inputs->AddInput(new SingVertexInput(VyEnum,iomodel->vy[i]));
    9191        if (iomodel->vz) this->inputs->AddInput(new SingVertexInput(VzEnum,iomodel->vz[i]));
    92         if (iomodel->vx_obs) this->inputs->AddInput(new SingVertexInput(VxEnum,iomodel->vx_obs[i]));
    93         if (iomodel->vy_obs) this->inputs->AddInput(new SingVertexInput(VyEnum,iomodel->vy_obs[i]));
    94         if (iomodel->vz_obs) this->inputs->AddInput(new SingVertexInput(VzEnum,iomodel->vz_obs[i]));
     92        if (iomodel->vx_obs) this->inputs->AddInput(new SingVertexInput(VxObsEnum,iomodel->vx_obs[i]));
     93        if (iomodel->vy_obs) this->inputs->AddInput(new SingVertexInput(VyObsEnum,iomodel->vy_obs[i]));
     94        if (iomodel->vz_obs) this->inputs->AddInput(new SingVertexInput(VzObsEnum,iomodel->vz_obs[i]));
    9595        if (iomodel->weights) this->inputs->AddInput(new SingVertexInput(WeightsEnum,iomodel->weights[i]));
     96        if (!iomodel->vx && iomodel->vx_obs){
     97                this->inputs->AddInput(new SingVertexInput(VxEnum,iomodel->vx_obs[i]));
     98                this->inputs->AddInput(new SingVertexInput(VxOldEnum,iomodel->vx_obs[i]));
     99        }
     100        if (!iomodel->vy && iomodel->vy_obs){
     101                this->inputs->AddInput(new SingVertexInput(VyEnum,iomodel->vy_obs[i]));
     102                this->inputs->AddInput(new SingVertexInput(VyOldEnum,iomodel->vy_obs[i]));
     103        }
     104        if (!iomodel->vz && iomodel->vz_obs){
     105                this->inputs->AddInput(new SingVertexInput(VzEnum,iomodel->vz_obs[i]));
     106                this->inputs->AddInput(new SingVertexInput(VzOldEnum,iomodel->vz_obs[i]));
     107        }
     108
    96109
    97110        //this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
  • issm/trunk/src/c/objects/Elements/Sing.h

    r3717 r3732  
    5454                int   MyRank();
    5555                void  UpdateInputsFromVector(double* vector, int name, int type);
     56                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     57                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     58                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     59
    5660                void  UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type);
    5761
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r3717 r3732  
    146146                for(i=0;i<3;i++)nodeinputs[i]=iomodel->vx[tria_node_ids[i]-1];
    147147                this->inputs->AddInput(new TriaVertexInput(VxEnum,nodeinputs));
     148                this->inputs->AddInput(new TriaVertexInput(VxOldEnum,nodeinputs));
    148149        }
    149150        if (iomodel->vy) {
    150151                for(i=0;i<3;i++)nodeinputs[i]=iomodel->vy[tria_node_ids[i]-1];
    151152                this->inputs->AddInput(new TriaVertexInput(VyEnum,nodeinputs));
     153                this->inputs->AddInput(new TriaVertexInput(VyOldEnum,nodeinputs));
    152154        }
    153155        if (iomodel->vz) {
    154156                for(i=0;i<3;i++)nodeinputs[i]=iomodel->vz[tria_node_ids[i]-1];
    155157                this->inputs->AddInput(new TriaVertexInput(VzEnum,nodeinputs));
     158                this->inputs->AddInput(new TriaVertexInput(VzOldEnum,nodeinputs));
    156159        }
    157160        if (iomodel->vx_obs) {
     
    171174                this->inputs->AddInput(new TriaVertexInput(WeightsEnum,nodeinputs));
    172175        }
    173 
     176        /*Default vx,vy and vz?:*/
     177        if(!iomodel->vx && iomodel->vx_obs){
     178                for(i=0;i<3;i++)nodeinputs[i]=iomodel->vx_obs[tria_node_ids[i]-1];
     179                this->inputs->AddInput(new TriaVertexInput(VxEnum,nodeinputs));
     180                this->inputs->AddInput(new TriaVertexInput(VxOldEnum,nodeinputs));
     181        }
     182        if(!iomodel->vy && iomodel->vy_obs){
     183                for(i=0;i<3;i++)nodeinputs[i]=iomodel->vy_obs[tria_node_ids[i]-1];
     184                this->inputs->AddInput(new TriaVertexInput(VyEnum,nodeinputs));
     185                this->inputs->AddInput(new TriaVertexInput(VyOldEnum,nodeinputs));
     186        }
     187        if(!iomodel->vz && iomodel->vz_obs){
     188                for(i=0;i<3;i++)nodeinputs[i]=iomodel->vz_obs[tria_node_ids[i]-1];
     189                this->inputs->AddInput(new TriaVertexInput(VzEnum,nodeinputs));
     190                this->inputs->AddInput(new TriaVertexInput(VzOldEnum,nodeinputs));
     191        }
    174192
    175193        if (iomodel->elementoniceshelf) this->inputs->AddInput(new BoolInput(ElementOnIceShelfEnum,(IssmBool)iomodel->elementoniceshelf[index]));
     
    445463                vy[i]=values[i*numdofpervertex+1];
    446464        }
     465
     466        /*Now, we have to move the previous Vx and Vy inputs  to old
     467         * status, otherwise, we'll wipe them off: */
     468        this->inputs->ChangeEnum(VxEnum,VxOldEnum);
     469        this->inputs->ChangeEnum(VyEnum,VyOldEnum);
    447470
    448471        /*Add vx and vy as inputs to the tria element: */
  • issm/trunk/src/c/objects/Elements/Tria.h

    r3717 r3732  
    5151                void  SetClone(int* minranks);
    5252                void    UpdateInputsFromVector(double* vector, int name, int type);
     53                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     56
    5357                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type);
    5458
  • issm/trunk/src/c/objects/FemModel.cpp

    r3703 r3732  
    179179}
    180180/*}}}*/
     181/*FUNCTION FemModel::FindParam(bool* pinteger,int enum_type) {{{1*/
     182int FemModel::FindParam(bool* pinteger,int enum_type){
     183       
     184        return parameters->FindParam(pinteger,enum_type);
     185
     186}
     187/*}}}*/
     188/*FUNCTION FemModel::FindParam(int* pinteger,int enum_type) {{{1*/
     189int FemModel::FindParam(int* pinteger,int enum_type){
     190       
     191        return parameters->FindParam(pinteger,enum_type);
     192
     193}
     194/*}}}*/
    181195/*FUNCTION FemModel::FindParam(double* pscalar,int enum_type) {{{1*/
    182196int FemModel::FindParam(double* pscalar,int enum_type){
     
    186200}
    187201/*}}}*/
    188 /*FUNCTION FemModel::FindParam(int* pinteger,int enum_type) {{{1*/
    189 int FemModel::FindParam(int* pinteger,int enum_type){
    190        
    191         return parameters->FindParam(pinteger,enum_type);
    192 
    193 }
    194 /*}}}*/
    195202/*FUNCTION FemModel::FindParam(char** pstring,int enum_type) {{{1*/
    196203int FemModel::FindParam(char** pstring,int enum_type){
     
    211218       
    212219        return parameters->FindParam(pdoublearray,pM,pN,enum_type);
     220
     221}
     222/*}}}*/
     223/*FUNCTION FemModel::FindParam(double** pdoublearray,int* pM,int enum_type) {{{1*/
     224int FemModel::FindParam(double** pdoublearray,int* pM,int enum_type){
     225       
     226        return parameters->FindParam(pdoublearray,pM,enum_type);
    213227
    214228}
     
    307321/*FUNCTION FemModel::UpdateInputsFromVector(double* vector, int name, int type){{{1*/
    308322void FemModel::UpdateInputsFromVector(double* vector, int name, int type){
     323
     324        if(vector==NULL)return; //don't bother
    309325
    310326        elements->UpdateInputsFromVector(vector,name,type);
     
    317333}
    318334/*}}}*/
     335/*FUNCTION FemModel::UpdateInputsFromConstant(double constant, int name){{{1*/
     336void    FemModel::UpdateInputsFromConstant(double constant, int name){
     337       
     338        elements->UpdateInputsFromConstant(constant,name);
     339        nodes->UpdateInputsFromConstant(constant,name);
     340        vertices->UpdateInputsFromConstant(constant,name);
     341        loads->UpdateInputsFromConstant(constant,name);
     342        materials->UpdateInputsFromConstant(constant,name);
     343        parameters->UpdateInputsFromConstant(constant,name);
     344
     345}
     346/*}}}*/
     347/*FUNCTION FemModel::UpdateInputsFromConstant(int constant, int name){{{1*/
     348void    FemModel::UpdateInputsFromConstant(int constant, int name){
     349       
     350        elements->UpdateInputsFromConstant(constant,name);
     351        nodes->UpdateInputsFromConstant(constant,name);
     352        vertices->UpdateInputsFromConstant(constant,name);
     353        loads->UpdateInputsFromConstant(constant,name);
     354        materials->UpdateInputsFromConstant(constant,name);
     355        parameters->UpdateInputsFromConstant(constant,name);
     356
     357}
     358/*}}}*/
     359/*FUNCTION FemModel::UpdateInputsFromConstant(bool constant, int name){{{1*/
     360void    FemModel::UpdateInputsFromConstant(bool constant, int name){
     361       
     362        elements->UpdateInputsFromConstant(constant,name);
     363        nodes->UpdateInputsFromConstant(constant,name);
     364        vertices->UpdateInputsFromConstant(constant,name);
     365        loads->UpdateInputsFromConstant(constant,name);
     366        materials->UpdateInputsFromConstant(constant,name);
     367        parameters->UpdateInputsFromConstant(constant,name);
     368
     369}
     370/*}}}*/
     371/*FUNCTION FemModel::UpdateInputsFromSolution(Vec vector, int name, int type){{{1*/
     372void FemModel::UpdateInputsFromSolution(Vec vector,int name, int type){
     373
     374        double* serial_vector=NULL;
     375
     376        VecToMPISerial(&serial_vector,vector);
     377
     378        elements->UpdateInputsFromSolution(serial_vector,name,type);
     379        nodes->UpdateInputsFromSolution(serial_vector,name,type);
     380        vertices->UpdateInputsFromSolution(serial_vector,name,type);
     381        loads->UpdateInputsFromSolution(serial_vector,name,type);
     382        materials->UpdateInputsFromSolution(serial_vector,name,type);
     383        parameters->UpdateInputsFromSolution(serial_vector,name,type);
     384
     385        /*Free ressources:*/
     386        xfree((void**)&serial_vector);
     387
     388}
     389/*}}}*/
    319390/*FUNCTION FemModel::UpdateInputsFromSolution(double* vector, int name, int type){{{1*/
    320 void FemModel::UpdateInputsFromSolution(double* vector, int name, int type){
    321 
    322         elements->UpdateInputsFromSolution(vector,name,type);
    323         nodes->UpdateInputsFromSolution(vector,name,type);
    324         vertices->UpdateInputsFromSolution(vector,name,type);
    325         loads->UpdateInputsFromSolution(vector,name,type);
    326         materials->UpdateInputsFromSolution(vector,name,type);
    327         parameters->UpdateInputsFromSolution(vector,name,type);
    328 
    329 }
    330 /*}}}*/
     391void FemModel::UpdateInputsFromSolution(double* vector,int name, int type){
     392        ISSMERROR(" not supported yet!");
     393}
     394/*}}}*/
  • issm/trunk/src/c/objects/FemModel.h

    r3703 r3732  
    5757               
    5858                int FindParam(double* pscalar,int enum_type);
     59                int FindParam(bool* pinteger,int enum_type);
    5960                int FindParam(int* pinteger,int enum_type);
    6061                int FindParam(char** pstring,int enum_type);
    6162                int FindParam(char*** pstringarray,int* pM,int enum_type);
     63                int FindParam(double** pdoublearray,int* pM, int enum_type);
    6264                int FindParam(double** pdoublearray,int* pM, int* pN,int enum_type);
    6365                int FindParam(Vec* pvec,int enum_type);
     
    8082
    8183                void    UpdateInputsFromVector(double* vector, int name, int type);
     84                void    UpdateInputsFromConstant(double constant, int name);
     85                void    UpdateInputsFromConstant(int constant, int name);
     86                void    UpdateInputsFromConstant(bool constant, int name);
     87                void    UpdateInputsFromSolution(Vec solution, int analysis_type, int sub_analysis_type);
    8288                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type);
    8389
  • issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp

    r3683 r3732  
    166166void BeamVertexInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");}
    167167/*}}}*/
     168/*FUNCTION BeamVertexInput::ChangeEnum(int newenumtype){{{1*/
     169void BeamVertexInput::ChangeEnum(int newenumtype){
     170        this->enum_type=newenumtype;
     171}
     172/*}}}*/
  • issm/trunk/src/c/objects/Inputs/BeamVertexInput.h

    r3703 r3732  
    3939                int   EnumType();
    4040                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     41                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     42                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     43                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     44
    4145                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4246
     
    5761                void GetStrainRate(double* epsilon,Input* yinput, double* xyz_list, double* gauss);
    5862                void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss);
     63                void ChangeEnum(int newenumtype);
    5964                /*}}}*/
    6065
  • issm/trunk/src/c/objects/Inputs/BoolInput.cpp

    r3683 r3732  
    166166void BoolInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");}
    167167/*}}}*/
     168/*FUNCTION BoolInput::ChangeEnum(int newenumtype){{{1*/
     169void BoolInput::ChangeEnum(int newenumtype){
     170        this->enum_type=newenumtype;
     171}
     172/*}}}*/
  • issm/trunk/src/c/objects/Inputs/BoolInput.h

    r3703 r3732  
    3939                int   EnumType();
    4040                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     41                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     42                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     43                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     44
    4145                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4246
     
    5761                void GetStrainRate(double* epsilon,Input* yinput, double* xyz_list, double* gauss);
    5862                void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss);
     63                void ChangeEnum(int newenumtype);
    5964                /*}}}*/
    6065
  • issm/trunk/src/c/objects/Inputs/DoubleInput.cpp

    r3683 r3732  
    166166void DoubleInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");}
    167167/*}}}*/
     168/*FUNCTION DoubleInput::ChangeEnum(int newenumtype){{{1*/
     169void DoubleInput::ChangeEnum(int newenumtype){
     170        this->enum_type=newenumtype;
     171}
     172/*}}}*/
  • issm/trunk/src/c/objects/Inputs/DoubleInput.h

    r3703 r3732  
    3939                int   EnumType();
    4040                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     41                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     42                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     43                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     44
    4145                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4246
     
    5761                void GetStrainRate(double* epsilon,Input* yinput, double* xyz_list, double* gauss);
    5862                void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss);
     63                void ChangeEnum(int newenumtype);
    5964                /*}}}*/
    6065
  • issm/trunk/src/c/objects/Inputs/Input.h

    r3683 r3732  
    3636                virtual void GetStrainRate(double* epsilon, Input* yinput, double* xyz_list, double* gauss)=0;
    3737                virtual void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss)=0;
     38                virtual void ChangeEnum(int newenumtype)=0;
    3839
    3940                /*}}}*/
  • issm/trunk/src/c/objects/Inputs/IntInput.cpp

    r3683 r3732  
    166166void IntInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");}
    167167/*}}}*/
     168/*FUNCTION IntInput::ChangeEnum(int newenumtype){{{1*/
     169void IntInput::ChangeEnum(int newenumtype){
     170        this->enum_type=newenumtype;
     171}
     172/*}}}*/
  • issm/trunk/src/c/objects/Inputs/IntInput.h

    r3703 r3732  
    3939                int   EnumType();
    4040                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     41                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     42                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     43                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     44
    4145                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4246
     
    5761                void GetStrainRate(double* epsilon,Input* yinput, double* xyz_list, double* gauss);
    5862                void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss);
    59 
     63                void ChangeEnum(int newenumtype);
    6064                /*}}}*/
    6165
  • issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp

    r3683 r3732  
    170170void PentaVertexInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");}
    171171/*}}}*/
     172/*FUNCTION PentaVertexInput::ChangeEnum(int newenumtype){{{1*/
     173void PentaVertexInput::ChangeEnum(int newenumtype){
     174        this->enum_type=newenumtype;
     175}
     176/*}}}*/
  • issm/trunk/src/c/objects/Inputs/PentaVertexInput.h

    r3703 r3732  
    3838                int   EnumType();
    3939                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     40                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     41                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     42                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     43
    4044                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4145
     
    5660                void GetStrainRate(double* epsilon,Input* yinput, double* xyz_list, double* gauss);
    5761                void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss);
     62                void ChangeEnum(int newenumtype);
    5863                /*}}}*/
    5964
  • issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp

    r3683 r3732  
    165165void SingVertexInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");}
    166166/*}}}*/
     167/*FUNCTION SingVertexInput::ChangeEnum(int newenumtype){{{1*/
     168void SingVertexInput::ChangeEnum(int newenumtype){
     169        this->enum_type=newenumtype;
     170}
     171/*}}}*/
  • issm/trunk/src/c/objects/Inputs/SingVertexInput.h

    r3703 r3732  
    3838                int   EnumType();
    3939                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     40                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     41                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     42                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     43
    4044                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4145
     
    5660                void GetStrainRate(double* epsilon,Input* yinput, double* xyz_list, double* gauss);
    5761                void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss);
     62                void ChangeEnum(int newenumtype);
    5863                /*}}}*/
    5964
  • issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp

    r3683 r3732  
    167167void TriaVertexInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");}
    168168/*}}}*/
     169/*FUNCTION TriaVertexInput::ChangeEnum(int newenumtype){{{1*/
     170void TriaVertexInput::ChangeEnum(int newenumtype){
     171        this->enum_type=newenumtype;
     172}
     173/*}}}*/
  • issm/trunk/src/c/objects/Inputs/TriaVertexInput.h

    r3703 r3732  
    3838                int   EnumType();
    3939                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     40                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     41                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     42                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     43
    4044                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4145
     
    5660                void GetStrainRate(double* epsilon,Input* yinput, double* xyz_list, double* gauss);
    5761                void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss);
     62                void ChangeEnum(int newenumtype);
    5863                /*}}}*/
    5964
  • issm/trunk/src/c/objects/Loads/Icefront.h

    r3703 r3732  
    5151                int   MyRank();
    5252                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     53                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     56
    5357                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    5458
  • issm/trunk/src/c/objects/Loads/Numericalflux.h

    r3703 r3732  
    4646                int   MyRank();
    4747                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     48                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     49                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     50                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     51
    4852                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4953
  • issm/trunk/src/c/objects/Loads/Pengrid.h

    r3703 r3732  
    5252                int   MyRank();
    5353                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     56                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     57
    5458                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    5559
  • issm/trunk/src/c/objects/Loads/Penpair.h

    r3703 r3732  
    4444                Object* copy();
    4545                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     46                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     47                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     48                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     49
    4650                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4751
  • issm/trunk/src/c/objects/Loads/Riftfront.h

    r3703 r3732  
    6161                int   MyRank();
    6262                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     63                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     64                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     65                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     66
    6367                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    6468
  • issm/trunk/src/c/objects/Materials/Material.h

    r3703 r3732  
    2727                virtual void  UpdateFromInputs(void* inputs)=0;
    2828                virtual void  UpdateInputsFromVector(double* vector, int name, int type)=0;
     29                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     30                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     31                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     32
    2933                virtual void  UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type)=0;
    3034
  • issm/trunk/src/c/objects/Materials/Matice.h

    r3703 r3732  
    4646                double GetN();
    4747                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     48                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     49                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     50                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     51
    4852                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4953
  • issm/trunk/src/c/objects/Materials/Matpar.h

    r3703 r3732  
    5858                Object* copy();
    5959                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     60                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     61                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     62                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     63
    6064                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    6165
  • issm/trunk/src/c/objects/Model.cpp

    r3703 r3732  
    206206}
    207207/*}}}1*/
    208 /*FUNCTION Model::FindParam(int* pparameter,int enum_type {{{1*/
    209 
    210 int   Model::FindParam(int* pparameter,int enum_type){
     208/*FUNCTION Model::FindParam(bool* pparameter,int enum_type {{{1*/
     209
     210int   Model::FindParam(bool* pparameter,int enum_type){
    211211
    212212        FemModel* femmodel=NULL;
     
    224224}
    225225/*}}}1*/
     226/*FUNCTION Model::FindParam(int* pparameter,int enum_type {{{1*/
     227
     228int   Model::FindParam(int* pparameter,int enum_type){
     229
     230        FemModel* femmodel=NULL;
     231
     232        /*no analysis_type or sub_analysis_type, find the parameter in the first dataset we find: */
     233        if (!femmodels->Size())ISSMERROR(" no fem models were found!");
     234
     235        /*recover first femmodel: */
     236        femmodel=(FemModel*)femmodels->GetObjectByOffset(0);
     237
     238        if(!femmodel)return 0;
     239
     240        femmodel->FindParam(pparameter,enum_type);
     241
     242}
     243/*}}}1*/
    226244/*FUNCTION Model::FindParam(double* pparameter,int enum_type ){{{1*/
    227245int   Model::FindParam(double* pparameter,int enum_type){
     
    260278}
    261279/*}}}1*/
     280/*FUNCTION Model::FindParam(double** pparameter,int* pM, int enum_type) {{{1*/
     281int   Model::FindParam(double** pparameter,int* pM, int enum_type){
     282       
     283        FemModel* femmodel=NULL;
     284
     285        /*no analysis_type or sub_analysis_type, find the parameter in the first dataset we find: */
     286        if (!femmodels->Size())ISSMERROR(" no fem models were found!");
     287
     288        /*recover first femmodel: */
     289        femmodel=(FemModel*)femmodels->GetObjectByOffset(0);
     290       
     291        if(!femmodel)return 0;
     292       
     293        femmodel->FindParam(pparameter,pM, enum_type);
     294
     295
     296}
     297/*}}}1*/
    262298/*FUNCTION Model::FindParam(char** pparameter,int enum_type) {{{1*/
    263299int   Model::FindParam(char** pparameter,int enum_type){
     
    277313}
    278314/*}}}1*/
     315/*FUNCTION Model::FindParam(bool* pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
     316int   Model::FindParam(bool* pparameter,int enum_type,int analysis_type,int sub_analysis_type){
     317       
     318        FemModel* femmodel=NULL;
     319
     320        /*find the correct formulation: */
     321        femmodel=this->GetFormulation(analysis_type,sub_analysis_type);
     322       
     323        if(!femmodel)return 0;
     324
     325        /*extract our parameter from the found formulation: */
     326        femmodel->FindParam(pparameter,enum_type);
     327}
     328/*}}}1*/
    279329/*FUNCTION Model::FindParam(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
    280330int   Model::FindParam(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type){
     
    319369}
    320370/*}}}1*/
     371/*FUNCTION Model::FindParam(double** pparameter,int* pM, int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
     372int   Model::FindParam(double** pparameter,int* pM, int enum_type,int analysis_type,int sub_analysis_type){
     373
     374        FemModel* femmodel=NULL;
     375
     376        /*find the correct formulation: */
     377        femmodel=this->GetFormulation(analysis_type,sub_analysis_type);
     378       
     379        if(!femmodel)return 0;
     380
     381        /*extract our parameter from the found formulation: */
     382        femmodel->FindParam(pparameter,pM, enum_type);
     383}
     384/*}}}1*/
    321385/*FUNCTION Model::FindParam(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
    322386int   Model::FindParam(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type){
     
    333397}
    334398/*}}}1*/
     399/*FUNCTION Model::FindParam(bool* pparameter,int enum_type,int analysis_type) {{{1*/
     400int   Model::FindParam(bool* pparameter,int enum_type,int analysis_type){
     401       
     402        FemModel* femmodel=NULL;
     403
     404        /*find the correct formulation: */
     405        femmodel=this->GetFormulation(analysis_type);
     406       
     407        if(!femmodel)return 0;
     408
     409        /*extract our parameter from the found formulation: */
     410        femmodel->FindParam(pparameter,enum_type);
     411}
     412/*}}}1*/
    335413/*FUNCTION Model::FindParam(int* pparameter,int enum_type,int analysis_type) {{{1*/
    336414int   Model::FindParam(int* pparameter,int enum_type,int analysis_type){
     
    373451        /*extract our parameter from the found formulation: */
    374452        femmodel->FindParam(pparameter,pM,pN,enum_type);
     453}
     454/*}}}1*/
     455/*FUNCTION Model::FindParam(double** pparameter,int* pM, int enum_type,int analysis_type) {{{1*/
     456int   Model::FindParam(double** pparameter,int* pM, int enum_type,int analysis_type){
     457
     458        FemModel* femmodel=NULL;
     459
     460        /*find the correct formulation: */
     461        femmodel=this->GetFormulation(analysis_type);
     462       
     463        if(!femmodel)return 0;
     464
     465        /*extract our parameter from the found formulation: */
     466        femmodel->FindParam(pparameter,pM,enum_type);
    375467}
    376468/*}}}1*/
     
    454546}
    455547/*}}}1*/
     548/*FUNCTION Model::UpdateInputsFromConstant(double constant, int name);{{{1*/
     549void  Model::UpdateInputsFromConstant(double constant, int name){
     550
     551        int i;
     552        FemModel* femmodel=NULL;
     553
     554        for(i=0;i<this->femmodels->Size();i++){
     555                femmodel=(FemModel*)this->femmodels->GetObjectByOffset(i);
     556                femmodel->UpdateInputsFromConstant(constant,name);
     557        }
     558
     559}
     560/*}}}1*/
     561/*FUNCTION Model::UpdateInputsFromConstant(int constant, int name);{{{1*/
     562void  Model::UpdateInputsFromConstant(int constant, int name){
     563
     564        int i;
     565        FemModel* femmodel=NULL;
     566
     567        for(i=0;i<this->femmodels->Size();i++){
     568                femmodel=(FemModel*)this->femmodels->GetObjectByOffset(i);
     569                femmodel->UpdateInputsFromConstant(constant,name);
     570        }
     571
     572}
     573/*}}}1*/
     574/*FUNCTION Model::UpdateInputsFromConstant(bool constant, int name);{{{1*/
     575void  Model::UpdateInputsFromConstant(bool constant, int name){
     576
     577        int i;
     578        FemModel* femmodel=NULL;
     579
     580        for(i=0;i<this->femmodels->Size();i++){
     581                femmodel=(FemModel*)this->femmodels->GetObjectByOffset(i);
     582                femmodel->UpdateInputsFromConstant(constant,name);
     583        }
     584
     585}
     586/*}}}1*/
    456587/*FUNCTION Model::UpdateInputsFromVector(double* vector,int name, int type);{{{1*/
    457588void  Model::UpdateInputsFromVector(double* vector,int name, int type){
     
    459590        int i;
    460591        FemModel* femmodel=NULL;
     592
     593        if(vector==NULL)return; //don't bother
    461594
    462595        for(i=0;i<this->femmodels->Size();i++){
     
    480613}
    481614/*}}}1*/
     615/*FUNCTION Model::UpdateFromDakota(double* variables,char** variables_descriptors,int numvariables,DataSet* parameters, double* qmu_part,int qmu_npart);{{{1:*/
     616void    UpdateFromDakota(double* variables,char** variables_descriptors,int numvariables,DataSet* parameters, double* qmu_part,int qmu_npart){
     617        ISSMERROR("not supported yet!");
     618}
     619/*}}}*/
  • issm/trunk/src/c/objects/Model.h

    r3703 r3732  
    3535
    3636                /*all overloaded forms of the FindParam routine: */
     37                int   FindParam(bool* pparameter,int enum_type);
    3738                int   FindParam(int* pparameter,int enum_type);
    3839                int   FindParam(double* pparameter,int enum_type);
    3940                int   FindParam(double** pparameter,int* pM,int* pN,int enum_type);
     41                int   FindParam(double** pparameter,int* pM,int enum_type);
    4042                int   FindParam(char** pparameter,int enum_type);
    4143
     44                int   FindParam(bool* pparameter,int enum_type,int analysis_type,int sub_analysis_type);
    4245                int   FindParam(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type);
    4346                int   FindParam(double* pparameter,int enum_type,int analysis_type,int sub_analysis_type);
     47                int   FindParam(double** pparameter,int* pM, int enum_type,int analysis_type,int sub_analysis_type);
    4448                int   FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type,int sub_analysis_type);
    4549                int   FindParam(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type);
    4650
     51                int   FindParam(bool* pparameter,int enum_type,int analysis_type);
    4752                int   FindParam(int* pparameter,int enum_type,int analysis_type);
    4853                int   FindParam(double* pparameter,int enum_type,int analysis_type);
     54                int   FindParam(double** pparameter,int* pM,int enum_type,int analysis_type);
    4955                int   FindParam(double** pparameter,int* pM,int* pN,int enum_type,int analysis_type);
    5056                int   FindParam(char** pparameter,int enum_type,int analysis_type);
     
    5460
    5561                void    UpdateInputsFromVector(double* vector, int name, int type);
     62                void    UpdateInputsFromConstant(double constant, int name);
     63                void    UpdateInputsFromConstant(int constant, int name);
     64                void    UpdateInputsFromConstant(bool constant, int name);
    5665                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type);
     66                void    UpdateFromDakota(double* variables,char** variables_descriptors,int numvariables,DataSet* parameters, double* qmu_part,int qmu_npart);
     67
    5768
    5869                FemModel* GetActiveFormulation();
  • issm/trunk/src/c/objects/Node.h

    r3703 r3732  
    5252                void  SetVertexDof(int in_dof);
    5353                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     56                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     57
    5458                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    5559
  • issm/trunk/src/c/objects/Object.h

    r3703 r3732  
    2626                virtual Object* copy()=0;
    2727                virtual void  UpdateInputsFromVector(double* vector, int name, int type)=0;
     28                virtual void  UpdateInputsFromConstant(double constant, int name)=0;
     29                virtual void  UpdateInputsFromConstant(int constant, int name)=0;
     30                virtual void  UpdateInputsFromConstant(bool constant, int name)=0;
    2831                virtual void  UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type)=0;
    2932       
  • issm/trunk/src/c/objects/Params/BoolParam.h

    r3715 r3732  
    5252                int   MyRank();
    5353                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     56                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     57
    5458                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    5559
  • issm/trunk/src/c/objects/Params/DoubleMatParam.h

    r3715 r3732  
    5454                int   MyRank();
    5555                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     56                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     57                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     58                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     59
    5660                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    5761
  • issm/trunk/src/c/objects/Params/DoubleParam.h

    r3715 r3732  
    5252                int   MyRank();
    5353                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     56                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     57
    5458                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    5559
  • issm/trunk/src/c/objects/Params/DoubleVecParam.h

    r3715 r3732  
    5353                int   MyRank();
    5454                void  UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     56                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     57                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     58
    5559                void  UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    5660                /*}}}*/
  • issm/trunk/src/c/objects/Params/IntParam.h

    r3715 r3732  
    5252                int   MyRank();
    5353                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     56                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     57
    5458                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    5559
  • issm/trunk/src/c/objects/Params/PetscMatParam.h

    r3715 r3732  
    5252                int   MyRank();
    5353                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     56                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     57
    5458                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    5559
  • issm/trunk/src/c/objects/Params/PetscVecParam.h

    r3715 r3732  
    5252                int   MyRank();
    5353                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     56                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     57
    5458                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    5559
  • issm/trunk/src/c/objects/Params/StringArrayParam.h

    r3715 r3732  
    5454                int   MyRank();
    5555                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     56                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     57                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     58                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     59
    5660                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    5761
  • issm/trunk/src/c/objects/Params/StringParam.h

    r3715 r3732  
    5252                int   MyRank();
    5353                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     56                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     57
    5458                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    5559
  • issm/trunk/src/c/objects/Result.h

    r3703 r3732  
    4444                Object* copy();
    4545                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     46                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     47                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     48                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     49
    4650                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4751
  • issm/trunk/src/c/objects/SolPar.h

    r3703 r3732  
    4040                Object* copy();
    4141                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     42                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     43                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     44                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     45
    4246                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    4347
  • issm/trunk/src/c/objects/Vertex.h

    r3703 r3732  
    5151                void  UpdatePosition(double* thickness,double* bed);
    5252                void  UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     53                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");}
     56
    5357                void  UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
    5458
  • issm/trunk/src/c/parallel/ControlInitialization.cpp

    r3717 r3732  
    1010#include "../modules.h"
    1111
    12 void ControlInitialization(Model* model, ParameterInputs* inputs){
     12void ControlInitialization(Model* model){
    1313
    1414        extern int my_rank;
     
    8181        //compute slopes
    8282        if(verbose)_printf_("%s\n","computing bed slope (x and y derivatives)...");
    83         diagnostic_core_linear(&slopex,fem_sl,inputs,SlopecomputeAnalysisEnum,BedXAnalysisEnum);
    84         diagnostic_core_linear(&slopey,fem_sl,inputs,SlopecomputeAnalysisEnum,BedYAnalysisEnum);
     83        diagnostic_core_linear(&slopex,fem_sl,SlopecomputeAnalysisEnum,BedXAnalysisEnum);
     84        diagnostic_core_linear(&slopey,fem_sl,SlopecomputeAnalysisEnum,BedYAnalysisEnum);
    8585        FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->vertices,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopex",0);
    8686        FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->vertices,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopey",0);
     
    9595        //horizontal velocity
    9696        if(verbose)_printf_("%s\n"," computing horizontal velocities...");
    97         diagnostic_core_nonlinear(&ug,NULL,NULL,NULL,fem_dh,inputs,DiagnosticAnalysisEnum,HorizAnalysisEnum);
     97        diagnostic_core_nonlinear(&ug,NULL,NULL,NULL,fem_dh,DiagnosticAnalysisEnum,HorizAnalysisEnum);
    9898        if(verbose)_printf_("%s\n"," extruding horizontal velocities...");
    9999        VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->vertices,fem_dh->loads,fem_dh-> materials,fem_dh->parameters,"velocity",1);
     
    102102        if(verbose)_printf_("%s\n"," computing vertical velocities...");
    103103        inputs->Add("velocity",ug_horiz,numberofdofspernode_dh,numberofnodes);
    104         diagnostic_core_linear(&ug_vert,fem_dv,inputs,DiagnosticAnalysisEnum,VertAnalysisEnum);
     104        diagnostic_core_linear(&ug_vert,fem_dv,DiagnosticAnalysisEnum,VertAnalysisEnum);
    105105
    106106        //Create 3d u_g
     
    113113        //Create 4d u_g
    114114        if(verbose)_printf_("%s\n"," computing pressure according to Pattyn...");
    115         ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->vertices,fem_dh->loads,  fem_dh->materials, fem_dh->parameters,inputs,DiagnosticAnalysisEnum,HorizAnalysisEnum);
     115        ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->vertices,fem_dh->loads,  fem_dh->materials, fem_dh->parameters,DiagnosticAnalysisEnum,HorizAnalysisEnum);
    116116        VecScale(pg,1.0/stokesreconditioning);
    117117        ug_stokes=NewVec(fem_ds->nodesets->GetGSize());
     
    133133        if(verbose)_printf_("%s\n"," computing stokes velocities and pressure ...");
    134134        VecFree(&ug);
    135         diagnostic_core_nonlinear(&ug,NULL,NULL,NULL,fem_ds,inputs,DiagnosticAnalysisEnum,StokesAnalysisEnum);
     135        diagnostic_core_nonlinear(&ug,NULL,NULL,NULL,fem_ds,DiagnosticAnalysisEnum,StokesAnalysisEnum);
    136136
    137137        //Add in inputs
  • issm/trunk/src/c/parallel/balancedthickness.cpp

    r3709 r3732  
    33 */
    44
    5 #include "../issm.h"
     5#include "../modules.h"
    66#include "./parallel.h"
    77
     
    3434        Result*  result=NULL;
    3535
    36         ParameterInputs* inputs=NULL;
    3736        Param*   param=NULL;
    3837
     
    8786                _printf_("call computational core:\n");
    8887                MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    89                 balancedthickness_core(results,model,inputs);
     88                balancedthickness_core(results,model);
    9089                MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    9190
     
    9897                #ifdef _HAVE_DAKOTA_
    9998                MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    100                 Qmux(model,inputs,BalancedthicknessAnalysisEnum,NoneAnalysisEnum);
     99                Qmux(model,BalancedthicknessAnalysisEnum,NoneAnalysisEnum);
    101100                MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    102101                #else
     
    124123        delete results;
    125124        delete model;
    126         delete inputs;
    127125
    128126        /*Get finish time and close*/
  • issm/trunk/src/c/parallel/balancedthickness2.cpp

    r3709 r3732  
    33 */
    44
    5 #include "../issm.h"
     5#include "../modules.h"
    66#include "./parallel.h"
    77
     
    3333        Result*  result=NULL;
    3434
    35         ParameterInputs* inputs=NULL;
    3635        Param*   param=NULL;
    3736
     
    8685                _printf_("call computational core:\n");
    8786                MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    88                 balancedthickness2_core(results,model,inputs);
     87                balancedthickness2_core(results,model);
    8988                MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    9089
     
    9796                #ifdef _HAVE_DAKOTA_
    9897                MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    99                 Qmux(model,inputs,Balancedthickness2AnalysisEnum,NoneAnalysisEnum);
     98                Qmux(model,Balancedthickness2AnalysisEnum,NoneAnalysisEnum);
    10099                MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    101100                #else
     
    123122        delete results;
    124123        delete model;
    125         delete inputs;
    126124
    127125        /*Get finish time and close*/
  • issm/trunk/src/c/parallel/balancedthickness2_core.cpp

    r3709 r3732  
    99#include "../EnumDefinitions/EnumDefinitions.h"
    1010#include "./parallel.h"
    11 #include "../issm.h"
     11#include "../modules.h"
    1212
    13 void balancedthickness2_core(DataSet* results,Model* model,ParameterInputs* inputs){
     13void balancedthickness2_core(DataSet* results,Model* model){
    1414
    1515        extern int my_rank;
     
    5555       
    5656        _printf_("call computational core:\n");
    57         diagnostic_core_linear(&h_g,fem_p,inputs,Balancedthickness2AnalysisEnum,NoneAnalysisEnum);
     57        diagnostic_core_linear(&h_g,fem_p,Balancedthickness2AnalysisEnum,NoneAnalysisEnum);
    5858
    5959        _printf_("Averaging over vertices:\n");
  • issm/trunk/src/c/parallel/balancedthickness_core.cpp

    r3709 r3732  
    99#include "../EnumDefinitions/EnumDefinitions.h"
    1010#include "./parallel.h"
    11 #include "../issm.h"
     11#include "../modules.h"
    1212
    13 void balancedthickness_core(DataSet* results,Model* model,ParameterInputs* inputs){
     13void balancedthickness_core(DataSet* results,Model* model){
    1414
    1515        extern int my_rank;
     
    4848       
    4949        _printf_("call computational core:\n");
    50         diagnostic_core_linear(&h_g,fem_p,inputs,BalancedthicknessAnalysisEnum,NoneAnalysisEnum);
     50        diagnostic_core_linear(&h_g,fem_p,BalancedthicknessAnalysisEnum,NoneAnalysisEnum);
    5151
    5252        _printf_("extrude computed thickness on all layers:\n");
  • issm/trunk/src/c/parallel/balancedvelocities.cpp

    r3709 r3732  
    33 */
    44
    5 #include "../issm.h"
     5#include "../modules.h"
    66#include "./parallel.h"
    77
     
    3232        Result*  result=NULL;
    3333
    34         ParameterInputs* inputs=NULL;
    3534        Param*   param=NULL;
    3635
     
    8584                _printf_("call computational core:\n");
    8685                MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    87                 balancedvelocities_core(results,model,inputs);
     86                balancedvelocities_core(results,model);
    8887                MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    8988
     
    9695                #ifdef _HAVE_DAKOTA_
    9796                MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    98                 Qmux(model,inputs,BalancedvelocitiesAnalysisEnum,NoneAnalysisEnum);
     97                Qmux(model,BalancedvelocitiesAnalysisEnum,NoneAnalysisEnum);
    9998                MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    10099                #else
     
    122121        delete results;
    123122        delete model;
    124         delete inputs;
    125123
    126124        /*Get finish time and close*/
  • issm/trunk/src/c/parallel/balancedvelocities_core.cpp

    r3709 r3732  
    88#include "../EnumDefinitions/EnumDefinitions.h"
    99#include "./parallel.h"
    10 #include "../issm.h"
     10#include "../modules.h"
    1111
    12 void balancedvelocities_core(DataSet* results,Model* model,ParameterInputs* inputs){
     12void balancedvelocities_core(DataSet* results,Model* model){
    1313
    1414        extern int my_rank;
     
    4747       
    4848        _printf_("call computational core:\n");
    49         diagnostic_core_linear(&v_g,fem_p,inputs,BalancedvelocitiesAnalysisEnum,NoneAnalysisEnum);
     49        diagnostic_core_linear(&v_g,fem_p,BalancedvelocitiesAnalysisEnum,NoneAnalysisEnum);
    5050
    5151        _printf_("extrude computed thickness on all layers:\n");
  • issm/trunk/src/c/parallel/control_core.cpp

    r3717 r3732  
    55#include "./parallel.h"
    66#include "../modules.h"
    7 
    8 void control_core(DataSet* results,Model* model, ParameterInputs* inputs){
     7#include "../EnumDefinitions/EnumDefinitions.h"
     8
     9void control_core(DataSet* results,Model* model){
    910
    1011        extern int my_rank;
     
    2425        Vec     m_g=NULL;
    2526        double  search_scalar;
    26         char*   control_type=NULL;
     27        int     control_type=NULL;
    2728        double* fit=NULL;
    2829        double* optscal=NULL;
     
    5556
    5657        /*Process models*/
    57         ControlInitialization(model,inputs);
     58        ControlInitialization(model);
    5859        fem_model=model->GetActiveFormulation();
    5960
     
    8485
    8586                _printf_("\n%s%i%s%i\n","   control method step ",n+1,"/",nsteps);
    86                 inputs->Add(control_type,param_g,1,numberofnodes);
    87                 inputs->Add("fit",fit[n]);
    88 
     87                model->UpdateInputsFromVector(param_g,control_type,VertexEnum);
     88                model->UpdateInputsFromVector(&fit[n],FitEnum,ConstantEnum);
     89               
    8990                /*In case we are running a steady state control method, compute new temperature field using new parameter
    9091                 * distribution: */
    9192                if (control_steady){
    9293                        steadystate_results=new DataSet(ResultsEnum);
    93                         steadystate_core(steadystate_results,model,inputs);
     94                        steadystate_core(steadystate_results,model);
    9495                        VecFree(&t_g); steadystate_results->FindResult(&t_g,"t_g");
    9596                        delete steadystate_results;
    96                         inputs->Add("temperature",t_g,1,numberofnodes);
     97                        model->UpdateInputsFromVector(t_g,TemperatureEnum,VertexEnum);
    9798                }
    9899       
    99                 /*Update parameters: */
    100                 UpdateFromInputsx(fem_model->elements,fem_model->nodes,fem_model->vertices,fem_model->loads, fem_model->materials,fem_model->parameters,inputs);
    101 
    102100                _printf_("%s\n","      computing gradJ...");
    103101                gradjcompute_results=new DataSet(ResultsEnum);
    104                 gradjcompute_core(gradjcompute_results,model, inputs);
     102                gradjcompute_core(gradjcompute_results,model);
    105103                gradjcompute_results->FindResult(&grad_g,"grad_g");
    106104                delete gradjcompute_results;
     
    145143                _printf_("%s\n","      optimizing along gradient direction");
    146144                optargs.model=model;
    147                 optargs.param_g=param_g; optargs.grad_g=grad_g_double; optargs.inputs=inputs;optargs.n=n;
     145                optargs.param_g=param_g; optargs.grad_g=grad_g_double; optargs.n=n;
    148146                optpars.xmin=0; optpars.xmax=1; optpars.tolerance=tolx; optpars.maxiter=(int)maxiter[n];optpars.cm_jump=cm_jump[n];
    149147                BrentSearch(&search_scalar,J+n,&optpars,&objectivefunctionC,&optargs);
     
    197195        /*Launch diagnostic with the last parameter distribution*/
    198196        if (control_steady){
    199                 inputs->Add(control_type,param_g,1,numberofnodes);
     197                model->UpdateInputsFromVector(param_g,control_type,VertexEnum);
    200198                steadystate_results=new DataSet(ResultsEnum);
    201                 steadystate_core(steadystate_results,model,inputs);
     199                steadystate_core(steadystate_results,model);
    202200
    203201                //extract u_g ,t_g and m_g from steadystate results, and erase diagnostic_results;
     
    210208                inputs->Add(control_type,param_g,1,numberofnodes);
    211209                diagnostic_results=new DataSet(ResultsEnum);
    212                 diagnostic_core(diagnostic_results,model, inputs);
     210                diagnostic_core(diagnostic_results,model);
    213211
    214212                //extract u_g from diagnostic_results, and erase diagnostic_results;
  • issm/trunk/src/c/parallel/convergence.cpp

    r3717 r3732  
    55#include "../objects/objects.h"
    66#include "../modules.h"
     7#include "../EnumDefinitions/EnumDefinitions.h"
    78
    8 void convergence(int* pconverged, Mat Kff,Vec pf,Vec uf,Vec old_uf,Parameters* parameters){
     9void convergence(double* pconverged, Mat Kff,Vec pf,Vec uf,Vec old_uf,Parameters* parameters){
    910
    1011        /*output*/
  • issm/trunk/src/c/parallel/diagnostic_core.cpp

    r3722 r3732  
    1313
    1414        extern int my_rank;
     15        int        dummy;
    1516
    1617        /*fem models: */
     
    3435        Vec riftproperties=NULL;
    3536        double* u_g_initial=NULL;
     37        double* vx=NULL;
     38        double* vy=NULL;
     39        double* vz=NULL;
    3640
    3741        /*flags: */
     
    6670        model->FindParam(&isstokes,IsStokesEnum);
    6771        model->FindParam(&stokesreconditioning,StokesReconditioningEnum);
    68         model->FindParam(&numrifts,NumriftsEnum);
     72        model->FindParam(&numrifts,NumRiftsEnum);
    6973        model->FindParam(&qmu_analysis,QmuAnalysisEnum);
    7074
     
    8387        //for qmu analysis, be sure the velocity input we are starting from  is the one in the parameters: */
    8488        if(qmu_analysis){
    85                 model->FindParam(&vx,VxEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);
    86                 model->FindParam(&vy,VyEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);
    87                 model->FindParam(&vz,VzEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vz,VzEnum,VertexEnum);
     89                model->FindParam(&vx,&dummy,VxEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);
     90                model->FindParam(&vy,&dummy,VyEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);
     91                model->FindParam(&vz,&dummy,VzEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vz,VzEnum,VertexEnum);
    8892        }
     93
     94        /*Compute slopes: */
     95        slope_core(&surfaceslopex,&surfaceslopey,model,SurfaceAnalysisEnum);
     96        slope_core(&bedslopex,&bedslopey,model,BedAnalysisEnum);
     97               
     98        /*Update: */
     99        model->UpdateInputsFromVector(surfaceslopex,SurfaceSlopexEnum,VertexEnum);
     100        model->UpdateInputsFromVector(surfaceslopey,SurfaceSlopeyEnum,VertexEnum);
     101        model->UpdateInputsFromVector(bedslopex,BedSlopexEnum,VertexEnum);
     102        model->UpdateInputsFromVector(bedslopey,BedSlopeyEnum,VertexEnum);
    89103
    90104        if(ishutter){
    91105                       
    92                 slope_core(&slopex,&slopey,fem_sl,SurfaceAnalysisEnum);
    93                        
    94                 if(verbose)_printf_("%s\n"," adding slopes in inputs...");
    95                 inputs->Add("surfaceslopex",slopex,numberofdofspernode_sl,numberofnodes);
    96                 inputs->Add("surfaceslopey",slopey,numberofdofspernode_sl,numberofnodes);
    97                 VecFree(&slopex); VecFree(&slopey);
    98 
    99106                if(verbose)_printf_("%s\n"," computing hutter velocities...");
    100107                diagnostic_core_linear(&ug,fem_dhu,DiagnosticAnalysisEnum,HutterAnalysisEnum);
     
    128135
    129136                if(verbose)_printf_("%s\n"," extruding horizontal velocities...");
    130                 VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->vertices,fem_dh->loads,fem_dh->materials,fem_dh->parameters,"velocity",1);
     137               
     138                FieldExtrudex( ug,fem_dh->elements,fem_dh->nodes, fem_dh->vertices,fem_dh->loads,fem_dh->materials,fem_dh->parameters,"velocity",1);
    131139
     140                SplitSolutionVector(ug,numberofnodes,numberofdofspernode_dh,&vx,&vy);
     141                model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);
     142                model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);
     143               
    132144                if(verbose)_printf_("%s\n"," computing vertical velocities...");
    133                 inputs->Add("velocity",ug_horiz,numberofdofspernode_dh,numberofnodes);
    134145                diagnostic_core_linear(&ug_vert,fem_dv,DiagnosticAnalysisEnum,VertAnalysisEnum);
    135 
    136                 if(verbose)_printf_("%s\n"," combining horizontal and vertical velocities...");
    137                 VecFree(&ug); ug=NewVec(numberofnodes*3);
    138 
    139                 xfree((void**)&dofset); dofset=dofsetgen(2,&dof01[0],3,numberofnodes*3); VecMerge(ug,ug_horiz,dofset,numberofnodes*2);
    140                 xfree((void**)&dofset); dofset=dofsetgen(1,&dof2[0],3,numberofnodes*3); VecMerge(ug,ug_vert,dofset,numberofnodes*1);
    141                 VecFree(&ug_horiz); VecFree(&ug_vert);
     146                model->UpdateInputsFromVector(ug_vert,VzEnum,VertexEnum);
    142147
    143148                if(verbose)_printf_("%s\n"," computing pressure according to Pattyn...");
    144149                ComputePressurex(&pg,fem_dh->elements, fem_dh->nodes, fem_dh->vertices,fem_dh->loads,  fem_dh->materials,fem_dh->parameters,DiagnosticAnalysisEnum,HorizAnalysisEnum);
     150                model->UpdateInputsFromVector(pg,PressureEnum,VertexEnum);
    145151               
    146152                if (isstokes){
     
    148154                        //"recondition" pressure
    149155                        VecScale(pg,1.0/stokesreconditioning);
    150 
    151                         if(verbose)_printf_("%s\n","computing bed slope (x and y derivatives)...");
    152                         slope_core(&slopex,&slopey,fem_sl,BedAnalysisEnum);
    153 
    154                         inputs->Add("bedslopex",slopex,numberofdofspernode_sl,numberofnodes);
    155                         inputs->Add("bedslopey",slopey,numberofdofspernode_sl,numberofnodes);
    156                         VecFree(&slopex); VecFree(&slopey);
    157                        
    158                         //recombine ug and pg:
    159                         ug_stokes=NewVec(fem_ds->nodesets->GetGSize());
    160                         xfree((void**)&dofset);dofset=dofsetgen(3,dof012,4,numberofnodes*4); VecMerge(ug_stokes,ug,dofset,numberofnodes*3);
    161                         xfree((void**)&dofset); dofset=dofsetgen(1,dof3,4,numberofnodes*4); VecMerge(ug_stokes,pg,dofset,numberofnodes);
    162 
    163                         inputs->Add("velocity",ug_stokes,numberofdofspernode_ds,numberofnodes);
    164                         VecFree(&ug_stokes);
    165156
    166157                        if(verbose)_printf_("%s\n"," update boundary conditions for stokes using velocities previously computed...");
  • issm/trunk/src/c/parallel/diagnostic_core_linear.cpp

    r3717 r3732  
    88#include "../modules.h"
    99
    10 void diagnostic_core_linear(Vec* pug,FemModel* fem,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
     10void diagnostic_core_linear(Vec* pug,FemModel* fem,int analysis_type,int sub_analysis_type){
    1111
    1212        /*parameters:*/
     
    3333        fem->parameters->FindParam(&solver_string,SolverStringEnum);
    3434
    35         /*Update parameters: */
    36         UpdateFromInputsx(fem->elements,fem->nodes,fem->vertices,fem->loads, fem->materials,fem->parameters,inputs);
    37                
    3835        //*Generate system matrices
    3936        if (verbose) _printf_("   Generating matrices\n");
    40         SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
     37        SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,analysis_type,sub_analysis_type);
    4138
    4239        if (verbose) _printf_("   Generating penalty matrices\n");
    4340                //*Generate penalty system matrices
    44                 PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type);
     41                PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,analysis_type,sub_analysis_type);
    4542
    4643        /*!Reduce matrix from g to f size:*/
  • issm/trunk/src/c/parallel/diagnostic_core_nonlinear.cpp

    r3717 r3732  
    99#include "./parallel.h"
    1010
    11 void diagnostic_core_nonlinear(Vec* pug,Mat* pKff0,Mat* pKfs0, DataSet* input_loads,FemModel* fem,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
     11void diagnostic_core_nonlinear(Vec* pug,Mat* pKff0,Mat* pKfs0, DataSet* input_loads,FemModel* fem,int analysis_type,int sub_analysis_type){
    1212
    1313
     
    3737        char* solver_string=NULL;
    3838        int verbose=0;
    39         int dofs[4]={1,1,0,0}; //recover vx,vy by default. vz and pressure may be.
    4039
    4140        /*Recover parameters: */
     
    5756        }
    5857
    59         /*Initialize ug, uf, ug_old and uf_old */
    60         if (numberofdofspernode>=3)dofs[2]=1;//only keep vz if running with more than 3 dofs per node
    61         if (numberofdofspernode==4)dofs[3]=1;//only keep vz and presure if running with more than 3 dofs per node
    62         ug=inputs->Get("velocity",&dofs[0],4);
    63         VecDuplicate(ug,&old_ug); VecCopy(ug,old_ug);
    64         Reducevectorgtofx(&uf,ug,fem->nodesets);
    65         VecDuplicate(uf,&old_uf); VecCopy(uf,old_uf);
    66 
    6758        count=1;
    6859        converged=0;
    6960        for(;;){
    70 
    71                 if (verbose) _printf_("   Updating inputs\n");
    72 
    73                 /*Set input parameters: */
    74                 if(old_ug)inputs->Add("old_velocity",old_ug,numberofdofspernode,numberofnodes);
    75                 if(ug)inputs->Add("velocity",ug,numberofdofspernode,numberofnodes);
    7661
    7762                //save pointer to old velocity
     
    7964                VecFree(&old_uf);old_uf=uf;
    8065
    81                 /*Update parameters: */
    82                 UpdateFromInputsx(fem->elements,fem->nodes,fem->vertices,loads, fem->materials,fem->parameters,inputs);
    83 
    8466                if (verbose) _printf_("   Generating matrices\n");
    8567                //*Generate system matrices
    86                 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
     68                SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,analysis_type,sub_analysis_type);
    8769
    8870                if (verbose) _printf_("   Generating penalty matrices\n");
    8971                //*Generate penalty system matrices
    90                 PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type);
     72                PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,kflag,pflag,analysis_type,sub_analysis_type);
    9173
    9274                if (verbose) _printf_("   reducing matrix from g to f set\n");
     
    11395                Mergesolutionfromftogx(&ug, uf,fem->Gmn,fem->ys,fem->nodesets);
    11496
     97                //Update inputs using new solution:
     98                fem->UpdateInputsFromSolution(ug,analysis_type,sub_analysis_type);
     99
    115100                //Deal with penalty loads
    116101                if (verbose) _printf_("   penalty constraints\n");
    117                 if (old_ug) inputs->Add("old_velocity",old_ug,numberofdofspernode,numberofnodes);
    118                 inputs->Add("velocity",ug,numberofdofspernode,numberofnodes);
    119                 PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,inputs,analysis_type,sub_analysis_type);
     102                PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,analysis_type,sub_analysis_type);
    120103
    121104                //if(verbose)_printf_("   number of unstable constraints: %i\n",num_unstable_constraints);
     
    127110               
    128111                /*add converged to inputs: */
    129                 inputs->Add("converged",converged);
     112                fem->UpdateInputsFromVector(&converged,ConvergedEnum,ConstantEnum);
    130113
    131114                //rift convergence
     
    150133        if(pKff0){
    151134
    152                 /*Set input parameters: */
    153                 inputs->Add("old_velocity",old_ug,numberofdofspernode,numberofnodes);
    154                 inputs->Add("velocity",ug,numberofdofspernode,numberofnodes);
    155        
    156135                kflag=1; pflag=0; //stiffness generation only
    157136       
    158                 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
     137                SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,analysis_type,sub_analysis_type);
    159138                Reducematrixfromgtofx(&Kff,&Kfs,Kgg,fem->Gmn,fem->nodesets);
    160139                MatFree(&Kgg);VecFree(&pg);
  • issm/trunk/src/c/parallel/gradjcompute_core.cpp

    r3717 r3732  
    55#include "../modules.h"
    66#include "./parallel.h"
     7#include "../EnumDefinitions/EnumDefinitions.h"
    78
    89#ifdef HAVE_CONFIG_H
  • issm/trunk/src/c/parallel/slope_core.cpp

    r3721 r3732  
    88#include "../modules.h"
    99
    10 void slope_core(Vec* pslopex,Vec* pslopey,FemModel* fem,int AnalysisEnum){
     10void slope_core(Vec* pslopex,Vec* pslopey,Model* model,int AnalysisEnum){
    1111
    1212        /*parameters: */
     
    2020        Vec slopey=NULL;
    2121
    22         fem->parameters->FindParam(&verbose,VerboseEnum);
    23         fem->parameters->FindParam(&dim,DimEnum);
     22        /*femmodel used to compute slopes: */
     23        FemModel* fem=NULL;
     24
     25        /*Recover fem model: */
     26        fem=model->fem_sl;
     27
     28
     29        /*Recover some parameters: */
     30        model->parameters->FindParam(&verbose,VerboseEnum);
     31        model->parameters->FindParam(&dim,DimEnum);
     32        model->parameters->FindParam(&isstokes,DimEnum);
     33        model->parameters->FindParam(&ishutter,DimEnum);
    2434
    2535        if(verbose)_printf_("%s\n","computing surface slope (x and y derivatives)...");
    2636
     37        /*Specify type of computations: */
    2738        if(AnalysisEnum==SurfaceAnalysisEnum){
    2839                xanalysis=SurfaceXAnalysisEnum;
     
    3546        else ISSMERROR("%s%s%s"," analysis ",EnumAsString(AnalysisEnum)," not supported yet!");
    3647
     48
     49        /*Early return possible? */
     50        if(!ishutter && AnalysisEnum==SurfaceAnalysisEnum){
     51                /*no need to compute Surface Slope except for Hutter: */
     52                *pslopex=NULL;
     53                *pslopey=NULL;
     54                return;
     55        }
     56        if(!isstokes && AnalysisEnum==BedAnalysisEnum){
     57                /*no need to compute Bed Slope except for full Stokes: */
     58                *pslopex=NULL;
     59                *pslopey=NULL;
     60        }
     61       
     62       
     63        /*Call on core computations: */
    3764        diagnostic_core_linear(&slopex,fem,SlopecomputeAnalysisEnum,xanalysis);
    3865        diagnostic_core_linear(&slopey,fem,SlopecomputeAnalysisEnum,yanalysis);
    3966
    40        
     67        /*extrude if we are in 3D: */
    4168        if (dim==3){
    42                
    4369                if(verbose)_printf_("%s\n","extruding slopes in 3d...");
    4470                FieldExtrudex( slopex, fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,"slopex",0);
  • issm/trunk/src/c/parallel/thermal_core_nonlinear.cpp

    r3717 r3732  
    88#include "../modules.h"
    99
    10 void thermal_core_nonlinear(Vec* ptg,double* pmelting_offset,FemModel* fem,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
     10void thermal_core_nonlinear(Vec* ptg,double* pmelting_offset,FemModel* fem,int analysis_type,int sub_analysis_type){
    1111
    1212        /*solution : */
     
    5656                if(verbose)_printf_("%s\n","starting direct shooting method");
    5757
    58                 if(count==1) inputs->Add("reset_penalties",1);
    59                 else inputs->Add("reset_penalties",0);
    60 
    61                 /*Update parameters: */
    62                 UpdateFromInputsx(fem->elements,fem->nodes,fem->vertices,fem->loads, fem->materials,fem->parameters,inputs);
     58                if(count==1) reset_penalties=1; else reset_penalties=0;
     59                fem->UpdateInputsFromVector(&reset_penalties,ResetPenaltiesEnum,ConstantEnum);
    6360
    6461                //*Generate system matrices
     
    6764                        /*Compute Kgg_nopenalty and pg_nopenalty once for all: */
    6865                        if (count==1){
    69                                 SystemMatricesx(&Kgg_nopenalty, &pg_nopenalty,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
     66                                SystemMatricesx(&Kgg_nopenalty, &pg_nopenalty,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,analysis_type,sub_analysis_type);
    7067                        }
    7168
     
    7572
    7673                        //apply penalties each time
    77                         PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type);
     74                        PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,analysis_type,sub_analysis_type);
    7875                }
    7976                else{
    80                         SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
     77                        SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,analysis_type,sub_analysis_type);
    8178                        //apply penalties
    82                         PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type);
     79                        PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,analysis_type,sub_analysis_type);
    8380                }
    8481
     
    112109                //Deal with penalty loads
    113110                if (verbose) _printf_("   penalty constraints\n");
     111                PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,inputs,analysis_type,sub_analysis_type);
     112               
    114113                inputs->Add("temperature",tg,numberofdofspernode,numberofnodes);
    115                
    116                 PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,inputs,analysis_type,sub_analysis_type);
    117114
    118115                if (!converged){
  • issm/trunk/src/c/shared/Numerics/numerics.h

    r3727 r3732  
    99#include "./SplitSolutionVector.h"
    1010#include "./isnan.h"
     11#include "./SplitSolutionVector.h"
    1112
    1213struct OptArgs;
Note: See TracChangeset for help on using the changeset viewer.