Changeset 2333


Ignore:
Timestamp:
09/27/09 21:43:40 (15 years ago)
Author:
Eric.Larour
Message:

Big commit: created Numpar, new object to hold solution parameters necessary
in elements. This lead to creating FetchParams and WriteParams, which now writes
a DataSet* parameters to a matlab workspace structure and vice versa. We now always have
a DataSet* parametes inside the x code. Introduced also a new configuration phase for the paramters
dataset. Also, rewrote the io/ using overloaded functions IoModelFetchData, FetchData and WriteData.
Much cleaner and less error prone, as arguments are consistently checked.

Location:
issm/trunk
Files:
4 added
7 deleted
176 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/cron/configs/linux64_local

    r2233 r2333  
    7777#by Matlab and nightlyrun.m
    7878
    79 NROPTIONS="'analysis_type',{'diagnostic'},'control',1"
     79NROPTIONS=""
  • issm/trunk/src/c/ComputePressurex/ComputePressurex.cpp

    r303 r2333  
    1313#include "../EnumDefinitions/EnumDefinitions.h"
    1414
    15 void    ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, int numberofnodes){
     15void    ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials,DataSet* parameters){
    1616
    1717        int i;
    1818
    1919        int  found=0;
     20        double numberofnodes;
    2021
    2122        /*output: */
    2223        Vec p_g=NULL;
     24
     25        /*Recover numberofnodes: */
     26    parameters->FindParam(&numberofnodes,"numberofnodes");
    2327
    2428        /*Allocate p_g on numberofnodes (only 1 dof): */
     
    2630
    2731        /*Get elements configured: */
    28         elements->Configure(elements,loads, nodes, materials);
     32        elements->Configure(elements,loads, nodes, materials,parameters);
     33        parameters->Configure(elements,loads, nodes, materials,parameters);
    2934
    3035        /*Call on dataset driver: */
  • issm/trunk/src/c/ComputePressurex/ComputePressurex.h

    r303 r2333  
    99
    1010/* local prototypes: */
    11 void    ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, int numberofnodes);
     11void    ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials,  DataSet* parameters);
    1212
    1313#endif  /* _COMPUTEPRESSUREX_H */
  • issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.cpp

    r1464 r2333  
    1313#include "../EnumDefinitions/EnumDefinitions.h"
    1414
    15 int     ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes,DataSet* materials){
     15int     ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes,DataSet* materials,DataSet* parameters){
    1616
    1717        int noerr=1;
     
    2424
    2525
    26         elements->Configure(elements,loads,nodes,materials);
    27         loads->Configure(elements,loads,nodes,materials);
    28         nodes->Configure(elements,loads,nodes,materials);
     26        elements->Configure(elements,loads,nodes,materials,parameters);
     27        loads->Configure(elements,loads,nodes,materials,parameters);
     28        nodes->Configure(elements,loads,nodes,materials,parameters);
     29        parameters->Configure(elements,loads, nodes, materials,parameters);
    2930
    3031        return noerr;
  • issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.h

    r1 r2333  
    99
    1010/* local prototypes: */
    11 int             ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* materials);
     11int             ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* materials, DataSet* parameters);
    1212
    1313#endif  /* _CONFIGUREOBJECTSX_H */
  • issm/trunk/src/c/DataSet/DataSet.cpp

    r2006 r2333  
    235235                        dataset->AddObject(param);
    236236                }
     237                else if(enum_type==NumparEnum()){
     238                        Numpar* numpar=NULL;
     239                        numpar=new Numpar();
     240                        numpar->Demarshall(&marshalled_dataset);
     241                        dataset->AddObject(numpar);
     242                }
    237243                else if(enum_type==TriaEnum()){
    238244                        Tria* tria=NULL;
     
    315321
    316322}
    317                
    318 int   DataSet::FindParam(void* pvalue, char* name){
    319 
     323
     324#undef __FUNCT__
     325#define __FUNCT__ "DataSet::FindParam"
     326int   DataSet::FindParam(double* pscalar, char* name){
     327       
    320328        /*Go through a dataset, and find a Param* object
    321329         *which parameter name is "name" : */
     
    336344                        if (strcmp(param->GetParameterName(),name)==0){
    337345                                /*Ok, this is the one! Recover the value of this parameter: */
    338                                 param->GetParameterValue(pvalue);
     346                                param->GetParameterValue(pscalar);
    339347                                found=1;
    340348                                break;
     
    345353}
    346354
     355#undef __FUNCT__
     356#define __FUNCT__ "DataSet::FindParam"
     357int   DataSet::FindParam(int* pinteger,char* name){
     358       
     359       
     360        /*Go through a dataset, and find a Param* object
     361         *which parameter name is "name" : */
     362       
     363        vector<Object*>::iterator object;
     364        Param* param=NULL;
     365
     366        int found=0;
     367
     368        for ( object=objects.begin() ; object < objects.end(); object++ ){
     369
     370                /*Find param type objects: */
     371                if((*object)->Enum()==ParamEnum()){
     372
     373                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     374                        param=(Param*)(*object);
     375
     376                        if (strcmp(param->GetParameterName(),name)==0){
     377                                /*Ok, this is the one! Recover the value of this parameter: */
     378                                param->GetParameterValue(pinteger);
     379                                found=1;
     380                                break;
     381                        }
     382                }
     383        }
     384        return found;
     385}
     386
     387#undef __FUNCT__
     388#define __FUNCT__ "DataSet::FindParam"
     389int   DataSet::FindParam(char** pstring,char* name){
     390       
     391        /*Go through a dataset, and find a Param* object
     392         *which parameter name is "name" : */
     393       
     394        vector<Object*>::iterator object;
     395        Param* param=NULL;
     396
     397        int found=0;
     398
     399        for ( object=objects.begin() ; object < objects.end(); object++ ){
     400
     401                /*Find param type objects: */
     402                if((*object)->Enum()==ParamEnum()){
     403
     404                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     405                        param=(Param*)(*object);
     406
     407                        if (strcmp(param->GetParameterName(),name)==0){
     408                                /*Ok, this is the one! Recover the value of this parameter: */
     409                                param->GetParameterValue(pstring);
     410                                found=1;
     411                                break;
     412                        }
     413                }
     414        }
     415        return found;
     416
     417}
     418#undef __FUNCT__
     419#define __FUNCT__ "DataSet::FindParam"
     420int   DataSet::FindParam(char*** pstringarray,int* pM,char* name){
     421       
     422        /*Go through a dataset, and find a Param* object
     423         *which parameter name is "name" : */
     424       
     425        vector<Object*>::iterator object;
     426        Param* param=NULL;
     427
     428        int found=0;
     429
     430        for ( object=objects.begin() ; object < objects.end(); object++ ){
     431
     432                /*Find param type objects: */
     433                if((*object)->Enum()==ParamEnum()){
     434
     435                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     436                        param=(Param*)(*object);
     437
     438                        if (strcmp(param->GetParameterName(),name)==0){
     439                                /*Ok, this is the one! Recover the value of this parameter: */
     440                                param->GetParameterValue(pstringarray);
     441                                if(pM)*pM=param->GetM();
     442                                found=1;
     443                                break;
     444                        }
     445                }
     446        }
     447        return found;
     448
     449}
     450#undef __FUNCT__
     451#define __FUNCT__ "DataSet::FindParam"
     452int   DataSet::FindParam(double** pdoublearray,int* pM, int* pN,char* name){
     453       
     454        /*Go through a dataset, and find a Param* object
     455         *which parameter name is "name" : */
     456       
     457        vector<Object*>::iterator object;
     458        Param* param=NULL;
     459
     460        int found=0;
     461
     462        for ( object=objects.begin() ; object < objects.end(); object++ ){
     463
     464                /*Find param type objects: */
     465                if((*object)->Enum()==ParamEnum()){
     466
     467                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     468                        param=(Param*)(*object);
     469
     470                        if (strcmp(param->GetParameterName(),name)==0){
     471                                /*Ok, this is the one! Recover the value of this parameter: */
     472                                param->GetParameterValue(pdoublearray);
     473                                if(pM)param->GetM();
     474                                if(pN)param->GetN();
     475                                found=1;
     476                                break;
     477                        }
     478                }
     479        }
     480        return found;
     481
     482}
     483#undef __FUNCT__
     484#define __FUNCT__ "DataSet::FindParam"
     485int   DataSet::FindParam(Vec* pvec,char* name){
     486       
     487        /*Go through a dataset, and find a Param* object
     488         *which parameter name is "name" : */
     489       
     490        vector<Object*>::iterator object;
     491        Param* param=NULL;
     492
     493        int found=0;
     494
     495        for ( object=objects.begin() ; object < objects.end(); object++ ){
     496
     497                /*Find param type objects: */
     498                if((*object)->Enum()==ParamEnum()){
     499
     500                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     501                        param=(Param*)(*object);
     502
     503                        if (strcmp(param->GetParameterName(),name)==0){
     504                                /*Ok, this is the one! Recover the value of this parameter: */
     505                                param->GetParameterValue(pvec);
     506                                found=1;
     507                                break;
     508                        }
     509                }
     510        }
     511        return found;
     512
     513}
     514#undef __FUNCT__
     515#define __FUNCT__ "DataSet::FindParam"
     516int   DataSet::FindParam(Mat* pmat,char* name){
     517       
     518        /*Go through a dataset, and find a Param* object
     519         *which parameter name is "name" : */
     520       
     521        vector<Object*>::iterator object;
     522        Param* param=NULL;
     523
     524        int found=0;
     525
     526        for ( object=objects.begin() ; object < objects.end(); object++ ){
     527
     528                /*Find param type objects: */
     529                if((*object)->Enum()==ParamEnum()){
     530
     531                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     532                        param=(Param*)(*object);
     533
     534                        if (strcmp(param->GetParameterName(),name)==0){
     535                                /*Ok, this is the one! Recover the value of this parameter: */
     536                                param->GetParameterValue(pmat);
     537                                found=1;
     538                                break;
     539                        }
     540                }
     541        }
     542        return found;
     543
     544}
     545
     546#undef __FUNCT__
     547#define __FUNCT__ "DataSet::FindResult"
    347548int   DataSet::FindResult(Vec* presult,char* name){
    348549
     
    8881089
    8891090
    890 void DataSet::Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials){
     1091void DataSet::Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials,DataSet* parameters){
    8911092
    8921093        vector<Object*>::iterator object;
     
    8941095        Load* load=NULL;
    8951096        Node* node=NULL;
     1097        Numpar* numpar=NULL;
    8961098
    8971099        for ( object=objects.begin() ; object < objects.end(); object++ ){
     
    9001102
    9011103                        element=(Element*)(*object);
    902                         element->Configure(loads,nodes,materials);
     1104                        element->Configure(loads,nodes,materials,parameters);
    9031105                }
    9041106                if(EnumIsLoad((*object)->Enum())){
     
    9121114                        node=(Node*)(*object);
    9131115                        node->Configure(nodes);
     1116                }
     1117               
     1118                if((*object)->Enum()==NumparEnum()){
     1119                        numpar=(Numpar*)(*object);
     1120                        numpar->Configure(parameters);
    9141121                }
    9151122
  • issm/trunk/src/c/DataSet/DataSet.h

    r1805 r2333  
    4444                int   DeleteObject(int id);
    4545                int   Size();
    46                 int   FindParam(void* pvalue, char* name);
     46                int   FindParam(double* pscalar, char* name);
     47                int   FindParam(int* pinteger,char* name);
     48                int   FindParam(char** pstring,char* name);
     49                int   FindParam(char*** pstringarray,int* pM,char* name);
     50                int   FindParam(double** pdoublearray,int* pM,int* pN,char* name);
     51                int   FindParam(Vec* pvec,char* name);
     52                int   FindParam(Mat* pmat,char* name);
    4753                int   FindResult(Vec* presult,char* name);
    4854                Object* FindParamObject(char* name);
     
    5864                void  FlagNodeSets(Vec pv_g, Vec pv_m, Vec pv_n, Vec pv_f, Vec pv_s);
    5965                void  clear();
    60                 void  Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials);
     66                void  Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials,DataSet* parameters);
    6167                Object* GetObjectByOffset(int offset);
    6268                Object* GetObjectById(int* poffset,int eid);
  • issm/trunk/src/c/Dofx/Dofx.cpp

    r2316 r2333  
    3535
    3636        /*First, recover number of grids from parameters: */
    37         found=params->FindParam((void*)&numberofnodes,"numberofnodes");
     37        found=params->FindParam(&numberofnodes,"numberofnodes");
    3838        if(!found)throw ErrorException(__FUNCT__," could not find numberofnodes in parameters");
    3939
    4040        /*Recover number of dofs per node: */
    41         found=params->FindParam((void*)&numberofdofspernode,"numberofdofspernode");
     41        found=params->FindParam(&numberofdofspernode,"numberofdofspernode");
    4242        if(!found)throw ErrorException(__FUNCT__," could not find numberofdofspernode in parameters");
    4343
  • issm/trunk/src/c/Dux/Dux.cpp

    r1185 r2333  
    1313#include "../EnumDefinitions/EnumDefinitions.h"
    1414
    15 void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,
     15void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,
    1616                        ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
    1717
     
    2424
    2525        /*First, get elements and loads configured: */
    26         elements->Configure(elements,loads, nodes, materials);
     26        elements->Configure(elements,loads, nodes, materials,parameters);
     27        parameters->Configure(elements,loads, nodes, materials,parameters);
    2728
    2829        /*Get size of matrix: */
  • issm/trunk/src/c/Dux/Dux.h

    r1185 r2333  
    99
    1010/* local prototypes: */
    11 void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,
     11void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,
    1212                        ParameterInputs* inputs,int analysis_type,int sub_analysis_type);
    1313
  • issm/trunk/src/c/EnumDefinitions/EnumDefinitions.cpp

    r2309 r2333  
    8181int MaticeEnum(void){                   return          441; }
    8282int MatparEnum(void){                   return          442; }
     83int NumparEnum(void){                   return          443; }
    8384/*Inputs: */
    8485int InputEnum(void){                    return          450; }
  • issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h

    r2309 r2333  
    8282int MaticeEnum(void);
    8383int MatparEnum(void);
     84int NumparEnum(void);
    8485/*Inputs: */
    8586int InputEnum(void);
  • issm/trunk/src/c/FieldDepthAveragex/FieldDepthAveragex.cpp

    r848 r2333  
    1313#include "../EnumDefinitions/EnumDefinitions.h"
    1414
    15 void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,char* fieldname){
     15void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,char* fieldname){
    1616
    1717        double* field_serial=NULL;
    1818
    1919        /*First, get elements and nodes configured: */
    20         elements->Configure(elements,loads, nodes, materials);
    21         nodes->Configure(elements,loads, nodes, materials);
     20        elements->Configure(elements,loads, nodes, materials,parameters);
     21        nodes->Configure(elements,loads, nodes, materials,parameters);
     22        parameters->Configure(elements,loads, nodes, materials,parameters);
    2223
    2324        /*Serialize field: */
  • issm/trunk/src/c/FieldDepthAveragex/FieldDepthAveragex.h

    r848 r2333  
    99
    1010/* local prototypes: */
    11 void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,char* fieldname);
     11void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,char* fieldname);
    1212
    1313#endif  /* _FIELDDEPTHAVERAGEX_H */
  • issm/trunk/src/c/FieldExtrudex/FieldExtrudex.cpp

    r848 r2333  
    1313#include "../EnumDefinitions/EnumDefinitions.h"
    1414
    15 void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,char* field_name,int collapse){
     15void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,char* field_name,int collapse){
    1616
    1717        double* field_serial=NULL;
    1818
    1919        /*First, get elements and nodes configured: */
    20         elements->Configure(elements,loads, nodes, materials);
    21         nodes->Configure(elements,loads, nodes, materials);
     20        elements->Configure(elements,loads, nodes, materials,parameters);
     21        nodes->Configure(elements,loads, nodes, materials,parameters);
     22        parameters->Configure(elements,loads, nodes, materials,parameters);
    2223
    2324        /*Serialize field: */
  • issm/trunk/src/c/FieldExtrudex/FieldExtrudex.h

    r848 r2333  
    99
    1010/* local prototypes: */
    11 void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,char* field_name, int collapse);
     11void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,char* field_name, int collapse);
    1212
    1313#endif  /* _FIELDEXTRUDEX_H */
  • issm/trunk/src/c/Gradjx/Gradjx.cpp

    r1188 r2333  
    1313#include "../EnumDefinitions/EnumDefinitions.h"
    1414
    15 void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,
     15void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,
    1616                        ParameterInputs* inputs,int analysis_type,int sub_analysis_type,char* control_type){
    1717
     
    2020
    2121        /*First, get elements and loads configured: */
    22         elements->Configure(elements,loads, nodes, materials);
     22        elements->Configure(elements,loads, nodes, materials,parameters);
     23        parameters->Configure(elements,loads, nodes, materials,parameters);
    2324
    2425        /*Allocate grad_g: */
  • issm/trunk/src/c/Gradjx/Gradjx.h

    r1188 r2333  
    99
    1010/* local prototypes: */
    11 void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,
     11void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,  DataSet* parameters,
    1212                        ParameterInputs* inputs,int analysis_type,int sub_analysis_type,char* control_type);
    1313
  • issm/trunk/src/c/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp

    r2304 r2333  
    117117                /*Get indices i and j that form a square around the currant triangle*/
    118118                if (yflip){
    119                         i1=floor((y_tria_max-y_grid_max)/yposting)-1;
    120                         i2= ceil((y_tria_min-y_grid_max)/yposting);
     119                        i1=(int)floor((y_tria_max-y_grid_max)/yposting)-1;
     120                        i2= (int)ceil((y_tria_min-y_grid_max)/yposting);
    121121                }
    122122                else{
    123                         i1=floor((y_tria_min-y_grid_min)/yposting)-1;
    124                         i2= ceil((y_tria_max-y_grid_min)/yposting);
     123                        i1=(int)floor((y_tria_min-y_grid_min)/yposting)-1;
     124                        i2= (int)ceil((y_tria_max-y_grid_min)/yposting);
    125125                }
    126126                if (xflip){
    127                         j1=floor((x_tria_max-x_grid_max)/xposting)-1;
    128                         j2= ceil((x_tria_min-x_grid_max)/xposting);
     127                        j1=(int)floor((x_tria_max-x_grid_max)/xposting)-1;
     128                        j2= (int)ceil((x_tria_min-x_grid_max)/xposting);
    129129                }
    130130                else{
    131                         j1=floor((x_tria_min-x_grid_min)/xposting)-1;
    132                         j2= ceil((x_tria_max-x_grid_min)/xposting);
     131                        j1=(int)floor((x_tria_min-x_grid_min)/xposting)-1;
     132                        j2= (int)ceil((x_tria_max-x_grid_min)/xposting);
    133133                }
    134134
  • issm/trunk/src/c/Makefile.am

    r2316 r2333  
    6060                                        ./objects/Matpar.h\
    6161                                        ./objects/Matpar.cpp\
     62                                        ./objects/Numpar.h\
     63                                        ./objects/Numpar.cpp\
    6264                                        ./objects/Input.h\
    6365                                        ./objects/Input.cpp\
     
    170172                                        ./io/WriteData.cpp\
    171173                                        ./io/WriteDataToDisk.cpp\
    172                                         ./io/SerialFetchData.cpp\
    173                                         ./io/ParallelFetchData.cpp\
    174                                         ./io/ParallelFetchInteger.cpp\
    175                                         ./io/ParallelFetchMat.cpp\
    176                                         ./io/ParallelFetchScalar.cpp\
    177                                         ./io/ParallelFetchString.cpp\
    178174                                        ./io/IoModelFetchData.cpp\
    179175                                        ./io/WriteNodeSets.cpp\
    180176                                        ./io/WriteParams.cpp\
     177                                        ./io/FetchParams.cpp\
    181178                                        ./io/FetchNodeSets.cpp\
    182179                                        ./io/ParameterInputsInit.cpp\
     
    359356                                        ./objects/Matpar.h\
    360357                                        ./objects/Matpar.cpp\
     358                                        ./objects/Numpar.h\
     359                                        ./objects/Numpar.cpp\
    361360                                        ./objects/Input.h\
    362361                                        ./objects/Input.cpp\
     
    467466                                        ./io/WriteData.cpp\
    468467                                        ./io/WriteDataToDisk.cpp\
    469                                         ./io/SerialFetchData.cpp\
    470                                         ./io/ParallelFetchData.cpp\
    471                                         ./io/ParallelFetchInteger.cpp\
    472                                         ./io/ParallelFetchMat.cpp\
    473                                         ./io/ParallelFetchScalar.cpp\
    474                                         ./io/ParallelFetchString.cpp\
    475468                                        ./io/IoModelFetchData.cpp\
    476469                                        ./io/WriteNodeSets.cpp\
  • issm/trunk/src/c/MassFluxx/MassFluxx.cpp

    r2112 r2333  
    1313#include "../EnumDefinitions/EnumDefinitions.h"
    1414
    15 void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,
    16                 double* segments,int num_segments,double* ug){
     15void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,DataSet* parameters,  double* segments,int num_segments,double* ug){
    1716
    1817        int i,j;
     
    2827
    2928        /*First, get elements and loads configured: */
    30         elements->Configure(elements,loads, nodes, materials);
    31         loads->Configure(elements, loads, nodes, materials);
     29        elements->Configure(elements,loads, nodes, materials,parameters);
     30        loads->Configure(elements, loads, nodes, materials,parameters);
     31        parameters->Configure(elements,loads, nodes, materials,parameters);
    3232
    3333        /*Go through segments, and then elements, and figure out which elements belong to a segment.
  • issm/trunk/src/c/MassFluxx/MassFluxx.h

    r2112 r2333  
    1010
    1111/* local prototypes: */
    12 void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,double* segments,int num_segments,double* ug);
     12void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, DataSet* parameters,double* segments,int num_segments,double* ug);
    1313
    1414
  • issm/trunk/src/c/Misfitx/Misfitx.cpp

    r1185 r2333  
    1313#include "../EnumDefinitions/EnumDefinitions.h"
    1414
    15 void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 
     15void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,DataSet* parameters,
    1616                        ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
    1717       
     
    2121       
    2222        /*First, get elements and loads configured: */
    23         elements->Configure(elements,loads, nodes, materials);
     23        elements->Configure(elements,loads, nodes, materials,parameters);
     24        parameters->Configure(elements,loads, nodes, materials,parameters);
    2425
    2526        /*Compute gradients: */
  • issm/trunk/src/c/Misfitx/Misfitx.h

    r1185 r2333  
    99
    1010/* local prototypes: */
    11 void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,
     11void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,
    1212                        ParameterInputs* inputs,int analysis_type,int sub_analysis_type);
    1313
  • issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp

    r2268 r2333  
    4545        //control analysis?
    4646        count++;
    47         param= new Param(count,"control_analysis",INTEGER);
    48         param->SetInteger(iomodel->control_analysis);
     47        param= new Param(count,"control_analysis",DOUBLE);
     48        param->SetDouble(iomodel->control_analysis);
    4949        parameters->AddObject(param);
    5050       
     
    6666                /*control_steady: */
    6767                count++;
    68                 param= new Param(count,"control_steady",INTEGER);
    69                 param->SetInteger(0);
     68                param= new Param(count,"control_steady",DOUBLE);
     69                param->SetDouble(0);
    7070                parameters->AddObject(param);
    7171
    7272                /*nsteps: */
    7373                count++;
    74                 param= new Param(count,"nsteps",INTEGER);
    75                 param->SetInteger(iomodel->nsteps);
     74                param= new Param(count,"nsteps",DOUBLE);
     75                param->SetDouble(iomodel->nsteps);
    7676                parameters->AddObject(param);
    7777
     
    119119
    120120                /*Now, recover fit, optscal and maxiter as vectors: */
    121                 IoModelFetchData((void**)&iomodel->fit,NULL,NULL,iomodel_handle,"fit","Matrix","Mat");
    122                 IoModelFetchData((void**)&iomodel->cm_jump,NULL,NULL,iomodel_handle,"cm_jump","Matrix","Mat");
    123                 IoModelFetchData((void**)&iomodel->optscal,NULL,NULL,iomodel_handle,"optscal","Matrix","Mat");
    124                 IoModelFetchData((void**)&iomodel->maxiter,NULL,NULL,iomodel_handle,"maxiter","Matrix","Mat");
     121                IoModelFetchData(&iomodel->fit,NULL,NULL,iomodel_handle,"fit");
     122                IoModelFetchData(&iomodel->cm_jump,NULL,NULL,iomodel_handle,"cm_jump");
     123                IoModelFetchData(&iomodel->optscal,NULL,NULL,iomodel_handle,"optscal");
     124                IoModelFetchData(&iomodel->maxiter,NULL,NULL,iomodel_handle,"maxiter");
    125125
    126126                count++;
     
    150150
    151151                /*Get vx, vx_obs, vy, vy_obs, and the parameter value: */
    152                 IoModelFetchData((void**)&vx,NULL,NULL,iomodel_handle,"vx","Matrix","Mat");
    153                 IoModelFetchData((void**)&vy,NULL,NULL,iomodel_handle,"vy","Matrix","Mat");
    154                 IoModelFetchData((void**)&vz,NULL,NULL,iomodel_handle,"vz","Matrix","Mat");
    155                 IoModelFetchData((void**)&vx_obs,NULL,NULL,iomodel_handle,"vx_obs","Matrix","Mat");
    156                 IoModelFetchData((void**)&vy_obs,NULL,NULL,iomodel_handle,"vy_obs","Matrix","Mat");
    157                 IoModelFetchData((void**)&control_parameter,NULL,NULL,iomodel_handle,iomodel->control_type,"Matrix","Mat");
     152                IoModelFetchData(&vx,NULL,NULL,iomodel_handle,"vx");
     153                IoModelFetchData(&vy,NULL,NULL,iomodel_handle,"vy");
     154                IoModelFetchData(&vz,NULL,NULL,iomodel_handle,"vz");
     155                IoModelFetchData(&vx_obs,NULL,NULL,iomodel_handle,"vx_obs");
     156                IoModelFetchData(&vy_obs,NULL,NULL,iomodel_handle,"vy_obs");
     157                IoModelFetchData(&control_parameter,NULL,NULL,iomodel_handle,iomodel->control_type);
    158158
    159159                u_g=(double*)xcalloc(iomodel->numberofnodes*3,sizeof(double));
  • issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp

    r2330 r2333  
    2020        DataSet* parameters = NULL;
    2121        Param*   param = NULL;
    22         int      count=1;
     22        Numpar*  numpar=NULL;
     23        int      count=0;
    2324        int      numberofdofspernode;
    2425        int      dim;
     
    3334        /*Initialize dataset: */
    3435        parameters   = new DataSet(ParametersEnum());
    35        
     36
     37        //solution parameters: always 1'st, to speed-up its lookup by elements..
     38        count++;
     39        numpar= new Numpar(count,
     40                        iomodel->meanvel, iomodel->epsvel, iomodel->artdiff, iomodel->viscosity_overshoot, iomodel->stokesreconditioning, iomodel->cm_noisedampening);
     41        parameters->AddObject(numpar);
     42
     43
    3644        //analysis and subanalysis
    3745        count++;
    38         param= new Param(count,"analysis_type",INTEGER);
    39         param->SetInteger(iomodel->analysis_type);
    40         parameters->AddObject(param);
    41 
    42         count++;
    43         param= new Param(count,"sub_analysis_type",INTEGER);
    44         param->SetInteger(iomodel->sub_analysis_type);
    45         parameters->AddObject(param);
    46 
     46        param= new Param(count,"analysis_type",DOUBLE);
     47        param->SetDouble(iomodel->analysis_type);
     48        parameters->AddObject(param);
     49
     50        count++;
     51        param= new Param(count,"sub_analysis_type",DOUBLE);
     52        param->SetDouble(iomodel->sub_analysis_type);
     53        parameters->AddObject(param);
     54
     55       
    4756        //dimension 2d or 3d:
    4857        if (strcmp(iomodel->meshtype,"2d")==0)dim=2;
     
    5059
    5160        count++;
    52         param= new Param(count,"dim",INTEGER);
    53         param->SetInteger(dim);
     61        param= new Param(count,"dim",DOUBLE);
     62        param->SetDouble(dim);
    5463        parameters->AddObject(param);
    5564
    5665        //elements types
    5766        count++;
    58         param= new Param(count,"ishutter",INTEGER);
    59         param->SetInteger(iomodel->ishutter);
    60         parameters->AddObject(param);
    61 
    62         count++;
    63         param= new Param(count,"ismacayealpattyn",INTEGER);
    64         param->SetInteger(iomodel->ismacayealpattyn);
    65         parameters->AddObject(param);
    66 
    67 
    68         count++;
    69         param= new Param(count,"isstokes",INTEGER);
    70         param->SetInteger(iomodel->isstokes);
     67        param= new Param(count,"ishutter",DOUBLE);
     68        param->SetDouble(iomodel->ishutter);
     69        parameters->AddObject(param);
     70
     71        count++;
     72        param= new Param(count,"ismacayealpattyn",DOUBLE);
     73        param->SetDouble(iomodel->ismacayealpattyn);
     74        parameters->AddObject(param);
     75
     76
     77        count++;
     78        param= new Param(count,"isstokes",DOUBLE);
     79        param->SetDouble(iomodel->isstokes);
    7180        parameters->AddObject(param);
    7281
    7382        /*verbose: */
    74         param= new Param(count,"verbose",INTEGER);
    75         param->SetInteger(iomodel->verbose);
     83        count++;
     84        param= new Param(count,"verbose",DOUBLE);
     85        param->SetDouble(iomodel->verbose);
    7686        parameters->AddObject(param);
    7787
     
    126136        /*lowmem: */
    127137        count++;
    128         param= new Param(count,"lowmem",INTEGER);
    129         param->SetInteger(iomodel->lowmem);
     138        param= new Param(count,"lowmem",DOUBLE);
     139        param->SetDouble(iomodel->lowmem);
    130140        parameters->AddObject(param);
    131141
    132142        /*connectivity: */
    133143        count++;
    134         param= new Param(count,"connectivity",INTEGER);
    135         param->SetInteger(iomodel->connectivity);
     144        param= new Param(count,"connectivity",DOUBLE);
     145        param->SetDouble(iomodel->connectivity);
    136146        parameters->AddObject(param);
    137147
     
    160170        parameters->AddObject(param);
    161171
     172        /*meanvel: */
     173        count++;
     174        param= new Param(count,"meanvel",DOUBLE);
     175        param->SetDouble(iomodel->meanvel);
     176        parameters->AddObject(param);
     177       
     178        /*artdiff: */
     179        count++;
     180        param= new Param(count,"artdiff",DOUBLE);
     181        param->SetDouble(iomodel->artdiff);
     182        parameters->AddObject(param);
     183       
     184        /*epsvel: */
     185        count++;
     186        param= new Param(count,"epsvel",DOUBLE);
     187        param->SetDouble(iomodel->epsvel);
     188        parameters->AddObject(param);
     189
    162190        /*penalty_melting: */
    163191        count++;
     
    168196        /*min_thermal_constraints: */
    169197        count++;
    170         param= new Param(count,"min_thermal_constraints",INTEGER);
    171         param->SetInteger(iomodel->min_thermal_constraints);
     198        param= new Param(count,"min_thermal_constraints",DOUBLE);
     199        param->SetDouble(iomodel->min_thermal_constraints);
    172200        parameters->AddObject(param);
    173201
    174202        /*stabilize_constraints: */
    175203        count++;
    176         param= new Param(count,"stabilize_constraints",INTEGER);
    177         param->SetInteger(iomodel->stabilize_constraints);
     204        param= new Param(count,"stabilize_constraints",DOUBLE);
     205        param->SetDouble(iomodel->stabilize_constraints);
    178206        parameters->AddObject(param);
    179207
     
    184212        parameters->AddObject(param);
    185213
     214        /*viscosity_overshoot: */
     215        count++;
     216        param= new Param(count,"viscosity_overshoot",DOUBLE);
     217        param->SetDouble(iomodel->viscosity_overshoot);
     218        parameters->AddObject(param);
     219
     220        /*cm_noisedampening: */
     221        count++;
     222        param= new Param(count,"cm_noisedampening",DOUBLE);
     223        param->SetDouble(iomodel->cm_noisedampening);
     224        parameters->AddObject(param);
     225
    186226        /*waitonlock: */
    187227        count++;
    188         param= new Param(count,"waitonlock",INTEGER);
    189         param->SetInteger(iomodel->waitonlock);
     228        param= new Param(count,"waitonlock",DOUBLE);
     229        param->SetDouble(iomodel->waitonlock);
    190230        parameters->AddObject(param);
    191231
     
    198238        /*plot: */
    199239        count++;
    200         param= new Param(count,"plot",INTEGER);
    201         param->SetInteger(iomodel->plot);
     240        param= new Param(count,"plot",DOUBLE);
     241        param->SetDouble(iomodel->plot);
    202242        parameters->AddObject(param);
    203243
    204244        /*numberofgrids: */
    205245        count++;
    206         param= new Param(count,"numberofnodes",INTEGER);
    207         param->SetInteger(iomodel->numberofnodes);
     246        param= new Param(count,"numberofnodes",DOUBLE);
     247        param->SetDouble(iomodel->numberofnodes);
    208248        parameters->AddObject(param);
    209249
     
    212252
    213253        count++;
    214         param= new Param(count,"numberofdofspernode",INTEGER);
    215         param->SetInteger(numberofdofspernode);
     254        param= new Param(count,"numberofdofspernode",DOUBLE);
     255        param->SetDouble(numberofdofspernode);
    216256        parameters->AddObject(param)
    217257                ;
    218258        /*numrifts: */
    219         IoModelFetchData((void**)&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo","Matrix","Mat");
    220         count++;
    221         param= new Param(count,"numrifts",INTEGER);
    222         param->SetInteger(iomodel->numrifts);
     259        IoModelFetchData(&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo");
     260        count++;
     261        param= new Param(count,"numrifts",DOUBLE);
     262        param->SetDouble(iomodel->numrifts);
    223263        parameters->AddObject(param);
    224264        xfree((void**)&iomodel->riftinfo);
     
    227267        /*parameteroutput: */
    228268        count++;
    229         param= new Param(count,"numoutput",INTEGER);
    230         param->SetInteger(iomodel->numoutput);
     269        param= new Param(count,"numoutput",DOUBLE);
     270        param->SetDouble(iomodel->numoutput);
    231271        parameters->AddObject(param);
    232272
     
    238278                for(i=0;i<iomodel->numoutput;i++){
    239279                        pfield2=mxGetCell(pfield,i);
    240                         FetchData((void**)&descriptor,NULL,NULL,pfield2,"String",NULL);
     280                        FetchData(&descriptor,pfield2);
    241281                        parameteroutput[i]=descriptor;
    242282                }
     
    245285                for(i=0;i<iomodel->numoutput;i++){
    246286                        sprintf(tag,"%s%i","parameteroutput_",i);
    247                         IoModelFetchData((void**)&descriptor,NULL,NULL,iomodel_handle,tag,"String",NULL);
     287                        IoModelFetchData(&descriptor,iomodel_handle,tag);
    248288                        parameteroutput[i]=descriptor;
    249289                }
  • issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp

    r1832 r2333  
    4747
    4848        /*Fetch data: */
    49         IoModelFetchData((void**)&spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity","Matrix","Mat");
    50         IoModelFetchData((void**)&gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","Matrix","Mat");
     49        IoModelFetchData(&spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity");
     50        IoModelFetchData(&gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");
    5151
    5252        count=0;
     
    9696        /*First fetch penalties: */
    9797        if (strcmp(iomodel->meshtype,"3d")==0){
    98                 IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
     98                IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
    9999        }
    100100
  • issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp

    r1904 r2333  
    5252        int tria_mid;
    5353        int tria_mparid;
     54        int tria_numparid;
    5455        int tria_g[3];
    5556        double tria_h[3];
     
    6465        double tria_q;
    6566        int    tria_shelf;
    66         double tria_meanvel;/*!scaling ratio for velocities*/
    67         double tria_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
    68         double tria_viscosity_overshoot;
    69         int    tria_artdiff;
    7067        bool   tria_onwater;
    7168       
     
    7976        int penta_mid;
    8077        int penta_mparid;
     78        int penta_numparid;
    8179        int penta_g[6];
    8280        double penta_h[6];
     
    9088        int penta_onbed;
    9189        int penta_onsurface;
    92         double penta_meanvel;/*!scaling ratio for velocities*/
    93         double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
    9490        int penta_collapse;
    9591        double penta_melting[6];
    9692        double penta_accumulation[6];
    9793        double penta_geothermalflux[6];
    98         int penta_artdiff;
    9994        int penta_thermal_steadystate;
    100         double penta_viscosity_overshoot;
    101         double penta_stokesreconditioning;
    10295        bool   penta_onwater;
    10396
     
    165158        if(strcmp(iomodel->meshtype,"2d")==0){
    166159                /*load elements: */
    167                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
     160                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
    168161        }
    169162        else{
    170163                /*load elements2d: */
    171                 IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
     164                IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
    172165        }
    173166
     
    180173
    181174        /*Deal with rifts, they have to be included into one partition only, not several: */
    182         IoModelFetchData((void**)&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo","Matrix","Mat");
     175        IoModelFetchData(&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo");
    183176
    184177        for(i=0;i<iomodel->numrifts;i++){
     
    202195
    203196                /*Fetch data needed: */
    204                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
    205                 IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    206                 IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
    207                 IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    208                 IoModelFetchData((void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");
    209                 IoModelFetchData((void**)&iomodel->p,NULL,NULL,iomodel_handle,"p","Matrix","Mat");
    210                 IoModelFetchData((void**)&iomodel->q,NULL,NULL,iomodel_handle,"q","Matrix","Mat");
    211                 IoModelFetchData((void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");
    212                 IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
    213                 IoModelFetchData((void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");
    214                 IoModelFetchData((void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");
    215                 IoModelFetchData((void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");
    216                 IoModelFetchData((void**)&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");
    217                 IoModelFetchData((void**)&iomodel->melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");
     197                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
     198                IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     199                IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
     200                IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     201                IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
     202                IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p");
     203                IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q");
     204                IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
     205                IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
     206                IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
     207                IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
     208                IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
     209                IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
     210                IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
    218211               
    219212                for (i=0;i<iomodel->numberofelements;i++){
     
    230223                                tria_mid=i+1; //refers to the corresponding material property card
    231224                                tria_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
     225                                tria_numparid=1;
    232226
    233227                                /*vertices offsets: */
     
    272266                                tria_onwater=(bool)*(iomodel->elementonwater+i);
    273267
    274                                 tria_meanvel=iomodel->meanvel;
    275                                 tria_epsvel=iomodel->epsvel;
    276 
    277                                 /*viscosity_overshoot*/
    278                                 tria_viscosity_overshoot=iomodel->viscosity_overshoot;
    279 
    280268                                /*Create tria element using its constructor:*/
    281                                 tria=new Tria(tria_id, tria_mid, tria_mparid, tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_meanvel, tria_epsvel, tria_viscosity_overshoot,tria_artdiff,tria_onwater);
     269                                tria=new Tria(tria_id, tria_mid, tria_mparid, tria_numparid,tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_onwater);
    282270
    283271                                /*Add tria element to elements dataset: */
     
    339327
    340328                /*Fetch data needed: */
    341                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
    342                 IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    343                 IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
    344                 IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    345                 IoModelFetchData((void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");
    346                 IoModelFetchData((void**)&iomodel->p,NULL,NULL,iomodel_handle,"p","Matrix","Mat");
    347                 IoModelFetchData((void**)&iomodel->q,NULL,NULL,iomodel_handle,"q","Matrix","Mat");
    348                 IoModelFetchData((void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");
    349                 IoModelFetchData((void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");
    350                 IoModelFetchData((void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");
    351                 IoModelFetchData((void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");
    352                 IoModelFetchData((void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");
    353                 IoModelFetchData((void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");
    354                 IoModelFetchData((void**)&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");
    355                 IoModelFetchData((void**)&iomodel->melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");
    356                 IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
     329                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
     330                IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     331                IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
     332                IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     333                IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
     334                IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p");
     335                IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q");
     336                IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
     337                IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
     338                IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
     339                IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
     340                IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
     341                IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
     342                IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
     343                IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
     344                IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
    357345               
    358346                for (i=0;i<iomodel->numberofelements;i++){
     
    368356                                penta_mid=i+1; //refers to the corresponding material property card
    369357                                penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
     358                                penta_numparid=1;
    370359
    371360                                /*vertices,thickness,surface,bed and drag: */
     
    390379                                penta_onbed=(int)*(iomodel->elementonbed+i);
    391380                                penta_onsurface=(int)*(iomodel->elementonsurface+i);
    392                                 penta_meanvel=iomodel->meanvel;
    393                                 penta_epsvel=iomodel->epsvel;
    394381                                penta_onwater=(bool)*(iomodel->elementonwater+i);
    395382                               
    396                                 /*viscosity_overshoot*/
    397                                 penta_viscosity_overshoot=iomodel->viscosity_overshoot;
    398 
    399383                                if (*(iomodel->elements_type+2*i+0)==MacAyealFormulationEnum()){ //elements of type 3 are MacAyeal type Penta. We collapse the formulation on their base.
    400384                                        penta_collapse=1;
     
    406390
    407391                                /*Create Penta using its constructor:*/
    408                                 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
    409                                                 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel,
    410                                                 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff,
    411                                                 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,penta_onwater);
     392                                penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
     393                                                penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,
     394                                                penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,
     395                                                penta_thermal_steadystate,penta_onwater);
    412396
    413397                                /*Add penta element to elements dataset: */
     
    524508       
    525509                /*Get penalties: */
    526                 IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
     510                IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
    527511
    528512                if(iomodel->numpenalties){
     
    560544        /*First fetch data: */
    561545        if (strcmp(iomodel->meshtype,"3d")==0){
    562                 IoModelFetchData((void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");
    563                 IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
    564         }
    565         IoModelFetchData((void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");
    566         IoModelFetchData((void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");
    567         IoModelFetchData((void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");
    568         IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    569         IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    570         IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
    571         IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
    572         IoModelFetchData((void**)&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","Matrix","Mat");
    573         IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
    574         IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
     546                IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
     547                IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
     548        }
     549        IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x");
     550        IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
     551        IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
     552        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     553        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     554        IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
     555        IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
     556        IoModelFetchData(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");
     557        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
     558        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
    575559
    576560        /*Get number of dofs per node: */
  • issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp

    r1854 r2333  
    7979        /*Create pressure loads as boundary conditions. Pay attention to the partitioning if we are running in parallel (the grids
    8080         * referenced by a certain load must belong to the cluster node): */
    81         IoModelFetchData((void**)&iomodel->pressureload,&iomodel->numberofpressureloads,NULL,iomodel_handle,"pressureload","Matrix","Mat");
    82         IoModelFetchData((void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");
    83         IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    84         IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
     81        IoModelFetchData(&iomodel->pressureload,&iomodel->numberofpressureloads,NULL,iomodel_handle,"pressureload");
     82        IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
     83        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     84        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
    8585
    8686        /*First load data:*/
     
    157157        /*Create penpair loads also for rift grids, so that they don't penetrate one another, if needed: */
    158158        /*First fetch rifts: */
    159         IoModelFetchData((void**)&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo","Matrix","Mat");
    160         IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    161         IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    162         IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
    163         IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
     159        IoModelFetchData(&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo");
     160        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     161        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     162        IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
     163        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
    164164       
    165165        if(iomodel->numrifts){
  • issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateParametersDiagnosticHoriz.cpp

    r1832 r2333  
    3434
    3535        /*Get vx and vy: */
    36         IoModelFetchData((void**)&vx,NULL,NULL,iomodel_handle,"vx","Matrix","Mat");
    37         IoModelFetchData((void**)&vy,NULL,NULL,iomodel_handle,"vy","Matrix","Mat");
    38         IoModelFetchData((void**)&vz,NULL,NULL,iomodel_handle,"vz","Matrix","Mat");
     36        IoModelFetchData(&vx,NULL,NULL,iomodel_handle,"vx");
     37        IoModelFetchData(&vy,NULL,NULL,iomodel_handle,"vy");
     38        IoModelFetchData(&vz,NULL,NULL,iomodel_handle,"vz");
    3939
    4040        ug=(double*)xcalloc(iomodel->numberofnodes*3,sizeof(double));
  • issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp

    r1835 r2333  
    4545       
    4646        /*Fetch data: */
    47         IoModelFetchData((void**)&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","Matrix","Mat");
     47        IoModelFetchData(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");
    4848
    4949        /*vx and vy are spc'd if we are not on gridonhutter: */
  • issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateElementsNodesAndMaterialsDiagnosticHutter.cpp

    r1941 r2333  
    5353        int   sing_mid;
    5454        int   sing_mparid;
     55        int   sing_numparid;
    5556        int   sing_g;
    5657        double sing_h,sing_k;
     
    6061        int   beam_mid;
    6162        int   beam_mparid;
     63        int   beam_numparid;
    6264        int   beam_g[2];
    6365        double beam_h[2];
     
    122124        if(strcmp(iomodel->meshtype,"2d")==0){
    123125                /*load elements: */
    124                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
     126                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
    125127        }
    126128        else{
    127129                /*load elements2d: */
    128                 IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
     130                IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
    129131        }
    130132
     
    141143        #ifdef _PARALLEL_
    142144        if(strcmp(iomodel->meshtype,"2d")==0){
    143                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
     145                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
    144146                for (i=0;i<iomodel->numberofelements;i++){
    145147                        if(my_rank==epart[i]){
     
    156158        }
    157159        else{
    158                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
     160                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
    159161                for (i=0;i<iomodel->numberofelements;i++){
    160162                        if(my_rank==epart[i]){
     
    198200
    199201        /*Fetch data temporarily needed: */
    200         IoModelFetchData((void**)&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","Matrix","Mat");
    201         IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    202         IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
    203         IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    204         IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
    205         IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
    206         IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
    207         IoModelFetchData((void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");
    208         IoModelFetchData((void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");
    209         IoModelFetchData((void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");
     202        IoModelFetchData(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");
     203        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     204        IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
     205        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     206        IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
     207        IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
     208        IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
     209        IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
     210        IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
     211        IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
    210212
    211213        /*2d mesh: */
     
    224226                                sing_mid=i+1; //refers to the corresponding material property card
    225227                                sing_mparid=iomodel->numberofnodes+1;//refers to the corresponding matpar property card
     228                                sing_numparid=1;
    226229                                sing_g=i+1;
    227230                                sing_h=iomodel->thickness[i];
     
    229232
    230233                                /*Create sing element using its constructor:*/
    231                                 sing=new Sing(sing_id, sing_mid, sing_mparid, sing_g, sing_h, sing_k);
     234                                sing=new Sing(sing_id, sing_mid, sing_mparid, sing_numparid, sing_g, sing_h, sing_k);
    232235
    233236                                /*Add tria element to elements dataset: */
     
    268271                                        beam_mid=i+1; //refers to the corresponding material property card
    269272                                        beam_mparid=iomodel->numberofnodes-iomodel->numberofnodes2d+1;//refers to the corresponding matpar property card
     273                                        beam_numparid=1;
    270274                                        beam_g[0]=i+1;
    271275                                        beam_g[1]=(int)iomodel->uppernodes[i]; //grid that lays right on top
     
    282286
    283287                                        /*Create beam element ubeam its constructor:*/
    284                                         beam=new Beam(beam_id, beam_mid, beam_mparid, beam_g, beam_h, beam_s,beam_b,beam_k,beam_onbed);
     288                                        beam=new Beam(beam_id, beam_mid, beam_mparid, beam_numparid,beam_g, beam_h, beam_s,beam_b,beam_k,beam_onbed);
    285289
    286290                                        /*Add tria element to elements dataset: */
     
    347351        /*First fetch data: */
    348352        if (strcmp(iomodel->meshtype,"3d")==0){
    349                 IoModelFetchData((void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");
    350                 IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
    351         }
    352         IoModelFetchData((void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");
    353         IoModelFetchData((void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");
    354         IoModelFetchData((void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");
    355         IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    356         IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    357         IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
    358         IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
    359         IoModelFetchData((void**)&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","Matrix","Mat");
    360         IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
    361         IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
     353                IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
     354                IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
     355        }
     356        IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x");
     357        IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
     358        IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
     359        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     360        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     361        IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
     362        IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
     363        IoModelFetchData(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");
     364        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
     365        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
    362366       
    363367        /*Get number of dofs per node: */
  • issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp

    r1834 r2333  
    3737
    3838        /*Fetch data: */
    39         IoModelFetchData((void**)&gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes","Matrix","Mat");
     39        IoModelFetchData(&gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes");
    4040
    4141        count=0;
  • issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp

    r1904 r2333  
    5858        int penta_mid;
    5959        int penta_mparid;
     60        int penta_numparid;
    6061        int penta_g[6];
    6162        double penta_h[6];
     
    6970        int penta_onbed;
    7071        int penta_onsurface;
    71         double penta_meanvel;/*!scaling ratio for velocities*/
    72         double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
    7372        int penta_collapse=0;
    7473        double penta_melting[6];
    7574        double penta_accumulation[6];
    7675        double penta_geothermalflux[6];
    77         int penta_artdiff;
    7876        int penta_thermal_steadystate;
    79         double penta_viscosity_overshoot;
    80         double penta_stokesreconditioning;
    8177        bool   penta_onwater;
    8278
     
    139135        if(strcmp(iomodel->meshtype,"2d")==0){
    140136                /*load elements: */
    141                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
     137                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
    142138        }
    143139        else{
    144140                /*load elements2d: */
    145                 IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
     141                IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
    146142        }
    147143
     
    169165
    170166                /*Fetch data needed: */
    171                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
    172                 IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    173                 IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
    174                 IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    175                 IoModelFetchData((void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");
    176                 IoModelFetchData((void**)&iomodel->p,NULL,NULL,iomodel_handle,"p","Matrix","Mat");
    177                 IoModelFetchData((void**)&iomodel->q,NULL,NULL,iomodel_handle,"q","Matrix","Mat");
    178                 IoModelFetchData((void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");
    179                 IoModelFetchData((void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");
    180                 IoModelFetchData((void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");
    181                 IoModelFetchData((void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");
    182                 IoModelFetchData((void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");
    183                 IoModelFetchData((void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");
    184                 IoModelFetchData((void**)&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");
    185                 IoModelFetchData((void**)&iomodel->melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");
    186                 IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
     167                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
     168                IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     169                IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
     170                IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     171                IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
     172                IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p");
     173                IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q");
     174                IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
     175                IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
     176                IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
     177                IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
     178                IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
     179                IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
     180                IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
     181                IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
     182                IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
    187183       
    188184                for (i=0;i<iomodel->numberofelements;i++){
     
    197193                        penta_mid=i+1; //refers to the corresponding material property card
    198194                        penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
     195                        penta_numparid=1;
    199196
    200197                        /*vertices,thickness,surface,bed and drag: */
     
    219216                        penta_onbed=(int)*(iomodel->elementonbed+i);
    220217                        penta_onsurface=(int)*(iomodel->elementonsurface+i);
    221                         penta_meanvel=iomodel->meanvel;
    222                         penta_epsvel=iomodel->epsvel;
    223218                        penta_onwater=(bool)*(iomodel->elementonwater+i);
    224219       
    225                         /*viscosity_overshoot*/
    226                         penta_viscosity_overshoot=iomodel->viscosity_overshoot;
    227 
    228                         /*stokesreconditioning: */
    229                         penta_stokesreconditioning=iomodel->stokesreconditioning;
    230 
    231                        
    232220                        if (*(iomodel->elements_type+2*i+1)==StokesFormulationEnum()){
    233221                       
    234222                                /*Create Penta using its constructor:*/
    235                                 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
    236                                                 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel,
    237                                                 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff,
    238                                                 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,penta_onwater);
     223                                penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
     224                                                penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,
     225                                                penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,
     226                                                penta_thermal_steadystate,penta_onwater);
    239227
    240228                                /*Add penta element to elements dataset: */
     
    353341       
    354342                /*Get penalties: */
    355                 IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
     343                IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
    356344
    357345                if(iomodel->numpenalties){
     
    389377        /*First fetch data: */
    390378        if (strcmp(iomodel->meshtype,"3d")==0){
    391                 IoModelFetchData((void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");
    392                 IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
    393         }
    394         IoModelFetchData((void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");
    395         IoModelFetchData((void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");
    396         IoModelFetchData((void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");
    397         IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    398         IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    399         IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
    400         IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
    401         IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
    402         IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
    403         IoModelFetchData((void**)&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes","Matrix","Mat");
    404         IoModelFetchData((void**)&iomodel->borderstokes,NULL,NULL,iomodel_handle,"borderstokes","Matrix","Mat");
     379                IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
     380                IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
     381        }
     382        IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x");
     383        IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
     384        IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
     385        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     386        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     387        IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
     388        IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
     389        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
     390        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
     391        IoModelFetchData(&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes");
     392        IoModelFetchData(&iomodel->borderstokes,NULL,NULL,iomodel_handle,"borderstokes");
    405393
    406394
  • issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateLoadsDiagnosticStokes.cpp

    r2212 r2333  
    6363        /*Create pressure loads as boundary conditions. Pay attention to the partitioning if we are running in parallel (the grids
    6464         * referenced by a certain load must belong to the cluster node): */
    65         IoModelFetchData((void**)&iomodel->pressureload_stokes,&numberofpressureloads_stokes,NULL,iomodel_handle,"pressureload_stokes","Matrix","Mat");
    66         IoModelFetchData((void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");
    67         IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    68         IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
     65        IoModelFetchData(&iomodel->pressureload_stokes,&numberofpressureloads_stokes,NULL,iomodel_handle,"pressureload_stokes");
     66        IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
     67        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     68        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
    6969
    7070        count=0;
     
    127127        //create penalties for grids on the base of icesheet. We must have wb=ub*db/dx+vb*db/dy
    128128
    129         IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
    130         IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
    131         IoModelFetchData((void**)&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes","Matrix","Mat");
     129        IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
     130        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
     131        IoModelFetchData(&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes");
    132132       
    133133        for (i=0;i<iomodel->numberofnodes;i++){
  • issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp

    r2283 r2333  
    3737
    3838        /*Fetch data: */
    39         IoModelFetchData((void**)&spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity","Matrix","Mat");
     39        IoModelFetchData(&spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity");
    4040
    4141        count=0;
  • issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateElementsNodesAndMaterialsDiagnosticVert.cpp

    r1904 r2333  
    5757        int penta_mid;
    5858        int penta_mparid;
     59        int penta_numparid;
    5960        int penta_g[6];
    6061        double penta_h[6];
     
    6869        int penta_onbed;
    6970        int penta_onsurface;
    70         double penta_meanvel;/*!scaling ratio for velocities*/
    71         double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
    7271        int penta_collapse;
    7372        double penta_melting[6];
     
    139138        if(strcmp(iomodel->meshtype,"2d")==0){
    140139                /*load elements: */
    141                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
     140                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
    142141        }
    143142        else{
    144143                /*load elements2d: */
    145                 IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
     144                IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
    146145        }
    147146
     
    159158        /*Create 3d elements: */
    160159        /*Fetch data needed: */
    161         IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
    162         IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    163         IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
    164         IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    165         IoModelFetchData((void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");
    166         IoModelFetchData((void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");
    167         IoModelFetchData((void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");
    168         IoModelFetchData((void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");
    169         IoModelFetchData((void**)&iomodel->melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");
    170         IoModelFetchData((void**)&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");
    171         IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
     160        IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
     161        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     162        IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
     163        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     164        IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
     165        IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
     166        IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
     167        IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
     168        IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
     169        IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
     170        IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
    172171       
    173172        for (i=0;i<iomodel->numberofelements;i++){
     
    182181                penta_mid=i+1; //refers to the corresponding material property card
    183182                penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
     183                penta_numparid=1;
    184184
    185185                /*vertices,thickness,surface,bed and drag: */
     
    201201
    202202                /*Create Penta using its constructor:*/
    203                 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
    204                                 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel,
    205                                 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff,
    206                                 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,penta_onwater);
     203                penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
     204                                penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,
     205                                penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,
     206                                penta_thermal_steadystate,penta_onwater);
    207207
    208208                /*Add penta element to elements dataset: */
     
    309309        /*First fetch data: */
    310310        if (strcmp(iomodel->meshtype,"3d")==0){
    311                 IoModelFetchData((void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");
    312                 IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
     311                IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
     312                IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
    313313        }
    314         IoModelFetchData((void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");
    315         IoModelFetchData((void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");
    316         IoModelFetchData((void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");
    317         IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    318         IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    319         IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
    320         IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
    321         IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
    322         IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
     314        IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x");
     315        IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
     316        IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
     317        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     318        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     319        IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
     320        IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
     321        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
     322        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
    323323
    324324       
  • issm/trunk/src/c/ModelProcessorx/IoModel.cpp

    r2330 r2333  
    135135        iomodel->yts=0;
    136136        iomodel->viscosity_overshoot=0;
     137        iomodel->artdiff=0;
    137138        iomodel->stokesreconditioning=0;
    138139        iomodel->waitonlock=0;
     
    290291
    291292        /*In IoModelInit, we get all the data that is not difficult to get, and that is small: */
    292         IoModelFetchData((void**)&iomodel->name,NULL,NULL,iomodel_handle,"name","String",NULL);
    293         IoModelFetchData((void**)&iomodel->analysis_type,NULL,NULL,iomodel_handle,"analysis_type","Integer",NULL);
    294         IoModelFetchData((void**)&iomodel->sub_analysis_type,NULL,NULL,iomodel_handle,"sub_analysis_type","Integer",NULL);
    295         IoModelFetchData((void**)&iomodel->qmu_analysis,NULL,NULL,iomodel_handle,"qmu_analysis","Integer",NULL);
    296         IoModelFetchData((void**)&iomodel->control_analysis,NULL,NULL,iomodel_handle,"control_analysis","Integer",NULL);
    297         IoModelFetchData((void**)&iomodel->meshtype,NULL,NULL,iomodel_handle,"type","String",NULL);
     293        IoModelFetchData(&iomodel->name,iomodel_handle,"name");
     294        IoModelFetchData(&iomodel->analysis_type,iomodel_handle,"analysis_type");
     295        IoModelFetchData(&iomodel->sub_analysis_type,iomodel_handle,"sub_analysis_type");
     296        IoModelFetchData(&iomodel->qmu_analysis,iomodel_handle,"qmu_analysis");
     297        IoModelFetchData(&iomodel->control_analysis,iomodel_handle,"control_analysis");
     298        IoModelFetchData(&iomodel->meshtype,iomodel_handle,"type");
    298299        /*!Get numberofelements and numberofnodes: */
    299         IoModelFetchData((void**)&iomodel->numberofnodes,NULL,NULL,iomodel_handle,"numberofgrids","Integer",NULL);
    300         IoModelFetchData((void**)&iomodel->numberofelements,NULL,NULL,iomodel_handle,"numberofelements","Integer",NULL);
     300        IoModelFetchData(&iomodel->numberofnodes,iomodel_handle,"numberofgrids");
     301        IoModelFetchData(&iomodel->numberofelements,iomodel_handle,"numberofelements");
    301302        /*!In case we are running 3d, we are going to need the collapsed and non-collapsed 2d meshes, from which the 3d mesh was extruded: */
    302303        if (strcmp(iomodel->meshtype,"3d")==0){
    303304       
    304305                /*!Deal with 2d mesh: */
    305                 IoModelFetchData((void**)&iomodel->numberofelements2d,NULL,NULL,iomodel_handle,"numberofelements2d","Integer",NULL);
    306                 IoModelFetchData((void**)&iomodel->numberofnodes2d,NULL,NULL,iomodel_handle,"numberofgrids2d","Integer",NULL);
    307                 IoModelFetchData((void**)&iomodel->numlayers,NULL,NULL,iomodel_handle,"numlayers","Integer",NULL);
     306                IoModelFetchData(&iomodel->numberofelements2d,iomodel_handle,"numberofelements2d");
     307                IoModelFetchData(&iomodel->numberofnodes2d,iomodel_handle,"numberofgrids2d");
     308                IoModelFetchData(&iomodel->numlayers,iomodel_handle,"numlayers");
    308309        }
    309310
    310311
    311312        /*elements type: */
    312         IoModelFetchData((void**)&iomodel->ishutter,NULL,NULL,iomodel_handle,"ishutter","Integer",NULL);
    313         IoModelFetchData((void**)&iomodel->ismacayealpattyn,NULL,NULL,iomodel_handle,"ismacayealpattyn","Integer",NULL);
    314         IoModelFetchData((void**)&iomodel->isstokes,NULL,NULL,iomodel_handle,"isstokes","Integer",NULL);
     313        IoModelFetchData(&iomodel->ishutter,iomodel_handle,"ishutter");
     314        IoModelFetchData(&iomodel->ismacayealpattyn,iomodel_handle,"ismacayealpattyn");
     315        IoModelFetchData(&iomodel->isstokes,iomodel_handle,"isstokes");
    315316
    316317        /*!Get drag_type, drag and p,q: */
    317         IoModelFetchData((void**)&iomodel->drag_type,NULL,NULL,iomodel_handle,"drag_type","Integer",NULL);
     318        IoModelFetchData(&iomodel->drag_type,iomodel_handle,"drag_type");
    318319
    319320        /*!Get materials: */
    320         IoModelFetchData((void**)&iomodel->rho_water,NULL,NULL,iomodel_handle,"rho_water","Scalar",NULL);
    321         IoModelFetchData((void**)&iomodel->rho_ice,NULL,NULL,iomodel_handle,"rho_ice","Scalar",NULL);
    322         IoModelFetchData((void**)&iomodel->g,NULL,NULL,iomodel_handle,"g","Scalar",NULL);
     321        IoModelFetchData(&iomodel->rho_water,iomodel_handle,"rho_water");
     322        IoModelFetchData(&iomodel->rho_ice,iomodel_handle,"rho_ice");
     323        IoModelFetchData(&iomodel->g,iomodel_handle,"g");
    323324
    324325        /*Get control parameters: */
    325         IoModelFetchData((void**)&iomodel->control_type,NULL,NULL,iomodel_handle,"control_type","String",NULL);
     326        IoModelFetchData(&iomodel->control_type,iomodel_handle,"control_type");
    326327
    327328        /*!Get solution parameters: */
    328         IoModelFetchData((void**)&iomodel->yts,NULL,NULL,iomodel_handle,"yts","Scalar",NULL);
    329         IoModelFetchData((void**)&iomodel->meanvel,NULL,NULL,iomodel_handle,"meanvel","Scalar",NULL);
    330         IoModelFetchData((void**)&iomodel->epsvel,NULL,NULL,iomodel_handle,"epsvel","Scalar",NULL);
    331         IoModelFetchData((void**)&iomodel->verbose,NULL,NULL,iomodel_handle,"verbose","Integer",NULL);
    332         IoModelFetchData((void**)&iomodel->plot,NULL,NULL,iomodel_handle,"plot","Integer",NULL);
    333         IoModelFetchData((void**)&iomodel->artificial_diffusivity,NULL,NULL,iomodel_handle,"artificial_diffusivity","Integer",NULL);
    334         IoModelFetchData((void**)&iomodel->nsteps,NULL,NULL,iomodel_handle,"nsteps","Integer",NULL);
    335         IoModelFetchData((void**)&iomodel->eps_cm,NULL,NULL,iomodel_handle,"eps_cm","Scalar",NULL);
    336         IoModelFetchData((void**)&iomodel->tolx,NULL,NULL,iomodel_handle,"tolx","Scalar",NULL);
    337         IoModelFetchData((void**)&iomodel->cm_noisedampening,NULL,NULL,iomodel_handle,"cm_noisedampening","Scalar",NULL);
    338         IoModelFetchData((void**)&iomodel->mincontrolconstraint,NULL,NULL,iomodel_handle,"mincontrolconstraint","Scalar",NULL);
    339         IoModelFetchData((void**)&iomodel->maxcontrolconstraint,NULL,NULL,iomodel_handle,"maxcontrolconstraint","Scalar",NULL);
    340         IoModelFetchData((void**)&iomodel->eps_res,NULL,NULL,iomodel_handle,"eps_res","Scalar",NULL);
    341         IoModelFetchData((void**)&iomodel->eps_rel,NULL,NULL,iomodel_handle,"eps_rel","Scalar",NULL);
    342         IoModelFetchData((void**)&iomodel->eps_abs,NULL,NULL,iomodel_handle,"eps_abs","Scalar",NULL);
    343         IoModelFetchData((void**)&iomodel->dt,NULL,NULL,iomodel_handle,"dt","Scalar",NULL);
    344         IoModelFetchData((void**)&iomodel->ndt,NULL,NULL,iomodel_handle,"ndt","Scalar",NULL);
    345         IoModelFetchData((void**)&iomodel->penalty_offset,NULL,NULL,iomodel_handle,"penalty_offset","Scalar",NULL);
    346         IoModelFetchData((void**)&iomodel->penalty_melting,NULL,NULL,iomodel_handle,"penalty_melting","Scalar",NULL);
    347         IoModelFetchData((void**)&iomodel->penalty_lock,NULL,NULL,iomodel_handle,"penalty_lock","Integer",NULL);
    348         IoModelFetchData((void**)&iomodel->sparsity,NULL,NULL,iomodel_handle,"sparsity","Scalar",NULL);
    349         IoModelFetchData((void**)&iomodel->connectivity,NULL,NULL,iomodel_handle,"connectivity","Integer",NULL);
    350         IoModelFetchData((void**)&iomodel->lowmem,NULL,NULL,iomodel_handle,"lowmem","Integer",NULL);
    351         IoModelFetchData((void**)&iomodel->solverstring,NULL,NULL,iomodel_handle,"solverstring","String",NULL);
    352         IoModelFetchData((void**)&iomodel->viscosity_overshoot,NULL,NULL,iomodel_handle,"viscosity_overshoot","Scalar",NULL);
    353         IoModelFetchData((void**)&iomodel->stokesreconditioning,NULL,NULL,iomodel_handle,"stokesreconditioning","Scalar",NULL);
    354         IoModelFetchData((void**)&iomodel->waitonlock,NULL,NULL,iomodel_handle,"waitonlock","Integer",NULL);
     329        IoModelFetchData(&iomodel->yts,iomodel_handle,"yts");
     330        IoModelFetchData(&iomodel->meanvel,iomodel_handle,"meanvel");
     331        IoModelFetchData(&iomodel->epsvel,iomodel_handle,"epsvel");
     332        IoModelFetchData(&iomodel->verbose,iomodel_handle,"verbose");
     333        IoModelFetchData(&iomodel->plot,iomodel_handle,"plot");
     334        IoModelFetchData(&iomodel->artificial_diffusivity,iomodel_handle,"artificial_diffusivity");
     335        IoModelFetchData(&iomodel->nsteps,iomodel_handle,"nsteps");
     336        IoModelFetchData(&iomodel->eps_cm,iomodel_handle,"eps_cm");
     337        IoModelFetchData(&iomodel->tolx,iomodel_handle,"tolx");
     338        IoModelFetchData(&iomodel->cm_noisedampening,iomodel_handle,"cm_noisedampening");
     339        IoModelFetchData(&iomodel->mincontrolconstraint,iomodel_handle,"mincontrolconstraint");
     340        IoModelFetchData(&iomodel->maxcontrolconstraint,iomodel_handle,"maxcontrolconstraint");
     341        IoModelFetchData(&iomodel->eps_res,iomodel_handle,"eps_res");
     342        IoModelFetchData(&iomodel->eps_rel,iomodel_handle,"eps_rel");
     343        IoModelFetchData(&iomodel->eps_abs,iomodel_handle,"eps_abs");
     344        IoModelFetchData(&iomodel->dt,iomodel_handle,"dt");
     345        IoModelFetchData(&iomodel->ndt,iomodel_handle,"ndt");
     346        IoModelFetchData(&iomodel->penalty_offset,iomodel_handle,"penalty_offset");
     347        IoModelFetchData(&iomodel->penalty_melting,iomodel_handle,"penalty_melting");
     348        IoModelFetchData(&iomodel->penalty_lock,iomodel_handle,"penalty_lock");
     349        IoModelFetchData(&iomodel->sparsity,iomodel_handle,"sparsity");
     350        IoModelFetchData(&iomodel->connectivity,iomodel_handle,"connectivity");
     351        IoModelFetchData(&iomodel->lowmem,iomodel_handle,"lowmem");
     352        IoModelFetchData(&iomodel->solverstring,iomodel_handle,"solverstring");
     353        IoModelFetchData(&iomodel->viscosity_overshoot,iomodel_handle,"viscosity_overshoot");
     354        IoModelFetchData(&iomodel->artdiff,iomodel_handle,"artificial_diffusivity");
     355        IoModelFetchData(&iomodel->stokesreconditioning,iomodel_handle,"stokesreconditioning");
     356        IoModelFetchData(&iomodel->waitonlock,iomodel_handle,"waitonlock");
    355357
    356358        /*!Get thermal parameters: */
    357         IoModelFetchData((void**)&iomodel->beta,NULL,NULL,iomodel_handle,"beta","Scalar",NULL);
    358         IoModelFetchData((void**)&iomodel->meltingpoint,NULL,NULL,iomodel_handle,"meltingpoint","Scalar",NULL);
    359         IoModelFetchData((void**)&iomodel->latentheat,NULL,NULL,iomodel_handle,"latentheat","Scalar",NULL);
    360         IoModelFetchData((void**)&iomodel->heatcapacity,NULL,NULL,iomodel_handle,"heatcapacity","Scalar",NULL);
    361         IoModelFetchData((void**)&iomodel->thermalconductivity,NULL,NULL,iomodel_handle,"thermalconductivity","Scalar",NULL);
    362         IoModelFetchData((void**)&iomodel->min_thermal_constraints,NULL,NULL,iomodel_handle,"min_thermal_constraints","Integer",NULL);
    363         IoModelFetchData((void**)&iomodel->stabilize_constraints,NULL,NULL,iomodel_handle,"stabilize_constraints","Integer",NULL);
    364         IoModelFetchData((void**)&iomodel->mixed_layer_capacity,NULL,NULL,iomodel_handle,"mixed_layer_capacity","Scalar",NULL);
    365         IoModelFetchData((void**)&iomodel->thermal_exchange_velocity,NULL,NULL,iomodel_handle,"thermal_exchange_velocity","Scalar",NULL);
     359        IoModelFetchData(&iomodel->beta,iomodel_handle,"beta");
     360        IoModelFetchData(&iomodel->meltingpoint,iomodel_handle,"meltingpoint");
     361        IoModelFetchData(&iomodel->latentheat,iomodel_handle,"latentheat");
     362        IoModelFetchData(&iomodel->heatcapacity,iomodel_handle,"heatcapacity");
     363        IoModelFetchData(&iomodel->thermalconductivity,iomodel_handle,"thermalconductivity");
     364        IoModelFetchData(&iomodel->min_thermal_constraints,iomodel_handle,"min_thermal_constraints");
     365        IoModelFetchData(&iomodel->stabilize_constraints,iomodel_handle,"stabilize_constraints");
     366        IoModelFetchData(&iomodel->mixed_layer_capacity,iomodel_handle,"mixed_layer_capacity");
     367        IoModelFetchData(&iomodel->thermal_exchange_velocity,iomodel_handle,"thermal_exchange_velocity");
    366368       
    367369        /*qmu: */
    368370        if(iomodel->qmu_analysis){
    369                 IoModelFetchData((void**)&iomodel->numberofvariables,NULL,NULL,iomodel_handle,"numberofvariables","Integer",NULL);
    370                 IoModelFetchData((void**)&iomodel->numberofresponses,NULL,NULL,iomodel_handle,"numberofresponses","Integer",NULL);
    371                 IoModelFetchData((void**)&iomodel->qmu_npart,NULL,NULL,iomodel_handle,"npart","Integer",NULL);
     371                IoModelFetchData(&iomodel->numberofvariables,iomodel_handle,"numberofvariables");
     372                IoModelFetchData(&iomodel->numberofresponses,iomodel_handle,"numberofresponses");
     373                IoModelFetchData(&iomodel->qmu_npart,iomodel_handle,"npart");
    372374        }
    373375       
    374376        /*parameter output : */
    375         IoModelFetchData((void**)&iomodel->numoutput,NULL,NULL,iomodel_handle,"numoutput","Integer",NULL);
     377        IoModelFetchData(&iomodel->numoutput,iomodel_handle,"numoutput");
    376378
    377379        /*Assign output pointers: */
  • issm/trunk/src/c/ModelProcessorx/IoModel.h

    r2330 r2333  
    102102        double* n;
    103103
     104        /*numerical parameters: */
     105        double  meanvel;
     106        double  epsvel;
     107        int     artdiff;
     108        double  viscosity_overshoot;
     109        double  stokesreconditioning;
     110        double  cm_noisedampening;
     111
    104112        /*control methods: */
    105113        char*   control_type;
     
    108116        double* fit;
    109117        double* cm_jump;
    110         double  meanvel,epsvel;
    111118        int     artificial_diffusivity;
    112119        int     nsteps;
     
    114121        double  tolx;
    115122        double* maxiter;
    116         double  cm_noisedampening;
    117123        double  mincontrolconstraint;
    118124        double  maxcontrolconstraint;
     
    131137        double* optscal;
    132138        double  yts;
    133         double  viscosity_overshoot;
    134         double  stokesreconditioning;
    135139        int     waitonlock;
    136140
  • issm/trunk/src/c/ModelProcessorx/Melting/CreateElementsNodesAndMaterialsMelting.cpp

    r1905 r2333  
    5757        int penta_mid;
    5858        int penta_mparid;
     59        int penta_numparid;
    5960        int penta_g[6];
    6061        double penta_h[6];
     
    6869        int penta_onbed;
    6970        int penta_onsurface;
    70         double penta_meanvel;/*!scaling ratio for velocities*/
    71         double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
    7271        int penta_collapse;
    7372        double penta_melting[6];
    7473        double penta_accumulation[6];
    7574        double penta_geothermalflux[6];
    76         int penta_artdiff;
    7775        int penta_thermal_steadystate;
    78         double penta_viscosity_overshoot;
    79         double penta_stokesreconditioning;
    8076        bool   penta_onwater;
    8177
     
    129125        #ifdef _PARALLEL_
    130126        /*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/
    131         IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
     127        IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
    132128
    133129
     
    146142
    147143        /*Fetch data needed: */
    148         IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
    149         IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    150         IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
    151         IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    152         IoModelFetchData((void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");
    153         IoModelFetchData((void**)&iomodel->p,NULL,NULL,iomodel_handle,"p","Matrix","Mat");
    154         IoModelFetchData((void**)&iomodel->q,NULL,NULL,iomodel_handle,"q","Matrix","Mat");
    155         IoModelFetchData((void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");
    156         IoModelFetchData((void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");
    157         IoModelFetchData((void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");
    158         IoModelFetchData((void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");
    159         IoModelFetchData((void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");
    160         IoModelFetchData((void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");
    161         IoModelFetchData((void**)&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");
    162         IoModelFetchData((void**)&iomodel->melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");
    163         IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
     144        IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
     145        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     146        IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
     147        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     148        IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
     149        IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p");
     150        IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q");
     151        IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
     152        IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
     153        IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
     154        IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
     155        IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
     156        IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
     157        IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
     158        IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
     159        IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
    164160       
    165161        for (i=0;i<iomodel->numberofelements;i++){
     
    174170                penta_mid=i+1; //refers to the corresponding material property card
    175171                penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
     172                penta_numparid=1;
    176173
    177174                /*vertices,thickness,surface,bed and drag: */
     
    196193                penta_onbed=(int)*(iomodel->elementonbed+i);
    197194                penta_onsurface=(int)*(iomodel->elementonsurface+i);
    198                 penta_meanvel=iomodel->meanvel;
    199                 penta_epsvel=iomodel->epsvel;
    200195                penta_onwater=(bool)*(iomodel->elementonwater+i);
    201        
    202                 /*viscosity_overshoot*/
    203                 penta_viscosity_overshoot=iomodel->viscosity_overshoot;
    204196                penta_collapse=1;
    205197
    206198                /*Create Penta using its constructor:*/
    207                 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
    208                                 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel,
    209                                 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff,
    210                                 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,penta_onwater);
     199                penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
     200                                penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,
     201                                penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,
     202                                penta_thermal_steadystate,penta_onwater);
    211203
    212204                /*Add penta element to elements dataset: */
     
    320312       
    321313                /*Get penalties: */
    322                 IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
     314                IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
    323315
    324316                if(iomodel->numpenalties){
     
    356348        /*First fetch data: */
    357349        if (strcmp(iomodel->meshtype,"3d")==0){
    358                 IoModelFetchData((void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");
    359                 IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
     350                IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
     351                IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
    360352        }
    361         IoModelFetchData((void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");
    362         IoModelFetchData((void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");
    363         IoModelFetchData((void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");
    364         IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    365         IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    366         IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
    367         IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
    368         IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
    369         IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
     353        IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x");
     354        IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
     355        IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
     356        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     357        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     358        IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
     359        IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
     360        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
     361        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
    370362
    371363
  • issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp

    r2212 r2333  
    5050
    5151        //create penalties for grids: no grid can have a temperature over the melting point
    52         IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
     52        IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
    5353
    5454        for (i=0;i<iomodel->numberofnodes;i++){
  • issm/trunk/src/c/ModelProcessorx/Melting/CreateParametersMelting.cpp

    r1905 r2333  
    3434
    3535                /*Get melting: */
    36                 IoModelFetchData((void**)&melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");
     36                IoModelFetchData(&melting,NULL,NULL,iomodel_handle,"melting");
    3737                if(melting) {
    3838                        for(i=0;i<iomodel->numberofnodes;i++)melting[i]=melting[i]/iomodel->yts;   //m/s instead of m/yr
  • issm/trunk/src/c/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp

    r1834 r2333  
    3535
    3636        /*Fetch data: */
    37         IoModelFetchData((void**)&spcthickness,NULL,NULL,iomodel_handle,"spcthickness","Matrix","Mat");
     37        IoModelFetchData(&spcthickness,NULL,NULL,iomodel_handle,"spcthickness");
    3838
    3939        count=0;
  • issm/trunk/src/c/ModelProcessorx/Prognostic/CreateElementsNodesAndMaterialsPrognostic.cpp

    r1904 r2333  
    5252        int tria_mid;
    5353        int tria_mparid;
     54        int tria_numparid;
    5455        int tria_g[3];
    5556        double tria_h[3];
     
    6465        double tria_q;
    6566        int    tria_shelf;
    66         double tria_meanvel;/*!scaling ratio for velocities*/
    67         double tria_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
    68         double tria_viscosity_overshoot;
    69         int    tria_artdiff;
    7067        bool   tria_onwater;
    7168
     
    8077        int penta_mid;
    8178        int penta_mparid;
     79        int penta_numparid;
    8280        int penta_g[6];
    8381        double penta_h[6];
     
    9189        int penta_onbed;
    9290        int penta_onsurface;
    93         double penta_meanvel;/*!scaling ratio for velocities*/
    94         double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
    9591        int penta_collapse;
    9692        double penta_melting[6];
    9793        double penta_accumulation[6];
    9894        double penta_geothermalflux[6];
    99         int penta_artdiff;
    10095        int penta_thermal_steadystate;
    101         double penta_viscosity_overshoot;
    102         double penta_stokesreconditioning;
    10396        bool   penta_onwater;
    10497
     
    157150        if(strcmp(iomodel->meshtype,"2d")==0){
    158151                /*load elements: */
    159                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
     152                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
    160153        }
    161154        else{
    162155                /*load elements2d: */
    163                 IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
     156                IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
    164157        }
    165158
     
    183176
    184177                /*Fetch data needed: */
    185                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
    186                 IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    187                 IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
    188                 IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    189                 IoModelFetchData((void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");
    190                 IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
     178                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
     179                IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     180                IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
     181                IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     182                IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
     183                IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
    191184               
    192185                for (i=0;i<iomodel->numberofelements;i++){
     
    202195                        tria_mid=-1; //no need for materials
    203196                        tria_mparid=-1; //no need for materials
     197                        tria_numparid=1;
    204198
    205199                        /*vertices offsets: */
     
    224218                        tria_shelf=(int)*(iomodel->elementoniceshelf+i);
    225219                        tria_onwater=(bool)*(iomodel->elementonwater+i);
    226                         tria_artdiff=iomodel->artificial_diffusivity;
    227220
    228221                        /*Create tria element using its constructor:*/
    229                         tria=new Tria(tria_id, tria_mid, tria_mparid, tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_meanvel, tria_epsvel, tria_viscosity_overshoot,tria_artdiff,tria_onwater);
     222                        tria=new Tria(tria_id, tria_mid, tria_mparid, tria_numparid,tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_onwater);
    230223
    231224                        /*Add tria element to elements dataset: */
     
    261254
    262255                /*Fetch data needed: */
    263                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
    264                 IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    265                 IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
    266                 IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    267                 IoModelFetchData((void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");
    268                 IoModelFetchData((void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");
    269                 IoModelFetchData((void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");
    270                 IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
     256                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
     257                IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     258                IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
     259                IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     260                IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
     261                IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
     262                IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
     263                IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
    271264       
    272265                for (i=0;i<iomodel->numberofelements;i++){
     
    281274                        penta_mid=-1;
    282275                        penta_mparid=-1; //no need for materials
     276                        penta_numparid=1;
    283277
    284278                        /*vertices,thickness,surface,bed and drag: */
     
    295289                        penta_onsurface=(int)*(iomodel->elementonsurface+i);
    296290                        penta_collapse=1;
    297                         penta_artdiff=iomodel->artificial_diffusivity;
    298291                        penta_onwater=(bool)*(iomodel->elementonwater+i);
    299292       
    300293
    301294                        /*Create Penta using its constructor:*/
    302                         penta= new Penta( penta_id,penta_mid,penta_mparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
    303                                         penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel,
    304                                         penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff,
    305                                         penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,penta_onwater);
     295                        penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
     296                                        penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,
     297                                        penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,
     298                                        penta_thermal_steadystate,penta_onwater);
    306299
    307300                        /*Add penta element to elements dataset: */
     
    390383       
    391384                /*Get penalties: */
    392                 IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
     385                IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
    393386
    394387                if(iomodel->numpenalties){
     
    426419        /*First fetch data: */
    427420        if (strcmp(iomodel->meshtype,"3d")==0){
    428                 IoModelFetchData((void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");
    429                 IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
    430         }
    431         IoModelFetchData((void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");
    432         IoModelFetchData((void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");
    433         IoModelFetchData((void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");
    434         IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    435         IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    436         IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
    437         IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
    438         IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
    439         IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
     421                IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
     422                IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
     423        }
     424        IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x");
     425        IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
     426        IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
     427        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     428        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     429        IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
     430        IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
     431        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
     432        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
    440433
    441434
  • issm/trunk/src/c/ModelProcessorx/Prognostic/CreateParametersPrognostic.cpp

    r1834 r2333  
    3939
    4040        /*Get vx and vy: */
    41         IoModelFetchData((void**)&vx,NULL,NULL,iomodel_handle,"vx","Matrix","Mat");
    42         IoModelFetchData((void**)&vy,NULL,NULL,iomodel_handle,"vy","Matrix","Mat");
    43         IoModelFetchData((void**)&vz,NULL,NULL,iomodel_handle,"vz","Matrix","Mat");
     41        IoModelFetchData(&vx,NULL,NULL,iomodel_handle,"vx");
     42        IoModelFetchData(&vy,NULL,NULL,iomodel_handle,"vy");
     43        IoModelFetchData(&vz,NULL,NULL,iomodel_handle,"vz");
    4444
    4545        u_g=(double*)xcalloc(iomodel->numberofnodes*3,sizeof(double));
     
    6161
    6262        /*Get pressure if 3d iomodel: */
    63         parameters->FindParam((void*)&dim,"dim");
     63        parameters->FindParam(&dim,"dim");
    6464        if (dim==3){
    65                 IoModelFetchData((void**)&pressure,NULL,NULL,iomodel_handle,"pressure","Matrix","Mat");
     65                IoModelFetchData(&pressure,NULL,NULL,iomodel_handle,"pressure");
    6666               
    6767                count++;
     
    7676
    7777        /*Get temperature if 3d iomodel: */
    78         parameters->FindParam((void*)&dim,"dim");
     78        parameters->FindParam(&dim,"dim");
    7979        if (dim==3){
    80                 IoModelFetchData((void**)&temperature,NULL,NULL,iomodel_handle,"temperature","Matrix","Mat");
     80                IoModelFetchData(&temperature,NULL,NULL,iomodel_handle,"temperature");
    8181               
    8282                count++;
     
    9191
    9292        /*Get thickness: */
    93         IoModelFetchData((void**)&thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
     93        IoModelFetchData(&thickness,NULL,NULL,iomodel_handle,"thickness");
    9494       
    9595        count++;
     
    103103
    104104        /*Get surface: */
    105         IoModelFetchData((void**)&surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
     105        IoModelFetchData(&surface,NULL,NULL,iomodel_handle,"surface");
    106106       
    107107        count++;
     
    115115
    116116        /*Get bed: */
    117         IoModelFetchData((void**)&bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
     117        IoModelFetchData(&bed,NULL,NULL,iomodel_handle,"bed");
    118118       
    119119        count++;
     
    127127
    128128        /*Get melting: */
    129         IoModelFetchData((void**)&melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");
     129        IoModelFetchData(&melting,NULL,NULL,iomodel_handle,"melting");
    130130        if(melting) for(i=0;i<iomodel->numberofnodes;i++)melting[i]=melting[i]/iomodel->yts;
    131131       
     
    140140
    141141        /*Get accumulation: */
    142         IoModelFetchData((void**)&accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");
     142        IoModelFetchData(&accumulation,NULL,NULL,iomodel_handle,"accumulation");
    143143        if(accumulation) for(i=0;i<iomodel->numberofnodes;i++)accumulation[i]=accumulation[i]/iomodel->yts;
    144144       
  • issm/trunk/src/c/ModelProcessorx/Qmu/CreateParametersQmu.cpp

    r2112 r2333  
    6060        //qmu analysis?
    6161        count++;
    62         param= new Param(count,"qmu_analysis",INTEGER);
    63         param->SetInteger(iomodel->qmu_analysis);
     62        param= new Param(count,"qmu_analysis",DOUBLE);
     63        param->SetDouble(iomodel->qmu_analysis);
    6464        parameters->AddObject(param);
    6565
     
    9494                //npart
    9595                count++;
    96                 param= new Param(count,"qmu_npart",INTEGER);
    97                 param->SetInteger(iomodel->qmu_npart);
     96                param= new Param(count,"qmu_npart",DOUBLE);
     97                param->SetDouble(iomodel->qmu_npart);
    9898                parameters->AddObject(param);
    9999
     
    110110                for(i=0;i<iomodel->numberofvariables;i++){
    111111                        pfield2=mxGetCell(pfield,i);
    112                         FetchData((void**)&descriptor,NULL,NULL,pfield2,"String",NULL);
     112                        FetchData(&descriptor,pfield2);
    113113                        variabledescriptors[i]=descriptor;
    114114                }
     
    117117                for(i=0;i<iomodel->numberofvariables;i++){
    118118                        sprintf(tag,"%s%i","variabledescriptor",i);
    119                         IoModelFetchData((void**)&descriptor,NULL,NULL,iomodel_handle,tag,"String",NULL);
     119                        IoModelFetchData(&descriptor,iomodel_handle,tag);
    120120                        variabledescriptors[i]=descriptor;
    121121                }
     
    138138                for(i=0;i<iomodel->numberofresponses;i++){
    139139                        pfield2=mxGetCell(pfield,i);
    140                         FetchData((void**)&descriptor,NULL,NULL,pfield2,"String",NULL);
     140                        FetchData(&descriptor,pfield2);
    141141                        responsedescriptors[i]=descriptor;
    142142                }
     
    147147                for(i=0;i<iomodel->numberofresponses;i++){
    148148                        sprintf(tag,"%s%i","responsedescriptor",i);
    149                         IoModelFetchData((void**)&descriptor,NULL,NULL,iomodel_handle,tag,"String",NULL);
     149                        IoModelFetchData(&descriptor,iomodel_handle,tag);
    150150                        responsedescriptors[i]=descriptor;
    151151                }
     
    171171
    172172                /*partition grids in iomodel->qmu_npart parts, unless a partition is already present: */
    173                 IoModelFetchData((void**)&dpart,NULL,NULL,iomodel_handle,"part","Matrix","Mat");
     173                IoModelFetchData(&dpart,NULL,NULL,iomodel_handle,"part");
    174174
    175175                if(!dpart){
    176176
    177177                        if(strcmp(iomodel->meshtype,"2d")==0){
    178                                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
     178                                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
    179179                                elements_width=3; //tria elements
    180180                        }
    181181                        else{
    182                                 IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
     182                                IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
    183183                                elements_width=6; //penta elements
    184184                        }
     
    206206
    207207                                //Fetch data:
    208                                 IoModelFetchData((void**)&dakota_parameter,NULL,NULL,iomodel_handle,descriptor,"Matrix","Mat");
     208                                IoModelFetchData(&dakota_parameter,NULL,NULL,iomodel_handle,descriptor);
    209209
    210210                                //Add parameter
     
    227227
    228228                                /*We need the qmu_mass_flux_segments to be able to compute the mass flux: */
    229                                 IoModelFetchData((void**)&qmu_mass_flux_segments,&num_qmu_mass_flux_segments,NULL,iomodel_handle,"qmu_mass_flux_segments","Matrix","Mat");
     229                                IoModelFetchData(&qmu_mass_flux_segments,&num_qmu_mass_flux_segments,NULL,iomodel_handle,"qmu_mass_flux_segments");
    230230
    231231                                #ifdef _PARALLEL_
  • issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateElementsNodesAndMaterialsSlopeCompute.cpp

    r1904 r2333  
    4848        int tria_mid;
    4949        int tria_mparid;
     50        int tria_numparid;
    5051        int tria_g[3];
    5152        double tria_h[3];
     
    6061        double tria_q;
    6162        int    tria_shelf;
    62         double tria_meanvel;/*!scaling ratio for velocities*/
    63         double tria_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
    64         double tria_viscosity_overshoot;
    65         int    tria_artdiff;
    6663        bool   tria_onwater;
    6764
     
    7168        int penta_mid;
    7269        int penta_mparid;
     70        int penta_numparid;
    7371        int penta_g[6];
    7472        double penta_h[6];
     
    8280        int penta_onbed;
    8381        int penta_onsurface;
    84         double penta_meanvel;/*!scaling ratio for velocities*/
    85         double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
    8682        int penta_collapse;
    8783        double penta_melting[6];
    8884        double penta_accumulation[6];
    8985        double penta_geothermalflux[6];
    90         int penta_artdiff;
    9186        int penta_thermal_steadystate;
    92         double penta_viscosity_overshoot;
    93         double penta_stokesreconditioning;
    9487        bool   penta_onwater;
    9588
     
    138131        if(strcmp(iomodel->meshtype,"2d")==0){
    139132                /*load elements: */
    140                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
     133                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
    141134        }
    142135        else{
    143136                /*load elements2d: */
    144                 IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
     137                IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
    145138        }
    146139
     
    165158
    166159                /*Fetch data needed: */
    167                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
    168                 IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
    169                 IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
    170                 IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
     160                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
     161                IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
     162                IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
     163                IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
    171164               
    172165                for (i=0;i<iomodel->numberofelements;i++){
     
    182175                        tria_mid=-1; //no materials
    183176                        tria_mparid=-1; //no materials
     177                        tria_numparid=1; //no materials
    184178
    185179                        /*vertices offsets: */
     
    201195
    202196                        /*Create tria element using its constructor:*/
    203                         tria=new Tria(tria_id, tria_mid, tria_mparid, tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_meanvel, tria_epsvel, tria_viscosity_overshoot,tria_artdiff,tria_onwater);
     197                        tria=new Tria(tria_id, tria_mid, tria_mparid, tria_numparid,tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_onwater);
    204198
    205199                        /*Add tria element to elements dataset: */
     
    233227
    234228                /*Fetch data needed: */
    235                 IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
    236                 IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
    237                 IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    238                 IoModelFetchData((void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");
    239                 IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
     229                IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
     230                IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
     231                IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     232                IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
     233                IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
    240234       
    241235                for (i=0;i<iomodel->numberofelements;i++){
     
    250244                        penta_mid=-1; //no materials
    251245                        penta_mparid=-1; //no materials
     246                        penta_numparid=1; //no materials
    252247                       
    253248
     
    264259
    265260                        /*Create Penta using its constructor:*/
    266                         penta= new Penta( penta_id,penta_mid,penta_mparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
    267                                         penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel,
    268                                         penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff,
    269                                         penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,penta_onwater);
     261                        penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
     262                                        penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,
     263                                        penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,
     264                                        penta_thermal_steadystate,penta_onwater);
    270265
    271266                        /*Add penta element to elements dataset: */
     
    331326       
    332327                /*Get penalties: */
    333                 IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
     328                IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
    334329
    335330                if(iomodel->numpenalties){
     
    367362        /*First fetch data: */
    368363        if (strcmp(iomodel->meshtype,"3d")==0){
    369                 IoModelFetchData((void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");
    370                 IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
    371         }
    372         IoModelFetchData((void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");
    373         IoModelFetchData((void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");
    374         IoModelFetchData((void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");
    375         IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    376         IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    377         IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
    378         IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
    379         IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
    380         IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
     364                IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
     365                IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
     366        }
     367        IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x");
     368        IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
     369        IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
     370        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     371        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     372        IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
     373        IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
     374        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
     375        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
    381376
    382377
  • issm/trunk/src/c/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp

    r1905 r2333  
    3838
    3939        /*Fetch data: */
    40         IoModelFetchData((void**)&spctemperature,NULL,NULL,iomodel_handle,"spctemperature","Matrix","Mat");
     40        IoModelFetchData(&spctemperature,NULL,NULL,iomodel_handle,"spctemperature");
    4141
    4242        count=0;
  • issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp

    r1905 r2333  
    5858        int penta_mid;
    5959        int penta_mparid;
     60        int penta_numparid;
    6061        int penta_g[6];
    6162        double penta_h[6];
     
    6970        int penta_onbed;
    7071        int penta_onsurface;
    71         double penta_meanvel;/*!scaling ratio for velocities*/
    72         double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
    7372        int penta_collapse;
    7473        double penta_melting[6];
    7574        double penta_accumulation[6];
    7675        double penta_geothermalflux[6];
    77         int penta_artdiff;
    7876        int penta_thermal_steadystate;
    79         double penta_viscosity_overshoot;
    80         double penta_stokesreconditioning;
    8177        bool   penta_onwater;
    8278
     
    131127        #ifdef _PARALLEL_
    132128        /*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/
    133         IoModelFetchData((void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");
     129        IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d");
    134130
    135131        MeshPartitionx(&epart, &npart,iomodel->numberofelements,iomodel->numberofnodes,iomodel->elements, iomodel->numberofelements2d,iomodel->numberofnodes2d,iomodel->elements2d,iomodel->numlayers,elements_width, iomodel->meshtype,num_procs);
     
    146142
    147143        /*Fetch data needed: */
    148         IoModelFetchData((void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");
    149         IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    150         IoModelFetchData((void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");
    151         IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    152         IoModelFetchData((void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");
    153         IoModelFetchData((void**)&iomodel->p,NULL,NULL,iomodel_handle,"p","Matrix","Mat");
    154         IoModelFetchData((void**)&iomodel->q,NULL,NULL,iomodel_handle,"q","Matrix","Mat");
    155         IoModelFetchData((void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");
    156         IoModelFetchData((void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");
    157         IoModelFetchData((void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");
    158         IoModelFetchData((void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");
    159         IoModelFetchData((void**)&iomodel->geothermalflux,NULL,NULL,iomodel_handle,"geothermalflux","Matrix","Mat");
    160         IoModelFetchData((void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");
    161         IoModelFetchData((void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");
    162         IoModelFetchData((void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");
     144        IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
     145        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     146        IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
     147        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     148        IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
     149        IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p");
     150        IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q");
     151        IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
     152        IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
     153        IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
     154        IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
     155        IoModelFetchData(&iomodel->geothermalflux,NULL,NULL,iomodel_handle,"geothermalflux");
     156        IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
     157        IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
     158        IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
    163159       
    164160        for (i=0;i<iomodel->numberofelements;i++){
     
    173169                penta_mid=i+1; //refers to the corresponding material property card
    174170                penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card
     171                penta_numparid=1;
    175172
    176173                /*vertices,thickness,surface,bed and drag: */
     
    194191                penta_onbed=(int)*(iomodel->elementonbed+i);
    195192                penta_onsurface=(int)*(iomodel->elementonsurface+i);
    196                 penta_meanvel=iomodel->meanvel;
    197                 penta_epsvel=iomodel->epsvel;
    198193                penta_onwater=(bool)*(iomodel->elementonwater+i);
    199                 penta_artdiff=iomodel->artificial_diffusivity;
    200194
    201195                /*We need the field collapse for transient, so that we can use compute B with the average temperature*/
     
    209203
    210204                /*Create Penta using its constructor:*/
    211                 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
    212                                 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel,
    213                                 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff,
    214                                 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,penta_onwater);
     205                penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,
     206                                penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,
     207                                penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,
     208                                penta_thermal_steadystate,penta_onwater);
    215209
    216210                /*Add penta element to elements dataset: */
     
    322316       
    323317                /*Get penalties: */
    324                 IoModelFetchData((void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");
     318                IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
    325319
    326320                if(iomodel->numpenalties){
     
    358352        /*First fetch data: */
    359353        if (strcmp(iomodel->meshtype,"3d")==0){
    360                 IoModelFetchData((void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");
    361                 IoModelFetchData((void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");
     354                IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
     355                IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
    362356        }
    363         IoModelFetchData((void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");
    364         IoModelFetchData((void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");
    365         IoModelFetchData((void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");
    366         IoModelFetchData((void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");
    367         IoModelFetchData((void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");
    368         IoModelFetchData((void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");
    369         IoModelFetchData((void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");
    370         IoModelFetchData((void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");
    371         IoModelFetchData((void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");
     357        IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x");
     358        IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y");
     359        IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z");
     360        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
     361        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     362        IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
     363        IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");
     364        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
     365        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
    372366
    373367        /*Get number of dofs per node: */
  • issm/trunk/src/c/ModelProcessorx/Thermal/CreateLoadsThermal.cpp

    r2212 r2333  
    5151
    5252        //create penalties for grids: no grid can have a temperature over the melting point
    53         IoModelFetchData((void**)&iomodel->spctemperature,NULL,NULL,iomodel_handle,"spctemperature","Matrix","Mat");
     53        IoModelFetchData(&iomodel->spctemperature,NULL,NULL,iomodel_handle,"spctemperature");
    5454
    5555        for (i=0;i<iomodel->numberofnodes;i++){
  • issm/trunk/src/c/ModelProcessorx/Thermal/CreateParametersThermal.cpp

    r1905 r2333  
    3636
    3737        /*Get vx vy and vz: */
    38         IoModelFetchData((void**)&vx,NULL,NULL,iomodel_handle,"vx","Matrix","Mat");
    39         IoModelFetchData((void**)&vy,NULL,NULL,iomodel_handle,"vy","Matrix","Mat");
    40         IoModelFetchData((void**)&vz,NULL,NULL,iomodel_handle,"vz","Matrix","Mat");
     38        IoModelFetchData(&vx,NULL,NULL,iomodel_handle,"vx");
     39        IoModelFetchData(&vy,NULL,NULL,iomodel_handle,"vy");
     40        IoModelFetchData(&vz,NULL,NULL,iomodel_handle,"vz");
    4141
    4242        u_g=(double*)xcalloc(iomodel->numberofnodes*3,sizeof(double));
     
    5757       
    5858        /*Get pressure: */
    59         IoModelFetchData((void**)&pressure,NULL,NULL,iomodel_handle,"pressure","Matrix","Mat");
     59        IoModelFetchData(&pressure,NULL,NULL,iomodel_handle,"pressure");
    6060       
    6161        count++;
     
    7272
    7373                /*Get melting and temperature: */
    74                 IoModelFetchData((void**)&temperature,NULL,NULL,iomodel_handle,"temperature","Matrix","Mat");
     74                IoModelFetchData(&temperature,NULL,NULL,iomodel_handle,"temperature");
    7575
    7676                count++;
  • issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.cpp

    r1787 r2333  
    1515
    1616void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes,
    17                 DataSet* loads,DataSet* materials, ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
     17                DataSet* loads,DataSet* materials,  DataSet* parameters,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
    1818
    1919        int i;
     
    2727
    2828        /*First, get loads configured: */
    29         loads->Configure(elements, loads, nodes, materials);
     29        loads->Configure(elements, loads, nodes, materials,parameters);
    3030
    3131        /*Do we have penalties linked to rifts? In this case, run our special rifts penalty
  • issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.h

    r465 r2333  
    1111/* local prototypes: */
    1212void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes,
    13                 DataSet* loads,DataSet* materials, ParameterInputs* inputs,int analysis_type,int sub_analysis_type);
     13                DataSet* loads,DataSet* materials,  DataSet* parameters,ParameterInputs* inputs,int analysis_type,int sub_analysis_type);
    1414
    1515#endif  /* _PENALTYCONSTRAINTSX_H */
  • issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.cpp

    r1904 r2333  
    1313#include "../EnumDefinitions/EnumDefinitions.h"
    1414
    15 void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,
     15void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, DataSet* parameters,
    1616                int kflag,int pflag,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
    1717       
     
    2323       
    2424        /*First, get elements and loads configured: */
    25         elements->Configure(elements,loads, nodes, materials);
    26         loads->Configure(elements, loads, nodes, materials);
     25        elements->Configure(elements,loads, nodes, materials,parameters);
     26        loads->Configure(elements, loads, nodes, materials,parameters);
     27        parameters->Configure(elements,loads, nodes, materials,parameters);
    2728
    2829        /*Now, figure out maximum value of K_gg, so that we can penalize it correctly: */
  • issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.h

    r472 r2333  
    1010
    1111/* local prototypes: */
    12 void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,
     12void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, DataSet* parameters,
    1313                int kflag,int pflag,ParameterInputs* inputs,int analysis_type,int sub_analysis_type);
    1414
  • issm/trunk/src/c/ProcessParamsx/ProcessParamsx.cpp

    r1937 r2333  
    3434
    3535        /*Some parameters needed: */
    36         parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     36        parameters->FindParam(&numberofnodes,"numberofnodes");
    3737
    3838        /*serialize partition vector: */
  • issm/trunk/src/c/Qmux/DakotaResponses.cpp

    r2114 r2333  
    262262                        if(!param)throw ErrorException(__FUNCT__," could not find qmu_mass_flux_segments to compute mass_flux");
    263263                       
    264                         param->GetParameterValue((void*)&segments);
     264                        param->GetParameterValue(&segments);
    265265                        num_segments=param->GetM();
    266266
    267267                        /*call mass flux module: */
    268                         MassFluxx(&mass_flux,femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,segments,num_segments,ug_serial);
     268                        MassFluxx(&mass_flux,femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,femmodel->parameters,segments,num_segments,ug_serial);
    269269                       
    270270                        if(my_rank==0)responses[i]=mass_flux;
  • issm/trunk/src/c/Qmux/SpawnCoreParallel.cpp

    r2330 r2333  
    6969        /*Recover partitioning for dakota: */
    7070        model->FindParam(&qmu_npart,"qmu_npart");
    71         model->FindParam(&qmu_part,"qmu_part");
     71        model->FindParam(&qmu_part,NULL,NULL,"qmu_part");
    7272        #ifdef _ISSM_DEBUG_
    7373        for(i=0;i<numresponses;i++){
  • issm/trunk/src/c/SystemMatricesx/SystemMatricesx.cpp

    r465 r2333  
    1313#include "../EnumDefinitions/EnumDefinitions.h"
    1414
    15 void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,
     15void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, DataSet* parameters,
    1616                int kflag,int pflag,int connectivity,int numberofdofspernode,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
    1717       
     
    2929
    3030        /*First, get elements and loads configured: */
    31         elements->Configure(elements,loads, nodes, materials);
    32         loads->Configure(elements, loads, nodes, materials);
     31        elements->Configure(elements,loads, nodes, materials,parameters);
     32        loads->Configure(elements, loads, nodes, materials,parameters);
     33        parameters->Configure(elements,loads, nodes, materials,parameters);
    3334
    3435        /*Get size of matrix: */
  • issm/trunk/src/c/SystemMatricesx/SystemMatricesx.h

    r465 r2333  
    1010
    1111/* local prototypes: */
    12 void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,
     12void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, DataSet* parameters,
    1313                int kflag,int pflag,int connectivity,int numberofdofspernode,ParameterInputs* inputs,int analysis_type,int sub_analysis_type);
    1414
  • issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.cpp

    r246 r2333  
    1313#include "../EnumDefinitions/EnumDefinitions.h"
    1414
    15 int UpdateFromInputsx( DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, ParameterInputs* inputs) {
     15int UpdateFromInputsx( DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,ParameterInputs* inputs) {
    1616
    1717        int noerr=1;
     
    2323
    2424        /*First, get elements and loads configured: */
    25         elements->Configure(elements,loads, nodes, materials);
    26         loads->Configure(elements, loads, nodes, materials);
    27         nodes->Configure(elements, loads, nodes, materials);
     25        elements->Configure(elements,loads, nodes, materials,parameters);
     26        loads->Configure(elements, loads, nodes, materials,parameters);
     27        nodes->Configure(elements, loads, nodes, materials,parameters);
     28        parameters->Configure(elements,loads, nodes, materials,parameters);
    2829
    2930        /*Update elements, nodes, loads and materials from inputs: */
  • issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.h

    r1 r2333  
    1010
    1111/* local prototypes: */
    12 int             UpdateFromInputsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, ParameterInputs* inputs);
     12int             UpdateFromInputsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials,  DataSet* parameters,ParameterInputs* inputs);
    1313
    1414#endif  /* _UPDATEFROMINPUTSXX_H */
  • issm/trunk/src/c/UpdateGeometryx/UpdateGeometryx.cpp

    r821 r2333  
    1515
    1616void UpdateGeometryx(Vec* poutthickness,Vec* poutbed,Vec* poutsurface,
    17                 DataSet* elements, DataSet* nodes,DataSet* loads, DataSet* materials,
     17                DataSet* elements, DataSet* nodes,DataSet* loads, DataSet* materials, DataSet* parameters,
    1818                Vec vec_newthickness,Vec vec_bed,Vec vec_surface){
    1919
     
    4646
    4747        /*First, get elements and loads configured: */
    48         elements->Configure(elements,loads, nodes, materials);
    49         materials->Configure(elements, loads, nodes, materials);
    50         loads->Configure(elements, loads, nodes, materials);
     48        elements->Configure(elements,loads, nodes, materials,parameters);
     49        materials->Configure(elements, loads, nodes, materials,parameters);
     50        loads->Configure(elements, loads, nodes, materials,parameters);
     51        parameters->Configure(elements,loads, nodes, materials,parameters);
    5152
    5253        /*Serialize inputs :*/
  • issm/trunk/src/c/UpdateGeometryx/UpdateGeometryx.h

    r825 r2333  
    1111/* local prototypes: */
    1212void UpdateGeometryx(Vec* poutthickness,Vec* poutbed,Vec* poutsurface,
    13                 DataSet* elements, DataSet* nodes,DataSet* loads, DataSet* materials,
     13                DataSet* elements, DataSet* nodes,DataSet* loads, DataSet* materials, DataSet* parameters,
    1414                Vec newthickness,Vec bed,Vec surface);
    1515
  • issm/trunk/src/c/UpdateNodePositionsx/UpdateNodePositionsx.cpp

    r848 r2333  
    1313#include "../EnumDefinitions/EnumDefinitions.h"
    1414
    15 void UpdateNodePositionsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, Vec thickness,Vec bed){
     15void UpdateNodePositionsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, DataSet* parameters,Vec thickness,Vec bed){
    1616
    1717        /*intermediary: */
     
    2020
    2121        /*First, get elements and loads configured: */
    22         elements->Configure(elements,loads, nodes, materials);
    23         loads->Configure(elements, loads, nodes, materials);
    24         nodes->Configure(elements, loads, nodes, materials);
     22        elements->Configure(elements,loads, nodes, materials,parameters);
     23        loads->Configure(elements, loads, nodes, materials,parameters);
     24        nodes->Configure(elements, loads, nodes, materials,parameters);
     25        parameters->Configure(elements,loads, nodes, materials,parameters);
    2526
    2627        /*serialize inputs: */
  • issm/trunk/src/c/UpdateNodePositionsx/UpdateNodePositionsx.h

    r848 r2333  
    1010
    1111/* local prototypes: */
    12 void UpdateNodePositionsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, Vec thickness,Vec bed);
     12void UpdateNodePositionsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials,  DataSet* parameters,Vec thickness,Vec bed);
    1313
    1414#endif  /* _UPDATENODEPOSITIONSXX_H */
  • issm/trunk/src/c/include/types.h

    r1881 r2333  
    1616typedef FILE* DataHandle;
    1717#endif
     18enum param_type { STRING, INTEGER, STRINGARRAY, DOUBLE, DOUBLEVEC, DOUBLEMAT, PETSCVEC, PETSCMAT };
    1819
    1920#endif //ifndef _TYPES_H_
  • issm/trunk/src/c/io/FetchData.cpp

    r1 r2333  
    1010
    1111#include "./io.h"
     12#include "../shared/shared.h"
     13
     14#undef __FUNCT__
     15#define __FUNCT__ "FetchData"
     16
     17
     18
     19/***************** **************** **************** **************** **************** **************** **************** **************** **************** ****************
     20                                                                                                          Serial Fetch Data Routines, all overloaded.
     21**************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/
    1222
    1323#ifdef _SERIAL_
    1424
    1525#include <mex.h>
    16 void FetchData(void** pdata,int* pM,int* pN,const mxArray* pdataref,char* data_type,char* sub_data_type){
     26
     27void FetchData(DataSet** pdataset,const mxArray* dataref){
     28
     29        /*output*/
     30        DataSet* outdataset=NULL;
     31        char*    outdataset_buffer=NULL;
     32        int      outdataset_size;
     33
     34        /*First, check that our reference is a double, otherwise, error out: */
     35        if (mxIsDouble(dataref)){
     36                       
     37                /*We need to copy the data pointed by dataref, so that our dataset is not actually a pointer!:*/
     38                if (!mxIsEmpty(dataref)){
     39                        outdataset_buffer=(char*)mxGetPr(dataref);
     40                        outdataset_size=mxGetM(dataref)*mxGetN(dataref);
     41                        if(outdataset_size)outdataset=DataSetDemarshall(outdataset_buffer);
     42                }
     43        }
     44        else{
     45                if (mxIsEmpty(dataref)){
     46                        /*Nothing to pick up. Just initialize pointer to NULL, and warn the server we are not uploading anything: */
     47                        outdataset_size=0;
     48                        outdataset=NULL;
     49                }
     50                else{
     51                        /*This is an error: we don't have the correct input!: */
     52                        throw ErrorException(__FUNCT__,"  wrong input parameter!");
     53                }
     54        }
     55
     56        /*Assign output pointers:*/
     57        *pdataset=outdataset;
     58}
     59
     60void FetchData(double** pmatrix,int* pM,int *pN,const mxArray* dataref){
     61
     62        double*  outmatrix=NULL;
     63        int      outmatrix_rows,outmatrix_cols;
     64
     65        if(mxIsEmpty(dataref) ){
     66                /*Nothing to pick up. Just initialize matrix pointer to NULL: */
     67                outmatrix_rows=0;
     68                outmatrix_cols=0;
     69                outmatrix=NULL;
     70        }
     71        else if (mxIsDouble(dataref) ){
     72
     73                /*Check dataref is not pointing to NaN: */
     74                if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetM(dataref)==1) && (mxGetN(dataref)==1) ){
     75                        outmatrix_rows=0;
     76                        outmatrix_cols=0;
     77                        outmatrix=NULL;
     78                }
     79                else{
     80
     81                        /*Convert matlab matrix to double* matrix: */
     82                        MatlabMatrixToDoubleMatrix(&outmatrix,&outmatrix_rows,&outmatrix_cols,dataref);
     83                }
     84        }
     85        else{
     86                /*This is an error: we don't have the correct input!: */
     87                throw ErrorException(__FUNCT__,"wrong input parameter");
     88        }
     89
     90                       
     91        /*Assign output pointers:*/
     92        *pmatrix=outmatrix;
     93        if (pM)*pM=outmatrix_rows;
     94        if (pN)*pN=outmatrix_cols;
     95
     96
     97}
     98
     99void FetchData(Mat* pmatrix,const mxArray* dataref){
    17100       
    18         SerialFetchData(pdata,pM,pN,pdataref,data_type,sub_data_type);
    19 
    20 }
     101        Mat outmatrix=NULL;
     102        int dummy=0;
     103
     104        if(mxIsEmpty(dataref) ){
     105                /*Nothing to pick up. Just initialize matrix pointer to NULL: */
     106                outmatrix=NULL;
     107        }
     108        else if (mxIsDouble(dataref) ){
     109
     110                /*Check dataref is not pointing to NaN: */
     111                if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetM(dataref)==1) && (mxGetN(dataref)==1) ){
     112                        outmatrix=NULL;
     113                }
     114                else{
     115
     116                        /*Convert matlab matrix to petsc matrix: */
     117                        MatlabMatrixToPetscMatrix(&outmatrix,&dummy,&dummy,dataref);
     118                }
     119        }
     120        else{
     121                /*This is an error: we don't have the correct input!: */
     122                throw ErrorException(__FUNCT__,"wrong input parameter");
     123        }
     124
     125        /*Assign output pointers:*/
     126        *pmatrix=outmatrix;
     127}
     128
     129void FetchData(double** pvector,int* pM,const mxArray* dataref){
     130
     131        double* outvector=NULL;
     132        int outvector_rows;
     133
     134        if(mxIsEmpty(dataref)){
     135                /*Nothing to pick up. Just initialize matrix pointer to NULL: */
     136                outvector_rows=0;
     137                outvector=NULL;
     138        }
     139        else if (mxIsDouble(dataref) ){
     140
     141                /*Convert matlab vector to double*  vector: */
     142                MatlabVectorToDoubleVector(&outvector,&outvector_rows,dataref);
     143
     144        }
     145        else{
     146                /*This is an error: we don't have the correct input!: */
     147                throw ErrorException(__FUNCT__,"wrong input parameter");
     148        }
     149
     150        /*Assign output pointers:*/
     151        *pvector=outvector;
     152        if (pM)*pM=outvector_rows;
     153}
     154
     155void FetchData(Vec* pvector,const mxArray* dataref){
     156
     157        Vec vector=NULL;
     158        int dummy;
     159
     160        if(mxIsEmpty(dataref)){
     161                /*Nothing to pick up. Just initialize matrix pointer to NULL: */
     162                vector=NULL;
     163        }
     164        else if (mxIsDouble(dataref) ){
     165
     166                /*Convert matlab vector to petsc vector: */
     167                MatlabVectorToPetscVector(&vector,&dummy,dataref);
     168        }
     169        else{
     170                /*This is an error: we don't have the correct input!: */
     171                throw ErrorException(__FUNCT__,"wrong input parameter");
     172        }
     173
     174        /*Assign output pointers:*/
     175        *pvector=vector;
     176}
     177
     178void FetchData(char** pstring,const mxArray* dataref){
     179
     180        char* outstring=NULL;
     181
     182
     183        /*Ok, the string should be coming directly from the matlab workspace: */
     184        if (!mxIsChar(dataref)){
     185                throw ErrorException(__FUNCT__,"input data_type is not a string!");
     186        }
     187        else{
     188                /*Recover the string:*/
     189                int stringlen;
     190               
     191                stringlen = mxGetM(dataref)*mxGetN(dataref)+1;
     192                outstring = (char*)xmalloc(sizeof(mxChar)*stringlen);
     193                mxGetString(dataref,outstring,stringlen);
     194        }
     195
     196        /*Assign output pointers:*/
     197        *pstring=outstring;
     198}
     199
     200void FetchData(double* pscalar,const mxArray* dataref){
     201
     202        double scalar;
     203
     204        if (!mxIsDouble(dataref)){
     205                throw ErrorException(__FUNCT__,"input data_type is not a scalar!");
     206        }
     207        else{
     208                /*Recover the double: */
     209                scalar=mxGetScalar(dataref);
     210        }
     211
     212        /*Assign output pointers:*/
     213        *pscalar=scalar;
     214}
     215
     216void FetchData(int* pinteger,const mxArray* dataref){
     217
     218        int integer;
     219
     220        if (!mxIsDouble(dataref)){
     221                throw ErrorException(__FUNCT__,"input data_type is not a scalar!");
     222        }
     223        else{
     224                /*Recover the double: */
     225                integer=(int)mxGetScalar(dataref);
     226        }
     227
     228        /*Assign output pointers:*/
     229        *pinteger=integer;
     230}
     231
     232
    21233#endif
    22234
    23235#if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
    24 void FetchData(void** pdata,int* pM,int* pN,FILE* fid,char* data_type,char* sub_data_type){
    25 
    26         ParallelFetchData(pdata,pM,pN,fid, data_type,sub_data_type);
    27 
    28 }
     236
     237/***************** **************** **************** **************** **************** **************** **************** **************** **************** ****************
     238                                                                                                          Parallel Fetch Data Routines, all overloaded.
     239**************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/
     240
     241void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid){
     242
     243        extern int my_rank;
     244        extern int num_procs;
     245
     246        /*output: */
     247        int M,N;
     248        double* matrix=NULL;
     249       
     250        /*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */
     251        /*numberofelements: */
     252        if(my_rank==0){ 
     253                if(fread(&M,sizeof(int),1,fid)!=1) throw ErrorException(__FUNCT__,"could not read number of rows for matrix ");
     254        }
     255
     256        MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD);
     257
     258        if(my_rank==0){ 
     259                if(fread(&N,sizeof(int),1,fid)!=1) throw ErrorException(__FUNCT__,"  could not read number of columns for matrix ");
     260        }
     261        MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD);
     262
     263        /*Now allocate matrix: */
     264        if(M*N){
     265                matrix=(double*)xmalloc(M*N*sizeof(double));
     266
     267                /*Read matrix on node 0, then broadcast: */
     268                if(my_rank==0){ 
     269                        if(fread(matrix,M*N*sizeof(double),1,fid)!=1) throw ErrorException(__FUNCT__," could not read matrix ");
     270                }
     271               
     272                MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD);
     273        }
     274
     275
     276        /*Assign output pointers: */
     277        *pmatrix=matrix;
     278        if (pM)*pM=M;
     279        if (pN)*pN=N;
     280
     281}
     282
     283void FetchData(char** pstring,FILE* fid){
     284
     285        extern int my_rank;
     286        extern int num_procs;
     287
     288        /*output: */
     289        char* string=NULL;
     290        int   string_size;
     291
     292        /*We have to read a string from disk. First read the dimensions of the string, then the string: */
     293        if(my_rank==0){ 
     294                if(fread(&string_size,sizeof(int),1,fid)!=1)throw ErrorException(__FUNCT__," could not read length of string ");
     295        }
     296
     297        MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD);
     298
     299        /*Now allocate string: */
     300        if(string_size){
     301                string=(char*)xmalloc((string_size+1)*sizeof(char));
     302                string[string_size]='\0';
     303
     304                /*Read string on node 0, then broadcast: */
     305                if(my_rank==0){ 
     306                        if(fread(string,string_size*sizeof(char),1,fid)!=1)throw ErrorException(__FUNCT__,"  could not read string ");
     307                }
     308                MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD);
     309        }
     310        else{
     311                string=(char*)xmalloc(sizeof(char));
     312                string[0]='\0';
     313        }
     314
     315
     316        /*Assign output pointers: */
     317        *pstring=string;
     318}
     319
     320
     321void FetchData(double* pscalar,FILE* fid){
     322
     323        extern int my_rank;
     324        extern int num_procs;
     325
     326        /*output: */
     327        double   scalar;
     328
     329        /*We have to read a scalar from disk. First read the dimensions of the scalar, then the scalar: */
     330        if(my_rank==0){
     331                if(fread(&scalar,sizeof(double),1,fid)!=1)throw ErrorException(__FUNCT__," could not read scalar ");
     332        }
     333        MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
     334
     335        /*Assign output pointers: */
     336        *pscalar=scalar;
     337                 
     338}
     339
     340void FetchData(int* pinteger,FILE* fid){
     341
     342        extern int my_rank;
     343        extern int num_procs;
     344
     345        /*output: */
     346        int   integer;
     347
     348        /*We have to read a integer from disk. First read the dimensions of the integer, then the integer: */
     349        if(my_rank==0){ 
     350                if(fread(&integer,sizeof(int),1,fid)!=1) throw ErrorException(__FUNCT__," could not read integer ");
     351        }
     352
     353        MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD);
     354
     355        /*Assign output pointers: */
     356        *pinteger=integer;
     357
     358}
     359
     360
    29361#endif
  • issm/trunk/src/c/io/FetchNodeSets.cpp

    r304 r2333  
    3737        else{
    3838
    39                 FetchData((void**)&pv_m,NULL,NULL,mxGetField(dataref,0,"pv_m"),"Vector","Vec");
    40                 FetchData((void**)&pv_n,NULL,NULL,mxGetField(dataref,0,"pv_n"),"Vector","Vec");
    41                 FetchData((void**)&pv_f,NULL,NULL,mxGetField(dataref,0,"pv_f"),"Vector","Vec");
    42                 FetchData((void**)&pv_s,NULL,NULL,mxGetField(dataref,0,"pv_s"),"Vector","Vec");
     39                FetchData(&pv_m,NULL,mxGetField(dataref,0,"pv_m"));
     40                FetchData(&pv_n,NULL,mxGetField(dataref,0,"pv_n"));
     41                FetchData(&pv_f,NULL,mxGetField(dataref,0,"pv_f"));
     42                FetchData(&pv_s,NULL,mxGetField(dataref,0,"pv_s"));
    4343               
    4444                gsize=(int)mxGetScalar(mxGetField(dataref,0,"gsize"));
  • issm/trunk/src/c/io/IoModelFetchData.cpp

    r1940 r2333  
    1313#include "../shared/shared.h"
    1414
    15 void  IoModelFetchData(void** pdata,int* pM,int* pN,ConstDataHandle model_handle,char* data_name,char* data_type,char* sub_data_type){
     15
     16
     17#ifdef _SERIAL_
     18/***************** **************** **************** **************** **************** **************** **************** **************** **************** ****************
     19                                                                                                          Serial IoModelFetch Data Routines, all overloaded.
     20**************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/
     21
     22void IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name){
     23
     24        FetchData(pdataset,mxGetAssignedField(model_handle,0,data_name));
     25
     26}
     27void IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name){
    1628       
     29        FetchData(pmatrix,pM,pN,mxGetAssignedField(model_handle,0,data_name));
     30
     31}
     32void IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name){
     33       
     34        FetchData(pmatrix,mxGetAssignedField(model_handle,0,data_name));
     35
     36}
     37void IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name){
     38       
     39        FetchData(pvector,pM,mxGetAssignedField(model_handle,0,data_name));
     40
     41}
     42void IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name){
     43       
     44        FetchData(pvector,mxGetAssignedField(model_handle,0,data_name));
     45
     46}
     47void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){
     48       
     49        FetchData(pstring,mxGetAssignedField(model_handle,0,data_name));
     50
     51}
     52void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){
     53       
     54        FetchData(pscalar,mxGetAssignedField(model_handle,0,data_name));
     55
     56}
     57void IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){
     58
     59        FetchData(pinteger,mxGetAssignedField(model_handle,0,data_name));
     60}
     61#endif
     62
     63
     64
     65/***************** **************** **************** **************** **************** **************** **************** **************** **************** ****************
     66                                                                                                          Parallel IoModelFetch Data Routines, all overloaded.
     67**************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/
     68#ifdef _PARALLEL_
     69FILE* SetFilePointerToData(ConstDataHandle model_handle,char* data_name){
    1770
    1871        extern int my_rank;
    1972        extern int num_procs;
    20 
     73       
    2174        int string_size;
    2275        int record_length;
    2376        char* string=NULL;
    24 
    25         /*Why this routine? To make IoModel management simpler. FetchData is enough for regular I/O, but here, we are dealing with
    26          * I/O that can act on the model matlab array (in case we are running serially), or I/O on the binary file when running
    27          * in parallel. On a matlab model array, it is easy to find the data with name "data_name", but not in a binary file. We
    28          * are abstracting all of this with one function, operating on the DataHandle object. */
    29 
    3077        char* repository=NULL;
    3178        FILE* fid=NULL;
    3279        int found=0;
    3380
    34         /*Ok, on the matlab side: */
    35         #ifdef _SERIAL_
    36 
    37         /*The typical model_handle is a const mxArray*, to which FetchData is applied. But here, we are dealing with a structure, the
    38          *model. Therefore, we are looking to fetch a certain field of this data. So get this field first, and then feed it to the
    39          FetchData routine. : */
    40 
    41         FetchData((void**)pdata,pM,pN,mxGetAssignedField(model_handle,0,data_name),data_type,sub_data_type);
    42 
    43         #else
    44 
    45         /*In parallel, we have a FetchData, which will recover data, but it will do a good job provided the FILE* descriptor
    46          * is pointing to the start of the data we want. Here, we have to go looking for the beginning of this data. */
    47 
     81        /*Go find in the binary file, the position of the data we want to fetch: */
    4882        if(my_rank==0){
    4983       
     
    93127        if(!found)throw ErrorException(__FUNCT__,exprintf("%s %s ","could not find data with name",data_name));
    94128
    95         /*We are at the correct position! Go for it: */
    96         FetchData((void**)pdata,pM,pN,fid,data_type,sub_data_type);
    97         #endif
     129        return fid;
    98130}
     131
     132void  IoModelFetchData(double** pmatrix,int* pM,int* pN,ConstDataHandle model_handle,char* data_name){
     133       
     134        FILE* fid=NULL;
     135       
     136        /*Set file pointer to beginning of the data: */
     137        fid=SetFilePointerToData(model_handle,data_name);
     138       
     139        /*Now fetch: */
     140        FetchData(pmatrix,pM,pN,fid);
     141
     142}
     143void  IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){
     144
     145        FILE* fid=NULL;
     146       
     147        /*Set file pointer to beginning of the data: */
     148        fid=SetFilePointerToData(model_handle,data_name);
     149       
     150        /*Now fetch: */
     151        FetchData(pstring,fid);
     152}
     153
     154void  IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){
     155
     156        FILE* fid=NULL;
     157       
     158        /*Set file pointer to beginning of the data: */
     159        fid=SetFilePointerToData(model_handle,data_name);
     160       
     161        /*Now fetch: */
     162        FetchData(pscalar,fid);
     163}
     164
     165void  IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){
     166
     167        FILE* fid=NULL;
     168       
     169        /*Set file pointer to beginning of the data: */
     170        fid=SetFilePointerToData(model_handle,data_name);
     171       
     172        /*Now fetch: */
     173        FetchData(pinteger,fid);
     174}
     175#endif
  • issm/trunk/src/c/io/WriteParams.cpp

    r2110 r2333  
    4848
    4949        /*Recover data from the parameters dataset: */
    50         nfields=(mwSize)parameters->Size();
     50        nfields=(mwSize)parameters->Size()-1; //don't include Numpar
    5151
    5252        fnames=(const char**)xmalloc(nfields*sizeof(char*));
     
    5454        /*Build structure in matlab workspace with all the parameter fields: */
    5555        for(i=0;i<nfields;i++){
    56                 param=(Param*)parameters->GetObjectByOffset(i);
     56                param=(Param*)parameters->GetObjectByOffset(i+1);
    5757                fnames[i]=(const char*)xmalloc((strlen(param->GetParameterName())+1)*sizeof(char));
    5858                strcpy((char*)fnames[i],param->GetParameterName());
     
    6464        for(i=0;i<nfields;i++){
    6565
    66                 param=(Param*)parameters->GetObjectByOffset(i);
     66                param=(Param*)parameters->GetObjectByOffset(i+1);
    6767               
    6868                switch(param->GetType()){
    6969                        case INTEGER:
    70                                 param->GetParameterValue((void*)&integer);
     70                                param->GetParameterValue(&integer);
    7171                                mxSetField( dataref, 0, param->GetParameterName(),mxCreateDoubleScalar((double)integer));
    7272                                break;
    7373
    7474                        case DOUBLE:
    75                                 param->GetParameterValue((void*)&ddouble);
     75                                param->GetParameterValue(&ddouble);
    7676                                mxSetField( dataref, 0, param->GetParameterName(),mxCreateDoubleScalar((double)ddouble));
    7777                                break;
    7878
    7979                        case STRING:
    80                                 param->GetParameterValue((void*)&string);
     80                                param->GetParameterValue(&string);
    8181                                mxSetField( dataref, 0, param->GetParameterName(),mxCreateString(string));
    8282                                break;
    8383
    8484                        case STRINGARRAY:
    85                                 param->GetParameterValue((void*)&stringarray);
     85                                param->GetParameterValue(&stringarray);
    8686                                M=param->GetM();
    8787                                dims[0]=M;
     
    9696
    9797                        case DOUBLEVEC:
    98                                 param->GetParameterValue((void*)&doublevec);
     98                                param->GetParameterValue(&doublevec);
    9999                                M=param->GetM();
    100100                                pfield=mxCreateDoubleMatrix(0,0,mxREAL);
     
    106106
    107107                        case DOUBLEMAT:
    108                                 param->GetParameterValue((void*)&doublemat);
     108                                param->GetParameterValue(&doublemat);
    109109                                M=param->GetM();
    110110                                N=param->GetN();
     
    119119               
    120120                        case PETSCVEC:
    121                                 param->GetParameterValue((void*)&vec);
     121                                param->GetParameterValue(&vec);
    122122                                VecToMPISerial(&serial_vec,vec);
    123123                                VecFree(&vec);
     
    131131               
    132132                        case PETSCMAT:
    133                                 param->GetParameterValue((void*)&mat);
     133                                param->GetParameterValue(&mat);
    134134                                MatToSerial(&serial_mat,mat);
    135135                                MatFree(&mat);
  • issm/trunk/src/c/io/io.h

    r2316 r2333  
    1313class DataSet;
    1414
    15 void FetchData(void** pdata,int* pM,int* pN,ConstDataHandle data_handle,char* data_type,char* sub_data_type);
    16 void IoModelFetchData(void** pdata,int* pM,int* pN,ConstDataHandle model_handle,char* data_name,char* data_type,char* sub_data_type);
     15FILE* pfopen(char* filename,char* format);
     16void  pfclose(FILE* fid,char* filename);
    1717
    18 /*Serial: */
    1918#ifdef _SERIAL_
    20 /*Write: */
     19
    2120void WriteData(mxArray** pdataref,DataSet* dataset);
    2221void WriteData(mxArray** pdataref,Mat matrix);
     
    2827void WriteData(mxArray** pdataref,char* string);
    2928void WriteData(mxArray** pdataref,DofVec* vector);
     29
    3030void WriteNodeSets(DataHandle* pdataref,NodeSets* nodesets);
    3131void WriteParams(DataHandle* pdataref,DataSet* parameters);
    3232
    33 /*Fetch: */
    34 void SerialFetchData(void** pdata,int* pM,int* pN,ConstDataHandle data_handle,char* data_type,char* sub_data_type);
     33void FetchData(DataSet** pdataset,const mxArray* dataref);
     34void FetchData(double** pmatrix,int* pM,int *pN,const mxArray* dataref);
     35void FetchData(Mat* pmatrix,const mxArray* dataref);
     36void FetchData(double** pvector,int* pM,const mxArray* dataref);
     37void FetchData(Vec* pvector,const mxArray* dataref);
     38void FetchData(char** pstring,const mxArray* dataref);
     39void FetchData(double* pscalar,const mxArray* dataref);
     40void FetchData(int* pinteger,const mxArray* dataref);
     41
     42
     43void IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name);
     44void IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name);
     45void IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name);
     46void IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name);
     47void IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name);
     48void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name);
     49void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name);
     50void IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name);
     51
    3552void FetchNodeSets(NodeSets** pnodesets,ConstDataHandle dataref);
     53void FetchParams(DataSet** pparameters, DataHandle dataref);
     54
    3655#endif
    3756
    38 /*Parallel: */
     57
     58
     59
     60
    3961#ifdef _PARALLEL_
    40 void ParallelFetchData(void** pdata,int* pM,int* pN,DataHandle data_handle, char* data_type,char* sub_data_type);
    41 void ParallelFetchMat(double** pdata,int* pM,int* pN,DataHandle data_handle);
    42 void ParallelFetchString(char** pdata,DataHandle data_handle);
    43 void ParallelFetchScalar(double* pdata,DataHandle data_handle);
    44 void ParallelFetchInteger(int* pdata,DataHandle data_handle);
     62void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid);
     63void FetchData(char** pstring,FILE* fid);
     64void FetchData(double* pscalar,FILE* fid);
     65void FetchData(int* pinteger,FILE* fid);
     66
     67
     68FILE* SetFilePointerToData(ConstDataHandle model_handle,char* data_name);
     69void  IoModelFetchData(double** pmatrix,int* pM,int* pN,ConstDataHandle model_handle,char* data_name);
     70void  IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name);
     71void  IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name);
     72void  IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name);
     73
     74void WriteData(int* pdummy,void* data,char* data_type);
    4575void WriteDataToDisk(void* data,int* pM,int* pN,char* datatype,FILE* fid);
    46 void WriteData(int* pdummy,void* data,char* data_type);
     76
    4777#endif
    4878
    49 /*File I/O: */
    50 FILE* pfopen(char* filename,char* format);
    51 void  pfclose(FILE* fid,char* filename);
    5279
    53 #endif  /* _IMDB_H */
    5480
     81
     82
     83
     84#endif  /* _IO_H_ */
  • issm/trunk/src/c/objects/Beam.cpp

    r2112 r2333  
    2626}
    2727               
    28 Beam::Beam(int beam_id, int beam_mid, int beam_mparid, int beam_g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2],bool beam_onbed){
     28Beam::Beam(int beam_id, int beam_mid, int beam_mparid, int beam_numparid, int beam_g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2],bool beam_onbed){
    2929
    3030        int i;
     
    3333        mid=beam_mid;
    3434        mparid=beam_mparid;
     35        numparid=beam_numparid;
    3536        for(i=0;i<2;i++){
    3637                node_ids[i]=beam_g[i];
     
    4647        matpar=NULL;
    4748        matpar_offset=UNDEF;
     49        numpar=NULL;
     50        numpar_offset=UNDEF;
    4851        onbed=beam_onbed;
    4952       
     
    127130        memcpy(marshalled_dataset,&matpar,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
    128131        memcpy(marshalled_dataset,&matpar_offset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
     132        memcpy(marshalled_dataset,&numparid,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
     133        memcpy(marshalled_dataset,&numpar,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
     134        memcpy(marshalled_dataset,&numpar_offset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
    129135        memcpy(marshalled_dataset,&h,sizeof(h));marshalled_dataset+=sizeof(h);
    130136        memcpy(marshalled_dataset,&s,sizeof(s));marshalled_dataset+=sizeof(s);
     
    148154                +sizeof(matpar)
    149155                +sizeof(matpar_offset)
     156                +sizeof(numparid)
     157                +sizeof(numpar)
     158                +sizeof(numpar_offset)
    150159                +sizeof(h)
    151160                +sizeof(s)
     
    181190        memcpy(&matpar,marshalled_dataset,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
    182191        memcpy(&matpar_offset,marshalled_dataset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
     192        memcpy(&numparid,marshalled_dataset,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
     193        memcpy(&numpar,marshalled_dataset,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
     194        memcpy(&numpar_offset,marshalled_dataset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
    183195        memcpy(&h,marshalled_dataset,sizeof(h));marshalled_dataset+=sizeof(h);
    184196        memcpy(&s,marshalled_dataset,sizeof(s));marshalled_dataset+=sizeof(s);
     
    211223#undef __FUNCT__
    212224#define __FUNCT__ "Beam::Configure"
    213 void  Beam::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin){
     225void  Beam::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin,void* pparametersin){
    214226
    215227        int i;
     
    218230        DataSet* nodesin=NULL;
    219231        DataSet* materialsin=NULL;
     232        DataSet* parametersin=NULL;
    220233
    221234        /*Recover pointers :*/
     
    223236        nodesin=(DataSet*)pnodesin;
    224237        materialsin=(DataSet*)pmaterialsin;
     238        parametersin=(DataSet*)pparametersin;
    225239
    226240        /*Link this element with its nodes, ie find pointers to the nodes in the nodes dataset.: */
     
    230244        ResolvePointers((Object**)&matice,&mid,&matice_offset,1,materialsin);
    231245        ResolvePointers((Object**)&matpar,&mparid,&matpar_offset,1,materialsin);
     246
     247        /*Same for numpar: */
     248        ResolvePointers((Object**)&numpar,&numparid,&numpar_offset,1,parametersin);
    232249
    233250}
  • issm/trunk/src/c/objects/Beam.h

    r2112 r2333  
    3333                Matpar* matpar;
    3434                int   matpar_offset;
     35
     36                int numparid;
     37                Numpar* numpar;
     38                int   numpar_offset;
    3539                                       
    3640                double h[2];
     
    4448
    4549                Beam();
    46                 Beam(int beam_id, int beam_mid, int beam_mparid, int beam_g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2],bool beam_onbed);
     50                Beam(int beam_id, int beam_mid, int beam_mparid, int beam_numparid,int beam_g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2],bool beam_onbed);
    4751                ~Beam();
    4852
     
    5660                int   GetId();
    5761                int   MyRank();
    58                 void  Configure(void* loads,void* nodes,void* materials);
     62                void  Configure(void* loads,void* nodes,void* materials,void* parameters);
    5963                void  CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type);
    6064                void  CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type);
  • issm/trunk/src/c/objects/Element.h

    r2112 r2333  
    2424                virtual char* GetName()=0;
    2525                virtual void  Demarshall(char** pmarshalled_dataset)=0;
    26                 virtual void  Configure(void* loads,void* nodes,void* materials)=0;
     26                virtual void  Configure(void* loads,void* nodes,void* materials,void* parameters)=0;
    2727                virtual void  CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type)=0;
    2828                virtual void  CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type)=0;
  • issm/trunk/src/c/objects/FemModel.cpp

    r2316 r2333  
    177177}
    178178
    179 #undef __FUNCT__
    180 #define __FUNCT__ "FemModel::FindParam"
    181 int FemModel::FindParam(void* pparameter,char* parametername){
    182        
    183         return parameters->FindParam(pparameter,parametername);
    184 
    185 }
     179
     180#undef __FUNCT__
     181#define __FUNCT__ "FemModel::FindParam"
     182int FemModel::FindParam(double* pscalar,char* name){
     183       
     184        return parameters->FindParam(pscalar,name);
     185
     186}
     187#undef __FUNCT__
     188#define __FUNCT__ "FemModel::FindParam"
     189int FemModel::FindParam(int* pinteger,char* name){
     190       
     191        return parameters->FindParam(pinteger,name);
     192
     193}
     194
     195#undef __FUNCT__
     196#define __FUNCT__ "FemModel::FindParam"
     197int FemModel::FindParam(char** pstring,char* name){
     198       
     199        return parameters->FindParam(pstring,name);
     200
     201}
     202
     203#undef __FUNCT__
     204#define __FUNCT__ "FemModel::FindParam"
     205int FemModel::FindParam(char*** pstringarray,int* pM,char* name){
     206       
     207        return parameters->FindParam(pstringarray,pM,name);
     208
     209}
     210
     211#undef __FUNCT__
     212#define __FUNCT__ "FemModel::FindParam"
     213int FemModel::FindParam(double** pdoublearray,int* pM,int* pN,char* name){
     214       
     215        return parameters->FindParam(pdoublearray,pM,pN,name);
     216
     217}
     218
     219#undef __FUNCT__
     220#define __FUNCT__ "FemModel::FindParam"
     221int FemModel::FindParam(Vec* pvec,char* name){
     222       
     223        return parameters->FindParam(pvec,name);
     224
     225}
     226
     227#undef __FUNCT__
     228#define __FUNCT__ "FemModel::FindParam"
     229int FemModel::FindParam(Mat* pmat,char* name){
     230       
     231        return parameters->FindParam(pmat,name);
     232
     233}
     234
    186235
    187236/*access to internal data: */
  • issm/trunk/src/c/objects/FemModel.h

    r2316 r2333  
    5353                Object* copy();
    5454               
    55                 int FindParam(void* pparameter,char* parametername);
     55                int FindParam(double* pscalar,char* name);
     56                int FindParam(int* pinteger,char* name);
     57                int FindParam(char** pstring,char* name);
     58                int FindParam(char*** pstringarray,int* pM,char* name);
     59                int FindParam(double** pdoublearray,int* pM, int* pN,char* name);
     60                int FindParam(Vec* pvec,char* name);
     61                int FindParam(Mat* pmat,char* name);
    5662                DataSet* get_elements(void);
    5763                DataSet* get_nodes(void);
  • issm/trunk/src/c/objects/Model.cpp

    r2316 r2333  
    106106
    107107        _printf_("   configuring element and loads:\n");
    108         ConfigureObjectsx(elements, loads, nodes, materials);
     108        ConfigureObjectsx(elements, loads, nodes, materials,parameters);
    109109
    110110        _printf_("   process parameters:\n");
     
    184184
    185185        _printf_("   configuring element and loads:\n");
    186         ConfigureObjectsx(elements, loads, nodes, materials);
     186        ConfigureObjectsx(elements, loads, nodes, materials,parameters);
    187187
    188188        _printf_("   process parameters:\n");
     
    216216        if(!femmodel)return 0;
    217217
    218         femmodel->FindParam((void*)pparameter,parametername);
     218        femmodel->FindParam(pparameter,parametername);
    219219
    220220}
     
    231231        if(!femmodel)return 0;
    232232       
    233         femmodel->FindParam((void*)pparameter,parametername);
    234 
    235 
    236 }
    237 int   Model::FindParam(double** pparameter,char* parametername){
     233        femmodel->FindParam(pparameter,parametername);
     234
     235
     236}
     237int   Model::FindParam(double** pparameter,int* pM, int *pN,char* parametername){
    238238       
    239239        FemModel* femmodel=NULL;
     
    247247        if(!femmodel)return 0;
    248248       
    249         femmodel->FindParam((void*)pparameter,parametername);
     249        femmodel->FindParam(pparameter,pM, pN,parametername);
    250250
    251251
     
    263263        if(!femmodel)return 0;
    264264       
    265         femmodel->FindParam((void*)pparameter,parametername);
     265        femmodel->FindParam(pparameter,parametername);
    266266
    267267}
     
    277277
    278278        /*extract our parameter from the found formulation: */
    279         femmodel->FindParam((void*)pparameter,parametername);
     279        femmodel->FindParam(pparameter,parametername);
    280280}
    281281
     
    290290
    291291        /*extract our parameter from the found formulation: */
    292         femmodel->FindParam((void*)pparameter,parametername);
    293 }
    294 
    295 
    296 int   Model::FindParam(double** pparameter,char* parametername,int analysis_type,int sub_analysis_type){
     292        femmodel->FindParam(pparameter,parametername);
     293}
     294
     295
     296int   Model::FindParam(double** pparameter,int* pM, int* pN,char* parametername,int analysis_type,int sub_analysis_type){
    297297
    298298        FemModel* femmodel=NULL;
     
    304304
    305305        /*extract our parameter from the found formulation: */
    306         femmodel->FindParam((void*)pparameter,parametername);
     306        femmodel->FindParam(pparameter,pM, pN,parametername);
    307307}
    308308
     
    317317
    318318        /*extract our parameter from the found formulation: */
    319         femmodel->FindParam((void*)pparameter,parametername);
     319        femmodel->FindParam(pparameter,parametername);
    320320}
    321321
     
    330330
    331331        /*extract our parameter from the found formulation: */
    332         femmodel->FindParam((void*)pparameter,parametername);
     332        femmodel->FindParam(pparameter,parametername);
    333333}
    334334
     
    343343
    344344        /*extract our parameter from the found formulation: */
    345         femmodel->FindParam((void*)pparameter,parametername);
    346 }
    347 
    348 
    349 int   Model::FindParam(double** pparameter,char* parametername,int analysis_type){
     345        femmodel->FindParam(pparameter,parametername);
     346}
     347
     348
     349int   Model::FindParam(double** pparameter,int* pM, int* pN,char* parametername,int analysis_type){
    350350
    351351        FemModel* femmodel=NULL;
     
    357357
    358358        /*extract our parameter from the found formulation: */
    359         femmodel->FindParam((void*)pparameter,parametername);
     359        femmodel->FindParam(pparameter,pM,pN,parametername);
    360360}
    361361
     
    370370
    371371        /*extract our parameter from the found formulation: */
    372         femmodel->FindParam((void*)pparameter,parametername);
     372        femmodel->FindParam(pparameter,parametername);
    373373}       
    374374
     
    390390
    391391                femmodel=(FemModel*)femmodels->GetObjectByOffset(i);
    392                 femmodel->FindParam((void*)&femmodel_analysis_type,"analysis_type");
    393                 femmodel->FindParam((void*)&femmodel_sub_analysis_type,"sub_analysis_type");
     392                femmodel->FindParam(&femmodel_analysis_type,"analysis_type");
     393                femmodel->FindParam(&femmodel_sub_analysis_type,"sub_analysis_type");
    394394
    395395                if((analysis_type==femmodel_analysis_type) && (sub_analysis_type==femmodel_sub_analysis_type)){
     
    420420
    421421                femmodel=(FemModel*)femmodels->GetObjectByOffset(i);
    422                 femmodel->FindParam((void*)&femmodel_analysis_type,"analysis_type");
     422                femmodel->FindParam(&femmodel_analysis_type,"analysis_type");
    423423
    424424                if((analysis_type==femmodel_analysis_type)){
  • issm/trunk/src/c/objects/Model.h

    r1886 r2333  
    3535                int   FindParam(int* pparameter,char* parametername);
    3636                int   FindParam(double* pparameter,char* parametername);
    37                 int   FindParam(double** pparameter,char* parametername);
     37                int   FindParam(double** pparameter,int* pM,int* pN,char* parametername);
    3838                int   FindParam(char** pparameter,char* parametername);
    3939
    4040                int   FindParam(int* pparameter,char* parametername,int analysis_type,int sub_analysis_type);
    4141                int   FindParam(double* pparameter,char* parametername,int analysis_type,int sub_analysis_type);
    42                 int   FindParam(double** pparameter,char* parametername,int analysis_type,int sub_analysis_type);
     42                int   FindParam(double** pparameter,int* pM, int* pN,char* parametername,int analysis_type,int sub_analysis_type);
    4343                int   FindParam(char** pparameter,char* parametername,int analysis_type,int sub_analysis_type);
    4444
    4545                int   FindParam(int* pparameter,char* parametername,int analysis_type);
    4646                int   FindParam(double* pparameter,char* parametername,int analysis_type);
    47                 int   FindParam(double** pparameter,char* parametername,int analysis_type);
     47                int   FindParam(double** pparameter,int* pM,int* pN,char* parametername,int analysis_type);
    4848                int   FindParam(char** pparameter,char* parametername,int analysis_type);
    4949
  • issm/trunk/src/c/objects/Param.cpp

    r2112 r2333  
    116116                        break;
    117117       
    118                 case INTEGER:
    119                         printf("   integer value: %i\n",integer);
    120                         break;
    121        
    122118                case DOUBLE:
    123119                        printf("   double value: %g\n",ddouble);
     
    175171                        }
    176172       
    177                 case INTEGER:
    178                         printf("   integer value: %i\n",integer);
    179                         break;
    180        
    181173                case DOUBLE:
    182174                        printf("   double value: %g\n",ddouble);
     
    254246                        break;
    255247
    256                 case INTEGER:
    257                         memcpy(marshalled_dataset,&integer,sizeof(integer));marshalled_dataset+=sizeof(integer);
    258                         break;
    259248                case DOUBLE:
    260249                        memcpy(marshalled_dataset,&ddouble,sizeof(ddouble));marshalled_dataset+=sizeof(ddouble);
     
    343332                        break;
    344333
    345                 case INTEGER:
    346                         size+= sizeof(integer);
    347                         break;
    348334                case DOUBLE:
    349335                        size+= sizeof(ddouble);
     
    411397                                for(i=0;i<M;i++){
    412398                                        int size;
    413                                         memcpy(&size,marshalled_dataset,sizeof(integer));marshalled_dataset+=sizeof(integer);
     399                                        memcpy(&size,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    414400                                        tempstring=(char*)xmalloc(size);
    415401                                        memcpy(tempstring,marshalled_dataset,size);marshalled_dataset+=size;
     
    417403                                }
    418404                        }
    419                         break;
    420 
    421                 case INTEGER:
    422                         memcpy(&integer,marshalled_dataset,sizeof(integer));marshalled_dataset+=sizeof(integer);
    423405                        break;
    424406
     
    510492}
    511493
    512 void  Param::GetParameterValue(void* pvalue){
     494#undef __FUNCT__
     495#define __FUNCT__ "GetParameterValue"
     496void  Param::GetParameterValue(double* pdouble){
     497
     498        if(type!=DOUBLE)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a double from a param with type",type));
     499        *pdouble=ddouble;
     500}
     501
     502#undef __FUNCT__
     503#define __FUNCT__ "GetParameterValue"
     504void  Param::GetParameterValue(int* pinteger){
     505       
     506        if(type!=DOUBLE)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover an integer from a param with type",type));
     507        *pinteger=(int)ddouble;
     508}
     509
     510#undef __FUNCT__
     511#define __FUNCT__ "GetParameterValue"
     512void  Param::GetParameterValue(char** pstring){
     513       
     514        char*  outstring=NULL;
     515       
     516        if(type!=STRING)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a string from a param with type",type));
     517        outstring=(char*)xmalloc((strlen(string)+1)*sizeof(char));
     518        strcpy(outstring,string);
     519        *pstring=outstring;
     520
     521}
     522
     523#undef __FUNCT__
     524#define __FUNCT__ "GetParameterValue"
     525void  Param::GetParameterValue(char*** pstringarray){
    513526
    514527        int i;
    515 
    516         if (type==STRING){
    517                 char** pstring=(char**)pvalue; //a little dangerous, but hey!
    518                 char*  outstring=NULL;
    519                 outstring=(char*)xmalloc((strlen(string)+1)*sizeof(char));
    520                 strcpy(outstring,string);
    521                 *pstring=outstring;
    522         }
    523         else if (type==STRINGARRAY){
    524                 char*** pstringarray=(char***)pvalue; //a little dangerous, but hey!
    525                 char**  outstringarray=NULL;
    526                 outstringarray=(char**)xmalloc(M*sizeof(char*));
    527                 for(i=0;i<M;i++){
    528                         char* outstring=(char*)xmalloc((strlen(stringarray[i])+1)*sizeof(char));
    529                         strcpy(outstring,stringarray[i]);
    530                         outstringarray[i]=outstring;
     528        if(type!=STRINGARRAY)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a string array from a param with type",type));
     529
     530        char**  outstringarray=NULL;
     531        outstringarray=(char**)xmalloc(M*sizeof(char*));
     532        for(i=0;i<M;i++){
     533                char* outstring=(char*)xmalloc((strlen(stringarray[i])+1)*sizeof(char));
     534                strcpy(outstring,stringarray[i]);
     535                outstringarray[i]=outstring;
     536        }
     537        *pstringarray=outstringarray;
     538}
     539
     540#undef __FUNCT__
     541#define __FUNCT__ "GetParameterValue"
     542       
     543void  Param::GetParameterValue(double** pdoublearray){
     544       
     545
     546        double* outdoublearray=NULL;
     547       
     548        if((type!=DOUBLEVEC) & (type!=DOUBLEMAT)) throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a double array from a param with type",type));
     549       
     550        if(type==DOUBLEVEC){
     551
     552                if(M){
     553                        outdoublearray=(double*)xmalloc(M*sizeof(double));
     554                        memcpy(outdoublearray,doublevec,M*sizeof(double));
    531555                }
    532                 *pstringarray=outstringarray;
    533         }
    534         else if(type==INTEGER){
    535                 int* pinteger=(int*)pvalue;
    536                 *pinteger=integer;
    537         }
    538         else if(type==DOUBLE){
    539                 double* pdouble=(double*)pvalue;
    540                 *pdouble=ddouble;
    541         }
    542         else if(type==DOUBLEVEC){
    543                 double** pdoublevec=(double**)pvalue;
    544                 double* outdoublevec=NULL;
    545                 if(M){
    546                         outdoublevec=(double*)xmalloc(M*sizeof(double));
    547                         memcpy(outdoublevec,doublevec,M*sizeof(double));
     556        }
     557       
     558        if(type==DOUBLEMAT){
     559       
     560                if(M*N){
     561                        outdoublearray=(double*)xmalloc(M*N*sizeof(double));
     562                        memcpy(outdoublearray,doublemat,M*N*sizeof(double));
    548563                }
    549                 *pdoublevec=outdoublevec;
    550         }
    551         else if(type==DOUBLEMAT){
    552                 double** pdoublemat=(double**)pvalue;
    553                 double* outdoublemat=NULL;
    554                 if(M*N){
    555                         outdoublemat=(double*)xmalloc(M*N*sizeof(double));
    556                         memcpy(outdoublemat,doublemat,M*N*sizeof(double));
    557                 }
    558                 *pdoublemat=outdoublemat;
    559         }
    560         else if(type==PETSCVEC){
    561                 Vec* pvec=(Vec*)pvalue;
    562                 Vec  outvec=NULL;
    563                 if(vec){
    564                         VecDuplicate(vec,&outvec);
    565                         VecCopy(vec,outvec);
    566                 }
    567                 *pvec=outvec;
    568         }
    569         else if(type==PETSCMAT){
    570                 Mat* pmat=(Mat*)pvalue;
    571                 Mat  outmat=NULL;
    572                 if(mat){
    573                         MatDuplicate(mat,MAT_COPY_VALUES,&outmat);
    574                 }
    575                 *pmat=outmat;
    576         }
    577         else{
    578                 _printf_("%s%s%i\n",__FUNCT__," error message: unknow type ",type);
    579                 abort();
    580         }
    581         return;
     564        }
     565
     566        *pdoublearray=outdoublearray;
     567}
     568
     569#undef __FUNCT__
     570#define __FUNCT__ "GetParameterValue"
     571void  Param::GetParameterValue(Vec* pvec){
     572       
     573        Vec  outvec=NULL;
     574       
     575        if(type!=PETSCVEC)  throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a Petsc vec from a param with type",type));
     576
     577        if(vec){
     578                VecDuplicate(vec,&outvec);
     579                VecCopy(vec,outvec);
     580        }
     581        *pvec=outvec;
     582}
     583
     584#undef __FUNCT__
     585#define __FUNCT__ "GetParameterValue"
     586
     587void  Param::GetParameterValue(Mat* pmat){
     588       
     589        Mat  outmat=NULL;
     590       
     591        if(type!=PETSCMAT)  throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a Petsc mat from a param with type",type));
     592       
     593        if(mat){
     594                MatDuplicate(mat,MAT_COPY_VALUES,&outmat);
     595        }
     596        *pmat=outmat;
    582597}
    583598
     
    608623
    609624#undef __FUNCT__
    610 #define __FUNCT__ "SetInteger"
    611 void  Param::SetInteger(int value){
    612         if (type!=INTEGER) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set integer for type",type));
    613         integer=value;
    614 }
     625#define __FUNCT__ "SetDouble"
     626void  Param::SetDouble(int value){
     627        if (type!=DOUBLE) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set double for type",type));
     628        ddouble=(double)value;
     629}
     630
    615631
    616632#undef __FUNCT__
  • issm/trunk/src/c/objects/Param.h

    r2110 r2333  
    88#include "./Object.h"
    99#include "../toolkits/toolkits.h"
     10#include "../include/types.h"
    1011
    1112#define PARAMSTRING 200 //max string length
    1213
    13 enum param_type { STRING, STRINGARRAY, INTEGER, DOUBLE, DOUBLEVEC, DOUBLEMAT, PETSCVEC, PETSCMAT };
    1414
    1515class Param: public Object{
     
    2020                int  type; /*! param type, from enum above*/
    2121               
    22                 int  integer;
    2322                double ddouble;
    2423                char  string[PARAMSTRING];
     
    4847               
    4948                void  SetDouble(double value);
     49                void  SetDouble(int  value);
    5050                void  SetDoubleVec(double* value,int size);
    5151                void  SetDoubleVec(double* value,int size,int ndof);
    5252                void  SetDoubleMat(double* value,int M,int N);
    5353                void  SetVec(Vec value);
    54                 void  SetInteger(int value);
    5554                void  SetString(char* value);
    5655                void  SetStringArray(char** value,int size);
    57                 void  GetParameterValue(void* pvalue);
     56
     57                void  GetParameterValue(double* pdouble);
     58                void  GetParameterValue(int* pinteger);
     59                void  GetParameterValue(char** pstring);
     60                void  GetParameterValue(char*** pstringarray);
     61                void  GetParameterValue(double** pdoublearray);
     62                void  GetParameterValue(Vec* pvec);
     63                void  GetParameterValue(Mat* pmat);
    5864               
    5965                int   GetId();
  • issm/trunk/src/c/objects/ParameterInputs.cpp

    r1904 r2333  
    295295
    296296        /*retrive some necessary parameters first: */
    297         found=parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     297        found=parameters->FindParam(&numberofnodes,"numberofnodes");
    298298        if(!found)throw ErrorException(__FUNCT__,"coud not find numberofnodes in parameters dataset!");
    299299
     
    321321
    322322                        /*Now, pick up the parameter corresponding to root: */
    323                         found=parameters->FindParam((void*)&parameter,root);
     323                        found=parameters->FindParam(&parameter,NULL,NULL,root);
    324324                        if(!found)throw ErrorException(__FUNCT__,exprintf("%s%s%s"," could not find parameter ",root," for Dakota input update"));
    325325                       
  • issm/trunk/src/c/objects/Penta.cpp

    r2112 r2333  
    1919        return;
    2020}
    21 Penta::Penta( int penta_id, int penta_mid, int penta_mparid, int penta_node_ids[6], double penta_h[6], double penta_s[6], double penta_b[6], double penta_k[6], int penta_friction_type,
    22                                 double penta_p, double penta_q, int penta_shelf, int penta_onbed, int penta_onsurface, double penta_meanvel,double penta_epsvel,
    23                                 int penta_collapse, double penta_melting[6], double penta_accumulation[6], double penta_geothermalflux[6],
    24                                 int penta_artdiff, int penta_thermal_steadystate,double penta_viscosity_overshoot,double penta_stokesreconditioning,bool penta_onwater){
     21Penta::Penta( int penta_id, int penta_mid, int penta_mparid, int penta_numparid, int penta_node_ids[6], double penta_h[6], double penta_s[6], double penta_b[6], double penta_k[6], int penta_friction_type,
     22                                double penta_p, double penta_q, int penta_shelf, int penta_onbed, int penta_onsurface,  int penta_collapse, double penta_melting[6], double penta_accumulation[6], double penta_geothermalflux[6],
     23                                 int penta_thermal_steadystate,bool penta_onwater){
    2524       
    2625        int i;
     
    2928        mid = penta_mid;
    3029        mparid = penta_mparid;
     30        numparid=penta_numparid;
    3131
    3232        for(i =0;i<6;i++){
     
    4646        matpar=NULL;
    4747        matpar_offset=UNDEF;
     48        numpar=NULL;
     49        numpar_offset=UNDEF;
    4850
    4951        friction_type = penta_friction_type;
     
    5456        onwater = penta_onwater;
    5557        onsurface = penta_onsurface;
    56         meanvel = penta_meanvel;
    57         epsvel = penta_epsvel;
    5858        collapse = penta_collapse;
    59         artdiff = penta_artdiff;
    6059        thermal_steadystate = penta_thermal_steadystate;
    61         viscosity_overshoot = penta_viscosity_overshoot;
    62         stokesreconditioning = penta_stokesreconditioning;
    6360
    6461        return;
     
    9289        printf("   onwater: %i\n",onwater);
    9390        printf("   onsurface: %i\n",onsurface);
    94         printf("   meanvel: %g\n",meanvel);
    95         printf("   epsvel: %g\n",epsvel);
    9691        printf("   collapse: %i\n",collapse);
    9792       
     
    9994        printf("   accumulation=[%g,%g,%g,%g,%g,%g]\n",accumulation[0],accumulation[1],accumulation[2],accumulation[3],accumulation[4],accumulation[5]);
    10095        printf("   geothermalflux=[%g,%g,%g,%g,%g,%g]\n",geothermalflux[0],geothermalflux[1],geothermalflux[2],geothermalflux[3],geothermalflux[4],geothermalflux[5]);
    101         printf("   artdiff: %i\n",artdiff);
    10296        printf("   thermal_steadystate: %i\n",thermal_steadystate);
    103         printf("   viscosity_overshoot: %i\n",viscosity_overshoot);
    104         printf("   stokesreconditioning: %i\n",stokesreconditioning);
    10597        return;
    10698}
     
    129121        printf("   onwater: %i\n",onwater);
    130122        printf("   onsurface: %i\n",onsurface);
    131         printf("   meanvel: %g\n",meanvel);
    132         printf("   epsvel: %g\n",epsvel);
    133123        printf("   collapse: %i\n",collapse);
    134124       
     
    136126        printf("   accumulation=[%i,%i,%i,%i,%i,%i]\n",accumulation[0],accumulation[1],accumulation[2],accumulation[3],accumulation[4],accumulation[5]);
    137127        printf("   geothermalflux=[%i,%i,%i,%i,%i,%i]\n",geothermalflux[0],geothermalflux[1],geothermalflux[2],geothermalflux[3],geothermalflux[4],geothermalflux[5]);
    138         printf("   artdiff: %i\n",artdiff);
    139128        printf("   thermal_steadystate: %i\n",thermal_steadystate);
    140         printf("   viscosity_overshoot: %i\n",viscosity_overshoot);
    141         printf("   stokesreconditioning: %i\n",stokesreconditioning);
    142129        return;
    143130}
     
    167154        memcpy(marshalled_dataset,&matpar,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
    168155        memcpy(marshalled_dataset,&matpar_offset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
     156        memcpy(marshalled_dataset,&numparid,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
     157        memcpy(marshalled_dataset,&numpar,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
     158        memcpy(marshalled_dataset,&numpar_offset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
    169159        memcpy(marshalled_dataset,&h,sizeof(h));marshalled_dataset+=sizeof(h);
    170160        memcpy(marshalled_dataset,&s,sizeof(s));marshalled_dataset+=sizeof(s);
     
    178168        memcpy(marshalled_dataset,&onwater,sizeof(onwater));marshalled_dataset+=sizeof(onwater);
    179169        memcpy(marshalled_dataset,&onsurface,sizeof(onsurface));marshalled_dataset+=sizeof(onsurface);
    180         memcpy(marshalled_dataset,&meanvel,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
    181         memcpy(marshalled_dataset,&epsvel,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
    182170        memcpy(marshalled_dataset,&collapse,sizeof(collapse));marshalled_dataset+=sizeof(collapse);
    183171        memcpy(marshalled_dataset,&melting,sizeof(melting));marshalled_dataset+=sizeof(melting);
    184172        memcpy(marshalled_dataset,&accumulation,sizeof(accumulation));marshalled_dataset+=sizeof(accumulation);
    185173        memcpy(marshalled_dataset,&geothermalflux,sizeof(geothermalflux));marshalled_dataset+=sizeof(geothermalflux);
    186         memcpy(marshalled_dataset,&artdiff,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);
    187174        memcpy(marshalled_dataset,&thermal_steadystate,sizeof(thermal_steadystate));marshalled_dataset+=sizeof(thermal_steadystate);
    188         memcpy(marshalled_dataset,&viscosity_overshoot,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);
    189         memcpy(marshalled_dataset,&stokesreconditioning,sizeof(stokesreconditioning));marshalled_dataset+=sizeof(stokesreconditioning);
    190175       
    191176        *pmarshalled_dataset=marshalled_dataset;
     
    205190                sizeof(matpar)+
    206191                sizeof(matpar_offset)+
     192                +sizeof(numparid)+
     193                +sizeof(numpar)+
     194                +sizeof(numpar_offset)+
    207195                sizeof(h)+
    208196                sizeof(s)+
     
    216204                sizeof(onwater)+
    217205                sizeof(onsurface)+
    218                 sizeof(meanvel)+
    219                 sizeof(epsvel)+
    220206                sizeof(collapse)+
    221207                sizeof(melting)+
    222208                sizeof(accumulation)+
    223209                sizeof(geothermalflux)+
    224                 sizeof(artdiff)+
    225210                sizeof(thermal_steadystate) +
    226                 sizeof(viscosity_overshoot) +
    227                 sizeof(stokesreconditioning) +
    228211                sizeof(int); //sizeof(int) for enum type
    229212}
     
    254237        memcpy(&matpar,marshalled_dataset,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
    255238        memcpy(&matpar_offset,marshalled_dataset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
     239        memcpy(&numparid,marshalled_dataset,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
     240        memcpy(&numpar,marshalled_dataset,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
     241        memcpy(&numpar_offset,marshalled_dataset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
    256242        memcpy(&h,marshalled_dataset,sizeof(h));marshalled_dataset+=sizeof(h);
    257243        memcpy(&s,marshalled_dataset,sizeof(s));marshalled_dataset+=sizeof(s);
     
    265251        memcpy(&onwater,marshalled_dataset,sizeof(onwater));marshalled_dataset+=sizeof(onwater);
    266252        memcpy(&onsurface,marshalled_dataset,sizeof(onsurface));marshalled_dataset+=sizeof(onsurface);
    267         memcpy(&meanvel,marshalled_dataset,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
    268         memcpy(&epsvel,marshalled_dataset,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
    269253        memcpy(&collapse,marshalled_dataset,sizeof(collapse));marshalled_dataset+=sizeof(collapse);
    270254        memcpy(&melting,marshalled_dataset,sizeof(melting));marshalled_dataset+=sizeof(melting);
    271255        memcpy(&accumulation,marshalled_dataset,sizeof(accumulation));marshalled_dataset+=sizeof(accumulation);
    272256        memcpy(&geothermalflux,marshalled_dataset,sizeof(geothermalflux));marshalled_dataset+=sizeof(geothermalflux);
    273         memcpy(&artdiff,marshalled_dataset,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);
    274257        memcpy(&thermal_steadystate,marshalled_dataset,sizeof(thermal_steadystate));marshalled_dataset+=sizeof(thermal_steadystate);
    275         memcpy(&viscosity_overshoot,marshalled_dataset,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);
    276         memcpy(&stokesreconditioning,marshalled_dataset,sizeof(stokesreconditioning));marshalled_dataset+=sizeof(stokesreconditioning);
    277258
    278259        /*nodes and materials are not pointing to correct objects anymore:*/
     
    300281#undef __FUNCT__
    301282#define __FUNCT__ "Penta::Configure"
    302 void  Penta::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin){
     283void  Penta::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin,void* pparametersin){
    303284
    304285        int i;
     
    307288        DataSet* nodesin=NULL;
    308289        DataSet* materialsin=NULL;
     290        DataSet* parametersin=NULL;
    309291
    310292        /*Recover pointers :*/
     
    312294        nodesin=(DataSet*)pnodesin;
    313295        materialsin=(DataSet*)pmaterialsin;
     296        parametersin=(DataSet*)pparametersin;
    314297
    315298        /*Link this element with its nodes, ie find pointers to the nodes in the nodes dataset.: */
     
    319302        ResolvePointers((Object**)&matice,&mid,&matice_offset,1,materialsin);
    320303        ResolvePointers((Object**)&matpar,&mparid,&matpar_offset,1,materialsin);
     304
     305        /*Same for numpar: */
     306        ResolvePointers((Object**)&numpar,&numparid,&numpar_offset,1,parametersin);
    321307
    322308}
     
    576562                                  onto this scalar matrix, so that we win some computational time: */
    577563                               
    578                                 newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
     564                                newviscosity=viscosity+numpar->viscosity_overshoot*(viscosity-oldviscosity);
    579565                                D_scalar=newviscosity*gauss_weight*Jdet;
    580566                                for (i=0;i<5;i++){
     
    915901                        }
    916902                        for (i=6;i<8;i++){
    917                                 D[i][i]=-D_scalar*stokesreconditioning;
     903                                D[i][i]=-D_scalar*numpar->stokesreconditioning;
    918904                        }
    919905
     
    1012998                        DLStokes[9][8]=-viscosity*gauss_weight*Jdet2d*bed_normal[0]/2.0;
    1013999                        DLStokes[10][10]=-viscosity*gauss_weight*Jdet2d*bed_normal[1]/2.0;
    1014                         DLStokes[11][11]=stokesreconditioning*gauss_weight*Jdet2d*bed_normal[0];
    1015                         DLStokes[12][12]=stokesreconditioning*gauss_weight*Jdet2d*bed_normal[1];
    1016                         DLStokes[13][13]=stokesreconditioning*gauss_weight*Jdet2d*bed_normal[2];
     1000                        DLStokes[11][11]=numpar->stokesreconditioning*gauss_weight*Jdet2d*bed_normal[0];
     1001                        DLStokes[12][12]=numpar->stokesreconditioning*gauss_weight*Jdet2d*bed_normal[1];
     1002                        DLStokes[13][13]=numpar->stokesreconditioning*gauss_weight*Jdet2d*bed_normal[2];
    10171003
    10181004                        /*  Do the triple product tL*D*L: */
     
    13971383        tria_node_offsets[2]=node_offsets[g2];
    13981384
    1399         tria= new Tria(id,mid,mparid,tria_node_ids,tria_h,tria_s,tria_b,tria_k, tria_melting, tria_accumulation, tria_geothermalflux,friction_type,p,q,shelf,meanvel,epsvel,viscosity_overshoot,artdiff,onwater);
     1385        tria= new Tria(id,mid,mparid,numparid,tria_node_ids,tria_h,tria_s,tria_b,tria_k, tria_melting, tria_accumulation, tria_geothermalflux,friction_type,p,q,shelf,onwater);
    14001386
    14011387        tria->NodeConfiguration(tria_node_ids,tria_nodes,tria_node_offsets);
     
    32233209                        }
    32243210                        for (i=6;i<8;i++){
    3225                                 D[i][i]=-D_scalar*stokesreconditioning;
     3211                                D[i][i]=-D_scalar*numpar->stokesreconditioning;
    32263212                        }
    32273213
     
    35833569
    35843570                        /*Artifficial diffusivity*/
    3585                         if(artdiff){
     3571                        if(numpar->artdiff){
    35863572                                /*Build K: */
    3587                                 D_scalar=gauss_weight*Jdet/(pow(u,2)+pow(v,2)+epsvel);
     3573                                D_scalar=gauss_weight*Jdet/(pow(u,2)+pow(v,2)+numpar->epsvel);
    35883574                                if(dt){
    35893575                                        D_scalar=D_scalar*dt;
  • issm/trunk/src/c/objects/Penta.h

    r2112 r2333  
    3232                Matpar* matpar;
    3333                int   matpar_offset;
     34
     35                int numparid;
     36                Numpar* numpar;
     37                int   numpar_offset;
    3438       
    3539
     
    4650                int    onbed;
    4751                int    onsurface;
    48                 bool    onwater;
    49                 double meanvel;/*!scaling ratio for velocities*/
    50                 double epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
     52                bool   onwater;
    5153                int    collapse;
    5254                double geothermalflux[6];
    53                 int    artdiff;
    5455                int    thermal_steadystate;
    55                 double viscosity_overshoot;
    56                 double stokesreconditioning;
    5756       
    5857        public:
    5958
    6059                Penta();
    61                 Penta( int id, int mid, int mparid, int node_ids[6], double h[6], double s[6], double b[6], double k[6], int    friction_type,
    62                                 double p, double q, int    shelf, int    onbed, int    onsurface, double meanvel,double epsvel,
    63                                 int    collapse, double melting[6], double accumulation[6], double geothermalflux[6],
    64                                 int    artdiff, int    thermal_steadystate,double viscosity_overshoot,double stokesreconditioning,bool onwater);
     60                Penta( int id, int mid, int mparid, int numparid, int node_ids[6], double h[6], double s[6], double b[6], double k[6], int    friction_type,
     61                                double p, double q, int    shelf, int    onbed, int    onsurface,  int    collapse, double melting[6], double accumulation[6], double geothermalflux[6],
     62                                int    thermal_steadystate,bool onwater);
    6563                ~Penta();
    6664
     
    7472                int   GetId();
    7573                int   MyRank();
    76                 void  Configure(void* loads,void* nodes,void* materials);
     74                void  Configure(void* loads,void* nodes,void* materials,void* parameters);
    7775                void  CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type);
    7876                void  CreateKMatrixDiagnosticHoriz( Mat Kgg, void* inputs, int analysis_type,int sub_analysis_type);
  • issm/trunk/src/c/objects/Sing.cpp

    r2112 r2333  
    2626}
    2727               
    28 Sing::Sing(int sing_id, int sing_mid, int sing_mparid, int sing_g, double sing_h, double sing_k){
     28Sing::Sing(int sing_id, int sing_mid, int sing_mparid, int sing_numparid,int sing_g, double sing_h, double sing_k){
    2929
    3030        id=sing_id;
    3131        mid=sing_mid;
    3232        mparid=sing_mparid;
     33        numparid=sing_numparid;
    3334
    3435        node_id=sing_g;
    3536        node_offset=UNDEF;
    3637        node=NULL;
     38
     39        numpar=NULL;
     40        numpar_offset=UNDEF;
    3741       
    3842        h=sing_h;
     
    4347        matpar=NULL;
    4448        matpar_offset=UNDEF;
     49
     50        numpar=NULL;
     51        numpar_offset=UNDEF;
    4552
    4653        return;
     
    116123        memcpy(marshalled_dataset,&matpar,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
    117124        memcpy(marshalled_dataset,&matpar_offset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
     125        memcpy(marshalled_dataset,&numparid,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
     126        memcpy(marshalled_dataset,&numpar,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
     127        memcpy(marshalled_dataset,&numpar_offset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
    118128        memcpy(marshalled_dataset,&h,sizeof(h));marshalled_dataset+=sizeof(h);
    119129        memcpy(marshalled_dataset,&k,sizeof(k));marshalled_dataset+=sizeof(k);
     
    134144                +sizeof(matpar)
    135145                +sizeof(matpar_offset)
     146                +sizeof(numparid)
     147                +sizeof(numpar)
     148                +sizeof(numpar_offset)
    136149                +sizeof(h)
    137150                +sizeof(k)
     
    164177        memcpy(&matpar,marshalled_dataset,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
    165178        memcpy(&matpar_offset,marshalled_dataset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
     179        memcpy(&numparid,marshalled_dataset,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
     180        memcpy(&numpar,marshalled_dataset,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
     181        memcpy(&numpar_offset,marshalled_dataset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
    166182        memcpy(&h,marshalled_dataset,sizeof(h));marshalled_dataset+=sizeof(h);
    167183        memcpy(&k,marshalled_dataset,sizeof(k));marshalled_dataset+=sizeof(k);
     
    191207#undef __FUNCT__
    192208#define __FUNCT__ "Sing::Configure"
    193 void  Sing::Configure(void* ploadsin, void* pnodesin,void* pmaterialsin){
     209void  Sing::Configure(void* ploadsin, void* pnodesin,void* pmaterialsin,void* pparametersin){
    194210
    195211        int i;
     
    197213        DataSet* nodesin=NULL;
    198214        DataSet* materialsin=NULL;
     215        DataSet* parametersin=NULL;
    199216
    200217        /*Recover pointers :*/
    201218        nodesin=(DataSet*)pnodesin;
    202219        materialsin=(DataSet*)pmaterialsin;
     220        parametersin=(DataSet*)pparametersin;
    203221
    204222        /*Link this element with its nodes, ie find pointers to the nodes in the nodes dataset.: */
     
    208226        ResolvePointers((Object**)&matice,&mid,&matice_offset,1,materialsin);
    209227        ResolvePointers((Object**)&matpar,&mparid,&matpar_offset,1,materialsin);
     228
     229        /*Same for numpar: */
     230        ResolvePointers((Object**)&numpar,&numparid,&numpar_offset,1,parametersin);
    210231
    211232}
  • issm/trunk/src/c/objects/Sing.h

    r2112 r2333  
    3232                Matpar* matpar;
    3333                int   matpar_offset;
     34
     35                int numparid;
     36                Numpar* numpar;
     37                int   numpar_offset;
    3438       
    3539                double h;
     
    3943
    4044                Sing();
    41                 Sing(int sing_id, int sing_mid, int sing_mparid, int sing_g, double sing_h, double sing_k);
     45                Sing(int sing_id, int sing_mid, int sing_mparid, int sing_numparid,int sing_g, double sing_h, double sing_k);
    4246                ~Sing();
    4347
     
    5155                int   GetId();
    5256                int   MyRank();
    53                 void  Configure(void* loads,void* nodes,void* materials);
     57                void  Configure(void* loads,void* nodes,void* materials,void* parameters);
    5458                void  CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type);
    5559                void  CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type);
  • issm/trunk/src/c/objects/Tria.cpp

    r2268 r2333  
    3232}
    3333
    34 Tria::Tria(int tria_id,int tria_mid,int tria_mparid,int tria_node_ids[3],double tria_h[3],double tria_s[3],double tria_b[3],double tria_k[3],double tria_melting[3],
    35                                 double tria_accumulation[3],double tria_geothermalflux[3],int tria_friction_type,double tria_p,double tria_q,int tria_shelf,double tria_meanvel,double tria_epsvel,
    36                                 double tria_viscosity_overshoot,int tria_artdiff,bool tria_onwater){
     34Tria::Tria(int tria_id,int tria_mid,int tria_mparid,int tria_numparid,int tria_node_ids[3],double tria_h[3],double tria_s[3],double tria_b[3],double tria_k[3],double tria_melting[3],
     35                                double tria_accumulation[3],double tria_geothermalflux[3],int tria_friction_type,double tria_p,double tria_q,int tria_shelf, bool tria_onwater){
    3736       
    3837        int i;
     
    4140        mid=tria_mid;
    4241        mparid=tria_mparid;
     42        numparid=tria_numparid;
    4343        for(i=0;i<3;i++){
    4444                node_ids[i]=tria_node_ids[i];
     
    5757        matpar=NULL;
    5858        matpar_offset=UNDEF;
     59        numpar=NULL;
     60        numpar_offset=UNDEF;
    5961        friction_type=tria_friction_type;
    6062        p=tria_p;
    6163        q=tria_q;
    6264        shelf=tria_shelf;
    63         meanvel=tria_meanvel;
    64         epsvel=tria_epsvel;
    6565        onbed=1;
    6666        onwater=tria_onwater;
    67         viscosity_overshoot=tria_viscosity_overshoot;
    68         artdiff=tria_artdiff;
    6967       
    7068        return;
     
    9593        printf("   q: %g\n",q);
    9694        printf("   shelf: %i\n",shelf);
    97         printf("   meanvel: %g\n",meanvel);
    98         printf("   epsvel: %g\n",epsvel);
    9995        printf("   onbed: %i\n",onbed);
    10096        printf("   onwater: %i\n",onwater);
    101         printf("   viscosity_overshoot=%g\n",viscosity_overshoot);
    102         printf("   artdiff=%g\n",artdiff);
    10397        printf("   nodes: \n");
    10498        if(nodes[0])nodes[0]->Echo();
     
    134128        printf("   q: %g\n",q);
    135129        printf("   shelf: %i\n",shelf);
    136         printf("   meanvel: %g\n",meanvel);
    137         printf("   epsvel: %g\n",epsvel);
    138130        printf("   onbed: %i\n",onbed);
    139131        printf("   onwater: %i\n",onwater);
    140         printf("   viscosity_overshoot=%g\n",viscosity_overshoot);
    141         printf("   artdiff=%g\n",artdiff);
    142132        printf("   nodes: \n");
    143133        if(nodes[0])nodes[0]->Echo();
     
    174164        memcpy(marshalled_dataset,&matpar,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
    175165        memcpy(marshalled_dataset,&matpar_offset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
     166        memcpy(marshalled_dataset,&numparid,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
     167        memcpy(marshalled_dataset,&numpar,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
     168        memcpy(marshalled_dataset,&numpar_offset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
    176169        memcpy(marshalled_dataset,&h,sizeof(h));marshalled_dataset+=sizeof(h);
    177170        memcpy(marshalled_dataset,&s,sizeof(s));marshalled_dataset+=sizeof(s);
     
    187180        memcpy(marshalled_dataset,&q,sizeof(q));marshalled_dataset+=sizeof(q);
    188181        memcpy(marshalled_dataset,&shelf,sizeof(shelf));marshalled_dataset+=sizeof(shelf);
    189         memcpy(marshalled_dataset,&meanvel,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
    190         memcpy(marshalled_dataset,&epsvel,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
    191         memcpy(marshalled_dataset,&viscosity_overshoot,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);
    192         memcpy(marshalled_dataset,&artdiff,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);
    193182       
    194183        *pmarshalled_dataset=marshalled_dataset;
     
    207196                +sizeof(matpar)
    208197                +sizeof(matpar_offset)
     198                +sizeof(numparid)
     199                +sizeof(numpar)
     200                +sizeof(numpar_offset)
    209201                +sizeof(h)
    210202                +sizeof(s)
     
    220212                +sizeof(q)
    221213                +sizeof(shelf)
    222                 +sizeof(meanvel)
    223                 +sizeof(epsvel)
    224                 +sizeof(viscosity_overshoot)
    225                 +sizeof(artdiff)
    226214                +sizeof(int); //sizeof(int) for enum type
    227215}
     
    252240        memcpy(&matpar,marshalled_dataset,sizeof(matpar));marshalled_dataset+=sizeof(matpar);
    253241        memcpy(&matpar_offset,marshalled_dataset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset);
     242        memcpy(&numparid,marshalled_dataset,sizeof(numparid));marshalled_dataset+=sizeof(numparid);
     243        memcpy(&numpar,marshalled_dataset,sizeof(numpar));marshalled_dataset+=sizeof(numpar);
     244        memcpy(&numpar_offset,marshalled_dataset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset);
    254245        memcpy(&h,marshalled_dataset,sizeof(h));marshalled_dataset+=sizeof(h);
    255246        memcpy(&s,marshalled_dataset,sizeof(s));marshalled_dataset+=sizeof(s);
     
    265256        memcpy(&q,marshalled_dataset,sizeof(q));marshalled_dataset+=sizeof(q);
    266257        memcpy(&shelf,marshalled_dataset,sizeof(shelf));marshalled_dataset+=sizeof(shelf);
    267         memcpy(&meanvel,marshalled_dataset,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);
    268         memcpy(&epsvel,marshalled_dataset,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);
    269         memcpy(&viscosity_overshoot,marshalled_dataset,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);
    270         memcpy(&artdiff,marshalled_dataset,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);
    271258
    272259        /*nodes and materials are not pointing to correct objects anymore:*/
     
    274261        matice=NULL;
    275262        matpar=NULL;
     263        numpar=NULL;
    276264
    277265        /*return: */
     
    294282#undef __FUNCT__
    295283#define __FUNCT__ "Tria::Configure"
    296 void  Tria::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin){
     284void  Tria::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin,void* pparametersin){
    297285
    298286        int i;
     
    301289        DataSet* nodesin=NULL;
    302290        DataSet* materialsin=NULL;
     291        DataSet* parametersin=NULL;
    303292
    304293        /*Recover pointers :*/
     
    306295        nodesin=(DataSet*)pnodesin;
    307296        materialsin=(DataSet*)pmaterialsin;
     297        parametersin=(DataSet*)pparametersin;
    308298
    309299        /*Link this element with its nodes, ie find pointers to the nodes in the nodes dataset.: */
     
    313303        ResolvePointers((Object**)&matice,&mid,&matice_offset,1,materialsin);
    314304        ResolvePointers((Object**)&matpar,&mparid,&matpar_offset,1,materialsin);
     305
     306        /*Same for numpar: */
     307        ResolvePointers((Object**)&numpar,&numparid,&numpar_offset,1,parametersin);
    315308
    316309}
     
    479472                /* Build the D matrix: we plug the gaussian weight, the thickness, the viscosity, and the jacobian determinant
    480473                   onto this scalar matrix, so that we win some computational time: */
    481                 newviscosity=viscosity+viscosity_overshoot*(viscosity-oldviscosity);
     474                newviscosity=viscosity+numpar->viscosity_overshoot*(viscosity-oldviscosity);
    482475                D_scalar=newviscosity*thickness*gauss_weight*Jdet;
    483476
     
    645638
    646639        //Create Artificial diffusivity once for all if requested
    647         if(artdiff){
     640        if(numpar->artdiff){
    648641                //Get the Jacobian determinant
    649642                gauss_l1l2l3[0]=1.0/3.0; gauss_l1l2l3[1]=1.0/3.0; gauss_l1l2l3[2]=1.0/3.0;
     
    724717                for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_thickness2[i][j];
    725718               
    726                 if(artdiff){
     719                if(numpar->artdiff){
    727720                       
    728721                        /* Compute artificial diffusivity */
     
    20832076                /*We are using a relative misfit: */
    20842077                for (i=0;i<numgrids;i++){
    2085                         scalex=pow(meanvel/(obs_vx_list[i]+epsvel),2);
    2086                         scaley=pow(meanvel/(obs_vy_list[i]+epsvel),2);
     2078                        scalex=pow(numpar->meanvel/(obs_vx_list[i]+numpar->epsvel),2);
     2079                        scaley=pow(numpar->meanvel/(obs_vy_list[i]+numpar->epsvel),2);
    20872080                        if(obs_vx_list[i]==0)scalex=0;
    20882081                        if(obs_vy_list[i]==0)scaley=0;
     
    20942087                /*We are using a logarithmic misfit: */
    20952088                for (i=0;i<numgrids;i++){
    2096                         velocity_mag=sqrt(pow(vx_list[i],2)+pow(vy_list[i],2))+epsvel; //epsvel to avoid velocity being nil.
    2097                         obs_velocity_mag=sqrt(pow(obs_vx_list[i],2)+pow(obs_vy_list[i],2))+epsvel; //epsvel to avoid observed velocity being nil.
    2098                         scale=-8*pow(meanvel,2)/pow(velocity_mag,2)*log(velocity_mag/obs_velocity_mag);
     2089                        velocity_mag=sqrt(pow(vx_list[i],2)+pow(vy_list[i],2))+numpar->epsvel; //epsvel to avoid velocity being nil.
     2090                        obs_velocity_mag=sqrt(pow(obs_vx_list[i],2)+pow(obs_vy_list[i],2))+numpar->epsvel; //epsvel to avoid observed velocity being nil.
     2091                        scale=-8*pow(numpar->meanvel,2)/pow(velocity_mag,2)*log(velocity_mag/obs_velocity_mag);
    20992092                        logarithmicx_list[i]=scale*vx_list[i];
    21002093                        logarithmicy_list[i]=scale*vy_list[i];
     
    22552248        double  lambda,mu;
    22562249        double  bed,thickness,Neff;
    2257         double  cm_noisedampening;
    22582250       
    22592251        /*drag: */
     
    23002292        if(!inputs->Recover("adjoint",&adjxadjy_list[0][0],2,dofs2,numgrids,(void**)nodes)){
    23012293                throw ErrorException(__FUNCT__,"missing adjoint input parameter");
    2302         }
    2303         if(!inputs->Recover("cm_noisedampening",&cm_noisedampening)){
    2304                 throw ErrorException(__FUNCT__,"missing cm_noisedampening");
    23052294        }
    23062295
     
    24072396                        grade_g_gaussian[i]=
    24082397                          -2*drag*alpha_complement*((lambda*vx+mu*vy))*Jdet*gauss_weight*l1l2l3[i]                         //standard term dJ/dki
    2409                           +cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);  // regularization term d/dki(1/2*(dk/dx)^2)
     2398                          +numpar->cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);  // regularization term d/dki(1/2*(dk/dx)^2)
    24102399                }
    24112400               
     
    24692458        double  bed_normal[3];
    24702459        double  dk[NDOF2];
    2471         double  cm_noisedampening;
    24722460
    24732461        /*drag: */
     
    25102498        if(!inputs->Recover("adjoint",&adjxyz_list[0][0],3,dofs3,numgrids,(void**)nodes)){
    25112499                throw ErrorException(__FUNCT__,"missing adjoint input parameter");
    2512         }
    2513         if(!inputs->Recover("cm_noisedampening",&cm_noisedampening)){
    2514                 throw ErrorException(__FUNCT__,"missing cm_noisedampening");
    25152500        }
    25162501
     
    26342619
    26352620                        //Add regularization term
    2636                         grade_g_gaussian[i]+=cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);
     2621                        grade_g_gaussian[i]+=numpar->cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);
    26372622                }
    26382623
     
    27412726        int     dofs[1]={0};
    27422727        double  dk[NDOF2];
    2743         double  cm_noisedampening;
    27442728       
    27452729        ParameterInputs* inputs=NULL;
     
    27632747        if(!inputs->Recover("adjoint",&adjxadjy_list[0][0],2,dofs2,numgrids,(void**)nodes)){
    27642748                throw ErrorException(__FUNCT__,"missing adjoint input parameter");
    2765         }
    2766         if(!inputs->Recover("cm_noisedampening",&cm_noisedampening)){
    2767                 throw ErrorException(__FUNCT__,"missing cm_noisedampening");
    27682749        }
    27692750
     
    28282809
    28292810                        //Add regularization term
    2830                         grade_g_gaussian[i]+=cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);
     2811                        grade_g_gaussian[i]+=numpar->cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);
    28312812                }
    28322813
     
    28902871        double  dk[NDOF2];
    28912872        double  dB[NDOF2];
    2892         double  cm_noisedampening;
    28932873
    28942874        /* Jacobian: */
     
    29192899        if(!inputs->Recover("velocity",&vxvy_list[0][0],2,dofs2,numgrids,(void**)nodes)){
    29202900                throw ErrorException(__FUNCT__,"missing velocity input parameter");
    2921         }
    2922         if(!inputs->Recover("cm_noisedampening",&cm_noisedampening)){
    2923                 throw ErrorException(__FUNCT__,"missing cm_noisedampening");
    29242901        }
    29252902
     
    29422919                /*We are using a relative misfit: */
    29432920                for (i=0;i<numgrids;i++){
    2944                         scalex=pow(meanvel/(obs_vx_list[i]+epsvel),(double)2);
    2945                         scaley=pow(meanvel/(obs_vy_list[i]+epsvel),(double)2);
     2921                        scalex=pow(numpar->meanvel/(obs_vx_list[i]+numpar->epsvel),(double)2);
     2922                        scaley=pow(numpar->meanvel/(obs_vy_list[i]+numpar->epsvel),(double)2);
    29462923                        if(obs_vx_list[i]==0)scalex=0;
    29472924                        if(obs_vy_list[i]==0)scaley=0;
     
    29522929                /*We are using a logarithmic misfit: */
    29532930                for (i=0;i<numgrids;i++){
    2954                         velocity_mag=sqrt(pow(vx_list[i],(double)2)+pow(vy_list[i],(double)2))+epsvel; //epsvel to avoid velocity being nil.
    2955                         obs_velocity_mag=sqrt(pow(obs_vx_list[i],(double)2)+pow(obs_vy_list[i],(double)2))+epsvel; //epsvel to avoid observed velocity being nil.
    2956                         logarithmic_list[i]=4*pow(meanvel,(double)2)*pow(log(velocity_mag/obs_velocity_mag),(double)2);
     2931                        velocity_mag=sqrt(pow(vx_list[i],(double)2)+pow(vy_list[i],(double)2))+numpar->epsvel; //epsvel to avoid velocity being nil.
     2932                        obs_velocity_mag=sqrt(pow(obs_vx_list[i],(double)2)+pow(obs_vy_list[i],(double)2))+numpar->epsvel; //epsvel to avoid observed velocity being nil.
     2933                        logarithmic_list[i]=4*pow(numpar->meanvel,(double)2)*pow(log(velocity_mag/obs_velocity_mag),(double)2);
    29572934                }
    29582935        }
     
    29912968                if (strcmp(control_type,"drag")==0 & !shelf){
    29922969                        GetParameterDerivativeValue(&dk[0], &k[0],&xyz_list[0][0], gauss_l1l2l3);
    2993                         Jelem+=cm_noisedampening*1/2*(pow(dk[0],2)+pow(dk[1],2))*Jdet*gauss_weight;
     2970                        Jelem+=numpar->cm_noisedampening*1/2*(pow(dk[0],2)+pow(dk[1],2))*Jdet*gauss_weight;
    29942971                        if (id==1){
    29952972                                printf("id=%i value=%g k=[%g %g %g]\n",id,(pow(dk[0],2)+pow(dk[1],2)),k[0],k[1],k[2]);
     
    30022979                        B=matice->GetB();
    30032980                        GetParameterDerivativeValue(&dB[0], &B[0],&xyz_list[0][0], gauss_l1l2l3);
    3004                         Jelem+=cm_noisedampening*1/2*(pow(dB[0],2)+pow(dB[1],2))*Jdet*gauss_weight;
     2981                        Jelem+=numpar->cm_noisedampening*1/2*(pow(dB[0],2)+pow(dB[1],2))*Jdet*gauss_weight;
    30052982                }
    30062983                */
  • issm/trunk/src/c/objects/Tria.h

    r2112 r2333  
    1111#include "./Matice.h"
    1212#include "./Matpar.h"
     13#include "./Numpar.h"
    1314#include "./ParameterInputs.h"
    1415
     
    3334                Matpar* matpar;
    3435                int   matpar_offset;
     36
     37                int numparid;
     38                Numpar* numpar;
     39                int   numpar_offset;
    3540       
    3641                double h[3];
     
    4550                double q;
    4651                int    shelf;
    47                 double meanvel;/*!scaling ratio for velocities*/
    48                 double epsvel; /*!minimum velocity to avoid infinite velocity ratios*/
    4952                int    onbed;
    5053                bool   onwater;
    51                 double viscosity_overshoot;
    52                 int    artdiff;
    5354
    5455        public:
    5556
    5657                Tria();
    57                 Tria(int id,int mid,int mparid,int node_ids[3],double h[3],double s[3],double b[3],double k[3],double melting[3],double accumulation[3],double geothermalflux[3],
    58                                 int friction_type,double p,double q,int shelf,double meanvel,double epsvel,double viscosity_overshoot,int artdiff,bool onwater);
     58                Tria(int id,int mid,int mparid,int numparid,int node_ids[3],double h[3],double s[3],double b[3],double k[3],double melting[3],double accumulation[3],double geothermalflux[3],int friction_type,double p,double q,int shelf,bool onwater);
    5959                ~Tria();
    6060
     
    6868                int   GetId();
    6969                int   MyRank();
    70                 void  Configure(void* loads,void* nodes,void* materials);
     70                void  Configure(void* loads,void* nodes,void* materials,void* parameters);
    7171                void  CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type);
    7272                void  CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type);
  • issm/trunk/src/c/parallel/ControlInitialization.cpp

    r2330 r2333  
    7070
    7171        //specific parameters for specific models
    72         fem_dh->FindParam((void*)&numberofdofspernode_dh,"numberofdofspernode");
    73         fem_sl->FindParam((void*)&numberofdofspernode_sl,"numberofdofspernode");
    74         fem_ds->FindParam((void*)&numberofdofspernode_ds,"numberofdofspernode");
     72        fem_dh->FindParam(&numberofdofspernode_dh,"numberofdofspernode");
     73        fem_sl->FindParam(&numberofdofspernode_sl,"numberofdofspernode");
     74        fem_ds->FindParam(&numberofdofspernode_ds,"numberofdofspernode");
    7575
    7676        /*if no Stokes, assign output and return*/
     
    8686        diagnostic_core_linear(&slopex,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum());
    8787        diagnostic_core_linear(&slopey,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum());
    88         FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,"slopex",0);
    89         FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,"slopey",0);
     88        FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopex",0);
     89        FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopey",0);
    9090
    9191        //Add in inputs
     
    100100        diagnostic_core_nonlinear(&ug,NULL,NULL,NULL,fem_dh,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum());
    101101        if(verbose)_printf_("%s\n"," extruding horizontal velocities...");
    102         VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->loads,fem_dh-> materials,"velocity",1);
     102        VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->loads,fem_dh-> materials,fem_dh->parameters,"velocity",1);
    103103
    104104        //vertical velocity
     
    116116        //Create 4d u_g
    117117        if(verbose)_printf_("%s\n"," computing pressure according to Pattyn...");
    118         ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads,  fem_dh->materials, numberofnodes);
     118        ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads,  fem_dh->materials, fem_dh->parameters);
    119119        VecScale(pg,1.0/stokesreconditioning);
    120120        ug_stokes=NewVec(fem_ds->nodesets->GetGSize());
  • issm/trunk/src/c/parallel/DakotaResponses.cpp

    r804 r2333  
    2727
    2828        /*some data needed across the responses: */
    29         found=fem->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     29        found=fem->parameters->FindParam(&numberofnodes,"numberofnodes");
    3030        if(!found)throw ErrorException(__FUNCT__," could not find numberofnodes in fem model");
    3131
     
    4141                        double min_vel=0;
    4242               
    43                         found=results->FindResult((void*)&vel,"vel");
     43                        found=results->FindResult(&vel,"vel");
    4444                        if(!found)throw ErrorException(__FUNCT__," could not find vel to compute min_vel");
    4545
     
    5656                        double max_vel=0;
    5757
    58                         found=results->FindResult((void*)&vel,"vel");
     58                        found=results->FindResult(&vel,"vel");
    5959                        if(!found)throw ErrorException(__FUNCT__," could not find vel to compute max_vel");
    6060
     
    6969                        double min_vx=0;
    7070                       
    71                         found=results->FindResult((void*)&vx,"vx");
     71                        found=results->FindResult(&vx,"vx");
    7272                        if(!found)throw ErrorException(__FUNCT__," could not find vx to compute min_vx");
    7373
     
    8282                        double max_vx=0;
    8383                       
    84                         found=results->FindResult((void*)&vx,"vx");
     84                        found=results->FindResult(&vx,"vx");
    8585                        if(!found)throw ErrorException(__FUNCT__," could not find vx to compute max_vx");
    8686
     
    9595                        double max_abs_vx=0;
    9696                       
    97                         found=results->FindResult((void*)&vx,"vx");
     97                        found=results->FindResult(&vx,"vx");
    9898                        if(!found)throw ErrorException(__FUNCT__," could not find vx to compute max_abs_vx");
    9999
     
    108108                        double min_vy=0;
    109109                       
    110                         found=results->FindResult((void*)&vy,"vy");
     110                        found=results->FindResult(&vy,"vy");
    111111                        if(!found)throw ErrorException(__FUNCT__," could not find vy to compute min_vy");
    112112
     
    121121                        double max_vy=0;
    122122                       
    123                         found=results->FindResult((void*)&vy,"vy");
     123                        found=results->FindResult(&vy,"vy");
    124124                        if(!found)throw ErrorException(__FUNCT__," could not find vy to compute max_vy");
    125125
     
    134134                        double max_abs_vy=0;
    135135                       
    136                         found=results->FindResult((void*)&vy,"vy");
     136                        found=results->FindResult(&vy,"vy");
    137137                        if(!found)throw ErrorException(__FUNCT__," could not find vy to compute max_abs_vy");
    138138
     
    147147                        double min_vz=0;
    148148                       
    149                         found=results->FindResult((void*)&vz,"vz");
     149                        found=results->FindResult(&vz,"vz");
    150150                        if(!found)throw ErrorException(__FUNCT__," could not find vz to compute min_vz");
    151151
     
    160160                        double max_vz=0;
    161161                       
    162                         found=results->FindResult((void*)&vz,"vz");
     162                        found=results->FindResult(&vz,"vz");
    163163                        if(!found)throw ErrorException(__FUNCT__," could not find vz to compute max_vz");
    164164
     
    173173                        double max_abs_vz=0;
    174174                       
    175                         found=results->FindResult((void*)&vz,"vz");
     175                        found=results->FindResult(&vz,"vz");
    176176                        if(!found)throw ErrorException(__FUNCT__," could not find vz to compute max_abs_vz");
    177177
  • issm/trunk/src/c/parallel/ProcessResults.cpp

    r2316 r2333  
    126126                                /*ok, 2 dofs, on number of nodes: */
    127127                                if(ismacayealpattyn){
    128                                         fem_dh->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     128                                        fem_dh->parameters->FindParam(&numberofnodes,"numberofnodes");
    129129                                        VecToMPISerial(&partition,fem_dh->partition->vector);
    130                                         fem_dh->parameters->FindParam((void*)&yts,"yts");
     130                                        fem_dh->parameters->FindParam(&yts,"yts");
    131131                                }
    132132                                else{
    133                                         fem_dhu->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     133                                        fem_dhu->parameters->FindParam(&numberofnodes,"numberofnodes");
    134134                                        VecToMPISerial(&partition,fem_dhu->partition->vector);
    135                                         fem_dhu->parameters->FindParam((void*)&yts,"yts");
     135                                        fem_dhu->parameters->FindParam(&yts,"yts");
    136136                                }
    137137                                vx=(double*)xmalloc(numberofnodes*sizeof(double));
     
    152152                                        /*ok, 3 dofs, on number of nodes: */
    153153                                        if(ismacayealpattyn){
    154                                                 fem_dh->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     154                                                fem_dh->parameters->FindParam(&numberofnodes,"numberofnodes");
    155155                                                VecToMPISerial(&partition,fem_dh->partition->vector);
    156                                                 fem_dh->parameters->FindParam((void*)&yts,"yts");
     156                                                fem_dh->parameters->FindParam(&yts,"yts");
    157157                                        }
    158158                                        else{
    159                                                 fem_dhu->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     159                                                fem_dhu->parameters->FindParam(&numberofnodes,"numberofnodes");
    160160                                                VecToMPISerial(&partition,fem_dhu->partition->vector);
    161                                                 fem_dhu->parameters->FindParam((void*)&yts,"yts");
     161                                                fem_dhu->parameters->FindParam(&yts,"yts");
    162162                                        }
    163163                                        vx=(double*)xmalloc(numberofnodes*sizeof(double));
     
    175175                                else{
    176176                                        /* 4 dofs on number of nodes. discard pressure: */
    177                                         fem_ds->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     177                                        fem_ds->parameters->FindParam(&numberofnodes,"numberofnodes");
    178178                                        VecToMPISerial(&partition,fem_ds->partition->vector);
    179                                         fem_ds->parameters->FindParam((void*)&yts,"yts");
     179                                        fem_ds->parameters->FindParam(&yts,"yts");
    180180                                        vx=(double*)xmalloc(numberofnodes*sizeof(double));
    181181                                        vy=(double*)xmalloc(numberofnodes*sizeof(double));
     
    220220                        if(!isstokes){
    221221                                if(ismacayealpattyn){
    222                                         fem_dh->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     222                                        fem_dh->parameters->FindParam(&numberofnodes,"numberofnodes");
    223223                                        VecToMPISerial(&partition,fem_dh->partition->vector);
    224224                                }
    225225                                else{
    226                                         fem_dhu->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     226                                        fem_dhu->parameters->FindParam(&numberofnodes,"numberofnodes");
    227227                                        VecToMPISerial(&partition,fem_dhu->partition->vector);
    228228                                }
    229229                        }
    230230                        else{
    231                                 fem_ds->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     231                                fem_ds->parameters->FindParam(&numberofnodes,"numberofnodes");
    232232                                VecToMPISerial(&partition,fem_ds->partition->vector);
    233233                        }
     
    253253                        result->GetField(&t_g);
    254254                        VecToMPISerial(&t_g_serial,t_g);
    255                         fem_t->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     255                        fem_t->parameters->FindParam(&numberofnodes,"numberofnodes");
    256256                        VecToMPISerial(&partition,fem_t->partition->vector);
    257257
     
    276276                        result->GetField(&m_g);
    277277                        VecToMPISerial(&m_g_serial,m_g);
    278                         fem_t->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
    279                         fem_t->parameters->FindParam((void*)&yts,"yts");
     278                        fem_t->parameters->FindParam(&numberofnodes,"numberofnodes");
     279                        fem_t->parameters->FindParam(&yts,"yts");
    280280                        VecToMPISerial(&partition,fem_t->partition->vector);
    281281
     
    300300                        result->GetField(&h_g);
    301301                        VecToMPISerial(&h_g_serial,h_g);
    302                         fem_p->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     302                        fem_p->parameters->FindParam(&numberofnodes,"numberofnodes");
    303303                        VecToMPISerial(&partition,fem_p->partition->vector);
    304304
     
    323323                        result->GetField(&s_g);
    324324                        VecToMPISerial(&s_g_serial,s_g);
    325                         fem_p->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     325                        fem_p->parameters->FindParam(&numberofnodes,"numberofnodes");
    326326                        VecToMPISerial(&partition,fem_p->partition->vector);
    327327
     
    346346                        result->GetField(&b_g);
    347347                        VecToMPISerial(&b_g_serial,b_g);
    348                         fem_p->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     348                        fem_p->parameters->FindParam(&numberofnodes,"numberofnodes");
    349349                        VecToMPISerial(&partition,fem_p->partition->vector);
    350350
     
    368368                        /*easy, param_g is of size numberofnodes, on 1 dof, just repartition: */
    369369                        result->GetField(&param_g);
    370                         fem_dh->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     370                        fem_dh->parameters->FindParam(&numberofnodes,"numberofnodes");
    371371                        VecToMPISerial(&partition,fem_dh->partition->vector);
    372372
     
    388388                else if(strcmp(result->GetFieldName(),"riftproperties")==0){
    389389                        result->GetField(&riftproperties);
    390                         fem_dh->parameters->FindParam((void*)&numrifts,"numrifts");
     390                        fem_dh->parameters->FindParam(&numrifts,"numrifts");
    391391                        VecToMPISerial(&riftproperties_serial,riftproperties);
    392392                       
  • issm/trunk/src/c/parallel/control_core.cpp

    r2330 r2333  
    6363        model->FindParam(&nsteps,"nsteps");
    6464        model->FindParam(&control_type,"control_type");
    65         model->FindParam(&fit,"fit");
    66         model->FindParam(&optscal,"optscal");
    67         model->FindParam(&maxiter,"maxiter");
    68         model->FindParam(&cm_jump,"cm_jump");
     65        model->FindParam(&fit,NULL,NULL,"fit");
     66        model->FindParam(&optscal,NULL,NULL,"optscal");
     67        model->FindParam(&maxiter,NULL,NULL,"maxiter");
     68        model->FindParam(&cm_jump,NULL,NULL,"cm_jump");
    6969        model->FindParam(&eps_cm,"eps_cm");
    7070        model->FindParam(&tolx,"tolx");
    7171        model->FindParam(&mincontrolconstraint,"mincontrolconstraint");
    7272        model->FindParam(&maxcontrolconstraint,"maxcontrolconstraint");
    73         model->FindParam(&param_g,"param_g");
     73        model->FindParam(&param_g,NULL,NULL,"param_g");
    7474        model->FindParam(&analysis_type,"analysis_type");
    7575        model->FindParam(&sub_analysis_type,"sub_analysis_type");
     
    106106       
    107107                /*Update parameters: */
    108                 UpdateFromInputsx(fem_model->elements,fem_model->nodes,fem_model->loads, fem_model->materials,inputs);
     108                UpdateFromInputsx(fem_model->elements,fem_model->nodes,fem_model->loads, fem_model->materials,fem_model->parameters,inputs);
    109109
    110110                _printf_("%s\n","      computing gradJ...");
  • issm/trunk/src/c/parallel/convergence.cpp

    r2330 r2333  
    3434
    3535        /*get convergence options*/
    36         parameters->FindParam((void*)&eps_res,"eps_res");
    37         parameters->FindParam((void*)&eps_rel,"eps_rel");
    38         parameters->FindParam((void*)&eps_abs,"eps_abs");
    39         parameters->FindParam((void*)&yts,"yts");
    40         parameters->FindParam((void*)&verbose,"verbose");
     36        parameters->FindParam(&eps_res,"eps_res");
     37        parameters->FindParam(&eps_rel,"eps_rel");
     38        parameters->FindParam(&eps_abs,"eps_abs");
     39        parameters->FindParam(&yts,"yts");
     40        parameters->FindParam(&verbose,"verbose");
    4141
    4242        /*Display solver caracteristics*/
  • issm/trunk/src/c/parallel/diagnostic.cpp

    r2268 r2333  
    9191
    9292        _printf_("initialize inputs:\n");
    93         model->FindParam(&u_g_initial,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
     93        model->FindParam(&u_g_initial,NULL,NULL,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
    9494        model->FindParam(&numberofnodes,"numberofnodes");
    9595        if(control_analysis){
    96                 model->FindParam(&u_g_obs,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
     96                model->FindParam(&u_g_obs,NULL,NULL,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
    9797        }
    9898
     
    102102                model->FindParam(&cm_noisedampening,"cm_noisedampening");
    103103                inputs->Add("cm_noisedampening",cm_noisedampening);
    104                 model->FindParam(&u_g_obs,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
     104                model->FindParam(&u_g_obs,NULL,NULL,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
    105105                inputs->Add("velocity_obs",u_g_obs,2,numberofnodes);
    106106        }
  • issm/trunk/src/c/parallel/diagnostic_core.cpp

    r2330 r2333  
    8080
    8181        //specific parameters for specific models
    82         fem_dh->FindParam((void*)&numberofdofspernode_dh,"numberofdofspernode");
    83         fem_sl->FindParam((void*)&numberofdofspernode_sl,"numberofdofspernode");
    84         fem_ds->FindParam((void*)&numberofdofspernode_ds,"numberofdofspernode");
     82        fem_dh->FindParam(&numberofdofspernode_dh,"numberofdofspernode");
     83        fem_sl->FindParam(&numberofdofspernode_sl,"numberofdofspernode");
     84        fem_ds->FindParam(&numberofdofspernode_ds,"numberofdofspernode");
    8585
    8686        //for qmu analysis, be sure the velocity input we are starting from  is the one in the parameters: */
    8787        if(qmu_analysis){
    88                 model->FindParam(&u_g_initial,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
     88                model->FindParam(&u_g_initial,NULL,NULL,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
    8989                inputs->Add("velocity",u_g_initial,3,numberofnodes);
    9090        }
     
    9999               
    100100                        if(verbose)_printf_("%s\n","extruding slopes in 3d...");
    101                         FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,"slopex",0);
    102                         FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,"slopex",0);
     101                        FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopex",0);
     102                        FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopex",0);
    103103                }
    104104
     
    112112
    113113                if(verbose)_printf_("%s\n"," computing pressure according to MacAyeal...");
    114                 ComputePressurex( &pg,fem_dhu->elements,fem_dhu->nodes,fem_dhu->loads,fem_dhu->materials, numberofnodes);
     114                ComputePressurex( &pg,fem_dhu->elements,fem_dhu->nodes,fem_dhu->loads,fem_dhu->materials, fem_dhu->parameters);
    115115
    116116                if(verbose)_printf_("%s\n"," update boundary conditions for macyeal pattyn using hutter results...");
     
    130130                if(dim==2){
    131131                        if(verbose)_printf_("%s\n"," computing pressure according to MacAyeal...");
    132                         ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads,  fem_dh->materials, numberofnodes);
     132                        ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads,  fem_dh->materials, fem_dh->parameters);
    133133                }
    134134
     
    139139
    140140                if(verbose)_printf_("%s\n"," extruding horizontal velocities...");
    141                 VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->loads,fem_dh->materials,"velocity",1);
     141                VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->loads,fem_dh->materials,fem_dh->parameters,"velocity",1);
    142142
    143143                if(verbose)_printf_("%s\n"," computing vertical velocities...");
     
    153153
    154154                if(verbose)_printf_("%s\n"," computing pressure according to Pattyn...");
    155                 ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads,  fem_dh->materials, numberofnodes);
     155                ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads,  fem_dh->materials,fem_dh->parameters);
    156156               
    157157                if (isstokes){
     
    163163                        diagnostic_core_linear(&slopex,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum());
    164164                        diagnostic_core_linear(&slopey,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum());
    165                         FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,"slopex",0);
    166                         FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,"slopey",0);
     165                        FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopex",0);
     166                        FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopey",0);
    167167
    168168                        inputs->Add("bedslopex",slopex,numberofdofspernode_sl,numberofnodes);
  • issm/trunk/src/c/parallel/diagnostic_core_linear.cpp

    r2330 r2333  
    3131        /*Recover parameters: */
    3232        kflag=1; pflag=1;
    33         fem->parameters->FindParam((void*)&connectivity,"connectivity");
    34         fem->parameters->FindParam((void*)&numberofdofspernode,"numberofdofspernode");
    35         fem->parameters->FindParam((void*)&verbose,"verbose");
    36         fem->parameters->FindParam((void*)&solver_string,"solverstring");
     33        fem->parameters->FindParam(&connectivity,"connectivity");
     34        fem->parameters->FindParam(&numberofdofspernode,"numberofdofspernode");
     35        fem->parameters->FindParam(&verbose,"verbose");
     36        fem->parameters->FindParam(&solver_string,"solverstring");
    3737
    3838        /*Update parameters: */
    39         UpdateFromInputsx(fem->elements,fem->nodes,fem->loads, fem->materials,inputs);
     39        UpdateFromInputsx(fem->elements,fem->nodes,fem->loads, fem->materials,fem->parameters,inputs);
    4040               
    4141        //*Generate system matrices
    4242        if (verbose) _printf_("   Generating matrices\n");
    43         SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->loads,fem->materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
     43        SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
    4444
    4545        if (verbose) _printf_("   Generating penalty matrices\n");
    4646        //*Generate penalty system matrices
    47         PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,fem->loads,fem->materials,kflag,pflag,inputs,analysis_type,sub_analysis_type);
     47        PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type);
    4848
    4949        /*!Reduce matrix from g to f size:*/
  • issm/trunk/src/c/parallel/diagnostic_core_nonlinear.cpp

    r2330 r2333  
    4242        /*Recover parameters: */
    4343        kflag=1; pflag=1;
    44         fem->FindParam((void*)&connectivity,"connectivity");
    45         fem->FindParam((void*)&numberofdofspernode,"numberofdofspernode");
    46         fem->FindParam((void*)&numberofnodes,"numberofnodes");
    47         fem->FindParam((void*)&solver_string,"solverstring");
     44        fem->FindParam(&connectivity,"connectivity");
     45        fem->FindParam(&numberofdofspernode,"numberofdofspernode");
     46        fem->FindParam(&numberofnodes,"numberofnodes");
     47        fem->FindParam(&solver_string,"solverstring");
    4848        fem->FindParam(&verbose,"verbose");
    4949
     
    7979
    8080                /*Update parameters: */
    81                 UpdateFromInputsx(fem->elements,fem->nodes,loads, fem->materials,inputs);
     81                UpdateFromInputsx(fem->elements,fem->nodes,loads, fem->materials,fem->parameters,inputs);
    8282
    8383                if (verbose) _printf_("   Generating matrices\n");
    8484                //*Generate system matrices
    85                 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,loads,fem->materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
     85                SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
    8686
    8787                if (verbose) _printf_("   Generating penalty matrices\n");
    8888                //*Generate penalty system matrices
    89                 PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,loads,fem->materials,kflag,pflag,inputs,analysis_type,sub_analysis_type);
     89                PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type);
    9090
    9191                if (verbose) _printf_("   reducing matrix from g to f set\n");
     
    116116                if (old_ug) inputs->Add("old_velocity",old_ug,numberofdofspernode,numberofnodes);
    117117                inputs->Add("velocity",ug,numberofdofspernode,numberofnodes);
    118                 PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,loads,fem->materials,inputs,analysis_type,sub_analysis_type);
     118                PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,loads,fem->materials,fem->parameters,inputs,analysis_type,sub_analysis_type);
    119119
    120120                if(verbose)_printf_("   number of unstable constraints: %i\n",num_unstable_constraints);
     
    149149                kflag=1; pflag=0; //stiffness generation only
    150150       
    151                 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,loads,fem->materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
     151                SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
    152152                Reducematrixfromgtofx(&Kff,&Kfs,Kgg,fem->Gmn,fem->nodesets);
    153153                MatFree(&Kgg);VecFree(&pg);
  • issm/trunk/src/c/parallel/gradjcompute_core.cpp

    r2330 r2333  
    5353        /*some parameters:*/
    5454        femmodel=model->GetActiveFormulation();
    55         femmodel->parameters->FindParam((void*)&analysis_type,"analysis_type");
    56         femmodel->parameters->FindParam((void*)&sub_analysis_type,"sub_analysis_type");
    57         femmodel->parameters->FindParam((void*)&control_steady,"control_steady");
    58         femmodel->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
    59         femmodel->parameters->FindParam((void*)&numberofdofspernode,"numberofdofspernode");
    60         femmodel->parameters->FindParam((void*)&solverstring,"solverstring");
    61         femmodel->parameters->FindParam((void*)&control_type,"control_type");
    62         femmodel->parameters->FindParam((void*)&extrude_param,"extrude_param");
    63         femmodel->parameters->FindParam((void*)&verbose,"verbose");
    64         femmodel->parameters->FindParam((void*)&dim,"dim");
     55        femmodel->parameters->FindParam(&analysis_type,"analysis_type");
     56        femmodel->parameters->FindParam(&sub_analysis_type,"sub_analysis_type");
     57        femmodel->parameters->FindParam(&control_steady,"control_steady");
     58        femmodel->parameters->FindParam(&numberofnodes,"numberofnodes");
     59        femmodel->parameters->FindParam(&numberofdofspernode,"numberofdofspernode");
     60        femmodel->parameters->FindParam(&solverstring,"solverstring");
     61        femmodel->parameters->FindParam(&control_type,"control_type");
     62        femmodel->parameters->FindParam(&extrude_param,"extrude_param");
     63        femmodel->parameters->FindParam(&verbose,"verbose");
     64        femmodel->parameters->FindParam(&dim,"dim");
    6565
    6666        _printf_("%s\n","      recover solution for this stiffness and right hand side:");
     
    7070
    7171        _printf_("%s\n","      buid Du, difference between observed velocity and model velocity:");
    72         Dux( &du_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,inputs,analysis_type,sub_analysis_type);
     72        Dux( &du_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,femmodel->parameters,inputs,analysis_type,sub_analysis_type);
    7373
    7474        _printf_("%s\n","      reduce adjoint load from g-set to f-set:");
     
    8888        inputs->Add("adjoint",lambda_g_double,numberofdofspernode,numberofnodes);
    8989
    90         Gradjx( &grad_g, numberofnodes,femmodel->elements,femmodel->nodes, femmodel->loads, femmodel->materials,
     90        Gradjx( &grad_g, numberofnodes,femmodel->elements,femmodel->nodes, femmodel->loads, femmodel->materials,femmodel->parameters,
    9191                                inputs,analysis_type,sub_analysis_type,control_type);
    9292
     
    9494
    9595                _printf_("%s\n","      extruding gradient...");
    96                 FieldExtrudex( grad_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,"gradj",0);
     96                FieldExtrudex( grad_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,femmodel->parameters,"gradj",0);
    9797        }
    9898
  • issm/trunk/src/c/parallel/objectivefunctionC.cpp

    r2217 r2333  
    6565
    6666        gsize=femmodel->nodesets->GetGSize();
    67         femmodel->parameters->FindParam((void*)&optscal,"optscal");
    68         femmodel->parameters->FindParam((void*)&mincontrolconstraint,"mincontrolconstraint");
    69         femmodel->parameters->FindParam((void*)&maxcontrolconstraint,"maxcontrolconstraint");
    70         femmodel->parameters->FindParam((void*)&control_type,"control_type");
    71         femmodel->parameters->FindParam((void*)&fit,"fit");
    72         femmodel->parameters->FindParam((void*)&analysis_type,"analysis_type");
    73         femmodel->parameters->FindParam((void*)&sub_analysis_type,"sub_analysis_type");
    74         femmodel->parameters->FindParam((void*)&control_steady,"control_steady");
    75         femmodel->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
    76         femmodel->parameters->FindParam((void*)&numberofdofspernode,"numberofdofspernode");
    77         femmodel->parameters->FindParam((void*)&isstokes,"isstokes");
     67        femmodel->parameters->FindParam(&optscal,NULL,NULL,"optscal");
     68        femmodel->parameters->FindParam(&fit,NULL,NULL,"fit");
     69        femmodel->parameters->FindParam(&mincontrolconstraint,"mincontrolconstraint");
     70        femmodel->parameters->FindParam(&maxcontrolconstraint,"maxcontrolconstraint");
     71        femmodel->parameters->FindParam(&control_type,"control_type");
     72        femmodel->parameters->FindParam(&analysis_type,"analysis_type");
     73        femmodel->parameters->FindParam(&sub_analysis_type,"sub_analysis_type");
     74        femmodel->parameters->FindParam(&control_steady,"control_steady");
     75        femmodel->parameters->FindParam(&numberofnodes,"numberofnodes");
     76        femmodel->parameters->FindParam(&numberofdofspernode,"numberofdofspernode");
     77        femmodel->parameters->FindParam(&isstokes,"isstokes");
    7878
    7979        /*First copy param_g so we don't modify it: */
     
    9797        /*Compute misfit for this velocity field.*/
    9898        inputs->Add("fit",fit[n]);
    99         Misfitx( &J, femmodel->elements,femmodel->nodes, femmodel->loads, femmodel->materials,
    100                                 inputs,analysis_type,sub_analysis_type);
     99        Misfitx( &J, femmodel->elements,femmodel->nodes, femmodel->loads, femmodel->materials, femmodel->parameters,inputs,analysis_type,sub_analysis_type);
    101100
    102101        /*Free ressources:*/
  • issm/trunk/src/c/parallel/prognostic.cpp

    r2112 r2333  
    8181        _printf_("initialize inputs:\n");
    8282       
    83         model->FindParam(&u_g_serial,"u_g",PrognosticAnalysisEnum());
    84         model->FindParam(&h_g_initial,"h_g",PrognosticAnalysisEnum());
    85         model->FindParam(&melting_g,"m_g",PrognosticAnalysisEnum());
    86         model->FindParam(&accumulation_g,"a_g",PrognosticAnalysisEnum());
     83        model->FindParam(&u_g_serial,NULL,NULL,"u_g",PrognosticAnalysisEnum());
     84        model->FindParam(&h_g_initial,NULL,NULL,"h_g",PrognosticAnalysisEnum());
     85        model->FindParam(&melting_g,NULL,NULL,"m_g",PrognosticAnalysisEnum());
     86        model->FindParam(&accumulation_g,NULL,NULL,"a_g",PrognosticAnalysisEnum());
    8787        model->FindParam(&dt,"dt");
    8888        model->FindParam(&yts,"yts");
  • issm/trunk/src/c/parallel/prognostic_core.cpp

    r2330 r2333  
    4646        _printf_("depth averaging velocity...\n");
    4747        u_g=inputs->Get("velocity",&dofs[0],2); //take (vx,vy) from inputs velocity
    48         FieldDepthAveragex( u_g, fem_p->elements,fem_p->nodes, fem_p->loads, fem_p->materials,"velocity");
     48        FieldDepthAveragex( u_g, fem_p->elements,fem_p->nodes, fem_p->loads, fem_p->materials,fem_p->parameters,"velocity");
    4949        inputs->Add("velocity_average",u_g,2,numberofnodes);
    5050       
     
    5353
    5454        _printf_("extrude computed thickness on all layers:\n");
    55         FieldExtrudex( h_g, fem_p->elements,fem_p->nodes, fem_p->loads, fem_p->materials,"thickness",0);
     55        FieldExtrudex( h_g, fem_p->elements,fem_p->nodes, fem_p->loads, fem_p->materials,fem_p->parameters,"thickness",0);
    5656
    5757        /*Plug results into output dataset: */
  • issm/trunk/src/c/parallel/steadystate.cpp

    r2268 r2333  
    9999
    100100        _printf_("initialize inputs:\n");
    101         model->FindParam(&u_g_initial,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
    102         model->FindParam(&p_g_initial,"p_g",ThermalAnalysisEnum());
     101        model->FindParam(&u_g_initial,NULL,NULL,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
     102        model->FindParam(&p_g_initial,NULL,NULL,"p_g",ThermalAnalysisEnum());
    103103        model->FindParam(&dt,"dt");
    104104        model->FindParam(&numberofnodes,"numberofnodes");
     
    112112                model->FindParam(&cm_noisedampening,"cm_noisedampening");
    113113                inputs->Add("cm_noisedampening",cm_noisedampening);
    114                 model->FindParam(&u_g_obs,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
     114                model->FindParam(&u_g_obs,NULL,NULL,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
    115115                inputs->Add("velocity_obs",u_g_obs,2,numberofnodes);
    116116        }
     
    139139                        fem_ds=model->GetFormulation(DiagnosticAnalysisEnum(),StokesAnalysisEnum());
    140140                        param=(Param*)fem_dh->parameters->FindParamObject("control_steady");
    141                         param->SetInteger(1);
     141                        param->SetDouble(1);
    142142                        param=(Param*)fem_ds->parameters->FindParamObject("control_steady");
    143                         param->SetInteger(1);
     143                        param->SetDouble(1);
    144144                        /*run control analysis: */
    145145                        _printf_("call computational core:\n");
  • issm/trunk/src/c/parallel/steadystate_core.cpp

    r2330 r2333  
    9595                //compute depth averaged temperature and add to inputs
    9696                VecDuplicatePatch(&t_g_average,t_g);
    97                 FieldDepthAveragex( t_g_average, fem_t->elements,fem_t->nodes, fem_t->loads, fem_t->materials,"temperature");
     97                FieldDepthAveragex( t_g_average, fem_t->elements,fem_t->nodes, fem_t->loads, fem_t->materials,fem_t->parameters,"temperature");
    9898                inputs->Add("temperature_average",t_g_average,1,numberofnodes);
    9999                inputs->Add("temperature",t_g,1,numberofnodes);
  • issm/trunk/src/c/parallel/thermal.cpp

    r2112 r2333  
    7878       
    7979        _printf_("initialize inputs:\n");
    80         model->FindParam(&u_g,"u_g",ThermalAnalysisEnum());
    81         model->FindParam(&p_g,"p_g",ThermalAnalysisEnum());
     80        model->FindParam(&u_g,NULL,NULL,"u_g",ThermalAnalysisEnum());
     81        model->FindParam(&p_g,NULL,NULL,"p_g",ThermalAnalysisEnum());
    8282        model->FindParam(&numberofnodes,"numberofnodes");
    8383        model->FindParam(&dt,"dt");
  • issm/trunk/src/c/parallel/thermal_core.cpp

    r2330 r2333  
    5252
    5353        //first recover parameters common to all solutions
    54         fem_t->FindParam((void*)&numberofnodes,"numberofnodes");
    55         fem_t->FindParam((void*)&sub_analysis_type,"sub_analysis_type");
    56         fem_t->FindParam((void*)&verbose,"verbose");
    57         fem_t->FindParam((void*)&ndt,"ndt");
    58         fem_t->FindParam((void*)&dt,"dt");
     54        fem_t->FindParam(&numberofnodes,"numberofnodes");
     55        fem_t->FindParam(&sub_analysis_type,"sub_analysis_type");
     56        fem_t->FindParam(&verbose,"verbose");
     57        fem_t->FindParam(&ndt,"ndt");
     58        fem_t->FindParam(&dt,"dt");
    5959
    6060        if(dt==0){
     
    8686
    8787                //initialize temperature and melting
    88                 fem_t->FindParam((void*)&t_g_serial,"t_g");
     88                fem_t->FindParam(&t_g_serial,NULL,NULL,"t_g");
    8989                t_g[0]=SerialToVec(t_g_serial,numberofnodes);
    9090                xfree((void**)&t_g_serial);
    91                 fem_m->FindParam((void*)&m_g_serial,"m_g");
     91                fem_m->FindParam(&m_g_serial,NULL,NULL,"m_g");
    9292                m_g[0]=SerialToVec(m_g_serial,numberofnodes);
    9393                xfree((void**)&m_g_serial);
  • issm/trunk/src/c/parallel/thermal_core_nonlinear.cpp

    r2330 r2333  
    4444        kflag=1; pflag=1;
    4545
    46         fem->parameters->FindParam((void*)&connectivity,"connectivity");
    47         fem->parameters->FindParam((void*)&numberofdofspernode,"numberofdofspernode");
    48         fem->parameters->FindParam((void*)&numberofnodes,"numberofnodes");
    49         fem->parameters->FindParam((void*)&solver_string,"solverstring");
    50         fem->parameters->FindParam((void*)&verbose,"verbose");
    51         fem->parameters->FindParam((void*)&lowmem,"lowmem");
    52         fem->parameters->FindParam((void*)&min_thermal_constraints,"min_thermal_constraints");
     46        fem->parameters->FindParam(&connectivity,"connectivity");
     47        fem->parameters->FindParam(&numberofdofspernode,"numberofdofspernode");
     48        fem->parameters->FindParam(&numberofnodes,"numberofnodes");
     49        fem->parameters->FindParam(&solver_string,"solverstring");
     50        fem->parameters->FindParam(&verbose,"verbose");
     51        fem->parameters->FindParam(&lowmem,"lowmem");
     52        fem->parameters->FindParam(&min_thermal_constraints,"min_thermal_constraints");
    5353
    5454        count=1;
     
    6363
    6464                /*Update parameters: */
    65                 UpdateFromInputsx(fem->elements,fem->nodes,fem->loads, fem->materials,inputs);
     65                UpdateFromInputsx(fem->elements,fem->nodes,fem->loads, fem->materials,fem->parameters,inputs);
    6666
    6767                //*Generate system matrices
     
    7070                        /*Compute Kgg_nopenalty and pg_nopenalty once for all: */
    7171                        if (count==1){
    72                                 SystemMatricesx(&Kgg_nopenalty, &pg_nopenalty,fem->elements,fem->nodes,fem->loads,fem->materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
     72                                SystemMatricesx(&Kgg_nopenalty, &pg_nopenalty,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
    7373                        }
    7474
     
    7878
    7979                        //apply penalties each time
    80                         PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->loads,fem->materials,kflag,pflag,inputs,analysis_type,sub_analysis_type);
     80                        PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type);
    8181                }
    8282                else{
    83                         SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->loads,fem->materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
     83                        SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
    8484                        //apply penalties
    85                         PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->loads,fem->materials,kflag,pflag,inputs,analysis_type,sub_analysis_type);
     85                        PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type);
    8686                }
    8787
     
    117117                inputs->Add("temperature",tg,numberofdofspernode,numberofnodes);
    118118               
    119                 PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->loads,fem->materials,inputs,analysis_type,sub_analysis_type);
     119                PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,inputs,analysis_type,sub_analysis_type);
    120120
    121121                if (!converged){
  • issm/trunk/src/c/parallel/transient.cpp

    r2113 r2333  
    102102
    103103        _printf_("initialize inputs:\n");
    104         model->FindParam(&u_g,"u_g",PrognosticAnalysisEnum());
    105         model->FindParam(&m_g,"m_g",PrognosticAnalysisEnum());
    106         model->FindParam(&a_g,"a_g",PrognosticAnalysisEnum());
     104        model->FindParam(&u_g,NULL,NULL,"u_g",PrognosticAnalysisEnum());
     105        model->FindParam(&m_g,NULL,NULL,"m_g",PrognosticAnalysisEnum());
     106        model->FindParam(&a_g,NULL,NULL,"a_g",PrognosticAnalysisEnum());
    107107        model->FindParam(&numberofnodes,"numberofnodes");
    108108        model->FindParam(&dt,"dt");
  • issm/trunk/src/c/parallel/transient_core_2d.cpp

    r2330 r2333  
    8484        time=0;
    8585       
    86         fem_p->parameters->FindParam((void*)&u_g_serial3d,"u_g");
     86        fem_p->parameters->FindParam(&u_g_serial3d,NULL,NULL,"u_g");
    8787        u_g_serial=(double*)xmalloc(2*numberofnodes*sizeof(double));
    8888        for(i=0;i<numberofnodes;i++){
     
    9292        u_g=SerialToVec(u_g_serial,2*numberofnodes); xfree((void**)&u_g_serial);
    9393
    94         fem_p->parameters->FindParam((void*)&h_g_serial,"h_g");
     94        fem_p->parameters->FindParam(&h_g_serial,NULL,NULL,"h_g");
    9595        h_g=SerialToVec(h_g_serial,1*numberofnodes); xfree((void**)&h_g_serial);
    9696
    97         fem_p->parameters->FindParam((void*)&s_g_serial,"s_g");
     97        fem_p->parameters->FindParam(&s_g_serial,NULL,NULL,"s_g");
    9898        s_g=SerialToVec(s_g_serial,1*numberofnodes); xfree((void**)&s_g_serial);
    9999
    100         fem_p->parameters->FindParam((void*)&b_g_serial,"b_g");
     100        fem_p->parameters->FindParam(&b_g_serial,NULL,NULL,"b_g");
    101101        b_g=SerialToVec(b_g_serial,1*numberofnodes); xfree((void**)&b_g_serial);
    102102
     
    143143                //update surface and bed using the new thickness
    144144                _printf_("   updating geometry\n");
    145                 UpdateGeometryx(&new_h_g,&new_b_g,&new_s_g,
    146                                 fem_p->elements, fem_p->nodes,fem_p->loads, fem_p->materials,
    147                                 h_g_intermediary,b_g,s_g);
     145                UpdateGeometryx(&new_h_g,&new_b_g,&new_s_g, fem_p->elements, fem_p->nodes,fem_p->loads, fem_p->materials, fem_p->parameters,h_g_intermediary,b_g,s_g);
    148146
    149147                VecFree(&h_g);h_g=new_h_g;
  • issm/trunk/src/c/parallel/transient_core_3d.cpp

    r2330 r2333  
    9090        time=0;
    9191       
    92         fem_p->parameters->FindParam((void*)&u_g_serial,"u_g");
     92        fem_p->parameters->FindParam(&u_g_serial,NULL,NULL,"u_g");
    9393        u_g=SerialToVec(u_g_serial,3*numberofnodes); xfree((void**)&u_g_serial);
    9494
    95         fem_p->parameters->FindParam((void*)&p_g_serial,"p_g");
     95        fem_p->parameters->FindParam(&p_g_serial,NULL,NULL,"p_g");
    9696        p_g=SerialToVec(p_g_serial,1*numberofnodes); xfree((void**)&p_g_serial);
    9797
    98         fem_p->parameters->FindParam((void*)&h_g_serial,"h_g");
     98        fem_p->parameters->FindParam(&h_g_serial,NULL,NULL,"h_g");
    9999        h_g=SerialToVec(h_g_serial,1*numberofnodes); xfree((void**)&h_g_serial);
    100100
    101         fem_p->parameters->FindParam((void*)&s_g_serial,"s_g");
     101        fem_p->parameters->FindParam(&s_g_serial,NULL,NULL,"s_g");
    102102        s_g=SerialToVec(s_g_serial,1*numberofnodes); xfree((void**)&s_g_serial);
    103103
    104         fem_p->parameters->FindParam((void*)&b_g_serial,"b_g");
     104        fem_p->parameters->FindParam(&b_g_serial,NULL,NULL,"b_g");
    105105        b_g=SerialToVec(b_g_serial,1*numberofnodes); xfree((void**)&b_g_serial);
    106106
    107         fem_p->parameters->FindParam((void*)&t_g_serial,"t_g");
     107        fem_p->parameters->FindParam(&t_g_serial,NULL,NULL,"t_g");
    108108        t_g=SerialToVec(t_g_serial,1*numberofnodes); xfree((void**)&t_g_serial);
    109109
    110         fem_p->parameters->FindParam((void*)&m_g_serial,"m_g");
     110        fem_p->parameters->FindParam(&m_g_serial,NULL,NULL,"m_g");
    111111        m_g=SerialToVec(m_g_serial,1*numberofnodes); xfree((void**)&m_g_serial);
    112112
     
    146146                if(verbose)_printf_("%s\n","computing depth average temperature");
    147147                VecDuplicatePatch(&t_g_average,t_g);
    148                 FieldDepthAveragex( t_g_average, fem_t->elements,fem_t->nodes, fem_t->loads, fem_t->materials,"temperature");
     148                FieldDepthAveragex( t_g_average, fem_t->elements,fem_t->nodes, fem_t->loads, fem_t->materials,fem_t->parameters,"temperature");
    149149                inputs->Add("temperature_average",t_g_average,1,numberofnodes);
    150150                VecFree(&t_g_average); //not needed anymore
     
    171171                //update surface and bed using the new thickness
    172172                if(verbose)_printf_("   updating geometry\n");
    173                 UpdateGeometryx(&h_g,&b_g,&s_g,
    174                                 fem_p->elements, fem_p->nodes,fem_p->loads, fem_p->materials,
    175                                 h_g_intermediary,b_g,s_g);
     173                UpdateGeometryx(&h_g,&b_g,&s_g, fem_p->elements, fem_p->nodes,fem_p->loads, fem_p->materials, fem_p->parameters,h_g_intermediary,b_g,s_g);
    176174                VecFree(&h_g_intermediary);
    177175               
    178176                if(verbose)_printf_("%s\n","updating node positions");
    179                 UpdateNodePositionsx( fem_dh->elements,fem_dh->nodes,fem_dh->loads,fem_dh->materials,h_g,b_g);
    180                 UpdateNodePositionsx( fem_dv->elements,fem_dv->nodes,fem_dv->loads,fem_dv->materials,h_g,b_g);
    181                 UpdateNodePositionsx( fem_dhu->elements,fem_dhu->nodes,fem_dhu->loads,fem_dhu->materials,h_g,b_g);
    182                 UpdateNodePositionsx( fem_ds->elements,fem_ds->nodes,fem_ds->loads,fem_ds->materials,h_g,b_g);
    183                 UpdateNodePositionsx( fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,h_g,b_g);
    184                 UpdateNodePositionsx( fem_p->elements,fem_p->nodes,fem_p->loads,fem_p->materials,h_g,b_g);
    185                 UpdateNodePositionsx( fem_t->elements,fem_t->nodes,fem_t->loads,fem_t->materials,h_g,b_g);
    186                 UpdateNodePositionsx( fem_m->elements,fem_m->nodes,fem_m->loads,fem_m->materials,h_g,b_g);
     177                UpdateNodePositionsx( fem_dh->elements,fem_dh->nodes,fem_dh->loads,fem_dh->materials,fem_dh->parameters,h_g,b_g);
     178                UpdateNodePositionsx( fem_dv->elements,fem_dv->nodes,fem_dv->loads,fem_dv->materials,fem_dv->parameters,h_g,b_g);
     179                UpdateNodePositionsx( fem_dhu->elements,fem_dhu->nodes,fem_dhu->loads,fem_dhu->materials,fem_dhu->parameters,h_g,b_g);
     180                UpdateNodePositionsx( fem_ds->elements,fem_ds->nodes,fem_ds->loads,fem_ds->materials,fem_ds->parameters,h_g,b_g);
     181                UpdateNodePositionsx( fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,h_g,b_g);
     182                UpdateNodePositionsx( fem_p->elements,fem_p->nodes,fem_p->loads,fem_p->materials,fem_p->parameters,h_g,b_g);
     183                UpdateNodePositionsx( fem_t->elements,fem_t->nodes,fem_t->loads,fem_t->materials,fem_t->parameters,h_g,b_g);
     184                UpdateNodePositionsx( fem_m->elements,fem_m->nodes,fem_m->loads,fem_m->materials,fem_m->parameters,h_g,b_g);
    187185
    188186                //plug into results.
  • issm/trunk/src/m/classes/public/plot/applyoptions.m

    r2307 r2333  
    7373%Basinzoom
    7474if ~isnan(options_structure.basinzoom),                                                                                                                         
    75         basinzoom(options_structure.basinzoom);                                                                                                                           
    76 end
     75        basinzoom(options_structure.basinzoom,options_structure.unitmultiplier);                                                                                                                          end
    7776
    7877%Caxis
  • issm/trunk/src/m/solutions/cielo/ControlInitialization.m

    r2330 r2333  
    2727slopex=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum());
    2828slopey=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum());
    29 slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,slopex,'slopex',0);
    30 slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,slopey,'slopey',0);
     29slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopex,'slopex',0);
     30slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopey,'slopey',0);
    3131
    3232%Add to inputs
     
    4040u_g=diagnostic_core_nonlinear(m_dh,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum());
    4141displaystring(verbose,'\n%s',['extruding horizontal velocities...']);
    42 u_g_horiz=FieldExtrude(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,u_g,'velocity',1);
     42u_g_horiz=FieldExtrude(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,m_dh.parameters,u_g,'velocity',1);
    4343
    4444%vertical velocities
  • issm/trunk/src/m/solutions/cielo/CreateFemModel.m

    r2330 r2333  
    99       
    1010        displaystring(md.verbose,'\n   reading data from model %s...',md.name);
    11         [m.elements,m.nodes,m.constraints,m.loads,m.materials,parameters]=ModelProcessor(md);
     11        [m.elements,m.nodes,m.constraints,m.loads,m.materials,m.parameters]=ModelProcessor(md);
    1212
    1313        displaystring(md.verbose,'%s','   generating degrees of freedom...');
    14         [m.nodes,m.part,m.tpart]=Dof(m.elements,m.nodes,parameters);
     14        [m.nodes,m.part,m.tpart]=Dof(m.elements,m.nodes,m.parameters);
    1515
    1616        displaystring(md.verbose,'%s','   generating single point constraints...');
     
    3030
    3131        displaystring(md.verbose,'%s','   configuring element and loads...');
    32         [m.elements,m.loads,m.nodes] = ConfigureObjects( m.elements, m.loads, m.nodes, m.materials);
     32        [m.elements,m.loads,m.nodes,m.parameters] = ConfigureObjects( m.elements, m.loads, m.nodes, m.materials,m.parameters);
    3333
    3434        displaystring(md.verbose,'%s','   processing parameters...');
    35         parameters= ProcessParams(parameters,m.part.vector);
    36 
    37         displaystring(md.verbose,'%s','   creating parameters in matlab workspace...');
    38         m.parameters= ParamsToWorkspace(parameters);
    39 
    40         %Get rid of parameters dataset.
    41         clear parameters;
     35        m.parameters= ProcessParams(m.parameters,m.part.vector);
    4236
    4337end
  • issm/trunk/src/m/solutions/cielo/control_core.m

    r2330 r2333  
    4545
    4646        %Update inputs in datasets
    47         [model.elements,model.nodes,model.loads,model.materials]=UpdateFromInputs(model.elements,model.nodes,model.loads,model.materials,inputs);
     47        [model.elements,model.nodes,model.loads,model.materials,model.parameters]=UpdateFromInputs(model.elements,model.nodes,model.loads,model.materials,model.parameters,inputs);
    4848
    4949        displaystring(verbose,'\n%s',['      computing gradJ...']);
  • issm/trunk/src/m/solutions/cielo/diagnostic.m

    r2330 r2333  
    55%      md=diagnostic(md)
    66%
    7 
    87        %timing
    98        t1=clock;
     
    1110        %Build all models requested for diagnostic simulation
    1211        models.analysis_type=DiagnosticAnalysisEnum; %needed for processresults
    13        
     12
    1413        displaystring(md.verbose,'%s',['reading diagnostic horiz model data']);
    1514        md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=HorizAnalysisEnum; models.dh=CreateFemModel(md);
    16        
     15
    1716        displaystring(md.verbose,'\n%s',['reading diagnostic vert model data']);
    1817        md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=VertAnalysisEnum; models.dv=CreateFemModel(md);
  • issm/trunk/src/m/solutions/cielo/diagnostic_core.m

    r2330 r2333  
    2121numrifts=m_dhu.parameters.numrifts;
    2222
     23debug=1;
     24
    2325if ishutter,
    2426
     
    2931        if dim==3,
    3032                displaystring(verbose,'\n%s',['extruding slopes in 3d...']);
    31                 slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,slopex,'slopex',0);
    32                 slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,slopey,'slopey',0);
     33                slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopex,'slopex',0);
     34                slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopey,'slopey',0);
    3335        end
    3436
     
    6365
    6466        displaystring(verbose,'\n%s',['extruding horizontal velocities...']);
    65         u_g_horiz=FieldExtrude(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,u_g,'velocity',1);
     67        u_g_horiz=FieldExtrude(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,m_dh.parameters,u_g,'velocity',1);
    6668
    6769        displaystring(verbose,'\n%s',['computing vertical velocities...']);
     
    8587                slopex=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum());
    8688                slopey=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum());
    87                 slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,slopex,'slopex',0);
    88                 slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,slopey,'slopey',0);
     89                slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopex,'slopex',0);
     90                slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopey,'slopey',0);
    8991
    9092                inputs=add(inputs,'bedslopex',slopex,'doublevec',m_sl.parameters.numberofdofspernode,m_sl.parameters.numberofnodes);
  • issm/trunk/src/m/solutions/cielo/diagnostic_core_linear.m

    r2330 r2333  
    99
    1010        %Update inputs in datasets
    11         [m.elements,m.nodes, m.loads,m.materials]=UpdateFromInputs(m.elements,m.nodes, m.loads,m.materials,inputs);
     11        [m.elements,m.nodes, m.loads,m.materials,m.parameters]=UpdateFromInputs(m.elements,m.nodes, m.loads,m.materials,m.parameters,inputs);
    1212       
    1313        %system matrices
  • issm/trunk/src/m/solutions/cielo/diagnostic_core_nonlinear.m

    r2330 r2333  
    2626                        inputs=add(inputs,'old_velocity',soln(count).u_g,'doublevec',m.parameters.numberofdofspernode,m.parameters.numberofnodes);
    2727                end
    28 
     28               
    2929                %Update inputs in datasets
    30                 [m.elements,m.nodes, loads,m.materials]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,inputs);
     30                [m.elements,m.nodes, loads,m.materials,m.parameters]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,m.parameters,inputs);
    3131               
    3232                %system matrices
    3333                [K_gg_nopenalty , p_g_nopenalty]=SystemMatrices(m.elements,m.nodes,loads,m.materials,m.parameters,inputs,analysis_type,sub_analysis_type);
    34                
     34       
    3535                %penalties
    3636                [K_gg , p_g, kmax]=PenaltySystemMatrices(K_gg_nopenalty,p_g_nopenalty,m.elements,m.nodes,loads,m.materials,m.parameters,inputs,analysis_type,sub_analysis_type);
     
    4141                %Reduce load from g size to f size
    4242                [p_f] = Reduceloadfromgtof( p_g, m.Gmn, K_fs, m.ys, m.nodesets);
    43 
     43               
    4444                %Increment index
    4545                count=count+1;
    46 
     46               
    4747                %Solve 
    4848                [soln(count).u_f]=Solver(K_ff,p_f,[],m.parameters);
    49 
     49               
    5050                %Merge back to g set
    5151                [soln(count).u_g]= Mergesolutionfromftog( soln(count).u_f, m.Gmn, m.ys, m.nodesets );
    52 
     52               
    5353                %Deal with penalty loads
    5454                inputs=add(inputs,'velocity',soln(count).u_g,'doublevec',m.parameters.numberofdofspernode,m.parameters.numberofnodes);
    55        
     55               
    5656                %penalty constraints
    5757                [loads,constraints_converged,num_unstable_constraints] =PenaltyConstraints( m.elements,m.nodes, loads, m.materials,m.parameters,inputs,analysis_type,sub_analysis_type);
    58        
     58               
    5959                displaystring(m.parameters.verbose,'%s%i','      number of unstable constraints: ',num_unstable_constraints);
    60 
     60               
    6161                %Figure out if convergence have been reached
    6262                converged=convergence(K_ff,p_f,soln(count).u_f,soln(count-1).u_f,m.parameters);
  • issm/trunk/src/m/solutions/cielo/gradjcompute_core.m

    r2330 r2333  
    3939if (dim==3 & extrude_param),
    4040        displaystring(verbose,'%s','          extruding gradient...');
    41         grad_g=FieldExtrude(m.elements,m.nodes,m.loads,m.materials,grad_g,'gradj',0);
     41        grad_g=FieldExtrude(m.elements,m.nodes,m.loads,m.materials,m.parameters,grad_g,'gradj',0);
    4242end
    4343
  • issm/trunk/src/m/solutions/cielo/prognostic_core.m

    r2330 r2333  
    1313        %Take only the first two dofs of m.parameters.u_g
    1414        u_g=get(inputs,'velocity',[1 1 0 0]);
    15         u_g=FieldDepthAverage(m.elements,m.nodes,m.loads,m.materials,u_g,'velocity');
     15        u_g=FieldDepthAverage(m.elements,m.nodes,m.loads,m.materials,m.parameters,u_g,'velocity');
    1616        inputs=add(inputs,'velocity_average',u_g,'doublevec',2,m.parameters.numberofnodes);
    1717
     
    2020
    2121        displaystring(m.parameters.verbose,'\n%s',['extrude computed thickness on all layers:']);
    22         results.h_g=FieldExtrude(m.elements,m.nodes,m.loads,m.materials,results.h_g,'thickness',0);
     22        results.h_g=FieldExtrude(m.elements,m.nodes,m.loads,m.materials,m.parameters,results.h_g,'thickness',0);
    2323
    2424end %end function
  • issm/trunk/src/m/solutions/cielo/steadystate_core.m

    r2330 r2333  
    4646        %add temperature to inputs.
    4747        %Compute depth averaged temperature
    48         temperature_average=FieldDepthAverage(m_t.elements,m_t.nodes,m_t.loads,m_t.materials,results_thermal.t_g,'temperature');
     48        temperature_average=FieldDepthAverage(m_t.elements,m_t.nodes,m_t.loads,m_t.materials,m_t.parameters,results_thermal.t_g,'temperature');
    4949        inputs=add(inputs,'temperature_average',temperature_average,'doublevec',1,m_t.parameters.numberofnodes);
    5050        inputs=add(inputs,'temperature',results_thermal.t_g,'doublevec',1,m_t.parameters.numberofnodes);
  • issm/trunk/src/m/solutions/cielo/thermal_core_nonlinear.m

    r2330 r2333  
    2323
    2424                %Update inputs in datasets
    25                 [m.elements,m.nodes, loads,m.materials]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,inputs);
     25                [m.elements,m.nodes, loads,m.materials,m.parameters]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,m.parameters,inputs);
    2626
    2727                %system matrices
     
    5757                inputs=add(inputs,'temperature',t_g,'doublevec',m.parameters.numberofdofspernode,m.parameters.numberofnodes);
    5858                displaystring(m.parameters.verbose,'%s',['   update inputs']);
    59                 [m.elements,m.nodes, loads,m.materials]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,inputs);
     59                [m.elements,m.nodes, loads,m.materials,m.parameters]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,m.parameters,inputs);
    6060       
    6161                %penalty constraints
  • issm/trunk/src/m/solutions/cielo/transient3d.m

    r2330 r2333  
    9393
    9494        %Compute depth averaged temperature
    95         temperature_average=FieldDepthAverage(models.t.elements,models.t.nodes,models.t.loads,models.t.materials,results(n+1).t_g,'temperature');
     95        temperature_average=FieldDepthAverage(models.t.elements,models.t.nodes,models.t.loads,models.t.materials,models.t.parameters,results(n+1).t_g,'temperature');
    9696        inputs=add(inputs,'temperature_average',temperature_average,'doublevec',1,models.t.parameters.numberofnodes);
    9797
  • issm/trunk/src/m/utils/Nightly/nightlyrun.m

    r2189 r2333  
    33%
    44%   This function goes to each directory of 'tests/Verifications' and
    5 %   launch the nightly tests. A list of option can be given in input:
     5%   launches the nightly tests. A list of option can be given in input:
    66%     o analysis_type: cell containing all the analysis that the user wants to run
    77%     o sub_analysis_type: cell containing all the sub_analysis that the user wants to run
  • issm/trunk/src/m/utils/Plot/basinzoom.m

    r2308 r2333  
    1 function varargout=basinzoom(region)
     1function varargout=basinzoom(region,unitmultiplier)
    22%ANTZOOM - zoom on a basin in Antarctica or Greenland.
    33%
     
    4545                                %do nothing;
    4646                        end
     47                end
     48
     49                if ~isnan(unitmultiplier)
     50                        x0=x0*unitmultiplier;
     51                        x1=x1*unitmultiplier;
     52                        y0=y0*unitmultiplier;
     53                        y1=y1*unitmultiplier;
    4754                end
    4855
     
    112119        regions=AddAvailableRegion(regions,'icestreams',-1.2274*10^6,-.137*10^6,-1.1172*10^6,-.138*10^6);
    113120        regions=AddAvailableRegion(regions,'icestreamE',2.2*10^6,2.7*10^6,0,5*10^5);
     121        regions=AddAvailableRegion(regions,'jakobshavn',-4.6*10^5,-3*10^5,-2.4*10^6,-2.1*10^6);
    114122        regions=AddAvailableRegion(regions,'larseniceshelf',-2.3855*10^6,-1.9649*10^6,0.9498*10^6,1.2996*10^6);
    115123        regions=AddAvailableRegion(regions,'mcmurdo',1.3750*10^5,4.8255*10^5,-1.4569*10^6,-1.1119*10^6);
  • issm/trunk/src/mex/BuildNodeSets/BuildNodeSets.cpp

    r1 r2333  
    2424
    2525        /*Input datasets: */
    26         FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
     26        FetchData(&nodes,NODES);
    2727       
    2828        /*!Generate internal degree of freedom numbers: */
  • issm/trunk/src/mex/ComputePressure/ComputePressure.cpp

    r2316 r2333  
    1515        DataSet* loads=NULL;
    1616        DataSet* materials=NULL;
     17        DataSet* parameters=NULL;
    1718        ParameterInputs* inputs=NULL;
    1819        int      numberofnodes;
     
    2829       
    2930        /*Input datasets: */
    30         FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
    31         FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
    32         FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
    33         FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
    34         FetchData((void**)&numberofnodes,NULL,NULL,mxGetField(PARAMS,0,"numberofnodes"),"Integer",NULL);
     31        FetchData(&elements,ELEMENTS);
     32        FetchData(&nodes,NODES);
     33        FetchData(&loads,LOADS);
     34        FetchData(&materials,MATERIALS);
     35        FetchParams(&parameters,PARAMETERS);
    3536
    3637        /*!Generate internal degree of freedom numbers: */
     
    3940        inputs->Init(INPUTS);
    4041
    41         UpdateFromInputsx(elements,nodes,loads, materials,inputs);
     42        UpdateFromInputsx(elements,nodes,loads, materials,parameters,inputs);
    4243
    4344        /*!Generate internal degree of freedom numbers: */
    44         ComputePressurex(&p_g, elements,nodes,loads,materials,numberofnodes);
     45        ComputePressurex(&p_g, elements,nodes,loads,materials,parameters);
    4546
    4647        /*write output datasets: */
     
    5253        delete materials;
    5354        delete loads;
     55        delete parameters;
    5456        delete inputs;
    5557        VecFree(&p_g);
  • issm/trunk/src/mex/ComputePressure/ComputePressure.h

    r1042 r2333  
    2121#define LOADS (mxArray*)prhs[2]
    2222#define MATERIALS (mxArray*)prhs[3]
    23 #define PARAMS (mxArray*)prhs[4]
     23#define PARAMETERS (mxArray*)prhs[4]
    2424#define INPUTS (mxArray*)prhs[5]
    2525
  • issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.cpp

    r2316 r2333  
    1515        DataSet* nodes=NULL;
    1616        DataSet* materials=NULL;
     17        DataSet* parameters=NULL;
    1718
    1819        /* output datasets: elements and loads*/
     
    2526       
    2627        /*Input datasets: */
    27         FetchData((void**)&elements,NULL,NULL,ELEMENTSIN,"DataSet",NULL);
    28         FetchData((void**)&loads,NULL,NULL,LOADSIN,"DataSet",NULL);
    29         FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
    30         FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
     28        FetchData(&elements,ELEMENTSIN);
     29        FetchData(&loads,LOADSIN);
     30        FetchData(&nodes,NODES);
     31        FetchData(&materials,MATERIALS);
     32        FetchData(&parameters,PARAMETERS);
    3133
    3234        /*!Configure objects:*/
    33         ConfigureObjectsx(elements, loads, nodes, materials);
     35        ConfigureObjectsx(elements, loads, nodes, materials,parameters);
    3436
    3537        /*write output datasets: */
     
    3739        WriteData(LOADS,loads);
    3840        WriteData(NODESOUT,nodes);
     41        WriteData(PARAMETERSOUT,parameters);
    3942
    4043        /*Free ressources: */
     
    4346        delete nodes;
    4447        delete materials;
     48        delete parameters;
    4549
    4650        /*end module: */
     
    5155{
    5256        _printf_("\n");
    53         _printf_("   usage: [elements,loads, nodes] = %s(elements,loads,nodes, materials);\n",__FUNCT__);
     57        _printf_("   usage: [elements,loads, nodes,parameters] = %s(elements,loads,nodes, materials,parameters);\n",__FUNCT__);
    5458        _printf_("\n");
    5559}
  • issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.h

    r103 r2333  
    2121#define NODES (mxArray*)prhs[2]
    2222#define MATERIALS (mxArray*)prhs[3]
     23#define PARAMETERS (mxArray*)prhs[4]
    2324
    2425/* serial output macros: */
     
    2627#define LOADS (mxArray**)&plhs[1]
    2728#define NODESOUT (mxArray**)&plhs[2]
     29#define PARAMETERSOUT (mxArray**)&plhs[3]
    2830
    2931/* serial arg counts: */
    3032#undef NLHS
    31 #define NLHS  3
     33#define NLHS  4
    3234#undef NRHS
    33 #define NRHS  4
     35#define NRHS  5
    3436
    3537
  • issm/trunk/src/mex/ContourToMesh/ContourToMesh.cpp

    r2316 r2333  
    5959
    6060        /*Fetch inputs: */
    61         FetchData((void**)&index,&nel,NULL,INDEXHANDLE,"Matrix","Mat");
    62         FetchData((void**)&x,&nods,NULL,XHANDLE,"Matrix","Mat");
    63         FetchData((void**)&y,NULL,NULL,YHANDLE,"Matrix","Mat");
    64         FetchData((void**)&edgevalue,NULL,NULL,EDGEVALUEHANDLE,"Integer",NULL);
     61        FetchData(&index,&nel,NULL,INDEXHANDLE);
     62        FetchData(&x,&nods,NULL,XHANDLE);
     63        FetchData(&y,NULL,NULL,YHANDLE);
     64        FetchData(&edgevalue,EDGEVALUEHANDLE);
    6565
    6666        /*Recover list of contours from the 'contours' structure: */
     
    9494
    9595        /*Recover  interptype: */
    96         FetchData((void**)&interptype,NULL,NULL,INTERPTYPEHANDLE,"String",NULL);
     96        FetchData(&interptype,INTERPTYPEHANDLE);
    9797
    9898        /*Run interpolation routine: */
  • issm/trunk/src/mex/ContourToNodes/ContourToNodes.cpp

    r2316 r2333  
    5353
    5454        /*Fetch inputs: */
    55         FetchData((void**)&x,&nods,NULL,XHANDLE,"Matrix","Mat");
    56         FetchData((void**)&y,NULL,NULL,YHANDLE,"Matrix","Mat");
    57         FetchData((void**)&edgevalue,NULL,NULL,EDGEVALUEHANDLE,"Integer",NULL);
     55        FetchData(&x,&nods,NULL,XHANDLE);
     56        FetchData(&y,NULL,NULL,YHANDLE);
     57        FetchData(&edgevalue,EDGEVALUEHANDLE);
    5858
    5959        /*Recover list of contours from the 'contours' structure: */
  • issm/trunk/src/mex/ControlConstrain/ControlConstrain.cpp

    r2316 r2333  
    1616        char*    control_type=NULL;
    1717        int      gsize;
     18        DataSet* parameters=NULL;
    1819
    1920        /*Boot module: */
     
    2425
    2526        /*Input datasets: */
    26         FetchData((void**)&p_g,&gsize,NULL,PG,"Vector","Vec");
    27         FetchData((void**)&mincontrolconstraint,NULL,NULL,mxGetField(PARAMETERS,0,"mincontrolconstraint"),"Scalar",NULL);
    28         FetchData((void**)&maxcontrolconstraint,NULL,NULL,mxGetField(PARAMETERS,0,"maxcontrolconstraint"),"Scalar",NULL);
    29         FetchData((void**)&control_type,NULL,NULL,mxGetField(PARAMETERS,0,"control_type"),"String",NULL);
     27        FetchData(&p_g,&gsize,PG);
     28        FetchParams(&parameters,PARAMETERS);
     29
     30        parameters->FindParam(&mincontrolconstraint,"mincontrolconstraint");
     31        parameters->FindParam(&maxcontrolconstraint,"maxcontrolconstraint");
     32        parameters->FindParam(&control_type,"control_type");
    3033
    3134        /*!Call core code: */
     
    3740        /*Free ressources: */
    3841        xfree((void**)&control_type);
     42        delete parameters;
    3943
    4044        /*end module: */
  • issm/trunk/src/mex/ControlOptimization/ControlOptimization.cpp

    r2316 r2333  
    3838
    3939        /*Input datasets: */
    40         FetchData((void**)&function_name,NULL,NULL,FUNCTIONNAME,"String",NULL);
    41         FetchData((void**)&xmin,NULL,NULL,XMIN,"Scalar",NULL);
    42         FetchData((void**)&xmax,NULL,NULL,XMAX,"Scalar",NULL);
    43         FetchData((void**)&tolerance,NULL,NULL,mxGetField(OPTIONS,0,"TolX"),"Scalar",NULL);
    44         FetchData((void**)&maxiter,NULL,NULL,mxGetField(OPTIONS,0,"MaxIter"),"Integer",NULL);
     40        FetchData(&function_name,FUNCTIONNAME);
     41        FetchData(&xmin,XMIN);
     42        FetchData(&xmax,XMAX);
     43        FetchData(&tolerance,mxGetField(OPTIONS,0,"TolX"));
     44        FetchData(&maxiter,mxGetField(OPTIONS,0,"MaxIter"));
    4545
    4646        /*Parameters: */
    47         FetchData((void**)&cm_jump,NULL,NULL,mxGetField(PARAMETERS,0,"cm_jump"),"Matrix","Mat");
    48         FetchData((void**)&n_value,NULL,NULL,STEP,"Integer",NULL);
     47        FetchData(&cm_jump,NULL,NULL,mxGetField(PARAMETERS,0,"cm_jump"));
     48        FetchData(&n_value,STEP);
    4949
    5050        optargs.function_name=function_name;
  • issm/trunk/src/mex/Dof/Dof.cpp

    r2316 r2333  
    2626
    2727        /*Input datasets: */
    28         FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
    29         FetchData((void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL);
    30         FetchData((void**)&params,NULL,NULL,PARAMS,"DataSet",NULL);
     28        FetchData(&elements,ELEMENTS);
     29        FetchData(&nodes,NODESIN);
     30        FetchData(&params,PARAMS);
    3131
    3232        /*!Generate internal degree of freedom numbers: */
  • issm/trunk/src/mex/Du/Du.cpp

    r2316 r2333  
    1515        DataSet* loads=NULL;
    1616        DataSet* materials=NULL;
     17        DataSet* parameters=NULL;
    1718        ParameterInputs* inputs=NULL;
    1819        int               analysis_type;
     
    3031
    3132        /*Input datasets: */
    32         FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
    33         FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
    34         FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
    35         FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
    36         FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);
    37         FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);
     33        FetchData(&elements,ELEMENTS);
     34        FetchData(&nodes,NODES);
     35        FetchData(&loads,LOADS);
     36        FetchData(&materials,MATERIALS);
     37        FetchParams(&parameters,PARAMETERS);
     38        FetchData(&analysis_type,ANALYSIS);
     39        FetchData(&sub_analysis_type,SUBANALYSIS);
    3840
    3941        /*Fetch inputs: */
     
    4244
    4345        /*!Call core code: */
    44         Dux(&du_g, elements,nodes,loads,materials,inputs,analysis_type,sub_analysis_type);
     46        Dux(&du_g, elements,nodes,loads,materials,parameters,inputs,analysis_type,sub_analysis_type);
    4547
    4648        /*write output : */
  • issm/trunk/src/mex/Echo/Echo.cpp

    r1 r2333  
    2020
    2121        /*Input datasets: */
    22         FetchData((void**)&dataset,NULL,NULL,DATASET,"DataSet",NULL);
     22        FetchData(&dataset,DATASET);
    2323
    2424        /*Echo dataset: */
  • issm/trunk/src/mex/ElementConnectivity/ElementConnectivity.cpp

    r2316 r2333  
    2323       
    2424        /*Input datasets: */
    25         FetchData((void**)&elements,&nel,NULL,ELEMENTS,"Matrix","Mat");
    26         FetchData((void**)&nodeconnectivity,&nods,&width,NODECONNECTIVITY,"Matrix","Mat");
     25        FetchData(&elements,&nel,NULL,ELEMENTS);
     26        FetchData(&nodeconnectivity,&nods,&width,NODECONNECTIVITY);
    2727
    2828        /*!Generate internal degree of freedom numbers: */
  • issm/trunk/src/mex/FieldDepthAverage/FieldDepthAverage.cpp

    r2316 r2333  
    1515        DataSet* loads=NULL;
    1616        DataSet* materials=NULL;
     17        DataSet* parameters=NULL;
    1718        Vec      field=NULL;
    1819        char*    fieldname=NULL;
     
    2526
    2627        /*Input datasets: */
    27         FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
    28         FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
    29         FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
    30         FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
    31         FetchData((void**)&field,NULL,NULL,FIELD,"Vector",NULL);
    32         FetchData((void**)&fieldname,NULL,NULL,FIELDNAME,"String",NULL);
     28        FetchData(&elements,ELEMENTS);
     29        FetchData(&nodes,NODES);
     30        FetchData(&loads,LOADS);
     31        FetchData(&materials,MATERIALS);
     32        FetchParams(&parameters,PARAMETERS);
     33        FetchData(&field,FIELD);
     34        FetchData(&fieldname,FIELDNAME);
    3335
    3436        /*!Call core code: */
    35         FieldDepthAveragex(field,elements,nodes,loads,materials,fieldname);
     37        FieldDepthAveragex(field,elements,nodes,loads,materials,parameters,fieldname);
    3638
    3739        /*write output : */
     
    4345        delete loads;
    4446        delete materials;
     47        delete parameters;
    4548        VecFree(&field);
    4649        xfree((void**)&fieldname);
     
    5457{
    5558        _printf_("\n");
    56         _printf_("   usage: [field] = %s(elements, nodes,loads, materials, field,fieldname);\n",__FUNCT__);
     59        _printf_("   usage: [field] = %s(elements, nodes,loads, materials, parameters,field,fieldname);\n",__FUNCT__);
    5760        _printf_("\n");
    5861}
  • issm/trunk/src/mex/FieldDepthAverage/FieldDepthAverage.h

    r847 r2333  
    2121#define LOADS (mxArray*)prhs[2]
    2222#define MATERIALS (mxArray*)prhs[3]
    23 #define FIELD (mxArray*)prhs[4]
    24 #define FIELDNAME (mxArray*)prhs[5]
     23#define PARAMETERS (mxArray*)prhs[4]
     24#define FIELD (mxArray*)prhs[5]
     25#define FIELDNAME (mxArray*)prhs[6]
    2526
    2627/* serial output macros: */
     
    3132#define NLHS  1
    3233#undef NRHS
    33 #define NRHS  6
     34#define NRHS  7
    3435
    3536
  • issm/trunk/src/mex/FieldExtrude/FieldExtrude.cpp

    r2316 r2333  
    1515        DataSet* loads=NULL;
    1616        DataSet* materials=NULL;
     17        DataSet* parameters=NULL;
    1718        Vec      field=NULL;
    1819        char*    field_name=NULL;
     
    2627
    2728        /*Input datasets: */
    28         FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
    29         FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
    30         FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
    31         FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
    32         FetchData((void**)&field,NULL,NULL,FIELD,"Vector",NULL);
    33         FetchData((void**)&field_name,NULL,NULL,FIELDNAME,"String",NULL);
    34         FetchData((void**)&collapse,NULL,NULL,COLLAPSE,"Integer",NULL);
     29        FetchData(&elements,ELEMENTS);
     30        FetchData(&nodes,NODES);
     31        FetchData(&loads,LOADS);
     32        FetchData(&materials,MATERIALS);
     33        FetchParams(&parameters,PARAMETERS);
     34        FetchData(&field,FIELD);
     35        FetchData(&field_name,FIELDNAME);
     36        FetchData(&collapse,COLLAPSE);
    3537
    3638        /*!Call core code: */
    37         FieldExtrudex(field,elements,nodes,loads,materials,field_name,collapse);
     39        FieldExtrudex(field,elements,nodes,loads,materials,parameters,field_name,collapse);
    3840
    3941        /*write output : */
     
    4547        delete loads;
    4648        delete materials;
     49        delete parameters;
    4750        VecFree(&field);
    4851        xfree((void**)&field_name);
     
    5659{
    5760        _printf_("\n");
    58         _printf_("   usage: [field] = %s(elements, nodes,loads, materials, field, field_name, collapse);\n",__FUNCT__);
     61        _printf_("   usage: [field] = %s(elements, nodes,loads, materials, parameters, field, field_name, collapse);\n",__FUNCT__);
    5962        _printf_("\n");
    6063}
  • issm/trunk/src/mex/FieldExtrude/FieldExtrude.h

    r847 r2333  
    2121#define LOADS (mxArray*)prhs[2]
    2222#define MATERIALS (mxArray*)prhs[3]
    23 #define FIELD (mxArray*)prhs[4]
    24 #define FIELDNAME (mxArray*)prhs[5]
    25 #define COLLAPSE (mxArray*)prhs[6]
     23#define PARAMETERS (mxArray*)prhs[4]
     24#define FIELD (mxArray*)prhs[5]
     25#define FIELDNAME (mxArray*)prhs[6]
     26#define COLLAPSE (mxArray*)prhs[7]
    2627
    2728/* serial output macros: */
     
    3233#define NLHS  1
    3334#undef NRHS
    34 #define NRHS  7
     35#define NRHS  8
    3536
    3637
  • issm/trunk/src/mex/Gradj/Gradj.cpp

    r2316 r2333  
    1515        DataSet* loads=NULL;
    1616        DataSet* materials=NULL;
     17        DataSet* parameters=NULL;
    1718        char*    control_type=NULL;
    1819        ParameterInputs* inputs=NULL;
     
    3233
    3334        /*Input datasets: */
    34         FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
    35         FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
    36         FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
    37         FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
    38         FetchData((void**)&numberofnodes,NULL,NULL,mxGetField(PARAMETERS,0,"numberofnodes"),"Integer",NULL);
    39         FetchData((void**)&control_type,NULL,NULL,mxGetField(PARAMETERS,0,"control_type"),"String",NULL);
    40         FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);
    41         FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);
     35        FetchData(&elements,ELEMENTS);
     36        FetchData(&nodes,NODES);
     37        FetchData(&loads,LOADS);
     38        FetchData(&materials,MATERIALS);
     39        FetchParams(&parameters,PARAMETERS);
     40        parameters->FindParam(&numberofnodes,"numberofnodes");
     41        parameters->FindParam(&control_type,"control_type");
     42        FetchData(&analysis_type,ANALYSIS);
     43        FetchData(&sub_analysis_type,SUBANALYSIS);
    4244
    4345        /*Fetch inputs: */
     
    4648
    4749        /*!Call core code: */
    48         Gradjx(&grad_g,numberofnodes,elements,nodes,loads,materials,inputs,analysis_type,sub_analysis_type,control_type);
     50        Gradjx(&grad_g,numberofnodes,elements,nodes,loads,materials,parameters,inputs,analysis_type,sub_analysis_type,control_type);
    4951
    5052        /*write output : */
     
    5658        delete loads;
    5759        delete materials;
     60        delete parameters;
    5861        xfree((void**)&control_type);
    5962        delete inputs;
  • issm/trunk/src/mex/HoleFiller/HoleFiller.cpp

    r2316 r2333  
    3838
    3939        /*Fetch data: */
    40         FetchData((void**)&imagein,&imagein_rows,&imagein_cols,IMAGEIN,"Matrix","Mat");
    41         FetchData((void**)&smooth_flag,NULL,NULL,SMOOTH,"Integer",NULL);
     40        FetchData(&imagein,&imagein_rows,&imagein_cols,IMAGEIN);
     41        FetchData(&smooth_flag,SMOOTH);
    4242       
    4343        /*Get smooth flag setup: */
  • issm/trunk/src/mex/InterpFromGridToMesh/InterpFromGridToMesh.cpp

    r2316 r2333  
    5353
    5454        /*Input datasets: */
    55         FetchData((void**)&x,&x_rows,NULL,XHANDLE,"Matrix","Mat");
    56         FetchData((void**)&y,&y_rows,NULL,YHANDLE,"Matrix","Mat");
    57         FetchData((void**)&data,&data_rows,&data_cols,DATAHANDLE,"Matrix","Mat");
    58         FetchData((void**)&x_mesh,&x_mesh_rows,NULL,XMESHHANDLE,"Matrix","Mat");
    59         FetchData((void**)&y_mesh,&y_mesh_rows,NULL,YMESHHANDLE,"Matrix","Mat");
    60         FetchData((void**)&default_value,NULL,NULL,DEFAULTHANDLE,"Scalar",NULL);
     55        FetchData(&x,&x_rows,NULL,XHANDLE);
     56        FetchData(&y,&y_rows,NULL,YHANDLE);
     57        FetchData(&data,&data_rows,&data_cols,DATAHANDLE);
     58        FetchData(&x_mesh,&x_mesh_rows,NULL,XMESHHANDLE);
     59        FetchData(&y_mesh,&y_mesh_rows,NULL,YMESHHANDLE);
     60        FetchData(&default_value,DEFAULTHANDLE);
    6161
    6262        /* Run core computations: */
  • issm/trunk/src/mex/InterpFromMeshToGrid/InterpFromMeshToGrid.cpp

    r2316 r2333  
    3535
    3636        /*Input datasets: */
    37         FetchData((void**)&index,&nel,NULL,INDEX,"Matrix","Mat");
    38         FetchData((void**)&x,&nods,NULL,X,"Matrix","Mat");
    39         FetchData((void**)&y,NULL,NULL,Y,"Matrix","Mat");
    40         FetchData((void**)&meshdata,&meshdata_length,NULL,MESHDATA,"Matrix","Mat");
    41         FetchData((void**)&cornereast,NULL,NULL,CORNEREAST,"Scalar",NULL);
    42         FetchData((void**)&cornernorth,NULL,NULL,CORNERNORTH,"Scalar",NULL);
    43         FetchData((void**)&xposting,NULL,NULL,XPOSTING,"Scalar",NULL);
    44         FetchData((void**)&yposting,NULL,NULL,YPOSTING,"Scalar",NULL);
    45         FetchData((void**)&nlines,NULL,NULL,NLINES,"Integer",NULL);
    46         FetchData((void**)&ncols,NULL,NULL,NCOLS,"Integer",NULL);
    47         FetchData((void**)&default_value,NULL,NULL,DEFAULTVALUE,"Scalar",NULL);
     37        FetchData(&index,&nel,NULL,INDEX);
     38        FetchData(&x,&nods,NULL,X);
     39        FetchData(&y,NULL,NULL,Y);
     40        FetchData(&meshdata,&meshdata_length,NULL,MESHDATA);
     41        FetchData(&cornereast,CORNEREAST);
     42        FetchData(&cornernorth,CORNERNORTH);
     43        FetchData(&xposting,XPOSTING);
     44        FetchData(&yposting,YPOSTING);
     45        FetchData(&nlines,NLINES);
     46        FetchData(&ncols,NCOLS);
     47        FetchData(&default_value,DEFAULTVALUE);
    4848
    4949        /*Call core of computation: */
  • issm/trunk/src/mex/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp

    r2316 r2333  
    6060
    6161        /*Input datasets: */
    62         FetchData((void**)&index_data,&index_data_rows,NULL,INDEXHANDLE,"Matrix","Mat");
    63         FetchData((void**)&x_data,&x_data_rows,NULL,XHANDLE,"Matrix","Mat");
    64         FetchData((void**)&y_data,&y_data_rows,NULL,YHANDLE,"Matrix","Mat");
    65         FetchData((void**)&data,&data_rows,&data_cols,DATAHANDLE,"Matrix","Mat");
    66         FetchData((void**)&x_prime,&x_prime_rows,NULL,XPRIMEHANDLE,"Matrix","Mat");
    67         FetchData((void**)&y_prime,&y_prime_rows,NULL,YPRIMEHANDLE,"Matrix","Mat");
    68         FetchData((void**)&default_value,NULL,NULL,DEFAULTHANDLE,"Scalar",NULL);
     62        FetchData(&index_data,&index_data_rows,NULL,INDEXHANDLE);
     63        FetchData(&x_data,&x_data_rows,NULL,XHANDLE);
     64        FetchData(&y_data,&y_data_rows,NULL,YHANDLE);
     65        FetchData(&data,&data_rows,&data_cols,DATAHANDLE);
     66        FetchData(&x_prime,&x_prime_rows,NULL,XPRIMEHANDLE);
     67        FetchData(&y_prime,&y_prime_rows,NULL,YPRIMEHANDLE);
     68        FetchData(&default_value,DEFAULTHANDLE);
    6969
    7070        /*some checks*/
  • issm/trunk/src/mex/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp

    r2316 r2333  
    6464
    6565        /*Input datasets: */
    66         FetchData((void**)&index_data,&index_data_rows,NULL,INDEXHANDLE,"Matrix","Mat");
    67         FetchData((void**)&x_data,&x_data_rows,NULL,XHANDLE,"Matrix","Mat");
    68         FetchData((void**)&y_data,&y_data_rows,NULL,YHANDLE,"Matrix","Mat");
    69         FetchData((void**)&z_data,&z_data_rows,NULL,ZHANDLE,"Matrix","Mat");
    70         FetchData((void**)&data,&data_rows,&data_cols,DATAHANDLE,"Matrix","Mat");
    71         FetchData((void**)&x_prime,&x_prime_rows,NULL,XPRIMEHANDLE,"Matrix","Mat");
    72         FetchData((void**)&y_prime,&y_prime_rows,NULL,YPRIMEHANDLE,"Matrix","Mat");
    73         FetchData((void**)&z_prime,&z_prime_rows,NULL,ZPRIMEHANDLE,"Matrix","Mat");
    74         FetchData((void**)&default_value,NULL,NULL,DEFAULTHANDLE,"Scalar",NULL);
     66        FetchData(&index_data,&index_data_rows,NULL,INDEXHANDLE);
     67        FetchData(&x_data,&x_data_rows,NULL,XHANDLE);
     68        FetchData(&y_data,&y_data_rows,NULL,YHANDLE);
     69        FetchData(&z_data,&z_data_rows,NULL,ZHANDLE);
     70        FetchData(&data,&data_rows,&data_cols,DATAHANDLE);
     71        FetchData(&x_prime,&x_prime_rows,NULL,XPRIMEHANDLE);
     72        FetchData(&y_prime,&y_prime_rows,NULL,YPRIMEHANDLE);
     73        FetchData(&z_prime,&z_prime_rows,NULL,ZPRIMEHANDLE);
     74        FetchData(&default_value,DEFAULTHANDLE);
    7575
    7676        /*some checks*/
  • issm/trunk/src/mex/Makefile.am

    r2300 r2333  
    3232                                Orth\
    3333                                OutputRifts\
    34                                 ParamsToWorkspace\
    3534                                PenaltyConstraints\
    3635                                PenaltySystemMatrices\
     
    165164                          OutputRifts/OutputRifts.h
    166165
    167 ParamsToWorkspace_SOURCES = ParamsToWorkspace/ParamsToWorkspace.cpp\
    168                           ParamsToWorkspace/ParamsToWorkspace.h
    169 
    170166PenaltyConstraints_SOURCES = PenaltyConstraints/PenaltyConstraints.cpp\
    171167                          PenaltyConstraints/PenaltyConstraints.h
  • issm/trunk/src/mex/MassFlux/MassFlux.cpp

    r2316 r2333  
    1515        DataSet* loads=NULL;
    1616        DataSet* materials=NULL;
     17        DataSet* parameters=NULL;
    1718        double*  segments=NULL;
    1819        int      num_segments;
     
    3031
    3132        /*Input datasets: */
    32         FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
    33         FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
    34         FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
    35         FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
    36 
    37         /*parameters: */
    38         FetchData((void**)&segments,&num_segments,NULL,mxGetField(PARAMETERS,0,"qmu_mass_flux_segments"),"Matrix","Mat");
     33        FetchData(&elements,ELEMENTS);
     34        FetchData(&nodes,NODES);
     35        FetchData(&loads,LOADS);
     36        FetchData(&materials,MATERIALS);
     37        FetchParams(&parameters,PARAMETERS);
     38        parameters->FindParam(&segments,&num_segments,NULL,"qmu_mass_flux_segments");
    3939
    4040        /*results: */
    41         FetchData((void**)&ug,NULL,NULL,UG,"Matrix","Mat");
     41        FetchData(&ug,NULL,NULL,UG);
    4242
    4343        /*!Compute mass flux along the profile: */
    44         MassFluxx(&mass_flux, elements,nodes,loads,materials,segments,num_segments,ug);
     44        MassFluxx(&mass_flux, elements,nodes,loads,materials,parameters,segments,num_segments,ug);
    4545
    4646        /*write output datasets: */
     
    5252        delete loads;
    5353        delete materials;
     54        delete parameters;
    5455        xfree((void**)&ug);
    5556
  • issm/trunk/src/mex/Mergesolutionfromftog/Mergesolutionfromftog.cpp

    r2316 r2333  
    2626
    2727        /*Input datasets: */
    28         FetchData((void**)&uf,NULL,NULL,UF,"Vector",NULL);
    29         FetchData((void**)&Gmn,NULL,NULL,GMN,"Matrix",NULL);
    30         FetchData((void**)&ys,NULL,NULL,YS,"Vector",NULL);
     28        FetchData(&uf,UF);
     29        FetchData(&Gmn,GMN);
     30        FetchData(&ys,YS);
    3131        FetchNodeSets(&nodesets,NODESETS);
    3232
  • issm/trunk/src/mex/MeshPartition/MeshPartition.cpp

    r2316 r2333  
    5757
    5858        /*Fetch data: */
    59         FetchData((void**)&meshtype,NULL,NULL,mxGetField(MODEL,0,"type"),"String",NULL);
    60         FetchData((void**)&numberofelements,NULL,NULL,mxGetField(MODEL,0,"numberofelements"),"Integer",NULL);
    61         FetchData((void**)&numberofgrids,NULL,NULL,mxGetField(MODEL,0,"numberofgrids"),"Integer",NULL);
    62         FetchData((void**)&elements,NULL,&elements_width,mxGetField(MODEL,0,"elements"),"Matrix","Mat");
     59        FetchData(&meshtype,mxGetField(MODEL,0,"type"));
     60        FetchData(&numberofelements,mxGetField(MODEL,0,"numberofelements"));
     61        FetchData(&numberofgrids,mxGetField(MODEL,0,"numberofgrids"));
     62        FetchData(&elements,NULL,&elements_width,mxGetField(MODEL,0,"elements"));
    6363
    6464       
     
    6666        if (strcmp(meshtype,"3d")==0){
    6767       
    68                 FetchData((void**)&numberofelements2d,NULL,NULL,mxGetField(MODEL,0,"numberofelements2d"),"Integer",NULL);
    69                 FetchData((void**)&numberofgrids2d,NULL,NULL,mxGetField(MODEL,0,"numberofgrids2d"),"Integer",NULL);
    70                 FetchData((void**)&elements2d,NULL,NULL,mxGetField(MODEL,0,"elements2d"),"Matrix","Mat");
     68                FetchData(&numberofelements2d,mxGetField(MODEL,0,"numberofelements2d"));
     69                FetchData(&numberofgrids2d,mxGetField(MODEL,0,"numberofgrids2d"));
     70                FetchData(&elements2d,NULL,NULL,mxGetField(MODEL,0,"elements2d"));
    7171
    7272        }
    73         FetchData((void**)&numlayers,NULL,NULL,mxGetField(MODEL,0,"numlayers"),"Integer",NULL);
    74         FetchData((void**)&numareas,NULL,NULL,NUMAREAS,"Integer",NULL);
     73        FetchData(&numlayers,mxGetField(MODEL,0,"numlayers"));
     74        FetchData(&numareas,NUMAREAS);
    7575
    7676        /*Run partitioning algorithm based on a "clever" use of the Metis partitioner: */
  • issm/trunk/src/mex/Misfit/Misfit.cpp

    r2316 r2333  
    1515        DataSet* loads=NULL;
    1616        DataSet* materials=NULL;
     17        DataSet* parameters=NULL;
    1718        ParameterInputs* inputs=NULL;
    1819        int               analysis_type;
     
    2930
    3031        /*Input datasets: */
    31         FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
    32         FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
    33         FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
    34         FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
    35         FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);
    36         FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);
     32        FetchData(&elements,ELEMENTS);
     33        FetchData(&nodes,NODES);
     34        FetchData(&loads,LOADS);
     35        FetchData(&materials,MATERIALS);
     36        FetchParams(&parameters,PARAMETERS);
     37        FetchData(&analysis_type,ANALYSIS);
     38        FetchData(&sub_analysis_type,SUBANALYSIS);
    3739
    3840        /*Fetch inputs: */
     
    4143
    4244        /*!Call core code: */
    43         Misfitx(&J, elements,nodes,loads,materials,inputs,analysis_type,sub_analysis_type);
     45        Misfitx(&J, elements,nodes,loads,materials,parameters,inputs,analysis_type,sub_analysis_type);
    4446
    4547        /*write output : */
     
    5153        delete loads;
    5254        delete materials;
     55        delete parameters;
    5356        delete inputs;
    5457
  • issm/trunk/src/mex/MpcNodes/MpcNodes.cpp

    r2316 r2333  
    2525
    2626        /*Input datasets: */
    27         FetchData((void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL);
    28         FetchData((void**)&constraints,NULL,NULL,CONSTRAINTS,"DataSet",NULL);
     27        FetchData(&nodes,NODESIN);
     28        FetchData(&constraints,CONSTRAINTS);
    2929
    3030        /*!Generate internal degree of freedom numbers: */
  • issm/trunk/src/mex/NodeConnectivity/NodeConnectivity.cpp

    r2316 r2333  
    2222       
    2323        /*Input datasets: */
    24         FetchData((void**)&elements,&nel,NULL,ELEMENTS,"Matrix","Mat");
    25         FetchData((void**)&nods,NULL,NULL,NUMNODES,"Integer",NULL);
     24        FetchData(&elements,&nel,NULL,ELEMENTS);
     25        FetchData(&nods,NUMNODES);
    2626
    2727        /*!Generate internal degree of freedom numbers: */
  • issm/trunk/src/mex/NormalizeConstraints/NormalizeConstraints.cpp

    r2316 r2333  
    2525        /*Input datasets: */
    2626        FetchNodeSets(&nodesets,NODESETS);
    27         FetchData((void**)&Rmg,NULL,NULL,RMG,"Matrix",NULL);
     27        FetchData(&Rmg,RMG);
    2828
    2929        /*!Generate internal degree of freedom numbers: */
  • issm/trunk/src/mex/Orth/Orth.cpp

    r2316 r2333  
    2424
    2525        /*Input datasets: */
    26         FetchData((void**)&gradj,NULL,NULL,GRADJ,"Vector",NULL);
    27         FetchData((void**)&oldgradj,NULL,NULL,OLDGRADJ,"Vector",NULL);
     26        FetchData(&gradj,GRADJ);
     27        FetchData(&oldgradj,OLDGRADJ);
    2828
    2929        /*!Reduce load from g to f size: */
  • issm/trunk/src/mex/OutputRifts/OutputRifts.cpp

    r2316 r2333  
    2525
    2626        /*Input datasets: */
    27         FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
    28         FetchData((void**)&numrifts,NULL,NULL,mxGetField(PARAMETERS,0,"numrifts"),"Integer",NULL);
     27        FetchData(&loads,LOADS);
     28        FetchData(&numrifts,mxGetField(PARAMETERS,0,"numrifts"));
    2929
    3030        /*!Call core code: */
  • issm/trunk/src/mex/ParameterOutput/ParameterOutput.cpp

    r2318 r2333  
    3131
    3232        /*Input datasets: */
    33         FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
    34         FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
    35         FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
    36         FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
    37         FetchData((void**)&results,NULL,NULL,RESULTS,"DataSet",NULL);
     33        FetchData(&elements,ELEMENTS);
     34        FetchData(&nodes,NODES);
     35        FetchData(&loads,LOADS);
     36        FetchData(&materials,MATERIALS);
     37        FetchData(&results,RESULTS);
    3838       
    3939        /*parameters: */
    40         FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);
    41         FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);
     40        FetchData(&analysis_type,ANALYSIS);
     41        FetchData(&sub_analysis_type,SUBANALYSIS);
    4242
    4343        /*Fetch inputs: */
  • issm/trunk/src/mex/PenaltyConstraints/PenaltyConstraints.cpp

    r2316 r2333  
    1515        DataSet* loads=NULL;
    1616        DataSet* materials=NULL;
     17        DataSet* parameters=NULL;
    1718        ParameterInputs* inputs=NULL;
    1819        int               analysis_type;
     
    3031
    3132        /*Input datasets: */
    32         FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
    33         FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
    34         FetchData((void**)&loads,NULL,NULL,LOADSIN,"DataSet",NULL);
    35         FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
     33        FetchData(&elements,ELEMENTS);
     34        FetchData(&nodes,NODES);
     35        FetchData(&loads,LOADSIN);
     36        FetchData(&materials,MATERIALS);
     37        FetchParams(&parameters,PARAMETERS);
    3638
    3739        /*parameters: */
    38         FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);
    39         FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);
     40        FetchData(&analysis_type,ANALYSIS);
     41        FetchData(&sub_analysis_type,SUBANALYSIS);
    4042
    4143        /*Fetch inputs: */
     
    4446
    4547        /*!Generate internal degree of freedom numbers: */
    46         PenaltyConstraintsx(&converged, &num_unstable_constraints, elements,nodes,loads,materials,inputs,analysis_type,sub_analysis_type);
     48        PenaltyConstraintsx(&converged, &num_unstable_constraints, elements,nodes,loads,materials,parameters,inputs,analysis_type,sub_analysis_type);
    4749
    4850        /*write output datasets: */
     
    5759        delete loads;
    5860        delete materials;
     61        delete parameters;
    5962        delete inputs;
    6063
  • issm/trunk/src/mex/PenaltySystemMatrices/PenaltySystemMatrices.cpp

    r2316 r2333  
    2020        DataSet* loads=NULL;
    2121        DataSet* materials=NULL;
     22        DataSet* parameters=NULL;
    2223        int         kflag,pflag;
    2324        ParameterInputs* inputs=NULL;
     
    3233
    3334        /*Input datasets: */
    34         FetchData((void**)&Kgg,NULL,NULL,KGGIN,"Matrix",NULL);
    35         FetchData((void**)&pg,NULL,NULL,PGIN,"Vector",NULL);
    36         FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
    37         FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
    38         FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
    39         FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
     35        FetchData(&Kgg,KGGIN);
     36        FetchData(&pg,PGIN);
     37        FetchData(&elements,ELEMENTS);
     38        FetchData(&nodes,NODES);
     39        FetchData(&loads,LOADS);
     40        FetchData(&materials,MATERIALS);
     41        FetchParams(&parameters,PARAMETERS);
     42       
    4043        /*parameters: */
    41         FetchData((void**)&kflag,NULL,NULL,mxGetField(PARAMETERS,0,"kflag"),"Integer",NULL);
    42         FetchData((void**)&pflag,NULL,NULL,mxGetField(PARAMETERS,0,"pflag"),"Integer",NULL);
    43         FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);
    44         FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);
     44        parameters->FindParam(&kflag,"kflag");
     45        parameters->FindParam(&pflag,"pflag");
     46        FetchData(&analysis_type,ANALYSIS);
     47        FetchData(&sub_analysis_type,SUBANALYSIS);
    4548
    4649        /*Fetch inputs: */
     
    4952
    5053        /*!Generate stiffnesses from penalties: */
    51         PenaltySystemMatricesx(Kgg, pg,&kmax,elements,nodes,loads,materials,kflag,pflag,inputs,analysis_type,sub_analysis_type);
     54        PenaltySystemMatricesx(Kgg, pg,&kmax,elements,nodes,loads,materials,parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type);
    5255
    5356        /*write output datasets: */
     
    6164        delete loads;
    6265        delete materials;
     66        delete parameters;
    6367        delete inputs;
    6468        MatFree(&Kgg);
  • issm/trunk/src/mex/ProcessParams/ProcessParams.cpp

    r2316 r2333  
    2121
    2222        /*Input datasets: */
    23         FetchData((void**)&parameters,NULL,NULL,PARAMETERSIN,"DataSet",NULL);
    24         FetchData((void**)&partition,NULL,NULL,PARTITION,"Vector",NULL);
     23        FetchData(&parameters,PARAMETERSIN);
     24        FetchData(&partition,PARTITION);
    2525
    2626        /*Shit partition: */
    2727        if(partition)VecShift(partition,-1.0);
     28
    2829
    2930        /*!Generate internal degree of freedom numbers: */
     
    3132
    3233        /*write output datasets: */
    33         WriteData(PARAMETERSOUT,parameters);
     34        WriteParams(PARAMETERSOUT,parameters);
    3435
    3536        /*Free ressources: */
  • issm/trunk/src/mex/Qmu/Qmu.cpp

    r1028 r2333  
    4141        inputs=INPUTS;
    4242       
    43         FetchData((void**)&analysis_type,NULL,NULL,mxGetField(PARAMETERS,0,"analysis_type"),"Integer",NULL);
    44         FetchData((void**)&sub_analysis_type,NULL,NULL,mxGetField(PARAMETERS,0,"sub_analysis_type"),"Integer",NULL);
    45         FetchData((void**)&dakota_input_file,NULL,NULL,mxGetField(PARAMETERS,0,"qmuinname"),"String",NULL);
    46         FetchData((void**)&dakota_output_file,NULL,NULL,mxGetField(PARAMETERS,0,"qmuoutname"),"String",NULL);
    47         FetchData((void**)&dakota_error_file,NULL,NULL,mxGetField(PARAMETERS,0,"qmuerrname"),"String",NULL);
     43        FetchData(&analysis_type,mxGetField(PARAMETERS,0,"analysis_type"));
     44        FetchData(&sub_analysis_type,mxGetField(PARAMETERS,0,"sub_analysis_type"));
     45        FetchData(&dakota_input_file,mxGetField(PARAMETERS,0,"qmuinname"));
     46        FetchData(&dakota_output_file,mxGetField(PARAMETERS,0,"qmuoutname"));
     47        FetchData(&dakota_error_file,mxGetField(PARAMETERS,0,"qmuerrname"));
    4848
    4949        /*!Generate internal degree of freedom numbers: */
  • issm/trunk/src/mex/Reduceloadfromgtof/Reduceloadfromgtof.cpp

    r2316 r2333  
    2727
    2828        /*Input datasets: */
    29         FetchData((void**)&pg,NULL,NULL,PG,"Vector",NULL);
    30         FetchData((void**)&Gmn,NULL,NULL,GMN,"Matrix",NULL);
    31         FetchData((void**)&Kfs,NULL,NULL,KFS,"Matrix",NULL);
    32         FetchData((void**)&ys,NULL,NULL,YS,"Vector",NULL);
     29        FetchData(&pg,PG);
     30        FetchData(&Gmn,GMN);
     31        FetchData(&Kfs,KFS);
     32        FetchData(&ys,YS);
    3333        FetchNodeSets(&nodesets,NODESETS);
    3434
  • issm/trunk/src/mex/Reducematrixfromgtof/Reducematrixfromgtof.cpp

    r2316 r2333  
    2626
    2727        /*Input datasets: */
    28         FetchData((void**)&Kgg,NULL,NULL,KGG,"Matrix",NULL);
    29         FetchData((void**)&Gmn,NULL,NULL,GMN,"Matrix",NULL);
     28        FetchData(&Kgg,KGG);
     29        FetchData(&Gmn,GMN);
    3030        FetchNodeSets(&nodesets,NODESETS);
    3131
  • issm/trunk/src/mex/Reducevectorgtof/Reducevectorgtof.cpp

    r2316 r2333  
    2424
    2525        /*Input datasets: */
    26         FetchData((void**)&ug,NULL,NULL,UG,"Vector",NULL);
     26        FetchData(&ug,UG);
    2727        FetchNodeSets(&nodesets,NODESETS);
    2828
  • issm/trunk/src/mex/Reducevectorgtos/Reducevectorgtos.cpp

    r2316 r2333  
    2525
    2626        /*Input datasets: */
    27         FetchData((void**)&yg,NULL,NULL,YG,"Vector",NULL);
     27        FetchData(&yg,YG);
    2828        FetchNodeSets(&nodesets,NODESETS);
    2929
  • issm/trunk/src/mex/SetStructureField/SetStructureField.cpp

    r1 r2333  
    5959
    6060        /*Get name in array.name: */
    61         FetchData((void**)&name,NULL,NULL,NAMEHANDLE,"String",NULL);
     61        FetchData(&name,NAMEHANDLE);
    6262
    6363        /*Get field in array.field: */
    64         FetchData((void**)&field,NULL,NULL,FIELDHANDLE,"String",NULL);
     64        FetchData(&field,FIELDHANDLE);
    6565
    6666        /*Branch out on type of value: */
     
    6868
    6969                /*Get string store in the value mxArray: */
    70                 FetchData((void**)&string,NULL,NULL,VALUEHANDLE,"String",NULL);
     70                FetchData(&string,VALUEHANDLE);
    7171
    7272                /*Start looping on output array: */
  • issm/trunk/src/mex/Solver/Solver.cpp

    r2316 r2333  
    1515        Vec uf0=NULL;
    1616        char* solver_string=NULL;
     17        DataSet* parameters=NULL;
    1718
    1819        /* output datasets: */
     
    2627
    2728        /*Input datasets: */
    28         FetchData((void**)&Kff,NULL,NULL,KFF,"Matrix",NULL);
    29         FetchData((void**)&pf,NULL,NULL,PF,"Vector",NULL);
    30         FetchData((void**)&uf0,NULL,NULL,UF0,"Vector",NULL);
    31         FetchData((void**)&solver_string,NULL,NULL,mxGetField(PARAMS,0,"solverstring"),"String",NULL);
     29        FetchData(&Kff,KFF);
     30        FetchData(&pf,PF);
     31        FetchData(&uf0,UF0);
     32        FetchParams(&parameters,PARAMETERS);
     33        parameters->FindParam(&solver_string,"solver_string");
    3234
    3335        /*!Reduce vector: */
     
    4345        VecFree(&uf);
    4446        xfree((void**)&solver_string);
     47        delete parameters;
    4548
    4649        /*end module: */
  • issm/trunk/src/mex/Solver/Solver.h

    r1 r2333  
    2020#define PF (mxArray*)prhs[1]
    2121#define UF0 (mxArray*)prhs[2]
    22 #define PARAMS (mxArray*)prhs[3]
     22#define PARAMETERS (mxArray*)prhs[3]
    2323
    2424/* serial output macros: */
  • issm/trunk/src/mex/SpcNodes/SpcNodes.cpp

    r2316 r2333  
    2525
    2626        /*Input datasets: */
    27         FetchData((void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL);
    28         FetchData((void**)&constraints,NULL,NULL,CONSTRAINTS,"DataSet",NULL);
     27        FetchData(&nodes,NODESIN);
     28        FetchData(&constraints,CONSTRAINTS);
    2929       
    3030        /*!Generate internal degree of freedom numbers: */
  • issm/trunk/src/mex/SystemMatrices/SystemMatrices.cpp

    r2316 r2333  
    1515        DataSet* loads=NULL;
    1616        DataSet* materials=NULL;
     17        DataSet* parameters=NULL;
    1718        int         kflag,pflag;
    1819        int         connectivity;
     
    3334
    3435        /*Input datasets: */
    35         FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
    36         FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
    37         FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
    38         FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
     36        FetchData(&elements,ELEMENTS);
     37        FetchData(&nodes,NODES);
     38        FetchData(&loads,LOADS);
     39        FetchData(&materials,MATERIALS);
     40        FetchParams(&parameters,PARAMETERS);
     41
    3942        /*parameters: */
    40         FetchData((void**)&kflag,NULL,NULL,mxGetField(PARAMETERS,0,"kflag"),"Integer",NULL);
    41         FetchData((void**)&pflag,NULL,NULL,mxGetField(PARAMETERS,0,"pflag"),"Integer",NULL);
    42         FetchData((void**)&connectivity,NULL,NULL,mxGetField(PARAMETERS,0,"connectivity"),"Integer",NULL);
    43         FetchData((void**)&numberofdofspernode,NULL,NULL,mxGetField(PARAMETERS,0,"numberofdofspernode"),"Integer",NULL);
    44         FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);
    45         FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);
     43        parameters->FindParam(&kflag,"kflag");
     44        parameters->FindParam(&pflag,"pflag");
     45        parameters->FindParam(&connectivity,"connectivity");
     46        parameters->FindParam(&numberofdofspernode,"numberofdofspernode");
     47
     48        FetchData(&analysis_type,ANALYSIS);
     49        FetchData(&sub_analysis_type,SUBANALYSIS);
    4650
    4751        /*Fetch inputs: */
     
    5054
    5155        /*!Generate internal degree of freedom numbers: */
    52         SystemMatricesx(&Kgg, &pg,elements,nodes,loads,materials,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
     56        SystemMatricesx(&Kgg, &pg,elements,nodes,loads,materials,parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);
    5357
    5458        /*write output datasets: */
     
    6266        delete loads;
    6367        delete materials;
     68        delete parameters;
    6469        delete inputs;
    6570        MatFree(&Kgg);
  • issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.cpp

    r2316 r2333  
    1515        DataSet* loads=NULL;
    1616        DataSet* materials=NULL;
     17        DataSet* parameters=NULL;
    1718        ParameterInputs* inputs=NULL;
    1819
     
    2223        /*checks on arguments on the matlab side: */
    2324        CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&UpdateFromInputsUsage);
    24 
     25       
    2526        /*Input datasets: */
    26         FetchData((void**)&elements,NULL,NULL,ELEMENTSIN,"DataSet",NULL);
    27         FetchData((void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL);
    28         FetchData((void**)&loads,NULL,NULL,LOADSIN,"DataSet",NULL);
    29         FetchData((void**)&materials,NULL,NULL,MATERIALSIN,"DataSet",NULL);
    30 
     27        FetchData(&elements,ELEMENTSIN);
     28        FetchData(&nodes,NODESIN);
     29        FetchData(&loads,LOADSIN);
     30        FetchData(&materials,MATERIALSIN);
     31        FetchParams(&parameters,PARAMETERSIN);
     32       
    3133        /*Fetch inputs: */
    3234        inputs=new ParameterInputs;
    3335        inputs->Init(INPUTS);
    34 
     36       
    3537        /*!Generate internal degree of freedom numbers: */
    36         UpdateFromInputsx(elements,nodes,loads, materials,inputs);
    37 
     38        UpdateFromInputsx(elements,nodes,loads, materials,parameters,inputs);
     39       
    3840        /*write output datasets: */
    3941        WriteData(ELEMENTS,elements);
     
    4143        WriteData(LOADS,loads);
    4244        WriteData(MATERIALS,materials);
    43 
     45        WriteParams(PARAMETERS,parameters);
     46       
    4447        /*Free ressources: */
    4548        delete elements;
     
    4750        delete loads;
    4851        delete materials;
     52        delete parameters;
    4953        delete inputs;
    50 
     54       
    5155        /*end module: */
    5256        MODULEEND();
     
    5660{
    5761        _printf_("\n");
    58         _printf_("   usage: [elements,nodes,loads, materials] = %s(elements,nodes,loads, materials,inputs);\n",__FUNCT__);
     62        _printf_("   usage: [elements,nodes,loads, materials, parameters] = %s(elements,nodes,loads, materials,parameters,inputs);\n",__FUNCT__);
    5963        _printf_("\n");
    6064}
  • issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.h

    r1 r2333  
    2121#define LOADSIN (mxArray*)prhs[2]
    2222#define MATERIALSIN (mxArray*)prhs[3]
    23 #define INPUTS (mxArray*)prhs[4]
     23#define PARAMETERSIN (mxArray*)prhs[4]
     24#define INPUTS (mxArray*)prhs[5]
    2425
    2526/* serial output macros: */
     
    2829#define LOADS (mxArray**)&plhs[2]
    2930#define MATERIALS (mxArray**)&plhs[3]
     31#define PARAMETERS (mxArray**)&plhs[4]
    3032
    3133/* serial arg counts: */
    3234#undef NLHS
    33 #define NLHS  4
     35#define NLHS  5
    3436#undef NRHS
    35 #define NRHS  5
     37#define NRHS  6
    3638
    3739
  • issm/trunk/src/mex/UpdateGeometry/UpdateGeometry.cpp

    r2316 r2333  
    1515        DataSet* loads=NULL;
    1616        DataSet* materials=NULL;
     17        DataSet* parameters=NULL;
    1718        Vec      newthickness=NULL;
    1819        Vec      bed=NULL;
     
    3132       
    3233        /*Input datasets: */
    33         FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
    34         FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
    35         FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
    36         FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
     34        FetchData(&elements,ELEMENTS);
     35        FetchData(&nodes,NODES);
     36        FetchData(&loads,LOADS);
     37        FetchData(&materials,MATERIALS);
     38        FetchParams(&parameters,PARAMETERS);
    3739       
    38         FetchData((void**)&newthickness,NULL,NULL,NEWTHICKNESS,"Vector",NULL);
    39         FetchData((void**)&bed,NULL,NULL,BED,"Vector",NULL);
    40         FetchData((void**)&surface,NULL,NULL,SURFACE,"Vector",NULL);
     40        FetchData(&newthickness,NEWTHICKNESS);
     41        FetchData(&bed,BED);
     42        FetchData(&surface,SURFACE);
    4143
    4244        /*!Generate internal degree of freedom numbers: */
    43         UpdateGeometryx(&outthickness,&outbed,&outsurface, elements, nodes,loads, materials, newthickness,bed,surface);
     45        UpdateGeometryx(&outthickness,&outbed,&outsurface, elements, nodes,loads, materials, parameters,newthickness,bed,surface);
    4446
    4547        /*write output data: */
     
    5355        delete loads;
    5456        delete materials;
     57        delete parameters;
    5558        VecFree(&newthickness);
    5659        VecFree(&bed);
     
    6669void UpdateGeometryUsage(void) {
    6770        _printf_("\n");
    68         _printf_("   usage: [outthickness,outbed,outsrface] = %s(elements, nodes, materials, params,newthickness,bed,surface);\n",__FUNCT__);
     71        _printf_("   usage: [outthickness,outbed,outsrface] = %s(elements, nodes, materials, parameters,newthickness,bed,surface);\n",__FUNCT__);
    6972        _printf_("\n");
    7073}
  • issm/trunk/src/mex/UpdateNodePositions/UpdateNodePositions.cpp

    r2316 r2333  
    1414        DataSet* nodes=NULL;
    1515        DataSet* loads=NULL;
    16         DataSet* materials=NULL;
     16        DataSet* materials=NULL;
     17        DataSet* parameters=NULL;
    1718        Vec      thickness=NULL;
    1819        Vec      bed=NULL;
     
    2526
    2627        /*Input datasets: */
    27         FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);
    28         FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);
    29         FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);
    30         FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);
    31         FetchData((void**)&thickness,NULL,NULL,THICKNESS,"Vector",NULL);
    32         FetchData((void**)&bed,NULL,NULL,BED,"Vector",NULL);
     28        FetchData(&elements,ELEMENTS);
     29        FetchData(&nodes,NODES);
     30        FetchData(&loads,LOADS);
     31        FetchData(&materials,MATERIALS);
     32        FetchParams(&parameters,PARAMETERS);
     33        FetchData(&thickness,THICKNESS);
     34        FetchData(&bed,BED);
    3335       
    3436        /*!Generate internal degree of freedom numbers: */
    35         UpdateNodePositionsx(elements,nodes,loads, materials,thickness,bed);
     37        UpdateNodePositionsx(elements,nodes,loads, materials,parameters,thickness,bed);
    3638
    3739        /*write output datasets: */
     
    4345        delete loads;
    4446        delete materials;
     47        delete parameters;
    4548        VecFree(&thickness);
    4649        VecFree(&bed);
     
    5356{
    5457        _printf_("\n");
    55         _printf_("   usage: [elements,nodes,loads, materials] = %s(elements,nodes,loads, materials,inputs);\n",__FUNCT__);
     58        _printf_("   usage: [elements,nodes,loads, materials] = %s(elements,nodes,loads, materials,parameters, inputs);\n",__FUNCT__);
    5659        _printf_("\n");
    5760}
  • issm/trunk/src/mex/UpdateNodePositions/UpdateNodePositions.h

    r847 r2333  
    2121#define LOADS (mxArray*)prhs[2]
    2222#define MATERIALS (mxArray*)prhs[3]
    23 #define BED (mxArray*)prhs[4]
    24 #define THICKNESS (mxArray*)prhs[5]
     23#define PARAMETERS (mxArray*)prhs[4]
     24#define BED (mxArray*)prhs[5]
     25#define THICKNESS (mxArray*)prhs[6]
    2526       
    2627/* serial output macros: */
     
    3132#define NLHS  1
    3233#undef NRHS
    33 #define NRHS  6
     34#define NRHS  7
    3435
    3536
Note: See TracChangeset for help on using the changeset viewer.