Changeset 3673


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

Redid Params and Inputs

Location:
issm/trunk
Files:
36 added
19 deleted
145 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/configs/macosx32/macosx32.sh.petsc2

    r3225 r3673  
    11#!/bin/sh
    22
    3 ./configure --prefix=$ISSM_DIR --with-matlab-dir=$MATLAB_DIR --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install --with-metis-dir=$ISSM_DIR/externalpackages/metis/install --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  --with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a" --with-petsc-arch=$ISSM_ARCH --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH  --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32/$ISSM_ARCH -lPLAPACK"  --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32/$ISSM_ARCH/INCLUDE"  --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/SCALAPACK/$ISSM_ARCH/ --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/MUMPS_4.6.3/$ISSM_ARCH --with-fortran-lib="/usr/local/lib/libgfortran.a" --with-math-lib="/usr/lib/libm.dylib" --with-graphics-lib="/usr/X11/lib/libX11.dylib" --with-petsc-version=2
     3./configure --prefix=$ISSM_DIR --with-matlab-dir=$MATLAB_DIR --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install --with-metis-dir=$ISSM_DIR/externalpackages/metis/install --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  --with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a" --with-petsc-arch=$ISSM_ARCH --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH  --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32/$ISSM_ARCH -lPLAPACK"  --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32/$ISSM_ARCH/INCLUDE"  --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/SCALAPACK/$ISSM_ARCH/ --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/MUMPS_4.6.3/$ISSM_ARCH --with-fortran-lib="/usr/local/lib/libgfortran.a" --with-math-lib="/usr/lib/libm.dylib" --with-graphics-lib="/usr/X11/lib/libX11.dylib" --with-petsc-version=2
  • issm/trunk/etc/environment_variables.csh

    r3601 r3673  
    1 #
    2 #
    3 #This routine can only be run if the ISSM_DIR variable has been correctly set!
    4 #
    5 #
    6 
    7 #MATLAB
    8 set MATLAB_DIR={$ISSM_DIR}/externalpackages/matlab/install
    9 set MATLAB_VERSION=
    10 
    11 #MPI
    12 set MPI_DIR={$ISSM_DIR}/externalpackages/mpich2/install
    13 
    14 #PETSC
    15 set PETSC_DIR={$ISSM_DIR}/externalpackages/petsc/install
    16 
    17 #SLEPC
    18 set SLEPC_DIR={$ISSM_DIR}/externalpackages/slepc/install
    19 
    20 #Dakota
    21 set DAKOTA_DIR={$ISSM_DIR}/externalpackages/dakota/install
    22 
    23 #Qhull
    24 set QHULL_DIR={$ISSM_DIR}/externalpackages/qhull/install
    25 
    26 #Doxygen
    27 set DOXYGEN_DIR={$ISSM_DIR}/externalpackages/doxygen/install
    28 
    29 #MTOC
    30 set MTOC_DIR={$ISSM_DIR}/externalpackages/mtoc/install
    31 
    32 #Triangle
    33 set TRIANGLE_DIR={$ISSM_DIR}/externalpackages/triangle/install
    34 
    35 #METIS
    36 set METIS_DIR={$ISSM_DIR}/externalpackages/metis/install
    37 
    38 #BLAS
    39 set BLAS_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/fblaslapack
    40 
    41 #LAPACK
    42 set LAPACK_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/fblaslapack/$ISSM_ARCH
    43 
    44 #SCALAPACK
    45 set SCALAPACK_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/SCALAPACK/$ISSM_ARCH
    46 
    47 #PLAPACK
    48 set PLAPACK_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/PLAPACKR32
    49 
    50 #BLACS
    51 set BLACS_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/blacs-dev/$ISSM_ARCH
    52 
    53 #sowing
    54 set SOWING_DIR={$ISSM_DIR}/externalpackages/sowing/install
    55 
    56 #YAMS
    57 set YAMS_DIR={$ISSM_DIR}/externalpackages/yams/install
    58 
    59 #TEX2IM
    60 set TEX2IM_DIR={$ISSM_DIR}/externalpackages/tex2im/install
    61 
    62 #Chaco
    63 set CHACO_DIR={$ISSM_DIR}/externalpackages/chaco/install
    64 
    65 #MeshPart
    66 set MESHPART_DIR={$ISSM_DIR}/externalpackages/meshpart/install
    67 
    68 #SCOTCH
    69 set SCOTCH_DIR={$ISSM_DIR}/externalpackages/scotch/install
    70 
    71 #Development packages
    72 #automake
    73 set AUTOMAKE_DIR={$ISSM_DIR}/devpackages/automake/install
    74 
    75 #autoconf
    76 set AUTOCONF_DIR={$ISSM_DIR}/devpackages/autoconf/install
    77 
    78 #borland
    79 set BORLAND_DIR=/cygdrive/c/Borland
    80 
    81 #ssh
    82 set SSH_DIR={$ISSM_DIR}/externalpackages/ssh
    83 
    84 #valgrind
    85 set VALGRIND_DIR={$ISSM_DIR}/externalpackages/valgrind/install/bin
  • issm/trunk/etc/environment_variables.sh

    r3602 r3673  
    1 #
    2 #
    3 #This routine can only be run if the ISSM_DIR variable has been correctly set!
    4 #
    5 #
    6 
    7 #MATLAB
    8 MATLAB_DIR="$ISSM_DIR/externalpackages/matlab/install"
    9 MATLAB_VERSION=
    10 
    11 #MPI
    12 MPI_DIR="$ISSM_DIR/externalpackages/mpich2/install"
    13 
    14 #PETSC
    15 PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install"
    16 
    17 #SLEPC
    18 SLEPC_DIR="$ISSM_DIR/externalpackages/slepc/install"
    19 
    20 #Dakota
    21 DAKOTA_DIR="$ISSM_DIR/externalpackages/dakota/install"
    22 
    23 #Qhull
    24 QHULL_DIR="$ISSM_DIR/externalpackages/qhull/install"
    25 
    26 #Doxygen
    27 DOXYGEN_DIR="$ISSM_DIR/externalpackages/doxygen/install"
    28 
    29 #MTOC
    30 MTOC_DIR="$ISSM_DIR/externalpackages/mtoc/install"
    31 
    32 #Triangle
    33 TRIANGLE_DIR="$ISSM_DIR/externalpackages/triangle/install"
    34 
    35 #METIS
    36 METIS_DIR="$ISSM_DIR/externalpackages/metis/install"
    37 
    38 #BLAS
    39 BLAS_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack"
    40 
    41 #LAPACK
    42 LAPACK_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH"
    43 
    44 #SCALAPACK
    45 SCALAPACK_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/SCALAPACK/$ISSM_ARCH"
    46 
    47 #PLAPACK
    48 PLAPACK_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32"
    49 
    50 #BLACS
    51 BLACS_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH"
    52 
    53 #sowing
    54 SOWING_DIR="$ISSM_DIR/externalpackages/sowing/install"
    55 
    56 #BLACS
    57 BLACS_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH"
    58 
    59 #YAMS
    60 YAMS_DIR="$ISSM_DIR/externalpackages/yams/install"
    61 
    62 #BAMG
    63 BAMG_DIR="$ISSM_DIR/externalpackages/bamg/install"
    64 
    65 #Chaco
    66 CHACO_DIR="$ISSM_DIR/externalpackages/chaco/install"
    67 
    68 #MeshPart
    69 MESHPART_DIR="$ISSM_DIR/externalpackages/meshpart/install"
    70 
    71 #SCOTCH
    72 SCOTCH_DIR="$ISSM_DIR/externalpackages/scotch/install"
    73 
    74 #Development packages
    75 #automake
    76 AUTOMAKE_DIR="$ISSM_DIR/devpackages/automake/install"
    77 
    78 #autoconf
    79 AUTOCONF_DIR="$ISSM_DIR/devpackages/autoconf/install"
    80 
    81 #borland
    82 #BORLAND_DIR="/cygdrive/c/Borland/"
    83 
    84 #intel
    85 #INTEL_DIR="C:/IntelInstall/Compiler/11.1/038/bin/ia32/"
    86 
    87 #TEX2IM                 
    88 TEX2IM_DIR="$ISSM_DIR/externalpackages/tex2im/install"
    89 
    90 #sdk
    91 SDK_DIR="C:/MicrosoftVisualStudio 9.0/Microsoft Visual C++ 2008 Express Edition with SP1 - ENU"
    92 
    93 #ssh
    94 SSH_DIR="$ISSM_DIR/externalpackages/ssh"
    95 
    96 #valgrind
    97 VALGRIND_DIR="$ISSM_DIR/externalpackages/valgrind/install/bin"
    98 
    99 #graphviz
    100 GRAPHVIZ_DIR="$ISSM_DIR/externalpackages/graphviz/install/bin"
    101 
    102 #cppcheck
    103 CPPCHECK_DIR="$ISSM_DIR/externalpackages/cppcheck/install"
  • issm/trunk/externalpackages/matlab/install.sh

    r3603 r3673  
    88
    99#symlink matlab to root matlab
    10 ln -s /usr/local/pkgs/matlab-$MATLAB_VERSION/ install
     10ln -s /Applications/MATLAB_R2008a/ install
     11
     12export MATLAB_VERSION=R2008a
    1113
    1214#initialize MATLAB_VERSION in etc/environment_variables
  • issm/trunk/externalpackages/mpich2/install.sh

    r2124 r3673  
    55
    66#version of mpich2
    7 version=1.1.1p1
     7version=1.0.2p1
    88
    99#Some cleanup
  • issm/trunk/m4/matlab.m4

    r1439 r3673  
    306306    fi
    307307fi])
     308echo $ax_cv_matlab_version
    308309case $ax_cv_matlab_version in
    309310  @<:@1-9@:>@.@<:@0-9@:>@ | @<:@1-9@:>@@<:@0-9@:>@.@<:@0-9@:>@)
     
    317318    MATLAB_MINOR=a
    318319        ;;
     320        R2008a)
     321        MATLAB_VERSION=R2008a
     322    MATLAB_MAJOR=R2008
     323    MATLAB_MINOR=a
     324        ;;
     325
    319326  *)
    320327    if test x$ax_enable_matlab = xyes ; then
  • issm/trunk/src/c/ComputeBasalStressx/ComputeBasalStressx.cpp

    r3529 r3673  
    1010#include "../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void    ComputeBasalStressx( Vec* psigma,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,DataSet* parameters,
    13                         ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
     12void    ComputeBasalStressx( Vec* psigma,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,Parameters* parameters,
     13                        int analysis_type,int sub_analysis_type){
    1414
    1515        int i;
     
    3434
    3535        /*Call on dataset driver: */
    36         elements->ComputeBasalStress(sigma,inputs,analysis_type,sub_analysis_type);
     36        elements->ComputeBasalStress(sigma,analysis_type,sub_analysis_type);
    3737
    3838        /*Assemble vector: */
  • issm/trunk/src/c/ComputeBasalStressx/ComputeBasalStressx.h

    r3612 r3673  
    1010
    1111/* local prototypes: */
    12 void    ComputeBasalStressx( Vec* pp_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,  DataSet* parameters,
     12void    ComputeBasalStressx( Vec* pp_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,  Parameters* parameters,
    1313                        int analysis_type,int sub_analysis_type);
    1414
  • issm/trunk/src/c/ComputePressurex/ComputePressurex.cpp

    r3529 r3673  
    1010#include "../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void    ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,DataSet* parameters,
    13                         ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
     12void    ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,Parameters* parameters,
     13                        int analysis_type,int sub_analysis_type){
    1414
    1515        int i;
     
    3232
    3333        /*Call on dataset driver: */
    34         elements->ComputePressure(p_g,inputs,analysis_type,sub_analysis_type);
     34        elements->ComputePressure(p_g,analysis_type,sub_analysis_type);
    3535
    3636        /*Assemble vector: */
  • issm/trunk/src/c/ComputePressurex/ComputePressurex.h

    r3612 r3673  
    1010
    1111/* local prototypes: */
    12 void    ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,  DataSet* parameters,
     12void    ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,  Parameters* parameters,
    1313                        int analysis_type,int sub_analysis_type);
    1414
  • issm/trunk/src/c/ComputeStrainRatex/ComputeStrainRatex.cpp

    r3529 r3673  
    1010#include "../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void    ComputeStrainRatex( Vec* peps,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,DataSet* parameters,
    13                         ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
     12void    ComputeStrainRatex( Vec* peps,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,Parameters* parameters,
     13                        int analysis_type,int sub_analysis_type){
    1414
    1515        int i;
     
    3333
    3434        /*Call on dataset driver: */
    35         elements->ComputeStrainRate(eps,inputs,analysis_type,sub_analysis_type);
     35        elements->ComputeStrainRate(eps,analysis_type,sub_analysis_type);
    3636
    3737        /*Assemble vector: */
  • issm/trunk/src/c/ComputeStrainRatex/ComputeStrainRatex.h

    r3612 r3673  
    1010
    1111/* local prototypes: */
    12 void    ComputeStrainRatex(Vec* eps_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,  DataSet* parameters,
     12void    ComputeStrainRatex(Vec* eps_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,  Parameters* parameters,
    1313                        int analysis_type,int sub_analysis_type);
    1414
  • issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.cpp

    r3633 r3673  
    1010#include "../EnumDefinitions/EnumDefinitions.h"
    1111
    12 int     ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials,DataSet* parameters){
     12int     ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials,Parameters* parameters){
    1313
    1414        int noerr=1;
     
    2323        loads->Configure(elements,loads,nodes,vertices,materials,parameters);
    2424        //_printf_("      Configuring nodes...\n");
    25         nodes->Configure(nodes);
     25        nodes->Configure(elements,loads,nodes,vertices,materials,parameters);
    2626        //_printf_("      Configuring parameters...\n");
    27         parameters->Configure(elements,loads, nodes,vertices, materials,parameters);
     27        parameters->Configure(elements,loads,nodes,vertices,materials,parameters);
    2828
    2929        return noerr;
  • issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.h

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

    r3502 r3673  
    1111#include "../SurfaceAreax/SurfaceAreax.h"
    1212
    13 void CostFunctionx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials,DataSet* parameters,
    14                         ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
     13void CostFunctionx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials,Parameters* parameters,
     14                        int analysis_type,int sub_analysis_type){
    1515
    1616        /*Intermediary*/
     
    2727        parameters->Configure(elements,loads, nodes,vertices, materials,parameters);
    2828
    29         /*If fit=3, compute Surface Area*/
    30         if(!inputs->Recover("fit",&fit)) ISSMERROR(" missing fit input parameter");
    31         if (fit==3 && !inputs->IsPresent("surfacearea")){
     29        /*Compute surface area: */
     30        SurfaceAreax(&S,elements,nodes,vertices, loads,materials,parameters,analysis_type,sub_analysis_type);
    3231
    33                 SurfaceAreax(&S,elements,nodes,vertices,loads,materials,parameters,inputs,analysis_type,sub_analysis_type);
    34                 inputs->Add("surfacearea",S);
    35         }
    36 
     32        /*add surface area to elements :*/
     33        elements->AddInput(S,SurfaceAreaEnum);
     34       
    3735        /*Compute gradients: */
    38         elements->CostFunction(&J,inputs,analysis_type,sub_analysis_type);
     36        elements->CostFunction(&J,analysis_type,sub_analysis_type);
    3937
    4038        /*Sum all J from all cpus of the cluster:*/
  • issm/trunk/src/c/CostFunctionx/CostFunctionx.h

    r3612 r3673  
    1010
    1111/* local prototypes: */
    12 void CostFunctionx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,
     12void CostFunctionx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,
    1313                        int analysis_type,int sub_analysis_type);
    1414
  • issm/trunk/src/c/DataSet/DataSet.cpp

    r3649 r3673  
    207207                        dataset->AddObject(vertex);
    208208                }
    209                 else if(enum_type==ParamEnum){
    210                         Param* param=NULL;
    211                         param=new Param();
    212                         param->Demarshall(&marshalled_dataset);
    213                         dataset->AddObject(param);
    214                 }
    215                 else if(enum_type==NumparEnum){
    216                         Numpar* numpar=NULL;
    217                         numpar=new Numpar();
    218                         numpar->Demarshall(&marshalled_dataset);
    219                         dataset->AddObject(numpar);
     209                else if(enum_type==DoubleParamEnum){
     210                        DoubleParam* doubleparam=NULL;
     211                        doubleparam=new DoubleParam();
     212                        doubleparam->Demarshall(&marshalled_dataset);
     213                        dataset->AddObject(doubleparam);
    220214                }
    221215                else if(enum_type==TriaEnum){
     
    512506
    513507                /*Which id does it have: */
    514                 id=(*object)->GetId();
     508                id=(*object)->Id();
    515509
    516510                /*Plug rank into ranks, according to id: */
     
    532526                for(i=0;i<objects.size();i++){
    533527                        id_offsets[i]=i;
    534                         sorted_ids[i]=objects[i]->GetId();
     528                        sorted_ids[i]=objects[i]->Id();
    535529                }
    536530        }
     
    13641358                        element->UpdateInputs(solution,analysis_type,sub_analysis_type);
    13651359                }
    1366                 else ISSMERROR("%s%i%s"," object with id: ",(*object)->GetId()," is not an element, in a function that deals only with elements!");
     1360                else ISSMERROR("%s%i%s"," object with id: ",(*object)->Id()," is not an element, in a function that deals only with elements!");
     1361        }
     1362}
     1363/*}}}*/
     1364/*FUNCTION DataSet::AddInput{{{1*/
     1365void  DataSet::AddInput(double value, int enum_type){
     1366
     1367        vector<Object*>::iterator object;
     1368        Element* element=NULL;
     1369
     1370        for ( object=objects.begin() ; object < objects.end(); object++ ){
     1371
     1372                if(EnumIsElement((*object)->Enum())){
     1373
     1374                        element=(Element*)(*object);
     1375                        element->AddInput(value,enum_type);
     1376                }
     1377                else ISSMERROR("%s%i%s"," object with id: ",(*object)->Id()," is not an element, in a function that deals only with elements!");
    13671378        }
    13681379}
  • issm/trunk/src/c/DataSet/DataSet.h

    r3649 r3673  
    7171                void  CreatePVector(Vec pg, int analysis_type,int sub_analysis_type);
    7272                void  UpdateInputs(double* solution,int analysis_type,int sub_analysis_type);
     73                void  AddInput(double value, int enum_type);
    7374                void  PenaltyCreateKMatrix(Mat Kgg,double kmax,int analysis_type,int sub_analysis_type);
    7475                void  PenaltyCreatePVector(Vec pg,double kmax,int analysis_type,int sub_analysis_type);
  • issm/trunk/src/c/DataSet/Inputs.cpp

    r3649 r3673  
    6464
    6565        /*Ok, we have an input if we made it here, request the input to return the values: */
    66         input->GetParameterValues(pvalue,gauss);
     66        input->GetParameterValue(pvalue,gauss);
    6767
    6868}
     
    165165/*}}}*/
    166166/*FUNCTION Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){{{1*/
    167 void GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){
    168 
     167void Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){
     168
     169        int i;
    169170        vector<Object*>::iterator object;
    170171        Input* input=NULL;
     
    188189/*}}}*/
    189190/*FUNCTION Inputs::GetParameterValue(bool* pvalue,int enum-type){{{1*/
    190 void GetParameterValue(bool* pvalue,int enum_type){
     191void Inputs::GetParameterValue(bool* pvalue,int enum_type){
    191192
    192193        vector<Object*>::iterator object;
     
    212213/*}}}*/
    213214/*FUNCTION Inputs::GetParameterValue(int* pvalue,int enum-type){{{1*/
    214 void GetParameterValue(int* pvalue,int enum_type){
     215void Inputs::GetParameterValue(int* pvalue,int enum_type){
    215216
    216217        vector<Object*>::iterator object;
     
    236237/*}}}*/
    237238/*FUNCTION Inputs::GetParameterValue(double* pvalue,int enum-type){{{1*/
    238 void GetParameterValue(double* pvalue,int enum_type){
     239void Inputs::GetParameterValue(double* pvalue,int enum_type){
    239240
    240241        vector<Object*>::iterator object;
     
    279280
    280281        /*Ok, we have an input if we made it here, request the input to return the value: */
    281         input->GetParameterValue(derivativevalues,xyz_list,gauss);
     282        input->GetParameterDerivativeValue(derivativevalues,xyz_list,gauss);
    282283}
    283284/*}}}*/
     
    312313/*}}}*/
    313314/*FUNCTION Inputs::GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){{{1*/
    314 void Inputs::GetStrainRate(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){
     315void Inputs::GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){
    315316
    316317        vector<Object*>::iterator object;
    317318        Input* xinput=NULL;
    318319        Input* yinput=NULL;
    319         Input* yinput=NULL;
     320        Input* zinput=NULL;
    320321
    321322        /*Go through inputs and find data for xenum: */
  • issm/trunk/src/c/DataSet/Inputs.h

    r3647 r3673  
    66#define _INPUTS_H_
    77
     8#include "./DataSet.h"
    89class Input;
    9 class Node;
    10 #include "./DataSet.h"
     10#include "../objects/Input.h"
    1111#include "../objects/Node.h"
    1212
  • issm/trunk/src/c/DataSet/Parameters.cpp

    r3621 r3673  
    99#endif
    1010
     11#include <vector>
     12#include <functional>
     13#include <algorithm>
     14#include <iostream>
     15
    1116#include "./DataSet.h"
    1217#include "./Parameters.h"
     18
     19#include "../shared/shared.h"
     20#include "../include/macros.h"
     21#include "../EnumDefinitions/EnumDefinitions.h"
     22
     23using namespace std;
     24
    1325
    1426/*Object constructors and destructor*/
     
    2032/*FUNCTION Parameters::Parameters(int in_enum){{{1*/
    2133Parameters::Parameters(int in_enum): DataSet(in_enum){
    22 {
    2334        //do nothing;
    2435        return;
     
    3243
    3344/*Object management*/
    34 /*FUNCTION Parameters::FindParam(double* pscalar, char* name){{{1*/
    35 int   Parameters::FindParam(double* pscalar, char* name){
    36        
    37         /*Go through a dataset, and find a Param* object
    38          *which parameter name is "name" : */
    39        
    40         vector<Object*>::iterator object;
    41         Param* param=NULL;
    42 
    43         int found=0;
    44 
    45         for ( object=objects.begin() ; object < objects.end(); object++ ){
    46 
    47                 /*Find param type objects: */
    48                 if((*object)->Enum()==ParamEnum){
    49 
    50                         /*Ok, this object is a parameter, recover it and ask which name it has: */
    51                         param=(Param*)(*object);
    52 
    53                         if (strcmp(param->GetParameterName(),name)==0){
     45/*FUNCTION Parameters::FindParam(double* pscalar, int enum_type){{{1*/
     46int   Parameters::FindParam(double* pscalar, int enum_type){
     47       
     48        /*Go through a dataset, and find a Param* object
     49         *which parameter name is "name" : */
     50       
     51        vector<Object*>::iterator object;
     52        Param* param=NULL;
     53
     54        int found=0;
     55
     56        for ( object=objects.begin() ; object < objects.end(); object++ ){
     57
     58                /*Find param type objects: */
     59                if((*object)->Enum()==ParamEnum){
     60
     61                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     62                        param=(Param*)(*object);
     63
     64                        if(param->EnumType()==enum_type){
    5465                                /*Ok, this is the one! Recover the value of this parameter: */
    5566                                param->GetParameterValue(pscalar);
     
    6273}
    6374/*}}}*/
    64 /*FUNCTION Parameters::FindParam(int* pinteger,char* name){{{1*/
    65 int   Parameters::FindParam(int* pinteger,char* name){
    66        
    67        
    68         /*Go through a dataset, and find a Param* object
    69          *which parameter name is "name" : */
    70        
    71         vector<Object*>::iterator object;
    72         Param* param=NULL;
    73 
    74         int found=0;
    75 
    76         for ( object=objects.begin() ; object < objects.end(); object++ ){
    77 
    78                 /*Find param type objects: */
    79                 if((*object)->Enum()==ParamEnum){
    80 
    81                         /*Ok, this object is a parameter, recover it and ask which name it has: */
    82                         param=(Param*)(*object);
    83 
    84                         if (strcmp(param->GetParameterName(),name)==0){
     75/*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{1*/
     76int   Parameters::FindParam(int* pinteger,int enum_type){
     77       
     78       
     79        /*Go through a dataset, and find a Param* object
     80         *which parameter name is "name" : */
     81       
     82        vector<Object*>::iterator object;
     83        Param* param=NULL;
     84
     85        int found=0;
     86
     87        for ( object=objects.begin() ; object < objects.end(); object++ ){
     88
     89                /*Find param type objects: */
     90                if((*object)->Enum()==ParamEnum){
     91
     92                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     93                        param=(Param*)(*object);
     94
     95                        if(param->EnumType()==enum_type){
    8596                                /*Ok, this is the one! Recover the value of this parameter: */
    8697                                param->GetParameterValue(pinteger);
     
    93104}
    94105/*}}}*/
    95 /*FUNCTION Parameters::FindParam(char** pstring,char* name){{{1*/
    96 int   Parameters::FindParam(char** pstring,char* name){
    97        
    98         /*Go through a dataset, and find a Param* object
    99          *which parameter name is "name" : */
    100        
    101         vector<Object*>::iterator object;
    102         Param* param=NULL;
    103 
    104         int found=0;
    105 
    106         for ( object=objects.begin() ; object < objects.end(); object++ ){
    107 
    108                 /*Find param type objects: */
    109                 if((*object)->Enum()==ParamEnum){
    110 
    111                         /*Ok, this object is a parameter, recover it and ask which name it has: */
    112                         param=(Param*)(*object);
    113 
    114                         if (strcmp(param->GetParameterName(),name)==0){
     106/*FUNCTION Parameters::FindParam(char** pstring,int enum_type){{{1*/
     107int   Parameters::FindParam(char** pstring,int enum_type){
     108       
     109        /*Go through a dataset, and find a Param* object
     110         *which parameter name is "name" : */
     111       
     112        vector<Object*>::iterator object;
     113        Param* param=NULL;
     114
     115        int found=0;
     116
     117        for ( object=objects.begin() ; object < objects.end(); object++ ){
     118
     119                /*Find param type objects: */
     120                if((*object)->Enum()==ParamEnum){
     121
     122                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     123                        param=(Param*)(*object);
     124
     125                        if(param->EnumType()==enum_type){
    115126                                /*Ok, this is the one! Recover the value of this parameter: */
    116127                                param->GetParameterValue(pstring);
     
    124135}
    125136/*}}}*/
    126 /*FUNCTION Parameters::FindParam(char*** pstringarray,int* pM,char* name){{{1*/
    127 int   Parameters::FindParam(char*** pstringarray,int* pM,char* name){
    128        
    129         /*Go through a dataset, and find a Param* object
    130          *which parameter name is "name" : */
    131        
    132         vector<Object*>::iterator object;
    133         Param* param=NULL;
    134 
    135         int found=0;
    136 
    137         for ( object=objects.begin() ; object < objects.end(); object++ ){
    138 
    139                 /*Find param type objects: */
    140                 if((*object)->Enum()==ParamEnum){
    141 
    142                         /*Ok, this object is a parameter, recover it and ask which name it has: */
    143                         param=(Param*)(*object);
    144 
    145                         if (strcmp(param->GetParameterName(),name)==0){
    146                                 /*Ok, this is the one! Recover the value of this parameter: */
    147                                 param->GetParameterValue(pstringarray);
    148                                 if(pM)*pM=param->GetM();
    149                                 found=1;
    150                                 break;
    151                         }
    152                 }
    153         }
    154         return found;
    155 
    156 }
    157 /*}}}*/
    158 /*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM, int* pN,char* name){{{1*/
    159 int   Parameters::FindParam(double** pdoublearray,int* pM, int* pN,char* name){
    160        
    161         /*Go through a dataset, and find a Param* object
    162          *which parameter name is "name" : */
    163        
    164         vector<Object*>::iterator object;
    165         Param* param=NULL;
    166 
    167         int found=0;
    168 
    169         for ( object=objects.begin() ; object < objects.end(); object++ ){
    170 
    171                 /*Find param type objects: */
    172                 if((*object)->Enum()==ParamEnum){
    173 
    174                         /*Ok, this object is a parameter, recover it and ask which name it has: */
    175                         param=(Param*)(*object);
    176 
    177                         if (strcmp(param->GetParameterName(),name)==0){
    178                                 /*Ok, this is the one! Recover the value of this parameter: */
    179                                 param->GetParameterValue(pdoublearray);
    180                                 if(pM)param->GetM();
    181                                 if(pN)param->GetN();
    182                                 found=1;
    183                                 break;
    184                         }
    185                 }
    186         }
    187         return found;
    188 
    189 }
    190 /*}}}*/
    191 /*FUNCTION Parameters::FindParam(Vec* pvec,char* name){{{1*/
    192 int   Parameters::FindParam(Vec* pvec,char* name){
    193        
    194         /*Go through a dataset, and find a Param* object
    195          *which parameter name is "name" : */
    196        
    197         vector<Object*>::iterator object;
    198         Param* param=NULL;
    199 
    200         int found=0;
    201 
    202         for ( object=objects.begin() ; object < objects.end(); object++ ){
    203 
    204                 /*Find param type objects: */
    205                 if((*object)->Enum()==ParamEnum){
    206 
    207                         /*Ok, this object is a parameter, recover it and ask which name it has: */
    208                         param=(Param*)(*object);
    209 
    210                         if (strcmp(param->GetParameterName(),name)==0){
     137/*FUNCTION Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){{{1*/
     138int   Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){
     139       
     140        /*Go through a dataset, and find a Param* object
     141         *which parameter name is "name" : */
     142       
     143        vector<Object*>::iterator object;
     144        Param* param=NULL;
     145
     146        int found=0;
     147
     148        for ( object=objects.begin() ; object < objects.end(); object++ ){
     149
     150                /*Find param type objects: */
     151                if((*object)->Enum()==ParamEnum){
     152
     153                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     154                        param=(Param*)(*object);
     155
     156                        if(param->EnumType()==enum_type){
     157                                /*Ok, this is the one! Recover the value of this parameter: */
     158                                param->GetParameterValue(pstringarray,pM);
     159                                found=1;
     160                                break;
     161                        }
     162                }
     163        }
     164        return found;
     165
     166}
     167/*}}}*/
     168/*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM,int enum_type){{{1*/
     169int   Parameters::FindParam(double** pdoublearray,int* pM, int enum_type){
     170       
     171        /*Go through a dataset, and find a Param* object
     172         *which parameter name is "name" : */
     173       
     174        vector<Object*>::iterator object;
     175        Param* param=NULL;
     176
     177        int found=0;
     178
     179        for ( object=objects.begin() ; object < objects.end(); object++ ){
     180
     181                /*Find param type objects: */
     182                if((*object)->Enum()==ParamEnum){
     183
     184                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     185                        param=(Param*)(*object);
     186
     187                        if(param->EnumType()==enum_type){
     188                                /*Ok, this is the one! Recover the value of this parameter: */
     189                                param->GetParameterValue(pdoublearray,pM)
     190                                found=1;
     191                                break;
     192                        }
     193                }
     194        }
     195        return found;
     196
     197}
     198/*}}}*/
     199/*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){{{1*/
     200int   Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){
     201       
     202        /*Go through a dataset, and find a Param* object
     203         *which parameter name is "name" : */
     204       
     205        vector<Object*>::iterator object;
     206        Param* param=NULL;
     207
     208        int found=0;
     209
     210        for ( object=objects.begin() ; object < objects.end(); object++ ){
     211
     212                /*Find param type objects: */
     213                if((*object)->Enum()==ParamEnum){
     214
     215                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     216                        param=(Param*)(*object);
     217
     218                        if(param->EnumType()==enum_type){
     219                                /*Ok, this is the one! Recover the value of this parameter: */
     220                                param->GetParameterValue(pdoublearray,pM,pN);
     221                                found=1;
     222                                break;
     223                        }
     224                }
     225        }
     226        return found;
     227
     228}
     229/*}}}*/
     230/*FUNCTION Parameters::FindParam(Vec* pvec,int enum_type){{{1*/
     231int   Parameters::FindParam(Vec* pvec,int enum_type){
     232       
     233        /*Go through a dataset, and find a Param* object
     234         *which parameter name is "name" : */
     235       
     236        vector<Object*>::iterator object;
     237        Param* param=NULL;
     238
     239        int found=0;
     240
     241        for ( object=objects.begin() ; object < objects.end(); object++ ){
     242
     243                /*Find param type objects: */
     244                if((*object)->Enum()==ParamEnum){
     245
     246                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     247                        param=(Param*)(*object);
     248
     249                        if(param->EnumType()==enum_type){
    211250                                /*Ok, this is the one! Recover the value of this parameter: */
    212251                                param->GetParameterValue(pvec);
     
    220259}
    221260/*}}}*/
    222 /*FUNCTION Parameters::FindParamMat* pmat,char* name){{{1*/
    223 int   Parameters::FindParam(Mat* pmat,char* name){
    224        
    225         /*Go through a dataset, and find a Param* object
    226          *which parameter name is "name" : */
    227        
    228         vector<Object*>::iterator object;
    229         Param* param=NULL;
    230 
    231         int found=0;
    232 
    233         for ( object=objects.begin() ; object < objects.end(); object++ ){
    234 
    235                 /*Find param type objects: */
    236                 if((*object)->Enum()==ParamEnum){
    237 
    238                         /*Ok, this object is a parameter, recover it and ask which name it has: */
    239                         param=(Param*)(*object);
    240 
    241                         if (strcmp(param->GetParameterName(),name)==0){
     261/*FUNCTION Parameters::FindParamMat* pmat,int enum_type){{{1*/
     262int   Parameters::FindParam(Mat* pmat,int enum_type){
     263       
     264        /*Go through a dataset, and find a Param* object
     265         *which parameter name is "name" : */
     266       
     267        vector<Object*>::iterator object;
     268        Param* param=NULL;
     269
     270        int found=0;
     271
     272        for ( object=objects.begin() ; object < objects.end(); object++ ){
     273
     274                /*Find param type objects: */
     275                if((*object)->Enum()==ParamEnum){
     276
     277                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     278                        param=(Param*)(*object);
     279
     280                        if(param->EnumType()==enum_type){
    242281                                /*Ok, this is the one! Recover the value of this parameter: */
    243282                                param->GetParameterValue(pmat);
     
    252291/*}}}*/
    253292/*FUNCTION Parameters::FindParamObject{{{1*/
    254 Object*   Parameters::FindParamObject(char* name){
    255 
    256         /*Go through a dataset, and find a Param* object
    257          *which parameter name is "name" : */
    258 
    259         vector<Object*>::iterator object;
    260         Param* param=NULL;
    261 
    262         for ( object=objects.begin() ; object < objects.end(); object++ ){
    263 
    264                 /*Find param type objects: */
    265                 if((*object)->Enum()==ParamEnum){
    266 
    267                         /*Ok, this object is a parameter, recover it and ask which name it has: */
    268                         param=(Param*)(*object);
    269 
    270                         if (strcmp(param->GetParameterName(),name)==0){
     293Object* Parameters::FindParamObject(int enum_type){
     294
     295        /*Go through a dataset, and find a Param* object
     296         *which parameter name is "name" : */
     297
     298        vector<Object*>::iterator object;
     299        Param* param=NULL;
     300
     301        for ( object=objects.begin() ; object < objects.end(); object++ ){
     302
     303                /*Find param type objects: */
     304                if((*object)->Enum()==ParamEnum){
     305
     306                        /*Ok, this object is a parameter, recover it and ask which name it has: */
     307                        param=(Param*)(*object);
     308
     309                        if(param->EnumType()==enum_type){
    271310                                /*Ok, this is the one! Return the object: */
    272311                                return (*object);
  • issm/trunk/src/c/DataSet/Parameters.h

    r3621 r3673  
    1818                /*}}}*/
    1919                /*numerics: {{{1*/
    20                 int   FindParam(double* pscalar, char* name);
    21                 int   FindParam(int* pinteger,char* name);
    22                 int   FindParam(char** pstring,char* name);
    23                 int   FindParam(char*** pstringarray,int* pM,char* name);
    24                 int   FindParam(double** pdoublearray,int* pM,int* pN,char* name);
    25                 int   FindParam(Vec* pvec,char* name);
    26                 int   FindParam(Mat* pmat,char* name);
     20                int   FindParam(double* pscalar, int enum_type);
     21                int   FindParam(int* pinteger,int enum_type);
     22                int   FindParam(char** pstring,int enum_type);
     23                int   FindParam(char*** pstringarray,int* pM,int enum_type);
     24                int   FindParam(double** pdoublearray,int* pM,int enum_type);
     25                int   FindParam(double** pdoublearray,int* pM,int* pN,int enum_type);
     26                int   FindParam(Vec* pvec,int enum_type);
     27                int   FindParam(Mat* pmat,int enum_type);
     28                Object* FindParamObject(int enum_type);
    2729                /*}}}*/
    2830
  • issm/trunk/src/c/Dofx/Dofx.cpp

    r3476 r3673  
    1010#include "../EnumDefinitions/EnumDefinitions.h"
    1111
    12 int Dofx( DofVec** ppartition, DofVec** ptpartition, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* params) {
     12int Dofx( DofVec** ppartition, DofVec** ptpartition, DataSet* elements,DataSet* nodes, DataSet* vertices, Parameters* parameters) {
    1313
    1414        int noerr=1;
     
    3636
    3737        /*First, recover number of vertices and nodes from parameters: */
    38         found=params->FindParam(&numberofvertices,"numberofvertices");
     38        found=parameters->FindParam(&numberofvertices,"numberofvertices");
    3939        if(!found)ISSMERROR(" could not find numberofvertices in parameters");
    4040       
    41         found=params->FindParam(&numberofnodes,"numberofnodes");
     41        found=parameters->FindParam(&numberofnodes,"numberofnodes");
    4242        if(!found)ISSMERROR(" could not find numberofnodes in parameters");
    4343
    4444        /*Recover number of dofs per node: */
    45         found=params->FindParam(&numberofdofspernode,"numberofdofspernode");
     45        found=parameters->FindParam(&numberofdofspernode,"numberofdofspernode");
    4646        if(!found)ISSMERROR(" could not find numberofdofspernode in parameters");
    4747
  • issm/trunk/src/c/Dofx/Dofx.h

    r3446 r3673  
    1010
    1111/* local prototypes: */
    12 int             Dofx( DofVec** partition, DofVec** ptpartition,DataSet* elements,DataSet* nodesin, DataSet* verticesin, DataSet* params);
     12int             Dofx( DofVec** partition, DofVec** ptpartition,DataSet* elements,DataSet* nodesin, DataSet* verticesin, Parameters* parameters);
    1313
    1414#endif  /* _DOFX_H */
  • issm/trunk/src/c/Dux/Dux.cpp

    r3502 r3673  
    1111#include "../SurfaceAreax/SurfaceAreax.h"
    1212
    13 void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,
    14                         ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
     13void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,
     14                        int analysis_type,int sub_analysis_type){
    1515
    1616        /*Intermediary*/
     
    2929        parameters->Configure(elements,loads, nodes, vertices, materials,parameters);
    3030
    31         /*If fit=3, compute Surface Area*/
    32         if(!inputs->Recover("fit",&fit)) ISSMERROR(" missing fit input parameter");
    33         if (fit==3 && !inputs->IsPresent("surfacearea")){
     31        /*Compute surface area: */
     32        SurfaceAreax(&S,elements,nodes,vertices, loads,materials,parameters,analysis_type,sub_analysis_type);
    3433
    35                 SurfaceAreax(&S,elements,nodes,vertices, loads,materials,parameters,inputs,analysis_type,sub_analysis_type);
    36                 inputs->Add("surfacearea",S);
    37         }
    38 
     34        /*add surface area to elements :*/
     35        elements->AddInput(S,SurfaceAreaEnum);
     36       
    3937        /*Get size of matrix: */
    4038        gsize=nodes->NumberOfDofs();
     
    4442
    4543        /*Compute velocity difference: */
    46         elements->Du(du_g,inputs,analysis_type,sub_analysis_type);
     44        elements->Du(du_g,analysis_type,sub_analysis_type);
    4745
    4846        /*Assemble vector: */
  • issm/trunk/src/c/Dux/Dux.h

    r3612 r3673  
    1010
    1111/* local prototypes: */
    12 void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,
     12void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,
    1313                        int analysis_type,int sub_analysis_type);
    1414
  • issm/trunk/src/c/EnumDefinitions/EnumDefinitions.cpp

    r3567 r3673  
    1717}
    1818int EnumIsMaterial(int en){
    19         if ((en>=MaterialEnum) && (en<=NumparEnum))return 1;
     19        if ((en>=MaterialEnum) && (en<=MatparEnum))return 1;
    2020        else return 0;
    2121}
  • issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h

    r3647 r3673  
    2222        /*Analysis types {{{1 */
    2323        AnalysisEnum,
     24        AnalysisTypeEnum,
     25        SubAnalysisTypeEnum,
    2426        //diagnostic
    2527        DiagnosticAnalysisEnum,
     
    99101        MaticeEnum,
    100102        MatparEnum,
    101         NumparEnum,
    102103        /*Inputs: */
    103104        InputEnum,
     
    111112        /*Params: */
    112113        ParamEnum,
     114        BoolParamEnum,
     115        IntParamEnum,
     116        DoubleParamEnum,
    113117        /*Results: */
    114118        ResultEnum,
     
    187191        FillEnum,
    188192        InternalEnum,
    189         BoundaryEnum
     193        MaxPenetrationEnum,
     194        BoundaryEnum,
     195        DtEnum,
     196        ArtDiffEnum,
     197        CmNoiseDmpEnum,
     198        CmMinDmpValueEnum,
     199        CmMaxDmpValueEnum,
     200        CmMinDmpSlopeEnum,
     201        CmMaxDmpSlopeEnum,
     202        ControlTypeEnum,
     203        ViscosityOvershootEnum,
     204        MeanVelEnum,
     205        EpsVelEnum,
     206        StokesReconditioningEnum,
     207        StabilizeConstraintsEnum,
     208        PenaltyOffsetEnum
    190209        /*}}}*/
    191210
  • issm/trunk/src/c/FieldAverageOntoVerticesx/FieldAverageOntoVerticesx.cpp

    r3556 r3673  
    1010#include "../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void FieldAverageOntoVerticesx(Vec* pfield, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters){
     12void FieldAverageOntoVerticesx(Vec* pfield, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters){
    1313
    1414        extern int my_rank;
  • issm/trunk/src/c/FieldAverageOntoVerticesx/FieldAverageOntoVerticesx.h

    r3556 r3673  
    99
    1010/* local prototypes: */
    11 void FieldAverageOntoVerticesx(Vec* field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters);
     11void FieldAverageOntoVerticesx(Vec* field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters);
    1212
    1313#endif  /* _FIELDDEPTHAVERAGEX_H */
  • issm/trunk/src/c/FieldDepthAveragex/FieldDepthAveragex.cpp

    r3446 r3673  
    1010#include "../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,char* fieldname){
     12void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,char* fieldname){
    1313
    1414        double* field_serial=NULL;
  • issm/trunk/src/c/FieldDepthAveragex/FieldDepthAveragex.h

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

    r3446 r3673  
    1010#include "../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,char* field_name,int collapse){
     12void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,char* field_name,int collapse){
    1313
    1414        double* field_serial=NULL;
  • issm/trunk/src/c/FieldExtrudex/FieldExtrudex.h

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

    r3502 r3673  
    1010#include "../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,
    13                         ParameterInputs* inputs,int analysis_type,int sub_analysis_type,char* control_type){
     12void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,
     13                        int analysis_type,int sub_analysis_type,char* control_type){
    1414
    1515        /*output: */
     
    2525
    2626        /*Compute gradients: */
    27         elements->Gradj(grad_g,inputs,analysis_type,sub_analysis_type,control_type);
     27        elements->Gradj(grad_g,analysis_type,sub_analysis_type,control_type);
    2828
    2929        /*Assemble vector: */
  • issm/trunk/src/c/Gradjx/Gradjx.h

    r3612 r3673  
    1010
    1111/* local prototypes: */
    12 void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials,  DataSet* parameters,
     12void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials,  Parameters* parameters,
    1313                        int analysis_type,int sub_analysis_type,char* control_type);
    1414
  • issm/trunk/src/c/Makefile.am

    r3642 r3673  
    6161                                        ./objects/Tria.h\
    6262                                        ./objects/Tria.cpp\
    63                                         ./objects/TriaVertexInput.h\
    64                                         ./objects/TriaVertexInput.cpp\
    65                                         ./objects/SingVertexInput.h\
    66                                         ./objects/SingVertexInput.cpp\
    67                                         ./objects/BeamVertexInput.h\
    68                                         ./objects/BeamVertexInput.cpp\
    69                                         ./objects/PentaVertexInput.h\
    70                                         ./objects/PentaVertexInput.cpp\
    71                                         ./objects/BoolInput.h\
    72                                         ./objects/BoolInput.cpp\
    73                                         ./objects/IntInput.h\
    74                                         ./objects/IntInput.cpp\
    75                                         ./objects/DoubleInput.h\
    76                                         ./objects/DoubleInput.cpp\
     63                                        ./objects/InputObjects/Input.h\
     64                                        ./objects/InputObjects/TriaVertexInput.h\
     65                                        ./objects/InputObjects/TriaVertexInput.cpp\
     66                                        ./objects/InputObjects/SingVertexInput.h\
     67                                        ./objects/InputObjects/SingVertexInput.cpp\
     68                                        ./objects/InputObjects/BeamVertexInput.h\
     69                                        ./objects/InputObjects/BeamVertexInput.cpp\
     70                                        ./objects/InputObjects/PentaVertexInput.h\
     71                                        ./objects/InputObjects/PentaVertexInput.cpp\
     72                                        ./objects/InputObjects/BoolInput.h\
     73                                        ./objects/InputObjects/BoolInput.cpp\
     74                                        ./objects/InputObjects/IntInput.h\
     75                                        ./objects/InputObjects/IntInput.cpp\
     76                                        ./objects/InputObjects/DoubleInput.h\
     77                                        ./objects/InputObjects/DoubleInput.cpp\
    7778                                        ./objects/Sing.h\
    7879                                        ./objects/Sing.cpp\
     
    8586                                        ./objects/Matpar.h\
    8687                                        ./objects/Matpar.cpp\
    87                                         ./objects/Input.h\
    8888                                        ./objects/Spc.cpp\
    8989                                        ./objects/Spc.h\
     
    100100                                        ./objects/Numericalflux.cpp\
    101101                                        ./objects/Numericalflux.h\
    102                                         ./objects/Param.cpp\
    103                                         ./objects/Param.h\
     102                                        ./objects/ParamObjects/Param.h\
     103                                        ./objects/ParamObjects/BoolParam.cpp\
     104                                        ./objects/ParamObjects/BoolParam.h\
     105                                        ./objects/ParamObjects/IntParam.cpp\
     106                                        ./objects/ParamObjects/IntParam.h\
     107                                        ./objects/ParamObjects/DoubleParam.cpp\
     108                                        ./objects/ParamObjects/DoubleParam.h\
     109                                        ./objects/ParamObjects/PetscMatParam.cpp\
     110                                        ./objects/ParamObjects/PetscMatParam.h\
     111                                        ./objects/ParamObjects/StringArrayParam.cpp\
     112                                        ./objects/ParamObjects/StringArrayParam.h\
     113                                        ./objects/ParamObjects/DoubleMatParam.cpp\
     114                                        ./objects/ParamObjects/DoubleMatParam.h\
     115                                        ./objects/ParamObjects/DoubleVecParam.cpp\
     116                                        ./objects/ParamObjects/DoubleVecParam.h\
     117                                        ./objects/ParamObjects/PetscVecParam.cpp\
     118                                        ./objects/ParamObjects/PetscVecParam.h\
     119                                        ./objects/ParamObjects/StringParam.cpp\
     120                                        ./objects/ParamObjects/StringParam.h\
    104121                                        ./objects/NodeSets.cpp\
    105122                                        ./objects/NodeSets.h\
     
    476493                                        ./objects/Tria.h\
    477494                                        ./objects/Tria.cpp\
    478                                         ./objects/TriaVertexInput.h\
    479                                         ./objects/TriaVertexInput.cpp\
    480                                         ./objects/SingVertexInput.h\
    481                                         ./objects/SingVertexInput.cpp\
    482                                         ./objects/BeamVertexInput.h\
    483                                         ./objects/BeamVertexInput.cpp\
    484                                         ./objects/PentaVertexInput.h\
    485                                         ./objects/PentaVertexInput.cpp\
    486                                         ./objects/BoolInput.h\
    487                                         ./objects/BoolInput.cpp\
    488                                         ./objects/IntInput.h\
    489                                         ./objects/IntInput.cpp\
    490                                         ./objects/DoubleInput.h\
    491                                         ./objects/DoubleInput.cpp\
     495                                        ./objects/InputObjects/Input.h\
     496                                        ./objects/InputObjects/TriaVertexInput.h\
     497                                        ./objects/InputObjects/TriaVertexInput.cpp\
     498                                        ./objects/InputObjects/SingVertexInput.h\
     499                                        ./objects/InputObjects/SingVertexInput.cpp\
     500                                        ./objects/InputObjects/BeamVertexInput.h\
     501                                        ./objects/InputObjects/BeamVertexInput.cpp\
     502                                        ./objects/InputObjects/PentaVertexInput.h\
     503                                        ./objects/InputObjects/PentaVertexInput.cpp\
     504                                        ./objects/InputObjects/BoolInput.h\
     505                                        ./objects/InputObjects/BoolInput.cpp\
     506                                        ./objects/InputObjects/IntInput.h\
     507                                        ./objects/InputObjects/IntInput.cpp\
     508                                        ./objects/InputObjects/DoubleInput.h\
     509                                        ./objects/InputObjects/DoubleInput.cpp\
    492510                                        ./objects/Sing.h\
    493511                                        ./objects/Sing.cpp\
     
    500518                                        ./objects/Matpar.h\
    501519                                        ./objects/Matpar.cpp\
    502                                         ./objects/Input.h\
    503520                                        ./objects/Spc.cpp\
    504521                                        ./objects/Spc.h\
     
    515532                                        ./objects/Numericalflux.cpp\
    516533                                        ./objects/Numericalflux.h\
    517                                         ./objects/Param.cpp\
    518                                         ./objects/Param.h\
     534                                        ./objects/ParamObjects/Param.h\
     535                                        ./objects/ParamObjects/BoolParam.cpp\
     536                                        ./objects/ParamObjects/BoolParam.h\
     537                                        ./objects/ParamObjects/IntParam.cpp\
     538                                        ./objects/ParamObjects/IntParam.h\
     539                                        ./objects/ParamObjects/DoubleParam.cpp\
     540                                        ./objects/ParamObjects/DoubleParam.h\
     541                                        ./objects/ParamObjects/PetscMatParam.cpp\
     542                                        ./objects/ParamObjects/PetscMatParam.h\
     543                                        ./objects/ParamObjects/StringArrayParam.cpp\
     544                                        ./objects/ParamObjects/StringArrayParam.h\
     545                                        ./objects/ParamObjects/DoubleMatParam.cpp\
     546                                        ./objects/ParamObjects/DoubleMatParam.h\
     547                                        ./objects/ParamObjects/DoubleVecParam.cpp\
     548                                        ./objects/ParamObjects/DoubleVecParam.h\
     549                                        ./objects/ParamObjects/PetscVecParam.cpp\
     550                                        ./objects/ParamObjects/PetscVecParam.h\
     551                                        ./objects/ParamObjects/StringParam.cpp\
     552                                        ./objects/ParamObjects/StringParam.h\
    519553                                        ./objects/NodeSets.cpp\
    520554                                        ./objects/NodeSets.h\
  • issm/trunk/src/c/MassFluxx/MassFluxx.cpp

    r3446 r3673  
    1010#include "../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials,DataSet* parameters,  double* segments,int num_segments,double* ug){
     12void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials,Parameters* parameters,  double* segments,int num_segments,double* ug){
    1313
    1414        int i,j;
     
    3535                for(j=0;j<elements->Size();j++){
    3636                        element=(Element*)elements->GetObjectByOffset(j);
    37                         if (element->GetId()==element_id){
     37                        if (element->Id()==element_id){
    3838                                /*We found the element which owns this segment, use it to compute the mass flux: */
    3939                                mass_flux+=element->MassFlux(segments+5*i+0,ug);
  • issm/trunk/src/c/MassFluxx/MassFluxx.h

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

    r3502 r3673  
    1111#include "../SurfaceAreax/SurfaceAreax.h"
    1212
    13 void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials,DataSet* parameters,
    14                         ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
     13void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials,Parameters* parameters,
     14                        int analysis_type,int sub_analysis_type){
    1515       
    1616        /*Intermediary*/
     
    2727        parameters->Configure(elements,loads, nodes,vertices, materials,parameters);
    2828
    29         /*If fit=3, compute Surface Area*/
    30         if(!inputs->Recover("fit",&fit)) ISSMERROR(" missing fit input parameter");
    31         if (fit==3 && !inputs->IsPresent("surfacearea")){
     29        /*Compute surface area: */
     30        SurfaceAreax(&S,elements,nodes,vertices, loads,materials,parameters,analysis_type,sub_analysis_type);
    3231
    33                 SurfaceAreax(&S,elements,nodes,vertices, loads,materials,parameters,inputs,analysis_type,sub_analysis_type);
    34                 inputs->Add("surfacearea",S);
    35         }
     32        /*add surface area to elements :*/
     33        elements->AddInput(S,SurfaceAreaEnum);
     34       
    3635
    3736        /*Compute Misfit: */
    38         elements->Misfit(&J,inputs,analysis_type,sub_analysis_type);
     37        elements->Misfit(&J,analysis_type,sub_analysis_type);
    3938
    4039        /*Sum all J from all cpus of the cluster:*/
  • issm/trunk/src/c/Misfitx/Misfitx.h

    r3612 r3673  
    1010
    1111/* local prototypes: */
    12 void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,
     12void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,
    1313                        int analysis_type,int sub_analysis_type);
    1414
  • issm/trunk/src/c/ModelProcessorx/Balancedthickness/CreateParametersBalancedthickness.cpp

    r3633 r3673  
    99#include "../ModelProcessorx.h"
    1010
    11 void CreateParametersBalancedthickness(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
     11void CreateParametersBalancedthickness(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
    1212       
    1313        Param*   param = NULL;
    14         DataSet* parameters=NULL;
     14        Parameters* parameters=NULL;
    1515        int      count;
    1616        int      i;
     
    4444        xfree((void**)&u_g);
    4545
    46         /*Get melting: */
    47         IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
    48         if(iomodel->melting) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting[i]=iomodel->melting[i]/iomodel->yts;
     46        /*Get melting_rate: */
     47        IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate");
     48        if(iomodel->melting_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting_rate[i]=iomodel->melting_rate[i]/iomodel->yts;
    4949       
    5050        count++;
    5151        param= new Param(count,"m_g",DOUBLEVEC);
    52         if(iomodel->melting) param->SetDoubleVec(iomodel->melting,iomodel->numberofvertices,1);
    53         else param->SetDoubleVec(iomodel->melting,0,1);
     52        if(iomodel->melting_rate) param->SetDoubleVec(iomodel->melting_rate,iomodel->numberofvertices,1);
     53        else param->SetDoubleVec(iomodel->melting_rate,0,1);
    5454        parameters->AddObject(param);
    5555
    56         /*Free melting: */
    57         xfree((void**)&iomodel->melting);
     56        /*Free melting_rate: */
     57        xfree((void**)&iomodel->melting_rate);
    5858
    59         /*Get accumulation: */
    60         IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
    61         if(iomodel->accumulation) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation[i]=iomodel->accumulation[i]/iomodel->yts;
     59        /*Get accumulation_rate: */
     60        IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate");
     61        if(iomodel->accumulation_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation_rate[i]=iomodel->accumulation_rate[i]/iomodel->yts;
    6262       
    6363        count++;
    6464        param= new Param(count,"a_g",DOUBLEVEC);
    65         if(iomodel->accumulation) param->SetDoubleVec(iomodel->accumulation,iomodel->numberofvertices,1);
    66         else param->SetDoubleVec(iomodel->accumulation,0,0);
     65        if(iomodel->accumulation_rate) param->SetDoubleVec(iomodel->accumulation_rate,iomodel->numberofvertices,1);
     66        else param->SetDoubleVec(iomodel->accumulation_rate,0,0);
    6767        parameters->AddObject(param);
    6868
    69         /*Free accumulation: */
    70         xfree((void**)&iomodel->accumulation);
     69        /*Free accumulation_rate: */
     70        xfree((void**)&iomodel->accumulation_rate);
    7171
    7272        /*Assign output pointer: */
  • issm/trunk/src/c/ModelProcessorx/Balancedthickness2/CreateLoadsBalancedthickness2.cpp

    r3633 r3673  
    1414
    1515        /*Intermediary*/
    16         int i,j;
    17         int i1,i2;
    18         int pos1,pos2;
    19         double e1,e2;
     16        int i;
    2017
    2118        /*Output*/
    2219        DataSet* loads=NULL;
    23 
    24         /*numericalflux intermediary data: */
    25         char numericalflux_type[NUMERICALFLUXSTRING];
    26         int  numericalflux_id;
    27         int  numericalflux_node_ids[MAX_NUMERICALFLUX_NODES];
    28         int  numericalflux_elem_id;
    29         double numericalflux_h[MAX_NUMERICALFLUX_NODES];
    3020
    3121        /*Create loads: */
     
    3929        /*First load data:*/
    4030        for (i=0;i<iomodel->numberofedges;i++){
    41 
    42                 /*Get left and right elements*/
    43                 e1=iomodel->edges[4*i+2]-1; //edges are [node1 node2 elem1 elem2]
    44                 e2=iomodel->edges[4*i+3]-1; //edges are [node1 node2 elem1 elem2]
    45 
    46                 /*Now, if this element is not in the partition, pass: */
    47                 if(!iomodel->my_elements[(int)e1]) continue;
    48 
    49                 /*Create load*/
    50                 numericalflux_id=i+1; //Matlab indexing
    51                 numericalflux_elem_id=(int)e1+1;//id is in matlab index
    52 
    53                 /*1: Get vertices ids*/
    54                 i1=(int)iomodel->edges[4*i+0];
    55                 i2=(int)iomodel->edges[4*i+1];
    56 
    57                 if (!isnan(e2)){
    58                         strcpy(numericalflux_type,"internal");
    59 
    60                         /*Now, we must get the nodes of the 4 nodes located on the edge*/
    61 
    62                         /*2: Get the column where these ids are located in the index*/
    63                         pos1=pos2=UNDEF;
    64                         for(j=0;j<3;j++){
    65                                 if (iomodel->elements[3*(int)e1+j]==i1) pos1=j+1;
    66                                 if (iomodel->elements[3*(int)e2+j]==i1) pos2=j+1;
    67                         }
    68                         ISSMASSERT(pos1!=UNDEF && pos2!=UNDEF);
    69 
    70                         /*3: We have the id of the elements and the position of the vertices in the index
    71                          * we can compute their dofs!*/
    72                         numericalflux_node_ids[0]=3*(int)e1+pos1;       //ex: 1 2 3
    73                         numericalflux_node_ids[1]=3*(int)e1+(pos1%3)+1; //ex: 2 3 1
    74                         numericalflux_node_ids[2]=3*(int)e2+pos2;           //ex: 1 2 3
    75                         numericalflux_node_ids[3]=3*(int)e2+((pos2+1)%3)+1; //ex: 3 1 2
    76 
    77                         numericalflux_h[0]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[0]-1] -1];
    78                         numericalflux_h[1]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[1]-1]-1];
    79                         numericalflux_h[2]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[2]-1]-1];
    80                         numericalflux_h[3]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[3]-1]-1];
    81                 }
    82                 else{
    83                         strcpy(numericalflux_type,"boundary");
    84 
    85                         /*2: Get the column where these ids are located in the index*/
    86                         pos1==UNDEF;
    87                         for(j=0;j<3;j++){
    88                                 if (iomodel->elements[3*(int)e1+j]==i1) pos1=j+1;
    89                         }
    90                         ISSMASSERT(pos1!=UNDEF);
    91 
    92                         /*3: We have the id of the elements and the position of the vertices in the index
    93                          * we can compute their dofs!*/
    94                         numericalflux_node_ids[0]=3*(int)e1+pos1;
    95                         numericalflux_node_ids[1]=3*(int)e1+(pos1%3)+1;
    96 
    97                         numericalflux_h[0]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[0]-1]-1];
    98                         numericalflux_h[1]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[1]-1]-1];
    99                         numericalflux_h[2]=UNDEF;
    100                         numericalflux_h[3]=UNDEF;
    101                 }
    102 
    103                 loads->AddObject(new Numericalflux(numericalflux_id,numericalflux_type,numericalflux_node_ids,numericalflux_elem_id,numericalflux_h));
     31                loads->AddObject(new Numericalflux(i+1,i,iomodel));
    10432        }
    10533
  • issm/trunk/src/c/ModelProcessorx/Balancedthickness2/CreateParametersBalancedthickness2.cpp

    r3633 r3673  
    1010#include "../ModelProcessorx.h"
    1111
    12 void CreateParametersBalancedthickness2(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
     12void CreateParametersBalancedthickness2(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
    1313       
    1414        Param*   param = NULL;
    15         DataSet* parameters=NULL;
     15        Parameters* parameters=NULL;
    1616        int      count;
    1717        int      i;
     
    7474        xfree((void**)&iomodel->dhdt);
    7575
    76         /*Get melting: */
    77         IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
    78         if(iomodel->melting) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting[i]=iomodel->melting[i]/iomodel->yts;
     76        /*Get melting_rate: */
     77        IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate");
     78        if(iomodel->melting_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting_rate[i]=iomodel->melting_rate[i]/iomodel->yts;
    7979       
    8080        count++;
    8181        param= new Param(count,"m_g",DOUBLEVEC);
    82         if(iomodel->melting) param->SetDoubleVec(iomodel->melting,iomodel->numberofvertices,1);
    83         else param->SetDoubleVec(iomodel->melting,0,1);
     82        if(iomodel->melting_rate) param->SetDoubleVec(iomodel->melting_rate,iomodel->numberofvertices,1);
     83        else param->SetDoubleVec(iomodel->melting_rate,0,1);
    8484        parameters->AddObject(param);
    8585
    86         /*Free melting: */
    87         xfree((void**)&iomodel->melting);
     86        /*Free melting_rate: */
     87        xfree((void**)&iomodel->melting_rate);
    8888
    89         /*Get accumulation: */
    90         IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
    91         if(iomodel->accumulation) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation[i]=iomodel->accumulation[i]/iomodel->yts;
     89        /*Get accumulation_rate: */
     90        IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate");
     91        if(iomodel->accumulation_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation_rate[i]=iomodel->accumulation_rate[i]/iomodel->yts;
    9292       
    9393        count++;
    9494        param= new Param(count,"a_g",DOUBLEVEC);
    95         if(iomodel->accumulation) param->SetDoubleVec(iomodel->accumulation,iomodel->numberofvertices,1);
    96         else param->SetDoubleVec(iomodel->accumulation,0,0);
     95        if(iomodel->accumulation_rate) param->SetDoubleVec(iomodel->accumulation_rate,iomodel->numberofvertices,1);
     96        else param->SetDoubleVec(iomodel->accumulation_rate,0,0);
    9797        parameters->AddObject(param);
    9898
    99         /*Free accumulation: */
    100         xfree((void**)&iomodel->accumulation);
     99        /*Free accumulation_rate: */
     100        xfree((void**)&iomodel->accumulation_rate);
    101101
    102102        /*Assign output pointer: */
  • issm/trunk/src/c/ModelProcessorx/Balancedvelocities/CreateParametersBalancedvelocities.cpp

    r3633 r3673  
    1010#include "../ModelProcessorx.h"
    1111
    12 void CreateParametersBalancedvelocities(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
     12void CreateParametersBalancedvelocities(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
    1313       
    1414        Param*   param = NULL;
    15         DataSet* parameters=NULL;
     15        Parameters* parameters=NULL;
    1616        int      count;
    1717        int      i;
     
    5656        xfree((void**)&iomodel->thickness);
    5757
    58         /*Get melting: */
    59         IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
    60         if(iomodel->melting) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting[i]=iomodel->melting[i]/iomodel->yts;
     58        /*Get melting_rate: */
     59        IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate");
     60        if(iomodel->melting_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting_rate[i]=iomodel->melting_rate[i]/iomodel->yts;
    6161       
    6262        count++;
    6363        param= new Param(count,"m_g",DOUBLEVEC);
    64         if(iomodel->melting) param->SetDoubleVec(iomodel->melting,iomodel->numberofvertices,1);
    65         else param->SetDoubleVec(iomodel->melting,0,1);
     64        if(iomodel->melting_rate) param->SetDoubleVec(iomodel->melting_rate,iomodel->numberofvertices,1);
     65        else param->SetDoubleVec(iomodel->melting_rate,0,1);
    6666        parameters->AddObject(param);
    6767
    68         /*Free melting: */
    69         xfree((void**)&iomodel->melting);
     68        /*Free melting_rate: */
     69        xfree((void**)&iomodel->melting_rate);
    7070
    71         /*Get accumulation: */
    72         IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
    73         if(iomodel->accumulation) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation[i]=iomodel->accumulation[i]/iomodel->yts;
     71        /*Get accumulation_rate: */
     72        IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate");
     73        if(iomodel->accumulation_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation_rate[i]=iomodel->accumulation_rate[i]/iomodel->yts;
    7474       
    7575        count++;
    7676        param= new Param(count,"a_g",DOUBLEVEC);
    77         if(iomodel->accumulation) param->SetDoubleVec(iomodel->accumulation,iomodel->numberofvertices,1);
    78         else param->SetDoubleVec(iomodel->accumulation,0,0);
     77        if(iomodel->accumulation_rate) param->SetDoubleVec(iomodel->accumulation_rate,iomodel->numberofvertices,1);
     78        else param->SetDoubleVec(iomodel->accumulation_rate,0,0);
    7979        parameters->AddObject(param);
    8080
    81         /*Free accumulation: */
    82         xfree((void**)&iomodel->accumulation);
     81        /*Free accumulation_rate: */
     82        xfree((void**)&iomodel->accumulation_rate);
    8383
    8484
  • issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp

    r3633 r3673  
    1111#include "../ModelProcessorx.h"
    1212
    13 void CreateParametersControl(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
     13void CreateParametersControl(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
    1414       
    1515        int i;
    1616       
    17         DataSet* parameters=NULL;
     17        Parameters* parameters=NULL;
    1818        Param*   param = NULL;
    1919        int      count;
  • issm/trunk/src/c/ModelProcessorx/CreateDataSets.cpp

    r3621 r3673  
    1313#include "../include/macros.h"
    1414#include "../EnumDefinitions/EnumDefinitions.h"
     15#include "./ModelProcessorx/ModelProcessorx.h"
    1516
    1617
  • issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp

    r3621 r3673  
    1111#include "./IoModel.h"
    1212
    13 void CreateParameters(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
     13void CreateParameters(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
    1414       
    1515        int i;
    1616       
    17         DataSet* parameters = NULL;
     17        Parameters* parameters = NULL;
    1818        Param*   param = NULL;
    19         Numpar*  numpar=NULL;
    2019        int      count=0;
    2120        int      numberofdofspernode;
     
    3029
    3130        /*Initialize dataset: */
    32         parameters   = new DataSet(ParametersEnum);
     31        parameters   = new Parameters(ParametersEnum);
    3332
    3433        //outputfilename
     
    3736        param->SetString(iomodel->outputfilename);
    3837        parameters->AddObject(param);
     38   
    3939
    4040        //dimension 2d or 3d:
  • issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateParametersDiagnosticHoriz.cpp

    r3633 r3673  
    1010#include "../ModelProcessorx.h"
    1111
    12 void CreateParametersDiagnosticHoriz(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
     12void CreateParametersDiagnosticHoriz(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
    1313       
    1414        Param*   param = NULL;
    15         DataSet* parameters=NULL;
     15        Parameters* parameters=NULL;
    1616        int      count;
    1717        int i;
  • issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateElementsNodesAndMaterialsDiagnosticHutter.cpp

    r3633 r3673  
    4646        IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
    4747        IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids");
    48         IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
    49         IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
    50         IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
     48        IoModelFetchData(&iomodel->drag_coefficient,NULL,NULL,iomodel_handle,"drag_coefficient");
     49        IoModelFetchData(&iomodel->rheology_B,NULL,NULL,iomodel_handle,"rheology_B");
     50        IoModelFetchData(&iomodel->rheology_n,NULL,NULL,iomodel_handle,"rheology_n");
    5151
    5252        /*2d mesh: */
     
    9797        xfree((void**)&iomodel->gridonsurface);
    9898        xfree((void**)&iomodel->uppernodes);
    99         xfree((void**)&iomodel->drag);
    100         xfree((void**)&iomodel->B);
    101         xfree((void**)&iomodel->n);
     99        xfree((void**)&iomodel->drag_coefficient);
     100        xfree((void**)&iomodel->rheology_B);
     101        xfree((void**)&iomodel->rheology_n);
    102102
    103103        /*Add new constrant material property to materials, at the end: */
     
    108108                materials->AddObject(new Matpar(iomodel->numberofvertices2d*(iomodel->numlayers-1)+1,iomodel)); //put it at the end of the materials
    109109        }
    110 }
    111110               
    112111        /*First fetch data: */
  • issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp

    r3633 r3673  
    4343        IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
    4444        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
    45         IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
    46         IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p");
    47         IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q");
     45        IoModelFetchData(&iomodel->drag_coefficient,NULL,NULL,iomodel_handle,"drag_coefficient");
     46        IoModelFetchData(&iomodel->drag_p,NULL,NULL,iomodel_handle,"drag_p");
     47        IoModelFetchData(&iomodel->drag_q,NULL,NULL,iomodel_handle,"drag_q");
    4848        IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
    4949        IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
    5050        IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
    5151        IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
    52         IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
    53         IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
    54         IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
    55         IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
     52        IoModelFetchData(&iomodel->rheology_B,NULL,NULL,iomodel_handle,"rheology_B");
     53        IoModelFetchData(&iomodel->rheology_n,NULL,NULL,iomodel_handle,"rheology_n");
     54        IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate");
     55        IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate");
    5656        IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
    5757
     
    7777        xfree((void**)&iomodel->surface);
    7878        xfree((void**)&iomodel->bed);
    79         xfree((void**)&iomodel->drag);
    80         xfree((void**)&iomodel->p);
    81         xfree((void**)&iomodel->q);
     79        xfree((void**)&iomodel->drag_coefficient);
     80        xfree((void**)&iomodel->drag_p);
     81        xfree((void**)&iomodel->drag_q);
    8282        xfree((void**)&iomodel->elementoniceshelf);
    8383        xfree((void**)&iomodel->elementonbed);
    8484        xfree((void**)&iomodel->elementonsurface);
    8585        xfree((void**)&iomodel->elements_type);
    86         xfree((void**)&iomodel->n);
    87         xfree((void**)&iomodel->B);
    88         xfree((void**)&iomodel->accumulation);
    89         xfree((void**)&iomodel->melting);
     86        xfree((void**)&iomodel->rheology_n);
     87        xfree((void**)&iomodel->rheology_B);
     88        xfree((void**)&iomodel->accumulation_rate);
     89        xfree((void**)&iomodel->melting_rate);
    9090        xfree((void**)&iomodel->elementonwater);
    9191
  • issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateLoadsDiagnosticStokes.cpp

    r3636 r3673  
    5353
    5454                /*Create and  add load: */
    55                 loads->AddObject(new Icefront(i,iomodel));
     55                loads->AddObject(new Icefront(counter,i,iomodel));
    5656                counter++;
    5757
     
    6868        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
    6969        IoModelFetchData(&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes");
    70         iomodel->CreateSingleNodeToElementConnectivity;
     70        iomodel->CreateSingleNodeToElementConnectivity();
    7171       
    7272        for (i=0;i<iomodel->numberofvertices;i++){
  • issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateElementsNodesAndMaterialsDiagnosticVert.cpp

    r3633 r3673  
    4545        IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
    4646        IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
    47         IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
    48         IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
     47        IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate");
     48        IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate");
    4949        IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
    5050       
     
    7272        xfree((void**)&iomodel->elementonsurface);
    7373        xfree((void**)&iomodel->elements_type);
    74         xfree((void**)&iomodel->melting);
    75         xfree((void**)&iomodel->accumulation);
     74        xfree((void**)&iomodel->melting_rate);
     75        xfree((void**)&iomodel->accumulation_rate);
    7676        xfree((void**)&iomodel->elementonwater);
    7777
  • issm/trunk/src/c/ModelProcessorx/IoModel.cpp

    r3633 r3673  
    3636
    3737        #ifdef _PARALLEL_
    38         xfree((void**)&iomodel->x);
    39         xfree((void**)&iomodel->y);
    40         xfree((void**)&iomodel->z);
    41         xfree((void**)&iomodel->elements);
    42         xfree((void**)&iomodel->elements_type);
    43         xfree((void**)&iomodel->gridonhutter);
    44         xfree((void**)&iomodel->gridonmacayeal);
    45         if (strcmp(iomodel->meshtype,"3d")==0){
    46                 xfree((void**)&iomodel->elements2d);
    47                 xfree((void**)&iomodel->deadgrids);
    48                 xfree((void**)&iomodel->uppernodes);
    49                 xfree((void**)&iomodel->gridonpattyn);
     38        xfree((void**)&this->x);
     39        xfree((void**)&this->y);
     40        xfree((void**)&this->z);
     41        xfree((void**)&this->elements);
     42        xfree((void**)&this->elements_type);
     43        xfree((void**)&this->gridonhutter);
     44        xfree((void**)&this->gridonmacayeal);
     45        if (strcmp(this->meshtype,"3d")==0){
     46                xfree((void**)&this->elements2d);
     47                xfree((void**)&this->deadgrids);
     48                xfree((void**)&this->uppernodes);
     49                xfree((void**)&this->gridonpattyn);
    5050        }
    51         xfree((void**)&iomodel->solverstring);
    52         xfree((void**)&iomodel->elementonbed);
    53         xfree((void**)&iomodel->elementonsurface);
    54         xfree((void**)&iomodel->gridonbed);
    55         xfree((void**)&iomodel->gridonsurface);
    56         xfree((void**)&iomodel->gridonstokes);
    57         xfree((void**)&iomodel->borderstokes);
    58         xfree((void**)&iomodel->thickness);
    59         xfree((void**)&iomodel->surface);
    60         xfree((void**)&iomodel->bed);
    61         xfree((void**)&iomodel->vx_obs);
    62         xfree((void**)&iomodel->vy_obs);
    63         xfree((void**)&iomodel->vx);
    64         xfree((void**)&iomodel->vy);
    65         xfree((void**)&iomodel->vz);
    66         xfree((void**)&iomodel->pressure);
    67         xfree((void**)&iomodel->temperature);
    68         xfree((void**)&iomodel->drag_coefficient);
    69         xfree((void**)&iomodel->drag_p);
    70         xfree((void**)&iomodel->drag_q);
    71         xfree((void**)&iomodel->elementoniceshelf);
    72         xfree((void**)&iomodel->elementonwater);
    73         xfree((void**)&iomodel->gridonicesheet);
    74         xfree((void**)&iomodel->gridoniceshelf);
    75         xfree((void**)&iomodel->pressureload);
    76         xfree((void**)&iomodel->spcvelocity);
    77         xfree((void**)&iomodel->spcthickness);
    78         xfree((void**)&iomodel->spctemperature);
    79         xfree((void**)&iomodel->edges);
    80         xfree((void**)&iomodel->geothermalflux);
    81         xfree((void**)&iomodel->melting_rate);
    82         xfree((void**)&iomodel->accumulation_rate);
    83         xfree((void**)&iomodel->dhdt);
    84         xfree((void**)&iomodel->rheology_B);
    85         xfree((void**)&iomodel->rheology_n);
    86         xfree((void**)&iomodel->fit);
    87         xfree((void**)&iomodel->weights);
    88         xfree((void**)&iomodel->cm_jump);
    89         xfree((void**)&iomodel->optscal);
    90         xfree((void**)&iomodel->maxiter);
     51        xfree((void**)&this->solverstring);
     52        xfree((void**)&this->elementonbed);
     53        xfree((void**)&this->elementonsurface);
     54        xfree((void**)&this->gridonbed);
     55        xfree((void**)&this->gridonsurface);
     56        xfree((void**)&this->gridonstokes);
     57        xfree((void**)&this->borderstokes);
     58        xfree((void**)&this->thickness);
     59        xfree((void**)&this->surface);
     60        xfree((void**)&this->bed);
     61        xfree((void**)&this->vx_obs);
     62        xfree((void**)&this->vy_obs);
     63        xfree((void**)&this->vx);
     64        xfree((void**)&this->vy);
     65        xfree((void**)&this->vz);
     66        xfree((void**)&this->pressure);
     67        xfree((void**)&this->temperature);
     68        xfree((void**)&this->drag_coefficient);
     69        xfree((void**)&this->drag_p);
     70        xfree((void**)&this->drag_q);
     71        xfree((void**)&this->elementoniceshelf);
     72        xfree((void**)&this->elementonwater);
     73        xfree((void**)&this->gridonicesheet);
     74        xfree((void**)&this->gridoniceshelf);
     75        xfree((void**)&this->pressureload);
     76        xfree((void**)&this->spcvelocity);
     77        xfree((void**)&this->spcthickness);
     78        xfree((void**)&this->spctemperature);
     79        xfree((void**)&this->edges);
     80        xfree((void**)&this->geothermalflux);
     81        xfree((void**)&this->melting_rate);
     82        xfree((void**)&this->accumulation_rate);
     83        xfree((void**)&this->dhdt);
     84        xfree((void**)&this->rheology_B);
     85        xfree((void**)&this->rheology_n);
     86        xfree((void**)&this->fit);
     87        xfree((void**)&this->weights);
     88        xfree((void**)&this->cm_jump);
     89        xfree((void**)&this->optscal);
     90        xfree((void**)&this->maxiter);
    9191
    9292
    9393        /*!Delete structure fields: */
    94         xfree((void**)&iomodel->inputfilename);
    95         xfree((void**)&iomodel->outputfilename);
    96         xfree((void**)&iomodel->repository);
    97         xfree((void**)&iomodel->meshtype);
    98         xfree((void**)&iomodel->name);
    99        
    100         xfree((void**)&iomodel->riftinfo);
    101        
    102         xfree((void**)&iomodel->penalties);
    103         xfree((void**)&iomodel->penaltypartitioning);
    104        
    105         xfree((void**)&iomodel->control_type);
     94        xfree((void**)&this->inputfilename);
     95        xfree((void**)&this->outputfilename);
     96        xfree((void**)&this->repository);
     97        xfree((void**)&this->meshtype);
     98        xfree((void**)&this->name);
     99       
     100        xfree((void**)&this->riftinfo);
     101       
     102        xfree((void**)&this->penalties);
     103        xfree((void**)&this->penaltypartitioning);
     104       
     105        xfree((void**)&this->control_type);
    106106       
    107107        /*exterior data: */
    108         xfree((void**)&iomodel->my_elements);
    109         xfree((void**)&iomodel->my_vertices);
    110         xfree((void**)&iomodel->my_nodes);
    111         xfree((void**)&iomodel->my_bordervertices);
    112         xfree((void**)&iomodel->penaltypartitioning);
     108        xfree((void**)&this->my_elements);
     109        xfree((void**)&this->my_vertices);
     110        xfree((void**)&this->my_nodes);
     111        xfree((void**)&this->my_bordervertices);
     112        xfree((void**)&this->penaltypartitioning);
    113113        #endif
    114114}
     
    124124        /*Get all the data that consists of scalars, integers and strings: */
    125125
    126         IoModelFetchData(&iomodel->name,iomodel_handle,"name");
    127         IoModelFetchData(&iomodel->inputfilename,iomodel_handle,"inputfilename");
    128         IoModelFetchData(&iomodel->outputfilename,iomodel_handle,"outputfilename");
    129         IoModelFetchData(&iomodel->analysis_type,iomodel_handle,"analysis_type");
    130         IoModelFetchData(&iomodel->sub_analysis_type,iomodel_handle,"sub_analysis_type");
    131         IoModelFetchData(&iomodel->qmu_analysis,iomodel_handle,"qmu_analysis");
    132         IoModelFetchData(&iomodel->control_analysis,iomodel_handle,"control_analysis");
    133         IoModelFetchData(&iomodel->meshtype,iomodel_handle,"type");
     126        IoModelFetchData(&this->name,iomodel_handle,"name");
     127        IoModelFetchData(&this->inputfilename,iomodel_handle,"inputfilename");
     128        IoModelFetchData(&this->outputfilename,iomodel_handle,"outputfilename");
     129        IoModelFetchData(&this->analysis_type,iomodel_handle,"analysis_type");
     130        IoModelFetchData(&this->sub_analysis_type,iomodel_handle,"sub_analysis_type");
     131        IoModelFetchData(&this->qmu_analysis,iomodel_handle,"qmu_analysis");
     132        IoModelFetchData(&this->control_analysis,iomodel_handle,"control_analysis");
     133        IoModelFetchData(&this->meshtype,iomodel_handle,"type");
    134134        /*!Get numberofelements and numberofvertices: */
    135         IoModelFetchData(&iomodel->numberofvertices,iomodel_handle,"numberofgrids");
    136         IoModelFetchData(&iomodel->numberofelements,iomodel_handle,"numberofelements");
     135        IoModelFetchData(&this->numberofvertices,iomodel_handle,"numberofgrids");
     136        IoModelFetchData(&this->numberofelements,iomodel_handle,"numberofelements");
    137137        /*!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: */
    138         if (strcmp(iomodel->meshtype,"3d")==0){
     138        if (strcmp(this->meshtype,"3d")==0){
    139139       
    140140                /*!Deal with 2d mesh: */
    141                 IoModelFetchData(&iomodel->numberofelements2d,iomodel_handle,"numberofelements2d");
    142                 IoModelFetchData(&iomodel->numberofvertices2d,iomodel_handle,"numberofgrids2d");
    143                 IoModelFetchData(&iomodel->numlayers,iomodel_handle,"numlayers");
     141                IoModelFetchData(&this->numberofelements2d,iomodel_handle,"numberofelements2d");
     142                IoModelFetchData(&this->numberofvertices2d,iomodel_handle,"numberofgrids2d");
     143                IoModelFetchData(&this->numlayers,iomodel_handle,"numlayers");
    144144        }
    145145
    146146
    147147        /*elements type: */
    148         IoModelFetchData(&iomodel->ishutter,iomodel_handle,"ishutter");
    149         IoModelFetchData(&iomodel->ismacayealpattyn,iomodel_handle,"ismacayealpattyn");
    150         IoModelFetchData(&iomodel->isstokes,iomodel_handle,"isstokes");
     148        IoModelFetchData(&this->ishutter,iomodel_handle,"ishutter");
     149        IoModelFetchData(&this->ismacayealpattyn,iomodel_handle,"ismacayealpattyn");
     150        IoModelFetchData(&this->isstokes,iomodel_handle,"isstokes");
    151151
    152152        /*!Get drag_type, drag and p,q: */
    153         IoModelFetchData(&iomodel->drag_type,iomodel_handle,"drag_type");
     153        IoModelFetchData(&this->drag_type,iomodel_handle,"drag_type");
    154154
    155155        /*!Get materials: */
    156         IoModelFetchData(&iomodel->rho_water,iomodel_handle,"rho_water");
    157         IoModelFetchData(&iomodel->rho_ice,iomodel_handle,"rho_ice");
    158         IoModelFetchData(&iomodel->g,iomodel_handle,"g");
     156        IoModelFetchData(&this->rho_water,iomodel_handle,"rho_water");
     157        IoModelFetchData(&this->rho_ice,iomodel_handle,"rho_ice");
     158        IoModelFetchData(&this->g,iomodel_handle,"g");
    159159
    160160        /*Get control parameters: */
    161         IoModelFetchData(&iomodel->control_type,iomodel_handle,"control_type");
     161        IoModelFetchData(&this->control_type,iomodel_handle,"control_type");
    162162
    163163        /*!Get solution parameters: */
    164         IoModelFetchData(&iomodel->yts,iomodel_handle,"yts");
    165         IoModelFetchData(&iomodel->meanvel,iomodel_handle,"meanvel");
    166         IoModelFetchData(&iomodel->epsvel,iomodel_handle,"epsvel");
    167         IoModelFetchData(&iomodel->verbose,iomodel_handle,"verbose");
    168         IoModelFetchData(&iomodel->plot,iomodel_handle,"plot");
    169         IoModelFetchData(&iomodel->artificial_diffusivity,iomodel_handle,"artificial_diffusivity");
    170         IoModelFetchData(&iomodel->nsteps,iomodel_handle,"nsteps");
    171         IoModelFetchData(&iomodel->eps_cm,iomodel_handle,"eps_cm");
    172         IoModelFetchData(&iomodel->tolx,iomodel_handle,"tolx");
    173         IoModelFetchData(&iomodel->cm_noisedmp,iomodel_handle,"cm_noisedmp");
    174         IoModelFetchData(&iomodel->cm_mindmp_value,iomodel_handle,"cm_mindmp_value");
    175         IoModelFetchData(&iomodel->cm_mindmp_slope,iomodel_handle,"cm_mindmp_slope");
    176         IoModelFetchData(&iomodel->cm_maxdmp_value,iomodel_handle,"cm_maxdmp_value");
    177         IoModelFetchData(&iomodel->cm_maxdmp_slope,iomodel_handle,"cm_maxdmp_slope");
    178         IoModelFetchData(&iomodel->cm_min,iomodel_handle,"cm_min");
    179         IoModelFetchData(&iomodel->cm_max,iomodel_handle,"cm_max");
    180         IoModelFetchData(&iomodel->cm_gradient,iomodel_handle,"cm_gradient");
    181         IoModelFetchData(&iomodel->eps_res,iomodel_handle,"eps_res");
    182         IoModelFetchData(&iomodel->eps_rel,iomodel_handle,"eps_rel");
    183         IoModelFetchData(&iomodel->eps_abs,iomodel_handle,"eps_abs");
    184         IoModelFetchData(&iomodel->max_nonlinear_iterations,iomodel_handle,"max_nonlinear_iterations");
    185         IoModelFetchData(&iomodel->dt,iomodel_handle,"dt");
    186         IoModelFetchData(&iomodel->ndt,iomodel_handle,"ndt");
    187         IoModelFetchData(&iomodel->penalty_offset,iomodel_handle,"penalty_offset");
    188         IoModelFetchData(&iomodel->penalty_melting,iomodel_handle,"penalty_melting");
    189         IoModelFetchData(&iomodel->penalty_lock,iomodel_handle,"penalty_lock");
    190         IoModelFetchData(&iomodel->sparsity,iomodel_handle,"sparsity");
    191         IoModelFetchData(&iomodel->connectivity,iomodel_handle,"connectivity");
    192         IoModelFetchData(&iomodel->lowmem,iomodel_handle,"lowmem");
    193         IoModelFetchData(&iomodel->solverstring,iomodel_handle,"solverstring");
    194         IoModelFetchData(&iomodel->viscosity_overshoot,iomodel_handle,"viscosity_overshoot");
    195         IoModelFetchData(&iomodel->artdiff,iomodel_handle,"artificial_diffusivity");
    196         IoModelFetchData(&iomodel->stokesreconditioning,iomodel_handle,"stokesreconditioning");
    197         IoModelFetchData(&iomodel->waitonlock,iomodel_handle,"waitonlock");
     164        IoModelFetchData(&this->yts,iomodel_handle,"yts");
     165        IoModelFetchData(&this->meanvel,iomodel_handle,"meanvel");
     166        IoModelFetchData(&this->epsvel,iomodel_handle,"epsvel");
     167        IoModelFetchData(&this->verbose,iomodel_handle,"verbose");
     168        IoModelFetchData(&this->plot,iomodel_handle,"plot");
     169        IoModelFetchData(&this->artificial_diffusivity,iomodel_handle,"artificial_diffusivity");
     170        IoModelFetchData(&this->nsteps,iomodel_handle,"nsteps");
     171        IoModelFetchData(&this->eps_cm,iomodel_handle,"eps_cm");
     172        IoModelFetchData(&this->tolx,iomodel_handle,"tolx");
     173        IoModelFetchData(&this->cm_noisedmp,iomodel_handle,"cm_noisedmp");
     174        IoModelFetchData(&this->cm_mindmp_value,iomodel_handle,"cm_mindmp_value");
     175        IoModelFetchData(&this->cm_mindmp_slope,iomodel_handle,"cm_mindmp_slope");
     176        IoModelFetchData(&this->cm_maxdmp_value,iomodel_handle,"cm_maxdmp_value");
     177        IoModelFetchData(&this->cm_maxdmp_slope,iomodel_handle,"cm_maxdmp_slope");
     178        IoModelFetchData(&this->cm_min,iomodel_handle,"cm_min");
     179        IoModelFetchData(&this->cm_max,iomodel_handle,"cm_max");
     180        IoModelFetchData(&this->cm_gradient,iomodel_handle,"cm_gradient");
     181        IoModelFetchData(&this->eps_res,iomodel_handle,"eps_res");
     182        IoModelFetchData(&this->eps_rel,iomodel_handle,"eps_rel");
     183        IoModelFetchData(&this->eps_abs,iomodel_handle,"eps_abs");
     184        IoModelFetchData(&this->max_nonlinear_iterations,iomodel_handle,"max_nonlinear_iterations");
     185        IoModelFetchData(&this->dt,iomodel_handle,"dt");
     186        IoModelFetchData(&this->ndt,iomodel_handle,"ndt");
     187        IoModelFetchData(&this->penalty_offset,iomodel_handle,"penalty_offset");
     188        IoModelFetchData(&this->penalty_melting,iomodel_handle,"penalty_melting");
     189        IoModelFetchData(&this->penalty_lock,iomodel_handle,"penalty_lock");
     190        IoModelFetchData(&this->sparsity,iomodel_handle,"sparsity");
     191        IoModelFetchData(&this->connectivity,iomodel_handle,"connectivity");
     192        IoModelFetchData(&this->lowmem,iomodel_handle,"lowmem");
     193        IoModelFetchData(&this->solverstring,iomodel_handle,"solverstring");
     194        IoModelFetchData(&this->viscosity_overshoot,iomodel_handle,"viscosity_overshoot");
     195        IoModelFetchData(&this->artdiff,iomodel_handle,"artificial_diffusivity");
     196        IoModelFetchData(&this->stokesreconditioning,iomodel_handle,"stokesreconditioning");
     197        IoModelFetchData(&this->waitonlock,iomodel_handle,"waitonlock");
    198198
    199199        /*!Get thermal parameters: */
    200         IoModelFetchData(&iomodel->beta,iomodel_handle,"beta");
    201         IoModelFetchData(&iomodel->meltingpoint,iomodel_handle,"meltingpoint");
    202         IoModelFetchData(&iomodel->latentheat,iomodel_handle,"latentheat");
    203         IoModelFetchData(&iomodel->heatcapacity,iomodel_handle,"heatcapacity");
    204         IoModelFetchData(&iomodel->thermalconductivity,iomodel_handle,"thermalconductivity");
    205         IoModelFetchData(&iomodel->min_thermal_constraints,iomodel_handle,"min_thermal_constraints");
    206         IoModelFetchData(&iomodel->min_mechanical_constraints,iomodel_handle,"min_mechanical_constraints");
    207         IoModelFetchData(&iomodel->stabilize_constraints,iomodel_handle,"stabilize_constraints");
    208         IoModelFetchData(&iomodel->mixed_layer_capacity,iomodel_handle,"mixed_layer_capacity");
    209         IoModelFetchData(&iomodel->thermal_exchange_velocity,iomodel_handle,"thermal_exchange_velocity");
     200        IoModelFetchData(&this->beta,iomodel_handle,"beta");
     201        IoModelFetchData(&this->meltingpoint,iomodel_handle,"meltingpoint");
     202        IoModelFetchData(&this->latentheat,iomodel_handle,"latentheat");
     203        IoModelFetchData(&this->heatcapacity,iomodel_handle,"heatcapacity");
     204        IoModelFetchData(&this->thermalconductivity,iomodel_handle,"thermalconductivity");
     205        IoModelFetchData(&this->min_thermal_constraints,iomodel_handle,"min_thermal_constraints");
     206        IoModelFetchData(&this->min_mechanical_constraints,iomodel_handle,"min_mechanical_constraints");
     207        IoModelFetchData(&this->stabilize_constraints,iomodel_handle,"stabilize_constraints");
     208        IoModelFetchData(&this->mixed_layer_capacity,iomodel_handle,"mixed_layer_capacity");
     209        IoModelFetchData(&this->thermal_exchange_velocity,iomodel_handle,"thermal_exchange_velocity");
    210210       
    211211        /*qmu: */
    212         if(iomodel->qmu_analysis){
    213                 IoModelFetchData(&iomodel->numberofvariables,iomodel_handle,"numberofvariables");
    214                 IoModelFetchData(&iomodel->numberofresponses,iomodel_handle,"numberofresponses");
    215                 IoModelFetchData(&iomodel->qmu_npart,iomodel_handle,"npart");
     212        if(this->qmu_analysis){
     213                IoModelFetchData(&this->numberofvariables,iomodel_handle,"numberofvariables");
     214                IoModelFetchData(&this->numberofresponses,iomodel_handle,"numberofresponses");
     215                IoModelFetchData(&this->qmu_npart,iomodel_handle,"npart");
    216216        }
    217217       
    218218        /*parameter output : */
    219         IoModelFetchData(&iomodel->numoutput,iomodel_handle,"numoutput");
    220 
    221         /*Assign output pointers: */
    222         *piomodel=iomodel;
    223 
    224         return 1;
     219        IoModelFetchData(&this->numoutput,iomodel_handle,"numoutput");
    225220}
    226221/*}}}*/
     
    229224       
    230225        /*!initialize all pointers to 0: */
    231         iomodel->name=NULL;
    232         iomodel->inputfilename=NULL;
    233         iomodel->outputfilename=NULL;
    234         iomodel->repository=NULL;
    235         iomodel->meshtype=NULL;
    236         iomodel->analysis_type=0;
    237         iomodel->sub_analysis_type=0;
    238         iomodel->qmu_analysis=0;
    239         iomodel->control_analysis=0;
    240         iomodel->solverstring=NULL;
    241         iomodel->numberofresponses=0;
    242         iomodel->numberofvariables=0;
    243         iomodel->qmu_npart=0;
    244         iomodel->numberofelements=0;
    245         iomodel->numberofvertices=0;
    246         iomodel->x=NULL;
    247         iomodel->y=NULL;
    248         iomodel->z=NULL;
    249         iomodel->elements=NULL;
    250         iomodel->elements_type=NULL;
    251         iomodel->numberofvertices2d=0;
    252         iomodel->elements2d=NULL;
    253         iomodel->deadgrids=NULL;
    254         iomodel->numlayers=0;
    255         iomodel->uppernodes=NULL;
    256         iomodel->gridonhutter=NULL;
    257         iomodel->gridonmacayeal=NULL;
    258         iomodel->gridonpattyn=NULL;
    259        
    260         iomodel->vx_obs=NULL;
    261         iomodel->vy_obs=NULL;
    262         iomodel->vx=NULL;
    263         iomodel->vy=NULL;
    264         iomodel->vz=NULL;
    265         iomodel->pressure=NULL;
    266         iomodel->temperature=NULL;
    267         iomodel->melting=NULL;
    268         iomodel->geothermalflux=NULL;
    269         iomodel->elementonbed=NULL;
    270         iomodel->elementonsurface=NULL;
    271         iomodel->gridonbed=NULL;
    272         iomodel->gridonsurface=NULL;
    273         iomodel->gridonstokes=NULL;
    274         iomodel->borderstokes=NULL;
    275         iomodel->thickness=NULL;
    276         iomodel->surface=NULL;
    277         iomodel->bed=NULL;
    278         iomodel->elementoniceshelf=NULL;
    279         iomodel->elementonwater=NULL;
    280         iomodel->gridonicesheet=NULL;
    281         iomodel->gridoniceshelf=NULL;
    282 
    283         iomodel->drag_type=0;
    284         iomodel->drag_cofficient=NULL;
    285         iomodel->drag_p=NULL;
    286         iomodel->drag_q=NULL;
    287        
    288        
    289         iomodel->numberofpressureloads=0;
    290         iomodel->pressureload=NULL;
    291         iomodel-> spcvelocity=NULL;
    292         iomodel-> spctemperature=NULL;
    293         iomodel-> spcthickness=NULL;
    294         iomodel->numberofedges=0;
    295         iomodel->edges=NULL;
     226        this->name=NULL;
     227        this->inputfilename=NULL;
     228        this->outputfilename=NULL;
     229        this->repository=NULL;
     230        this->meshtype=NULL;
     231        this->analysis_type=0;
     232        this->sub_analysis_type=0;
     233        this->qmu_analysis=0;
     234        this->control_analysis=0;
     235        this->solverstring=NULL;
     236        this->numberofresponses=0;
     237        this->numberofvariables=0;
     238        this->qmu_npart=0;
     239        this->numberofelements=0;
     240        this->numberofvertices=0;
     241        this->x=NULL;
     242        this->y=NULL;
     243        this->z=NULL;
     244        this->elements=NULL;
     245        this->elements_type=NULL;
     246        this->numberofvertices2d=0;
     247        this->elements2d=NULL;
     248        this->deadgrids=NULL;
     249        this->numlayers=0;
     250        this->uppernodes=NULL;
     251        this->gridonhutter=NULL;
     252        this->gridonmacayeal=NULL;
     253        this->gridonpattyn=NULL;
     254       
     255        this->vx_obs=NULL;
     256        this->vy_obs=NULL;
     257        this->vx=NULL;
     258        this->vy=NULL;
     259        this->vz=NULL;
     260        this->pressure=NULL;
     261        this->temperature=NULL;
     262        this->melting_rate=NULL;
     263        this->geothermalflux=NULL;
     264        this->elementonbed=NULL;
     265        this->elementonsurface=NULL;
     266        this->gridonbed=NULL;
     267        this->gridonsurface=NULL;
     268        this->gridonstokes=NULL;
     269        this->borderstokes=NULL;
     270        this->thickness=NULL;
     271        this->surface=NULL;
     272        this->bed=NULL;
     273        this->elementoniceshelf=NULL;
     274        this->elementonwater=NULL;
     275        this->gridonicesheet=NULL;
     276        this->gridoniceshelf=NULL;
     277
     278        this->drag_type=0;
     279        this->drag_coefficient=NULL;
     280        this->drag_p=NULL;
     281        this->drag_q=NULL;
     282       
     283       
     284        this->numberofpressureloads=0;
     285        this->pressureload=NULL;
     286        this-> spcvelocity=NULL;
     287        this-> spctemperature=NULL;
     288        this-> spcthickness=NULL;
     289        this->numberofedges=0;
     290        this->edges=NULL;
    296291       
    297292        /*!materials: */
    298         iomodel->rho_water=0;
    299         iomodel->rho_ice=0;
    300         iomodel->g=0;
    301         iomodel->rheology_n=NULL;
    302         iomodel->rheology_B=NULL;
     293        this->rho_water=0;
     294        this->rho_ice=0;
     295        this->g=0;
     296        this->rheology_n=NULL;
     297        this->rheology_B=NULL;
    303298
    304299        /*!control methods: */
    305         iomodel->control_type=NULL;
     300        this->control_type=NULL;
    306301
    307302        /*!solution parameters: */
    308         iomodel->fit=NULL;
    309         iomodel->weights=NULL;
    310         iomodel->cm_jump=NULL;
    311         iomodel->meanvel=0;
    312         iomodel->epsvel=0;
    313         iomodel->artificial_diffusivity=0;
    314         iomodel->nsteps=0;
    315         iomodel->eps_cm=0;
    316         iomodel->tolx=0;
    317         iomodel->maxiter=NULL;
    318         iomodel->cm_noisedmp=0;
    319         iomodel->cm_mindmp_value=0;
    320         iomodel->cm_mindmp_slope=0;
    321         iomodel->cm_maxdmp_value=0;
    322         iomodel->cm_maxdmp_slope=0;
    323         iomodel->cm_min=0;
    324         iomodel->cm_max=0;
    325         iomodel->cm_gradient=0;
    326         iomodel->verbose=0;
    327         iomodel->plot=0;
    328         iomodel->eps_res=0;
    329         iomodel->eps_rel=0;
    330         iomodel->eps_abs=0;
    331         iomodel->max_nonlinear_iterations=0;
    332         iomodel->dt=0;
    333         iomodel->ndt=0;
    334         iomodel->penalty_offset=0;
    335         iomodel->penalty_melting=0;
    336         iomodel->penalty_lock=0;
    337         iomodel->sparsity=0;
    338         iomodel->connectivity=0;
    339         iomodel->lowmem=0;
    340         iomodel->optscal=NULL;
    341         iomodel->yts=0;
    342         iomodel->viscosity_overshoot=0;
    343         iomodel->artdiff=0;
    344         iomodel->stokesreconditioning=0;
    345         iomodel->waitonlock=0;
     303        this->fit=NULL;
     304        this->weights=NULL;
     305        this->cm_jump=NULL;
     306        this->meanvel=0;
     307        this->epsvel=0;
     308        this->artificial_diffusivity=0;
     309        this->nsteps=0;
     310        this->eps_cm=0;
     311        this->tolx=0;
     312        this->maxiter=NULL;
     313        this->cm_noisedmp=0;
     314        this->cm_mindmp_value=0;
     315        this->cm_mindmp_slope=0;
     316        this->cm_maxdmp_value=0;
     317        this->cm_maxdmp_slope=0;
     318        this->cm_min=0;
     319        this->cm_max=0;
     320        this->cm_gradient=0;
     321        this->verbose=0;
     322        this->plot=0;
     323        this->eps_res=0;
     324        this->eps_rel=0;
     325        this->eps_abs=0;
     326        this->max_nonlinear_iterations=0;
     327        this->dt=0;
     328        this->ndt=0;
     329        this->penalty_offset=0;
     330        this->penalty_melting=0;
     331        this->penalty_lock=0;
     332        this->sparsity=0;
     333        this->connectivity=0;
     334        this->lowmem=0;
     335        this->optscal=NULL;
     336        this->yts=0;
     337        this->viscosity_overshoot=0;
     338        this->artdiff=0;
     339        this->stokesreconditioning=0;
     340        this->waitonlock=0;
    346341
    347342        /*!thermal parameters: */
    348         iomodel->beta=0;
    349         iomodel->meltingpoint=0;
    350         iomodel->latentheat=0;
    351         iomodel->heatcapacity=0;
    352         iomodel->thermalconductivity=0;
    353         iomodel->min_thermal_constraints=0;
    354         iomodel->min_mechanical_constraints=0;
    355         iomodel->stabilize_constraints=0;
    356         iomodel->mixed_layer_capacity=0;
    357         iomodel->thermal_exchange_velocity=0;
    358 
    359        
    360         iomodel->numrifts=0;
    361         iomodel->riftinfo=NULL;
     343        this->beta=0;
     344        this->meltingpoint=0;
     345        this->latentheat=0;
     346        this->heatcapacity=0;
     347        this->thermalconductivity=0;
     348        this->min_thermal_constraints=0;
     349        this->min_mechanical_constraints=0;
     350        this->stabilize_constraints=0;
     351        this->mixed_layer_capacity=0;
     352        this->thermal_exchange_velocity=0;
     353
     354       
     355        this->numrifts=0;
     356        this->riftinfo=NULL;
    362357
    363358        /*!penalties: */
    364         iomodel->numpenalties=0;
    365         iomodel->penalties=NULL;
    366         iomodel->penaltypartitioning=NULL;
     359        this->numpenalties=0;
     360        this->penalties=NULL;
     361        this->penaltypartitioning=NULL;
    367362
    368363        /*!basal: */
    369         iomodel->accumulation_rate=NULL;
    370         iomodel->dhdt=NULL;
     364        this->accumulation_rate=NULL;
     365        this->dhdt=NULL;
    371366       
    372367        /*parameter output: */
    373         iomodel->numoutput=0;
     368        this->numoutput=0;
    374369
    375370        /*elements type: */
    376         iomodel->ishutter=0;
    377         iomodel->ismacayealpattyn=0;
    378         iomodel->isstokes=0;
     371        this->ishutter=0;
     372        this->ismacayealpattyn=0;
     373        this->isstokes=0;
    379374
    380375        /*exterior data: */
    381         iomodel->my_elements=NULL;
    382         iomodel->my_vertices=NULL;
    383         iomodel->my_nodes=NULL;
    384         iomodel->my_bordervertices=NULL;
    385         iomodel->penaltypartitioning=NULL;
     376        this->my_elements=NULL;
     377        this->my_vertices=NULL;
     378        this->my_nodes=NULL;
     379        this->my_bordervertices=NULL;
     380        this->penaltypartitioning=NULL;
    386381}
    387382/*}}}*/
     
    394389        int i,j;
    395390
    396         if(which_part==1 && my_rank==rank && (strcmp(iomodel->meshtype,"3d")==0)){
     391        if(which_part==1 && my_rank==rank && (strcmp(this->meshtype,"3d")==0)){
    397392                printf("IoModel penalties: \n");
    398                 printf("   number of penalties: %i\n",iomodel->numpenalties);
     393                printf("   number of penalties: %i\n",this->numpenalties);
    399394                printf("   grids: \n");
    400395
    401                 for(i=0;i<iomodel->numpenalties;i++){
    402                         for(j=0;j<iomodel->numlayers;j++){
    403                                 printf("%i ",(int)*(iomodel->penalties+iomodel->numlayers*i+j));
     396                for(i=0;i<this->numpenalties;i++){
     397                        for(j=0;j<this->numlayers;j++){
     398                                printf("%i ",(int)*(this->penalties+this->numlayers*i+j));
    404399                        }
    405400                        printf("\n");
     
    408403}
    409404/*}}}*/
     405/*FUNCTION IoModel::CreateSingleNodeToElementConnectivity(void){{{1*/
     406void IoModel::CreateSingleNodeToElementConnectivity(void){
     407
     408        ISSMERROR(" not supported yet!");
     409}
     410/*}}}*/
  • issm/trunk/src/c/ModelProcessorx/IoModel.h

    r3633 r3673  
    191191                void IoModelInit(void);
    192192                void Echo(int which_part,int rank);
     193                void CreateSingleNodeToElementConnectivity(void);
    193194                /*}}}*/
    194195
  • issm/trunk/src/c/ModelProcessorx/Melting/CreateElementsNodesAndMaterialsMelting.cpp

    r3633 r3673  
    3737        IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
    3838        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
    39         IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
    40         IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p");
    41         IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q");
     39        IoModelFetchData(&iomodel->drag_coefficient,NULL,NULL,iomodel_handle,"drag_coefficient");
     40        IoModelFetchData(&iomodel->drag_p,NULL,NULL,iomodel_handle,"drag_p");
     41        IoModelFetchData(&iomodel->drag_q,NULL,NULL,iomodel_handle,"drag_q");
    4242        IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
    4343        IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
    4444        IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface");
    4545        IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
    46         IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
    47         IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
    48         IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
    49         IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
     46        IoModelFetchData(&iomodel->rheology_B,NULL,NULL,iomodel_handle,"rheology_B");
     47        IoModelFetchData(&iomodel->rheology_n,NULL,NULL,iomodel_handle,"rheology_n");
     48        IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate");
     49        IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate");
    5050        IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
    5151       
     
    6868        xfree((void**)&iomodel->surface);
    6969        xfree((void**)&iomodel->bed);
    70         xfree((void**)&iomodel->drag);
    71         xfree((void**)&iomodel->p);
    72         xfree((void**)&iomodel->q);
     70        xfree((void**)&iomodel->drag_coefficient);
     71        xfree((void**)&iomodel->drag_p);
     72        xfree((void**)&iomodel->drag_q);
    7373        xfree((void**)&iomodel->elementoniceshelf);
    7474        xfree((void**)&iomodel->elementonbed);
    7575        xfree((void**)&iomodel->elementonsurface);
    7676        xfree((void**)&iomodel->elements_type);
    77         xfree((void**)&iomodel->n);
    78         xfree((void**)&iomodel->B);
    79         xfree((void**)&iomodel->accumulation);
    80         xfree((void**)&iomodel->melting);
     77        xfree((void**)&iomodel->rheology_n);
     78        xfree((void**)&iomodel->rheology_B);
     79        xfree((void**)&iomodel->accumulation_rate);
     80        xfree((void**)&iomodel->melting_rate);
    8181        xfree((void**)&iomodel->elementonwater);
    8282
  • issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp

    r3633 r3673  
    2424        //create penalties for grids: no grid can have a temperature over the melting point
    2525        IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
    26         iomodel->CreateSingleNodeToElementConnectivity;
     26        iomodel->CreateSingleNodeToElementConnectivity();
    2727
    2828        for (i=0;i<iomodel->numberofvertices;i++){
  • issm/trunk/src/c/ModelProcessorx/Melting/CreateParametersMelting.cpp

    r3633 r3673  
    1010#include "../ModelProcessorx.h"
    1111
    12 void CreateParametersMelting(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
     12void CreateParametersMelting(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
    1313       
    1414        Param*   param = NULL;
    15         DataSet* parameters=NULL;
     15        Parameters* parameters=NULL;
    1616        int      count;
    1717        int i;
     
    2525        count=parameters->Size();
    2626
    27         /* get initial melting if transient*/
     27        /* get initial melting_rate if transient*/
    2828        if(iomodel->dt){
    2929
    30                 /*Get melting: */
    31                 IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
    32                 if(iomodel->melting) {
    33                         for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting[i]=iomodel->melting[i]/iomodel->yts;   //m/s instead of m/yr
     30                /*Get melting_rate: */
     31                IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate");
     32                if(iomodel->melting_rate) {
     33                        for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting_rate[i]=iomodel->melting_rate[i]/iomodel->yts;   //m/s instead of m/yr
    3434                }
    3535                else{
    36                         for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting[i]=0;
     36                        for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting_rate[i]=0;
    3737                }
    3838
    3939                count++;
    4040                param= new Param(count,"m_g",DOUBLEVEC);
    41                 if(iomodel->melting) param->SetDoubleVec(iomodel->melting,iomodel->numberofvertices);
    42                 else param->SetDoubleVec(iomodel->melting,0);
     41                if(iomodel->melting_rate) param->SetDoubleVec(iomodel->melting_rate,iomodel->numberofvertices);
     42                else param->SetDoubleVec(iomodel->melting_rate,0);
    4343                parameters->AddObject(param);
    4444
    45                 /*Free melting: */
    46                 xfree((void**)&iomodel->melting);
     45                /*Free melting_rate: */
     46                xfree((void**)&iomodel->melting_rate);
    4747        }
    4848
  • issm/trunk/src/c/ModelProcessorx/ModelProcessorx.h

    r3633 r3673  
    66#define _MODEL_PROCESSORX_H_
    77
    8 #include "./ModelProcessorx.h"
    9 
    108#define RIFTINFOSIZE 11
    119
    1210/*Creation of fem datasets: general drivers*/
    13 void  CreateDataSets(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads,Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
     11void  CreateDataSets(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads,Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
    1412       
    15 void  CreateParameters(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
     13void  CreateParameters(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
    1614
    1715
     
    1917
    2018/*diagnostic horizontal*/
    21 void    CreateElementsNodesAndMaterialsDiagnosticHoriz(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
     19void    CreateElementsNodesAndMaterialsDiagnosticHoriz(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
    2220void    CreateConstraintsDiagnosticHoriz(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
    2321void  CreateLoadsDiagnosticHoriz(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
    24 void  CreateParametersDiagnosticHoriz(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
     22void  CreateParametersDiagnosticHoriz(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
    2523
    2624/*diagnostic vertical*/
    27 void    CreateElementsNodesAndMaterialsDiagnosticVert(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
     25void    CreateElementsNodesAndMaterialsDiagnosticVert(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
    2826void    CreateConstraintsDiagnosticVert(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
    2927void  CreateLoadsDiagnosticVert(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
    3028
    3129/*diagnostic hutter*/
    32 void    CreateElementsNodesAndMaterialsDiagnosticHutter(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
     30void    CreateElementsNodesAndMaterialsDiagnosticHutter(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
    3331void    CreateConstraintsDiagnosticHutter(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
    3432void  CreateLoadsDiagnosticHutter(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
    3533
    3634/*diagnostic stokes*/
    37 void    CreateElementsNodesAndMaterialsDiagnosticStokes(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
     35void    CreateElementsNodesAndMaterialsDiagnosticStokes(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
    3836void    CreateConstraintsDiagnosticStokes(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
    3937void  CreateLoadsDiagnosticStokes(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
    4038
    4139/*slope compute*/
    42 void    CreateElementsNodesAndMaterialsSlopeCompute(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
     40void    CreateElementsNodesAndMaterialsSlopeCompute(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
    4341void    CreateConstraintsSlopeCompute(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
    4442void  CreateLoadsSlopeCompute(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
    4543
    4644/*control:*/
    47 void  CreateParametersControl(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
     45void  CreateParametersControl(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
    4846
    4947/*thermal:*/
    50 void    CreateElementsNodesAndMaterialsThermal(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
     48void    CreateElementsNodesAndMaterialsThermal(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
    5149void    CreateConstraintsThermal(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
    5250void  CreateLoadsThermal(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
    53 void  CreateParametersThermal(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
     51void  CreateParametersThermal(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
    5452
    5553/*melting:*/
    56 void    CreateElementsNodesAndMaterialsMelting(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
     54void    CreateElementsNodesAndMaterialsMelting(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
    5755void    CreateConstraintsMelting(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
    5856void  CreateLoadsMelting(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
    59 void  CreateParametersMelting(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
     57void  CreateParametersMelting(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
    6058
    6159/*prognostic:*/
    62 void    CreateElementsNodesAndMaterialsPrognostic(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
     60void    CreateElementsNodesAndMaterialsPrognostic(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
    6361void    CreateConstraintsPrognostic(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
    6462void  CreateLoadsPrognostic(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
    65 void  CreateParametersPrognostic(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
     63void  CreateParametersPrognostic(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
    6664
    6765/*prognostic2:*/
    68 void    CreateElementsNodesAndMaterialsPrognostic2(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
     66void    CreateElementsNodesAndMaterialsPrognostic2(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
    6967void    CreateConstraintsPrognostic2(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
    7068void  CreateLoadsPrognostic2(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
    71 void  CreateParametersPrognostic2(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
     69void  CreateParametersPrognostic2(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
    7270
    7371/*balancedthickness:*/
    74 void    CreateElementsNodesAndMaterialsBalancedthickness(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
     72void    CreateElementsNodesAndMaterialsBalancedthickness(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
    7573void    CreateConstraintsBalancedthickness(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
    7674void  CreateLoadsBalancedthickness(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
    77 void  CreateParametersBalancedthickness(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
     75void  CreateParametersBalancedthickness(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
     76
     77void    CreateElementsNodesAndMaterialsBalancedthickness2(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
     78void    CreateConstraintsBalancedthickness2(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
     79void  CreateLoadsBalancedthickness2(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
     80void  CreateParametersBalancedthickness2(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
     81
    7882
    7983/*balancedvelocities:*/
    80 void    CreateElementsNodesAndMaterialsBalancedvelocities(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
     84void    CreateElementsNodesAndMaterialsBalancedvelocities(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);
    8185void    CreateConstraintsBalancedvelocities(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle);
    8286void  CreateLoadsBalancedvelocities(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle);
    83 void  CreateParametersBalancedvelocities(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
     87void  CreateParametersBalancedvelocities(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
    8488
    8589/*qmu: */
    86 void CreateParametersQmu(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
     90void CreateParametersQmu(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);
     91
     92/*partitioning: */
     93void  Partitioning(bool** pmy_elements, bool** pmy_vertices, bool** pmy_nodes, bool** pmy_bordervertices, IoModel* iomodel, ConstDataHandle iomodel_handle);
    8794
    8895#endif
  • issm/trunk/src/c/ModelProcessorx/Partitioning.cpp

    r3595 r3673  
    1616#include "../include/typedefs.h"
    1717#include "../MeshPartitionx/MeshPartitionx.h"
     18#include "../ModelProcessorx/ModelProcessorx.h"
    1819
    1920void  DiscontinuousGalerkinPartitioning(bool** pmy_elements, bool** pmy_vertices, bool** pmy_nodes, bool** pmy_bordervertices, IoModel* iomodel, ConstDataHandle iomodel_handle);
  • issm/trunk/src/c/ModelProcessorx/Prognostic/CreateParametersPrognostic.cpp

    r3633 r3673  
    1111#include "../ModelProcessorx.h"
    1212
    13 void CreateParametersPrognostic(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
     13void CreateParametersPrognostic(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
    1414       
    1515        Param*   param = NULL;
    16         DataSet* parameters=NULL;
     16        Parameters* parameters=NULL;
    1717        int      count;
    1818        int      i;
     
    113113        xfree((void**)&iomodel->bed);
    114114
    115         /*Get melting: */
    116         IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
    117         if(iomodel->melting) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting[i]=iomodel->melting[i]/iomodel->yts;
     115        /*Get melting_rate: */
     116        IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate");
     117        if(iomodel->melting_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting_rate[i]=iomodel->melting_rate[i]/iomodel->yts;
    118118       
    119119        count++;
    120120        param= new Param(count,"m_g",DOUBLEVEC);
    121         if(iomodel->melting) param->SetDoubleVec(iomodel->melting,iomodel->numberofvertices,1);
    122         else param->SetDoubleVec(iomodel->melting,0,1);
     121        if(iomodel->melting_rate) param->SetDoubleVec(iomodel->melting_rate,iomodel->numberofvertices,1);
     122        else param->SetDoubleVec(iomodel->melting_rate,0,1);
    123123        parameters->AddObject(param);
    124124
    125         /*Free melting: */
    126         xfree((void**)&iomodel->melting);
     125        /*Free melting_rate: */
     126        xfree((void**)&iomodel->melting_rate);
    127127
    128         /*Get accumulation: */
    129         IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
    130         if(iomodel->accumulation) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation[i]=iomodel->accumulation[i]/iomodel->yts;
     128        /*Get accumulation_rate: */
     129        IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate");
     130        if(iomodel->accumulation_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation_rate[i]=iomodel->accumulation_rate[i]/iomodel->yts;
    131131       
    132132        count++;
    133133        param= new Param(count,"a_g",DOUBLEVEC);
    134         if(iomodel->accumulation) param->SetDoubleVec(iomodel->accumulation,iomodel->numberofvertices,1);
    135         else param->SetDoubleVec(iomodel->accumulation,0,0);
     134        if(iomodel->accumulation_rate) param->SetDoubleVec(iomodel->accumulation_rate,iomodel->numberofvertices,1);
     135        else param->SetDoubleVec(iomodel->accumulation_rate,0,0);
    136136        parameters->AddObject(param);
    137137
    138         /*Free accumulation: */
    139         xfree((void**)&iomodel->accumulation);
     138        /*Free accumulation_rate: */
     139        xfree((void**)&iomodel->accumulation_rate);
    140140
    141141        /*Assign output pointer: */
  • issm/trunk/src/c/ModelProcessorx/Prognostic2/CreateParametersPrognostic2.cpp

    r3633 r3673  
    1111#include "../ModelProcessorx.h"
    1212
    13 void CreateParametersPrognostic2(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
     13void CreateParametersPrognostic2(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
    1414       
    1515        Param*   param = NULL;
    16         DataSet* parameters=NULL;
     16        Parameters* parameters=NULL;
    1717        int      count;
    1818        int      i;
     
    8686        xfree((void**)&iomodel->bed);
    8787
    88         /*Get melting: */
    89         IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting");
    90         if(iomodel->melting) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting[i]=iomodel->melting[i]/iomodel->yts;
     88        /*Get melting_rate: */
     89        IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate");
     90        if(iomodel->melting_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting_rate[i]=iomodel->melting_rate[i]/iomodel->yts;
    9191       
    9292        count++;
    9393        param= new Param(count,"m_g",DOUBLEVEC);
    94         if(iomodel->melting) param->SetDoubleVec(iomodel->melting,iomodel->numberofvertices,1);
    95         else param->SetDoubleVec(iomodel->melting,0,1);
     94        if(iomodel->melting_rate) param->SetDoubleVec(iomodel->melting_rate,iomodel->numberofvertices,1);
     95        else param->SetDoubleVec(iomodel->melting_rate,0,1);
    9696        parameters->AddObject(param);
    9797
    98         /*Free melting: */
    99         xfree((void**)&iomodel->melting);
     98        /*Free melting_rate: */
     99        xfree((void**)&iomodel->melting_rate);
    100100
    101         /*Get accumulation: */
    102         IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation");
    103         if(iomodel->accumulation) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation[i]=iomodel->accumulation[i]/iomodel->yts;
     101        /*Get accumulation_rate: */
     102        IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate");
     103        if(iomodel->accumulation_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation_rate[i]=iomodel->accumulation_rate[i]/iomodel->yts;
    104104       
    105105        count++;
    106106        param= new Param(count,"a_g",DOUBLEVEC);
    107         if(iomodel->accumulation) param->SetDoubleVec(iomodel->accumulation,iomodel->numberofvertices,1);
    108         else param->SetDoubleVec(iomodel->accumulation,0,0);
     107        if(iomodel->accumulation_rate) param->SetDoubleVec(iomodel->accumulation_rate,iomodel->numberofvertices,1);
     108        else param->SetDoubleVec(iomodel->accumulation_rate,0,0);
    109109        parameters->AddObject(param);
    110110
    111         /*Free accumulation: */
    112         xfree((void**)&iomodel->accumulation);
     111        /*Free accumulation_rate: */
     112        xfree((void**)&iomodel->accumulation_rate);
    113113
    114114        /*Assign output pointer: */
  • issm/trunk/src/c/ModelProcessorx/Qmu/CreateParametersQmu.cpp

    r3633 r3673  
    1212#include "../ModelProcessorx.h"
    1313
    14 void CreateParametersQmu(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
     14void CreateParametersQmu(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
    1515       
    1616        int i,j,k;
    1717       
    18         DataSet* parameters = NULL;
     18        Parameters* parameters = NULL;
    1919        Param*   param = NULL;
    2020        int      count;
  • issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp

    r3633 r3673  
    3737        IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface");
    3838        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
    39         IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag");
    40         IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p");
    41         IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q");
     39        IoModelFetchData(&iomodel->drag_coefficient,NULL,NULL,iomodel_handle,"drag_coefficient");
     40        IoModelFetchData(&iomodel->drag_p,NULL,NULL,iomodel_handle,"drag_p");
     41        IoModelFetchData(&iomodel->drag_q,NULL,NULL,iomodel_handle,"drag_q");
    4242        IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf");
    4343        IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed");
     
    4545        IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type");
    4646        IoModelFetchData(&iomodel->geothermalflux,NULL,NULL,iomodel_handle,"geothermalflux");
    47         IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B");
    48         IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n");
     47        IoModelFetchData(&iomodel->rheology_B,NULL,NULL,iomodel_handle,"rheology_B");
     48        IoModelFetchData(&iomodel->rheology_n,NULL,NULL,iomodel_handle,"rheology_n");
    4949        IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater");
    5050       
     
    6565        xfree((void**)&iomodel->surface);
    6666        xfree((void**)&iomodel->bed);
    67         xfree((void**)&iomodel->drag);
    68         xfree((void**)&iomodel->p);
    69         xfree((void**)&iomodel->q);
     67        xfree((void**)&iomodel->drag_coefficient);
     68        xfree((void**)&iomodel->drag_p);
     69        xfree((void**)&iomodel->drag_q);
    7070        xfree((void**)&iomodel->elementoniceshelf);
    7171        xfree((void**)&iomodel->elementonbed);
     
    7373        xfree((void**)&iomodel->elements_type);
    7474        xfree((void**)&iomodel->geothermalflux);
    75         xfree((void**)&iomodel->n);
    76         xfree((void**)&iomodel->B);
     75        xfree((void**)&iomodel->rheology_n);
     76        xfree((void**)&iomodel->rheology_B);
    7777        xfree((void**)&iomodel->elementonwater);
    7878
  • issm/trunk/src/c/ModelProcessorx/Thermal/CreateLoadsThermal.cpp

    r3633 r3673  
    2525        //create penalties for grids: no grid can have a temperature over the melting point
    2626        IoModelFetchData(&iomodel->spctemperature,NULL,NULL,iomodel_handle,"spctemperature");
    27         iomodel->CreateSingleNodeToElementConnectivity;
     27        iomodel->CreateSingleNodeToElementConnectivity();
    2828
    2929        for (i=0;i<iomodel->numberofvertices;i++){
  • issm/trunk/src/c/ModelProcessorx/Thermal/CreateParametersThermal.cpp

    r3633 r3673  
    1111#include "../ModelProcessorx.h"
    1212
    13 void CreateParametersThermal(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
     13void CreateParametersThermal(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){
    1414       
    1515        Param*   param = NULL;
    16         DataSet* parameters=NULL;
     16        Parameters* parameters=NULL;
    1717        int      count;
    1818        int i;
  • issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.cpp

    r3503 r3673  
    1212
    1313void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes, DataSet* vertices,
    14                 DataSet* loads,DataSet* materials,  DataSet* parameters,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
     14                DataSet* loads,DataSet* materials,  Parameters* parameters,int analysis_type,int sub_analysis_type){
    1515
    1616        int i;
     
    3434         * management routine, otherwise, skip : */
    3535        if (RiftIsPresent(loads)){
    36                 RiftConstraints(&converged,&num_unstable_constraints,loads,inputs,min_mechanical_constraints,analysis_type,sub_analysis_type);
     36                RiftConstraints(&converged,&num_unstable_constraints,loads,min_mechanical_constraints,analysis_type,sub_analysis_type);
    3737        }
    3838        else if(loads->MeltingIsPresent()){
    39                 loads->MeltingConstraints(&converged,&num_unstable_constraints,inputs,analysis_type,sub_analysis_type);
     39                loads->MeltingConstraints(&converged,&num_unstable_constraints,analysis_type,sub_analysis_type);
    4040        }
    4141        else{
  • issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.h

    r3612 r3673  
    1111/* local prototypes: */
    1212void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes, DataSet* vertices,
    13                 DataSet* loads,DataSet* materials,  DataSet* parameters,int analysis_type,int sub_analysis_type);
     13                DataSet* loads,DataSet* materials,  Parameters* parameters,int analysis_type,int sub_analysis_type);
    1414
    1515#endif  /* _PENALTYCONSTRAINTSX_H */
  • issm/trunk/src/c/PenaltyConstraintsx/RiftConstraints.cpp

    r3595 r3673  
    1010#define _ZIGZAGCOUNTER_
    1111
    12 int RiftConstraints(int* pconverged, int* pnum_unstable_constraints,DataSet* loads,ParameterInputs* inputs,int min_mechanical_constraints,int analysis_type,int sub_analysis_type){
     12int RiftConstraints(int* pconverged, int* pnum_unstable_constraints,DataSet* loads,int min_mechanical_constraints,int analysis_type,int sub_analysis_type){
    1313
    1414        int num_unstable_constraints=0;
     
    1717        extern int my_rank;
    1818
    19         Constrain(&num_unstable_constraints,loads,inputs,analysis_type);
     19        Constrain(&num_unstable_constraints,loads,analysis_type);
    2020        if(num_unstable_constraints==0)converged=1;
    2121       
     
    2727        else if(num_unstable_constraints<=min_mechanical_constraints){
    2828                _printf_("   freezing constraints\n");
    29                 FreezeConstraints(loads,inputs,analysis_type);
     29                FreezeConstraints(loads,analysis_type);
    3030        }
    3131
     
    3535}
    3636
    37 int IsMaterialStable(DataSet* loads,ParameterInputs* inputs,int analysis_type){
     37int IsMaterialStable(DataSet* loads,int analysis_type){
    3838
    3939        int i;
     
    5050                        riftfront=(Riftfront*)loads->GetObjectByOffset(i);
    5151
    52                         if (riftfront->IsMaterialStable(inputs,analysis_type)){
     52                        if (riftfront->IsMaterialStable(analysis_type)){
    5353                                found=1;
    5454                                /*do not break! all penalties should get informed the non-linearity converged!*/
     
    150150}
    151151
    152 int PreConstrain(int* pnum_unstable_constraints,DataSet* loads,ParameterInputs* inputs,int analysis_type){
     152int PreConstrain(int* pnum_unstable_constraints,DataSet* loads,int analysis_type){
    153153
    154154        int                     i;
     
    168168                        riftfront=(Riftfront*)loads->GetObjectByOffset(i);
    169169
    170                         riftfront->PreConstrain(&unstable,inputs,analysis_type);
     170                        riftfront->PreConstrain(&unstable,analysis_type);
    171171
    172172                        num_unstable_constraints+=unstable;
     
    185185}
    186186
    187 int Constrain(int* pnum_unstable_constraints,DataSet* loads,ParameterInputs* inputs,int analysis_type){
     187int Constrain(int* pnum_unstable_constraints,DataSet* loads,int analysis_type){
    188188
    189189        int                     i;
     
    203203                        riftfront=(Riftfront*)loads->GetObjectByOffset(i);
    204204
    205                         riftfront->Constrain(&unstable,inputs,analysis_type);
     205                        riftfront->Constrain(&unstable,analysis_type);
    206206
    207207                        num_unstable_constraints+=unstable;
     
    220220}
    221221
    222 void FreezeConstraints(DataSet* loads,ParameterInputs* inputs,int analysis_type){
     222void FreezeConstraints(DataSet* loads,int analysis_type){
    223223
    224224        int                     i;
     
    234234                        riftfront=(Riftfront*)loads->GetObjectByOffset(i);
    235235
    236                         riftfront->FreezeConstraints(inputs,analysis_type);
     236                        riftfront->FreezeConstraints(analysis_type);
    237237
    238238                }
     
    273273}
    274274
    275 int MaxPenetrationInInputs(DataSet* loads,ParameterInputs* inputs,int analysis_type){
     275int MaxPenetrationInInputs(DataSet* loads,int analysis_type){
    276276
    277277        int                     i;
     
    295295                        riftfront=(Riftfront*)loads->GetObjectByOffset(i);
    296296
    297                         riftfront->MaxPenetration(&penetration,inputs,analysis_type);
     297                        riftfront->MaxPenetration(&penetration,analysis_type);
    298298
    299299                        if (penetration>max_penetration)max_penetration=penetration;
     
    308308
    309309        /*feed max_penetration to inputs: */
    310         inputs->Add("max_penetration",max_penetration);
    311 }
    312 
    313 int PotentialUnstableConstraints(DataSet* loads,ParameterInputs* inputs,int analysis_type){
     310        loads->AddInput(max_penetration,MaxPenetrationEnum);
     311}
     312
     313int PotentialUnstableConstraints(DataSet* loads,int analysis_type){
    314314
    315315        int                     i;
     
    330330                        riftfront=(Riftfront*)loads->GetObjectByOffset(i);
    331331
    332                         riftfront->PotentialUnstableConstraint(&unstable,inputs,analysis_type);
     332                        riftfront->PotentialUnstableConstraint(&unstable,analysis_type);
    333333
    334334                        num_unstable_constraints+=unstable;
  • issm/trunk/src/c/PenaltyConstraintsx/RiftConstraints.h

    r3201 r3673  
    1010#include "../DataSet/DataSet.h"
    1111
    12 int RiftConstraints(int* pconverged, int* pnum_unstable_constraints,DataSet* loads,ParameterInputs* inputs,int min_mechanical_constraints,int analysis_type,int sub_analysis_type);
     12int RiftConstraints(int* pconverged, int* pnum_unstable_constraints,DataSet* loads,int min_mechanical_constraints,int analysis_type,int sub_analysis_type);
    1313
    1414int RiftIsPresent(DataSet* loads);
     
    1818int SetPreStable(DataSet* loads);
    1919
    20 int PreConstrain(int* pnum_unstable_constraints,DataSet* loads,ParameterInputs* inputs,int analysis_type_enum);
     20int PreConstrain(int* pnum_unstable_constraints,DataSet* loads,int analysis_type_enum);
    2121
    22 int Constrain(int* pnum_unstable_constraints,DataSet* loads,ParameterInputs* inputs,int analysis_type_enum);
     22int Constrain(int* pnum_unstable_constraints,DataSet* loads,int analysis_type_enum);
    2323
    24 void FreezeConstraints(DataSet* loads,ParameterInputs* inputs,int analysis_type);
     24void FreezeConstraints(DataSet* loads,int analysis_type);
    2525
    26 int MaxPenetrationInInputs(DataSet* loads,ParameterInputs* inputs,int analysis_type_enum);
     26int MaxPenetrationInInputs(DataSet* loads,int analysis_type_enum);
    2727
    28 int PotentialUnstableConstraints(DataSet* loads,ParameterInputs* inputs,int analysis_type_enum);
     28int PotentialUnstableConstraints(DataSet* loads,int analysis_type_enum);
    2929
    30 int IsMaterialStable(DataSet* loads,ParameterInputs* inputs,int analysis_type_enum);
     30int IsMaterialStable(DataSet* loads,int analysis_type_enum);
    3131
    3232int IsFrozen(DataSet* loads);
  • issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.cpp

    r3612 r3673  
    1010#include "../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, DataSet* parameters,
     12void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, Parameters* parameters,
    1313                int kflag,int pflag,int analysis_type,int sub_analysis_type){
    1414       
     
    2929
    3030        /*Add penalties to stiffnesses, from loads: */
    31         if(kflag)loads->PenaltyCreateKMatrix(Kgg,inputs,kmax,analysis_type,sub_analysis_type);
    32         if(pflag)loads->PenaltyCreatePVector(pg,inputs,kmax,analysis_type,sub_analysis_type);
     31        if(kflag)loads->PenaltyCreateKMatrix(Kgg,kmax,analysis_type,sub_analysis_type);
     32        if(pflag)loads->PenaltyCreatePVector(pg,kmax,analysis_type,sub_analysis_type);
    3333       
    3434        /*Assemble matrices: */
  • issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.h

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

    r3567 r3673  
    1515#include "../EnumDefinitions/EnumDefinitions.h"
    1616
    17 void ProcessParamsx( DataSet* parameters, Vec  part){
     17void ProcessParamsx( Parameters* parameters, Vec  part){
    1818
    1919       
  • issm/trunk/src/c/ProcessParamsx/ProcessParamsx.h

    r1 r3673  
    99
    1010/* local prototypes: */
    11 void            ProcessParamsx( DataSet* parameters, Vec partition);
     11void            ProcessParamsx( Parameters* parameters, Vec partition);
    1212
    1313#endif  /* _PROCESSPARAMSX_H */
  • issm/trunk/src/c/Qmux/DakotaResponses.cpp

    r3570 r3673  
    1616#include "../Misfitx/Misfitx.h"
    1717
    18 void DakotaResponses(double* responses,char** responses_descriptors,int numresponses,Model* model,DataSet* results,DataSet* processed_results,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
     18void DakotaResponses(double* responses,char** responses_descriptors,int numresponses,Model* model,DataSet* results,DataSet* processed_results,int analysis_type,int sub_analysis_type){
    1919
    2020        int i,j;
     
    258258                        if(!found)ISSMERROR(" could not find velocity to compute misfit");
    259259
     260                        SplitSolutionVector(&vx,&vy,&vz,u_g,numberofnodes*numberofdofspernode);
     261
    260262                        /*Add to inputs: */
    261                         inputs->Add("velocity",u_g_double,numberofdofspernode,numberofnodes);
    262                         inputs->Add("fit",fit[0]);
     263                        femmodel->elements->AddInput(vx,VxEnum);
     264                        femmodel->elements->AddInput(vy,VyEnum);
     265                        femmodel->elements->AddInput(vz,VzEnum);
     266                        femmodel->elements->AddInput(fit[0],FitEnum);
    263267
    264268                        /*Compute misfit: */
    265                         Misfitx( &J, femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,inputs,analysis_type,sub_analysis_type);
     269                        Misfitx( &J, femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,analysis_type,sub_analysis_type);
    266270                       
    267271
  • issm/trunk/src/c/Qmux/Qmux.cpp

    r3332 r3673  
    5151
    5252#ifdef _SERIAL_
    53 void Qmux(mxArray* model,mxArray* inputs,int analysis_type,int sub_analysis_type,char* dakota_input_file,char* dakota_output_file,char* dakota_error_file){
     53void Qmux(mxArray* model,int analysis_type,int sub_analysis_type,char* dakota_input_file,char* dakota_output_file,char* dakota_error_file){
    5454#else
    55 void Qmux(Model* model,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
     55void Qmux(Model* model,int analysis_type,int sub_analysis_type){
    5656#endif
    5757
     
    111111
    112112                        // Serial case: plug in derived Interface object without an analysisComm
    113                         interface.assign_rep(new SIM::DakotaPlugin(problem_db,(void*)model,(void*)inputs,analysis_type,sub_analysis_type), false);
     113                        interface.assign_rep(new SIM::DakotaPlugin(problem_db,(void*)model,analysis_type,sub_analysis_type), false);
    114114                }
    115115       
     
    120120                #ifdef _PARALLEL_
    121121                //Warn other cpus that we are done running the dakota iterator, by setting the counter to -1:
    122                 SpawnCore(NULL,0, NULL,NULL,0,model,inputs,analysis_type,sub_analysis_type,-1);
     122                SpawnCore(NULL,0, NULL,NULL,0,model,analysis_type,sub_analysis_type,-1);
    123123                #endif
    124124
     
    128128
    129129                for(;;){
    130                         if(!SpawnCore(NULL,0, NULL,NULL,0,model,inputs,analysis_type,sub_analysis_type,0))break; //counter came in at -1 on cpu0, bail out.
     130                        if(!SpawnCore(NULL,0, NULL,NULL,0,model,analysis_type,sub_analysis_type,0))break; //counter came in at -1 on cpu0, bail out.
    131131                }
    132132        }
  • issm/trunk/src/c/Qmux/Qmux.h

    r3612 r3673  
    1010
    1111/* local prototypes: */
    12 int SpawnCore(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, void* model,void* inputs,int analysis_type,int sub_analysis_type,int counter);
     12int SpawnCore(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, void* model,int analysis_type,int sub_analysis_type,int counter);
    1313#ifdef _SERIAL_
    14 void Qmux(mxArray* model,mxArray* inputs,int analysis_type,int sub_analysis_type,char* dakota_input_file,char* dakota_output_file,char* dakota_error_file);
    15 void SpawnCoreSerial(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, mxArray* model,mxArray* inputs,int analysis_type,int sub_analysis_type,int counter);
     14void Qmux(mxArray* model,int analysis_type,int sub_analysis_type,char* dakota_input_file,char* dakota_output_file,char* dakota_error_file);
     15void SpawnCoreSerial(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, mxArray* model,int analysis_type,int sub_analysis_type,int counter);
    1616#else
    1717void Qmux(Model* model,int analysis_type,int sub_analysis_type);
  • issm/trunk/src/c/Qmux/SpawnCore.cpp

    r3332 r3673  
    1717#include "../include/macros.h"
    1818
    19 int SpawnCore(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, void* model,void* inputs,int analysis_type,int sub_analysis_type,int counter){
     19int SpawnCore(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, void* model,int analysis_type,int sub_analysis_type,int counter){
    2020
    2121        /*Branch into a serial SpawnCore and a parallel SpawnCore: */
    2222        #ifdef _SERIAL_
    23         SpawnCoreSerial(responses, numresponses, variables, variables_descriptors,numvariables, (mxArray*)model, (mxArray*)inputs,analysis_type,sub_analysis_type,counter);
     23        SpawnCoreSerial(responses, numresponses, variables, variables_descriptors,numvariables, (mxArray*)model, analysis_type,sub_analysis_type,counter);
    2424        #else
    2525        /*Call SpawnCoreParallel unless counter=-1 on cpu0, in which case, bail out and return 0: */
    2626        MPI_Bcast(&counter,1,MPI_INT,0,MPI_COMM_WORLD); if(counter==-1)return 0;
    2727       
    28         SpawnCoreParallel(responses, numresponses, variables, variables_descriptors,numvariables, (Model*)model, (ParameterInputs*)inputs,analysis_type,sub_analysis_type,counter);
     28        SpawnCoreParallel(responses, numresponses, variables, variables_descriptors,numvariables, (Model*)model, analysis_type,sub_analysis_type,counter);
    2929        #endif
    3030
  • issm/trunk/src/c/Qmux/SpawnCoreParallel.cpp

    r3595 r3673  
    3434#include "../parallel/parallel.h"
    3535
    36 void SpawnCoreParallel(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, Model* model,ParameterInputs* inputs,int analysis_type,int sub_analysis_type,int counter){
     36void SpawnCoreParallel(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, Model* model,int analysis_type,int sub_analysis_type,int counter){
    3737
    3838        int i;
     
    9797        results=new DataSet(ResultsEnum);
    9898
    99         /*Modify core inputs to reflect the dakota variables inputs: */
    100         inputs->UpdateFromDakota(variables,variables_descriptors,numvariables,model->GetFormulation(DiagnosticAnalysisEnum,HorizAnalysisEnum)->parameters,qmu_part,qmu_npart); //diagnostic horiz model is the one holding the parameters for Dakota.
     99        /*Modify core inputs in objects contained in model, to reflect the dakota variables inputs: */
     100        model->UpdateFromDakota(variables,variables_descriptors,numvariables,model->GetFormulation(DiagnosticAnalysisEnum,HorizAnalysisEnum)->parameters,qmu_part,qmu_npart); //diagnostic horiz model is the one holding the parameters for Dakota.
    101101
    102         /*Run the analysis core solution sequence, with the updated inputs: */
     102        /*Run the analysis core solution sequence: */
    103103        if(analysis_type==DiagnosticAnalysisEnum){
    104104                       
    105105                if(verbose)_printf_("Starting diagnostic core\n");
    106106
    107                 diagnostic_core(results,model,inputs);
     107                diagnostic_core(results,model);
    108108
    109109        }
     
    111111               
    112112                if(verbose)_printf_("Starting thermal core\n");
    113                 thermal_core(results,model,inputs);
     113                thermal_core(results,model);
    114114
    115115        }
     
    117117
    118118                if(verbose)_printf_("Starting prognostic core\n");
    119                 prognostic_core(results,model,inputs);
     119                prognostic_core(results,model);
    120120
    121121        }
     
    123123
    124124                if(verbose)_printf_("Starting transient core\n");
    125                 transient_core(results,model,inputs);
     125                transient_core(results,model);
    126126
    127127        }
     
    137137        /*compute responses on cpu 0: dummy for now! */
    138138        if(verbose)_printf_("compute dakota responses:\n");
    139         DakotaResponses(responses,responses_descriptors,numresponses,model,results,processed_results,inputs,analysis_type,sub_analysis_type);
     139        DakotaResponses(responses,responses_descriptors,numresponses,model,results,processed_results,analysis_type,sub_analysis_type);
    140140
    141141        /*Free ressources:*/
  • issm/trunk/src/c/Qmux/SpawnCoreSerial.cpp

    r3332 r3673  
    1919#include "../include/macros.h"
    2020
    21 void SpawnCoreSerial(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, mxArray* model,mxArray* inputs,int analysis_type,int sub_analysis_type,int counter){
     21void SpawnCoreSerial(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, mxArray* model,int analysis_type,int sub_analysis_type,int counter){
    2222
    2323        int i;
     
    5757        //call SpwanCore matlab routine.
    5858        array[0]=model;
    59         array[1]=inputs;
    6059        array[2]=mxvariables;
    6160        array[3]=mxvariabledescriptors;
  • issm/trunk/src/c/SurfaceAreax/SurfaceAreax.cpp

    r3446 r3673  
    1010#include "../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void SurfaceAreax( double* pS, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials,DataSet* parameters,
    13                         ParameterInputs* inputs,int analysis_type,int sub_analysis_type){
     12void SurfaceAreax( double* pS, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials,Parameters* parameters,
     13                        int analysis_type,int sub_analysis_type){
    1414       
    1515        /*output: */
     
    2222
    2323        /*Compute gradients: */
    24         elements->SurfaceArea(&S,inputs,analysis_type,sub_analysis_type);
     24        elements->SurfaceArea(&S,analysis_type,sub_analysis_type);
    2525
    2626        /*Sum all J from all cpus of the cluster:*/
  • issm/trunk/src/c/SurfaceAreax/SurfaceAreax.h

    r3612 r3673  
    1010
    1111/* local prototypes: */
    12 void SurfaceAreax( double* pS, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,
     12void SurfaceAreax( double* pS, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,
    1313                        int analysis_type,int sub_analysis_type);
    1414
  • issm/trunk/src/c/SystemMatricesx/SystemMatricesx.cpp

    r3612 r3673  
    1010#include "../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, DataSet* parameters,
     12void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, Parameters* parameters,
    1313                int kflag,int pflag,int connectivity,int numberofdofspernode,int analysis_type,int sub_analysis_type){
    1414       
     
    4040
    4141        /*Fill stiffness matrix and right hand side vector, from elements: */
    42         if(kflag)elements->CreateKMatrix(Kgg,inputs,analysis_type,sub_analysis_type);
    43         if(pflag)elements->CreatePVector(pg,inputs,analysis_type,sub_analysis_type);
     42        if(kflag)elements->CreateKMatrix(Kgg,analysis_type,sub_analysis_type);
     43        if(pflag)elements->CreatePVector(pg,analysis_type,sub_analysis_type);
    4444       
    4545        /*Fill stiffness matrix and right hand side vector, from loads: */
    46         if(kflag)loads->CreateKMatrix(Kgg,inputs,analysis_type,sub_analysis_type);
    47         if(pflag)loads->CreatePVector(pg,inputs,analysis_type,sub_analysis_type);
     46        if(kflag)loads->CreateKMatrix(Kgg,analysis_type,sub_analysis_type);
     47        if(pflag)loads->CreatePVector(pg,analysis_type,sub_analysis_type);
    4848
    4949        /*Assemble matrices: */
  • issm/trunk/src/c/SystemMatricesx/SystemMatricesx.h

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

    r3567 r3673  
    1212
    1313void UpdateGeometryx(Vec* poutthickness,Vec* poutbed,Vec* poutsurface,
    14                 DataSet* elements, DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, DataSet* parameters,
     14                DataSet* elements, DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, Parameters* parameters,
    1515                Vec vec_newthickness,Vec vec_bed,Vec vec_surface){
    1616
  • issm/trunk/src/c/UpdateGeometryx/UpdateGeometryx.h

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

    r3612 r3673  
    99#include "../EnumDefinitions/EnumDefinitions.h"
    1010
    11 int UpdateInputsx( DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,Vec solution, int analysis_type, int sub_analysis_type){
     11int UpdateInputsx( DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,Vec solution, int analysis_type, int sub_analysis_type){
    1212
    1313        int noerr=1;
  • issm/trunk/src/c/UpdateInputsx/UpdateInputsx.h

    r3599 r3673  
    1010
    1111/* local prototypes: */
    12 int             UpdateInputsx( DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,  DataSet* parameters,Vec solution, int analysis_type, int sub_analysis_type);
     12int             UpdateInputsx( DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,  Parameters* parameters,Vec solution, int analysis_type, int sub_analysis_type);
    1313
    1414#endif  /* _UPDATEINPUTSXX_H */
  • issm/trunk/src/c/io/FetchParams.cpp

    r3570 r3673  
    2020void FetchParams(DataSet** pparameters, DataHandle dataref){
    2121
    22         int i,j,count;
     22        int i,j;
    2323
    2424        /*output: */
    2525        Param* param=NULL;
    26         Numpar*  numpar=NULL;
    27         DataSet* parameters=NULL;
     26        Parameters* parameters=NULL;
    2827
    2928        /*intermediary: */
     
    3635        mxArray* pfield=NULL;
    3736        mxArray* pfield2=NULL;
     37        int enum_type;
    3838
    3939
    4040        /*First, create parameters : */
    41         parameters=new DataSet();
     41        parameters=new Parameters();
    4242
    43         /*Then, create Numpar object, before building the params objects: */
    44         numpar= new Numpar(1);
    45         parameters->AddObject(numpar);
    46 
    47         /*now, go through matlab params structure, and create Param object for each field: */
     43        /*go through matlab params structure, and create Param object for each field: */
    4844
    4945        nfields=mxGetNumberOfFields(dataref);
     
    5349                /*Get i'th field: */
    5450                name=(char*)mxGetFieldNameByNumber(dataref,count);
     51                enum_type=StringAsEnum(name);
    5552                pfield=mxGetFieldByNumber(dataref,0,count);
    5653
     
    6562                                ISSMERROR("%s%i (%s) %s%i%s%i%s","array in parameters structure field ",count,name," is of size (",M,",",N,")");
    6663                        }
    67 
    6864                        if (M==1 && N==1){
    69 
    7065                                /*we have a simple scalar: */
    71                                 param= new Param(count+1,name,DOUBLE);
    72                                 param->SetDouble(*mxGetPr(pfield));
     66                                param= new DoubleParam(enum_type,*mxGetPr(pfield));
    7367                                parameters->AddObject(param);
    7468
     
    7872                                       
    7973                                        /*vector: */
    80                                         param= new Param(count+1,name,DOUBLEVEC);
    81                                         param->SetDoubleVec(mxGetPr(pfield),M,1);
     74                                        param= new DoubleVecParam(enum_type,mxGetPr(pfield),M);
    8275                                        parameters->AddObject(param);
    8376
    8477                                }
    8578                                else{
    86 
    8779                                        /*matrix: first, transpose, then plug into Param */
    8880                                        matrix=mxGetPr(pfield);
     
    9486                                        }
    9587
    96                                         param= new Param(count+1,name,DOUBLEMAT);
    97                                         param->SetDoubleMat(tmatrix,M,N);
     88                                        param= new DoubleMatParam(enum_type,tmatrix,M,N);
    9889                                        parameters->AddObject(param);
    9990       
    10091                                        /*Free ressources:*/
    10192                                        xfree((void**)&tmatrix);
    102 
    10393                                }
    10494                        }
     
    116106                        mxGetString(pfield,string,stringlen);
    117107
    118                         param= new Param(count+1,name,STRING);
    119                         param->SetString(string);
     108                        param= new StringParam(enum_type,string);
    120109                        parameters->AddObject(param);
    121110
     
    135124                        }
    136125               
    137                         param= new Param(count+1,name,STRINGARRAY);
    138                         param->SetStringArray(stringarray,M);
     126                        param= new StringArrayParam(enum_type,stringarray,M);
    139127                        parameters->AddObject(param);
    140128
  • issm/trunk/src/c/io/WriteParams.cpp

    r3621 r3673  
    1818#include "../include/macros.h"
    1919
    20 void WriteParams(DataHandle* pdataref,DataSet* parameters){
     20void WriteParams(DataHandle* pdataref,Parameters* parameters){
     21
     22        int i;
    2123
    2224        /*output: */
     
    2628        mwSize          onebyone[2] = {1,1};
    2729        mwSize          ndim=2;
    28         mxArray*    pfield=NULL;
    29         mxArray*    pfield2=NULL;
    3030
    3131        /*intermediary: */
    32         int         i,k;
    33         mxArray*    field=NULL;
    3432        Param*      param=NULL;
    35         int         integer;
    36         double      ddouble;
    37         char*       string;
    38         double*     doublevec=NULL;
    39         double*     doublemat=NULL;
    40         Mat         mat=NULL;
    41         Vec         vec=NULL;
    42         char**      stringarray=NULL;
    43         double*     serial_vec=NULL;
    44         double*     serial_mat=NULL;
    45         mwSize      M,N;
    46         mwSize      dims[2]={0};
    4733
    4834        /*Recover data from the parameters dataset: */
    49         nfields=(mwSize)parameters->Size()-1; //don't include Numpar
    50 
     35        nfields=(mwSize)parameters->Size();
    5136        fnames=(const char**)xmalloc(nfields*sizeof(char*));
    5237       
    5338        /*Build structure in matlab workspace with all the parameter fields: */
    5439        for(i=0;i<nfields;i++){
    55                 param=(Param*)parameters->GetObjectByOffset(i+1);
    56                 fnames[i]=(const char*)xmalloc((strlen(param->GetParameterName())+1)*sizeof(char));
    57                 strcpy((char*)fnames[i],param->GetParameterName());
     40                param=(Param*)parameters->GetObjectByOffset(i);
     41                fnames[i]=param->GetParameterName();
    5842        }
    5943        /*Initialize structure: */
     
    6347        for(i=0;i<nfields;i++){
    6448
    65                 param=(Param*)parameters->GetObjectByOffset(i+1); //skip the numpar object
     49                param=(Param*)parameters->GetObjectByOffset(i);
     50                param->SetMatlabField(dataref);
     51        }
    6652               
    67                 switch(param->GetType()){
    68                         case INTEGER:
    69                                 param->GetParameterValue(&integer);
    70                                 mxSetField( dataref, 0, param->GetParameterName(),mxCreateDoubleScalar((double)integer));
    71                                 break;
    72 
    73                         case DOUBLE:
    74                                 param->GetParameterValue(&ddouble);
    75                                 mxSetField( dataref, 0, param->GetParameterName(),mxCreateDoubleScalar((double)ddouble));
    76                                 break;
    77 
    78                         case STRING:
    79                                 param->GetParameterValue(&string);
    80                                 mxSetField( dataref, 0, param->GetParameterName(),mxCreateString(string));
    81                                 break;
    82 
    83                         case STRINGARRAY:
    84                                 param->GetParameterValue(&stringarray);
    85                                 M=param->GetM();
    86                                 dims[0]=M;
    87                                 dims[1]=1;
    88                                 pfield=mxCreateCellArray(2,dims);
    89                                 for(k=0;k<M;k++){
    90                                         char* string=stringarray[k];
    91                                         mxSetCell(pfield,k,mxCreateString(string));
    92                                 }
    93                                 mxSetField( dataref, 0, param->GetParameterName(),pfield);
    94                                 break;
    95 
    96                         case DOUBLEVEC:
    97                                 param->GetParameterValue(&doublevec);
    98                                 M=param->GetM();
    99                                 pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    100                                 mxSetM(pfield,M);
    101                                 mxSetN(pfield,1);
    102                                 mxSetPr(pfield,doublevec);
    103                                 mxSetField( dataref, 0, param->GetParameterName(),pfield);
    104                                 break;
    105 
    106                         case DOUBLEMAT:
    107                                 param->GetParameterValue(&doublemat);
    108                                 M=param->GetM();
    109                                 N=param->GetN();
    110                                 pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    111                                 mxSetM(pfield,N);
    112                                 mxSetN(pfield,M);
    113                                 mxSetPr(pfield,doublemat);
    114                                 //transpose the matrix, written directly to matlab! from C to matlab.
    115                                 mexCallMATLAB(1,&pfield2, 1, &pfield, "'");
    116                                 mxSetField( dataref, 0, param->GetParameterName(),pfield2);
    117                                 break;
    118                
    119                         case PETSCVEC:
    120                                 param->GetParameterValue(&vec);
    121                                 VecToMPISerial(&serial_vec,vec);
    122                                 VecFree(&vec);
    123                                 M=param->GetM();
    124                                 pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    125                                 mxSetM(pfield,M);
    126                                 mxSetN(pfield,1);
    127                                 mxSetPr(pfield,serial_vec);
    128                                 mxSetField( dataref, 0, param->GetParameterName(),pfield);
    129                                 break;
    130                
    131                         case PETSCMAT:
    132                                 param->GetParameterValue(&mat);
    133                                 MatToSerial(&serial_mat,mat);
    134                                 MatFree(&mat);
    135                                 M=param->GetM();
    136                                 N=param->GetN();
    137                                 pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    138                                 mxSetM(pfield,M);
    139                                 mxSetN(pfield,N);
    140                                 mxSetPr(pfield,serial_mat);
    141                                 mxSetField( dataref, 0, param->GetParameterName(),pfield);
    142                                 break;
    143                         default:
    144                                 ISSMERROR("%s%i","unknown parameter type: ",param->GetType());
    145                                 break;
    146                 }
    147         }
    148 
    14953        /*Assign output pointers:*/
    15054        *pdataref=dataref;
  • issm/trunk/src/c/io/io.h

    r3314 r3673  
    3333
    3434void WriteNodeSets(DataHandle* pdataref,NodeSets* nodesets);
    35 void WriteParams(DataHandle* pdataref,DataSet* parameters);
     35void WriteParams(DataHandle* pdataref,Parameters* parameters);
    3636
    3737void FetchData(DataSet** pdataset,const mxArray* dataref);
  • issm/trunk/src/c/objects/Beam.cpp

    r3622 r3673  
    586586}
    587587/*}}}*/
    588 /*FUNCTION Beam::GetId{{{1*/
    589 int    Beam::GetId(void){ return id; }
     588/*FUNCTION Beam::Id{{{1*/
     589int    Beam::Id(void){ return id; }
    590590/*}}}*/
    591591/*FUNCTION Beam::GetJacobianDeterminant{{{1*/
     
    614614
    615615        return matpar;
    616 }
    617 /*}}}*/
    618 /*FUNCTION Beam::GetName{{{1*/
    619 char* Beam::GetName(void){
    620         return "beam";
    621616}
    622617/*}}}*/
  • issm/trunk/src/c/objects/Beam.h

    r3637 r3673  
    1313#include "./Matice.h"
    1414#include "./Matpar.h"
     15#include "../shared/Exceptions/exceptions.h"
     16#include "../include/macros.h"
    1517#include "../ModelProcessorx/IoModel.h"
    1618#include "../DataSet/Inputs.h"
     
    5254                void  Marshall(char** pmarshalled_dataset);
    5355                int   MarshallSize();
    54                 char* GetName();
    5556                void  Demarshall(char** pmarshalled_dataset);
    5657                int   Enum();
    57                 int   GetId();
     58                int   Id();
    5859                int   MyRank();
    5960                void  Configure(DataSet* loads,DataSet* nodes,DataSet* materials,Parameters* parameters);
     
    9495                void  GetJacobianDeterminant(double* pJdet,double* z_list, double gauss_coord);
    9596                double MassFlux(double* segment,double* ug);
     97                void AddInput(double value, int enum_type){ISSMERROR("not supporte yet!");}
    9698                /*}}}*/
    9799
  • issm/trunk/src/c/objects/DakotaPlugin.cpp

    r2048 r3673  
    4444
    4545//constructor
    46 DakotaPlugin::DakotaPlugin(const Dakota::ProblemDescDB& problem_db,void* in_model, void* in_inputs, int in_analysis_type, int in_sub_analysis_type):Dakota::DirectApplicInterface(problem_db){
     46DakotaPlugin::DakotaPlugin(const Dakota::ProblemDescDB& problem_db,void* in_model, int in_analysis_type, int in_sub_analysis_type):Dakota::DirectApplicInterface(problem_db){
    4747
    4848
    4949        model=in_model;
    50         inputs=in_inputs;
    5150        analysis_type=in_analysis_type;
    5251        sub_analysis_type=in_sub_analysis_type;
     
    9089
    9190        /*run core solution: */
    92         SpawnCore(responses,numFns, variables,variable_descriptors,numACV,model,inputs,analysis_type,sub_analysis_type,counter);
     91        SpawnCore(responses,numFns, variables,variable_descriptors,numACV,model,analysis_type,sub_analysis_type,counter);
    9392
    9493        /*populate responses: */
  • issm/trunk/src/c/objects/DakotaPlugin.h

    r3637 r3673  
    2424public:
    2525
    26         DakotaPlugin(const Dakota::ProblemDescDB& problem_db,void* model, void* inputs, int analysis_type, int sub_analysis_type);
     26        DakotaPlugin(const Dakota::ProblemDescDB& problem_db,void* model, int analysis_type, int sub_analysis_type);
    2727        ~DakotaPlugin();
    2828
    2929        /*these fields are used by core solutions: */
    3030        void* model;
    31         void* inputs;
    3231
    3332        int analysis_type;
  • issm/trunk/src/c/objects/DofVec.cpp

    r3570 r3673  
    231231}
    232232/*}}}*/
    233 /*FUNCTION DofVec::GetId {{{1*/
    234 int DofVec::GetId(void){
     233/*FUNCTION DofVec::Id {{{1*/
     234int DofVec::Id(void){
    235235        ISSMERROR(" no id function for DofVec class");
    236236}
    237237
    238 /*FUNCTION DofVec::GetName {{{1*/
    239 char* DofVec::GetName(void){
    240         char* string=NULL;
    241         string=(char*)xmalloc((strlen(this->name)+1)*sizeof(char));
    242         strcpy(string,this->name);
    243         return string;
    244 }
    245 /*}}}*/
    246238/*FUNCTION DofVec::GetVec {{{1*/
    247239Vec     DofVec::GetVec(void){
  • issm/trunk/src/c/objects/DofVec.h

    r3637 r3673  
    4242                void  Marshall(char** pmarshalled_dataset);
    4343                int   MarshallSize();
    44                 char* GetName();
    4544                void  Demarshall(char** pmarshalled_dataset);
    4645                int   Enum();
    47                 int   GetId();
     46                int   Id();
    4847                int   MyRank();
    4948                int   Size();
  • issm/trunk/src/c/objects/Element.h

    r3637 r3673  
    2222               
    2323                virtual        ~Element(){};
    24                 virtual int    Enum()=0;
    2524                virtual void   Configure(DataSet* loads,DataSet* nodes,DataSet* materials,Parameters* parameters)=0;
    2625               
     
    4544                virtual void   ComputeStrainRate(Vec eps,     int analysis_type,int sub_analysis_type)=0;
    4645                virtual double MassFlux(double* segment,double* ug)=0;
     46                virtual void   AddInput(double value, int enum_type)=0;
    4747
    4848                /*Implementation: */
  • issm/trunk/src/c/objects/FemModel.cpp

    r3620 r3673  
    144144}
    145145/*}}}*/
    146 /*FUNCTION FemModel::GetId {{{1*/
    147 int   FemModel::GetId(void){
     146/*FUNCTION FemModel::Id {{{1*/
     147int   FemModel::Id(void){
    148148        ISSMERROR("not implemented yet!");
    149149}
     
    164164}
    165165/*}}}*/
    166 /*FUNCTION FemModel::GetName {{{1*/
    167 char*   FemModel::GetName(void){
    168         ISSMERROR("not implemented yet!");
    169 }
    170 /*}}}*/
    171166/*FUNCTION FemModel::Demarshall {{{1*/
    172167void  FemModel::Demarshall(char** pmarshalled_dataset){
     
    184179}
    185180/*}}}*/
    186 /*FUNCTION FemModel::FindParam(double* pscalar,char* name) {{{1*/
    187 int FemModel::FindParam(double* pscalar,char* name){
    188        
    189         return parameters->FindParam(pscalar,name);
    190 
    191 }
    192 /*}}}*/
    193 /*FUNCTION FemModel::FindParam(int* pinteger,char* name) {{{1*/
    194 int FemModel::FindParam(int* pinteger,char* name){
    195        
    196         return parameters->FindParam(pinteger,name);
    197 
    198 }
    199 /*}}}*/
    200 /*FUNCTION FemModel::FindParam(char** pstring,char* name) {{{1*/
    201 int FemModel::FindParam(char** pstring,char* name){
    202        
    203         return parameters->FindParam(pstring,name);
    204 
    205 }
    206 /*}}}*/
    207 /*FUNCTION FemModel::FindParam(char*** pstringarray,int* pM,char* name) {{{1*/
    208 int FemModel::FindParam(char*** pstringarray,int* pM,char* name){
    209        
    210         return parameters->FindParam(pstringarray,pM,name);
    211 
    212 }
    213 /*}}}*/
    214 /*FUNCTION FemModel::FindParam(double** pdoublearray,int* pM,int* pN,char* name) {{{1*/
    215 int FemModel::FindParam(double** pdoublearray,int* pM,int* pN,char* name){
    216        
    217         return parameters->FindParam(pdoublearray,pM,pN,name);
    218 
    219 }
    220 /*}}}*/
    221 /*FUNCTION FemModel::FindParam(Vec* pvec,char* name) {{{1*/
    222 int FemModel::FindParam(Vec* pvec,char* name){
    223        
    224         return parameters->FindParam(pvec,name);
    225 
    226 }
    227 /*}}}*/
    228 /*FUNCTION FemModel::FindParam(Mat* pmat,char* name) {{{1*/
    229 int FemModel::FindParam(Mat* pmat,char* name){
    230        
    231         return parameters->FindParam(pmat,name);
     181/*FUNCTION FemModel::FindParam(double* pscalar,int enum_type) {{{1*/
     182int FemModel::FindParam(double* pscalar,int enum_type){
     183       
     184        return parameters->FindParam(pscalar,enum_type);
     185
     186}
     187/*}}}*/
     188/*FUNCTION FemModel::FindParam(int* pinteger,int enum_type) {{{1*/
     189int FemModel::FindParam(int* pinteger,int enum_type){
     190       
     191        return parameters->FindParam(pinteger,enum_type);
     192
     193}
     194/*}}}*/
     195/*FUNCTION FemModel::FindParam(char** pstring,int enum_type) {{{1*/
     196int FemModel::FindParam(char** pstring,int enum_type){
     197       
     198        return parameters->FindParam(pstring,enum_type);
     199
     200}
     201/*}}}*/
     202/*FUNCTION FemModel::FindParam(char*** pstringarray,int* pM,int enum_type) {{{1*/
     203int FemModel::FindParam(char*** pstringarray,int* pM,int enum_type){
     204       
     205        return parameters->FindParam(pstringarray,pM,enum_type);
     206
     207}
     208/*}}}*/
     209/*FUNCTION FemModel::FindParam(double** pdoublearray,int* pM,int* pN,int enum_type) {{{1*/
     210int FemModel::FindParam(double** pdoublearray,int* pM,int* pN,int enum_type){
     211       
     212        return parameters->FindParam(pdoublearray,pM,pN,enum_type);
     213
     214}
     215/*}}}*/
     216/*FUNCTION FemModel::FindParam(Vec* pvec,int enum_type) {{{1*/
     217int FemModel::FindParam(Vec* pvec,int enum_type){
     218       
     219        return parameters->FindParam(pvec,enum_type);
     220
     221}
     222/*}}}*/
     223/*FUNCTION FemModel::FindParam(Mat* pmat,int enum_type) {{{1*/
     224int FemModel::FindParam(Mat* pmat,int enum_type){
     225       
     226        return parameters->FindParam(pmat,enum_type);
    232227
    233228}
  • issm/trunk/src/c/objects/FemModel.h

    r3637 r3673  
    5050                void  Echo();
    5151                void  DeepEcho();
    52                 int   GetId();
     52                int   Id();
    5353                int   MyRank();
    5454                void  Marshall(char** pmarshalled_dataset);
    5555                int   MarshallSize();
    56                 char* GetName();
    5756                void  Demarshall(char** pmarshalled_dataset);
    5857                int   Enum();
    5958                Object* copy();
    6059               
    61                 int FindParam(double* pscalar,char* name);
    62                 int FindParam(int* pinteger,char* name);
    63                 int FindParam(char** pstring,char* name);
    64                 int FindParam(char*** pstringarray,int* pM,char* name);
    65                 int FindParam(double** pdoublearray,int* pM, int* pN,char* name);
    66                 int FindParam(Vec* pvec,char* name);
    67                 int FindParam(Mat* pmat,char* name);
     60                int FindParam(double* pscalar,int enum_type);
     61                int FindParam(int* pinteger,int enum_type);
     62                int FindParam(char** pstring,int enum_type);
     63                int FindParam(char*** pstringarray,int* pM,int enum_type);
     64                int FindParam(double** pdoublearray,int* pM, int* pN,int enum_type);
     65                int FindParam(Vec* pvec,int enum_type);
     66                int FindParam(Mat* pmat,int enum_type);
    6867                DataSet* get_elements(void);
    6968                DataSet* get_nodes(void);
  • issm/trunk/src/c/objects/Hook.cpp

    r3612 r3673  
    7777        this->num=input->GetNum();
    7878        input_objects=input->GetObjects();
    79         input_ids=input->GetIds();
     79        input_ids=input->Ids();
    8080        input_offsets=input->GetOffsets();
    8181
     
    195195                /*Check whether existing this->objects are correct: */
    196196                if(this->objects[i]){
    197                         if(this->objects[i]->GetId()==this->ids[i]) continue; //this node is good.
     197                        if(this->objects[i]->Id()==this->ids[i]) continue; //this node is good.
    198198                        else this->objects[i]=NULL; //this node was incorrect, reset it.
    199199                }
     
    204204                         * we are good: */
    205205                        object=(Object*)dataset->GetObjectByOffset(this->offsets[i]);
    206                         if (object->GetId()==this->ids[i]){
     206                        if (object->Id()==this->ids[i]){
    207207                                this->objects[i]=object;
    208208                                continue;
     
    215215                        this->objects[i]=(Object*)dataset->GetObjectById(this->offsets+i,this->ids[i]); //remember the offset for later on.
    216216                        /*check the id is correct!: */
    217                         if (this->objects[i]->GetId()!=this->ids[i]) ISSMERROR("%s%i%s%i%s"," wrong id: ",this->objects[i]->GetId()," vs ",this->ids[i],"  in resolved pointer!");
     217                        if (this->objects[i]->Id()!=this->ids[i]) ISSMERROR("%s%i%s%i%s"," wrong id: ",this->objects[i]->Id()," vs ",this->ids[i],"  in resolved pointer!");
    218218                }
    219219        }
     
    294294}
    295295/*}}}*/
    296 /*FUNCTION Hook::GetIds{{{1*/
    297 int* Hook::GetIds(void){
     296/*FUNCTION Hook::Ids{{{1*/
     297int* Hook::Ids(void){
    298298        return this->ids;
    299299}
  • issm/trunk/src/c/objects/Hook.h

    r3637 r3673  
    4545                Hook*      Spawn(int* indices, int numindices);
    4646                Object**   GetObjects(void);
    47                 int*       GetIds(void);
     47                int*       Ids(void);
    4848                int*       GetOffsets(void);
    4949                int        GetNum(void);
  • issm/trunk/src/c/objects/Icefront.cpp

    r3637 r3673  
    4141}
    4242/*}}}*/
    43 /*FUNCTION Icefront::Icefront(int id, Hook* hnodes, Hook* helement, Hook* hmatpar, DataSet* parameters, Inputs* icefront_inputs) {{{1*/
     43/*FUNCTION Icefront::Icefront(int id, Hook* hnodes, Hook* helement, Hook* hmatpar, Parameters* parameters, Inputs* icefront_inputs) {{{1*/
    4444Icefront::Icefront(int icefront_id,Hook* icefront_hnodes, Hook* icefront_helement, Hook* icefront_hmatpar, Parameters* icefront_parameters, Inputs* icefront_inputs):
    4545        hnodes(icefront_hnodes),
     
    214214}
    215215/*}}}*/
    216 /*FUNCTION Icefront GetId {{{1*/
    217 int    Icefront::GetId(void){ return id; }
    218 /*}}}*/
    219 /*FUNCTION Icefront GetName {{{1*/
    220 char* Icefront::GetName(void){
    221         return "icefront";
    222 }
     216/*FUNCTION Icefront Id {{{1*/
     217int    Icefront::Id(void){ return id; }
    223218/*}}}*/
    224219/*FUNCTION Icefront::Marshall {{{1*/
  • issm/trunk/src/c/objects/Icefront.h

    r3637 r3673  
    5252                void  Echo();
    5353                int   Enum();
    54                 int   GetId();
    55                 char* GetName();
     54                int   Id();
    5655                void  Marshall(char** pmarshalled_dataset);
    5756                int   MarshallSize();
  • issm/trunk/src/c/objects/Load.h

    r3637 r3673  
    2525                virtual void  Echo()=0;
    2626                virtual void  DeepEcho()=0;
    27                 virtual int   GetId()=0;
     27                virtual int   Id()=0;
    2828                virtual int   MyRank()=0;
    2929                virtual void  Marshall(char** pmarshalled_dataset)=0;
    3030                virtual int   MarshallSize()=0;
    31                 virtual char* GetName()=0;
    3231                virtual void  Demarshall(char** pmarshalled_dataset)=0;
    3332                virtual void  Configure(DataSet* elements,DataSet* loads,DataSet* nodes,DataSet* vertices,DataSet* materials,Parameters* parameters)=0;
  • issm/trunk/src/c/objects/Material.h

    r3637 r3673  
    2020                virtual void  Echo()=0;
    2121                virtual void  DeepEcho()=0;
    22                 virtual int   GetId()=0;
     22                virtual int   Id()=0;
    2323                virtual int   MyRank()=0;
    2424                virtual void  Marshall(char** pmarshalled_dataset)=0;
    2525                virtual int   MarshallSize()=0;
    26                 virtual char* GetName()=0;
    2726                virtual void  Demarshall(char** pmarshalled_dataset)=0;
    2827                virtual void  UpdateFromInputs(void* inputs)=0;
  • issm/trunk/src/c/objects/Matice.cpp

    r3622 r3673  
    180180}
    181181/*}}}*/
    182 /*FUNCTION Matice::GetId {{{1*/
    183 int    Matice::GetId(void){ return mid; }
     182/*FUNCTION Matice::Id {{{1*/
     183int    Matice::Id(void){ return mid; }
    184184/*}}}*/
    185185/*FUNCTION Matice::GetN {{{1*/
    186186double Matice::GetN(){
    187187        return n;
    188 }
    189 /*}}}*/
    190 /*FUNCTION Matice::GetName {{{1*/
    191 char* Matice::GetName(void){
    192         return "matice";
    193188}
    194189/*}}}*/
  • issm/trunk/src/c/objects/Matice.h

    r3637 r3673  
    3232                void  Marshall(char** pmarshalled_dataset);
    3333                int   MarshallSize();
    34                 char* GetName();
    3534                void  Demarshall(char** pmarshalled_dataset);
    3635                int   Enum();
    37                 int   GetId();
     36                int   Id();
    3837                int   MyRank();
    3938                void  DistributeNumDofs(int* numdofspernode,int analysis_type);
  • issm/trunk/src/c/objects/Matpar.cpp

    r3622 r3673  
    230230}
    231231/*}}}1*/
    232 /*FUNCTION Matpar::GetId {{{1*/
    233 int    Matpar::GetId(void){ return mid; }
     232/*FUNCTION Matpar::Id {{{1*/
     233int    Matpar::Id(void){ return mid; }
    234234/*}}}1*/
    235235/*FUNCTION Matpar::GetLatentHeat {{{1*/
     
    246246double Matpar::GetMixedLayerCapacity(){
    247247        return mixed_layer_capacity;
    248 }
    249 /*}}}1*/
    250 /*FUNCTION Matpar::GetName {{{1*/
    251 char* Matpar::GetName(void){
    252         return "matpar";
    253248}
    254249/*}}}1*/
  • issm/trunk/src/c/objects/Matpar.h

    r3637 r3673  
    4141                void  Marshall(char** pmarshalled_dataset);
    4242                int   MarshallSize();
    43                 char* GetName();
    4443                void  Demarshall(char** pmarshalled_dataset);
    4544                int   Enum();
    46                 int   GetId();
     45                int   Id();
    4746                int   MyRank();
    4847                void  DistributeNumDofs(int* numdofspernode,int analysis_type);
  • issm/trunk/src/c/objects/Model.cpp

    r3632 r3673  
    33 */
    44
    5 #include "./objects.h"
    6 #include "../io/io.h"
    7 #include "../shared/shared.h"
    8 #include "../include/macros.h"
    95#include "../issm.h"
    106
     
    1612
    1713#include "./Model.h"
     14#include "../EnumDefinitions/EnumDefinitions.h"
    1815#include "stdio.h"
    1916
     
    205202}
    206203/*}}}1*/
    207 /*FUNCTION Model::FindParam(int* pparameter,char* parametername {{{1*/
    208 
    209 int   Model::FindParam(int* pparameter,char* parametername){
     204/*FUNCTION Model::FindParam(int* pparameter,int enum_type {{{1*/
     205
     206int   Model::FindParam(int* pparameter,int enum_type){
    210207
    211208        FemModel* femmodel=NULL;
     
    219216        if(!femmodel)return 0;
    220217
    221         femmodel->FindParam(pparameter,parametername);
    222 
    223 }
    224 /*}}}1*/
    225 /*FUNCTION Model::FindParam(double* pparameter,char* parametername ){{{1*/
    226 int   Model::FindParam(double* pparameter,char* parametername){
     218        femmodel->FindParam(pparameter,enum_type);
     219
     220}
     221/*}}}1*/
     222/*FUNCTION Model::FindParam(double* pparameter,int enum_type ){{{1*/
     223int   Model::FindParam(double* pparameter,int enum_type){
    227224       
    228225        FemModel* femmodel=NULL;
     
    236233        if(!femmodel)return 0;
    237234       
    238         femmodel->FindParam(pparameter,parametername);
    239 
    240 
    241 }
    242 /*}}}1*/
    243 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int *pN,char* parametername) {{{1*/
    244 int   Model::FindParam(double** pparameter,int* pM, int *pN,char* parametername){
     235        femmodel->FindParam(pparameter,enum_type);
     236
     237
     238}
     239/*}}}1*/
     240/*FUNCTION Model::FindParam(double** pparameter,int* pM, int *pN,int enum_type) {{{1*/
     241int   Model::FindParam(double** pparameter,int* pM, int *pN,int enum_type){
    245242       
    246243        FemModel* femmodel=NULL;
     
    254251        if(!femmodel)return 0;
    255252       
    256         femmodel->FindParam(pparameter,pM, pN,parametername);
    257 
    258 
    259 }
    260 /*}}}1*/
    261 /*FUNCTION Model::FindParam(char** pparameter,char* parametername) {{{1*/
    262 int   Model::FindParam(char** pparameter,char* parametername){
     253        femmodel->FindParam(pparameter,pM, pN,enum_type);
     254
     255
     256}
     257/*}}}1*/
     258/*FUNCTION Model::FindParam(char** pparameter,int enum_type) {{{1*/
     259int   Model::FindParam(char** pparameter,int enum_type){
    263260       
    264261        FemModel* femmodel=NULL;
     
    272269        if(!femmodel)return 0;
    273270       
    274         femmodel->FindParam(pparameter,parametername);
    275 
    276 }
    277 /*}}}1*/
    278 /*FUNCTION Model::FindParam(int* pparameter,char* parametername,int analysis_type,int sub_analysis_type) {{{1*/
    279 int   Model::FindParam(int* pparameter,char* parametername,int analysis_type,int sub_analysis_type){
     271        femmodel->FindParam(pparameter,enum_type);
     272
     273}
     274/*}}}1*/
     275/*FUNCTION Model::FindParam(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
     276int   Model::FindParam(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type){
    280277       
    281278        FemModel* femmodel=NULL;
     
    287284
    288285        /*extract our parameter from the found formulation: */
    289         femmodel->FindParam(pparameter,parametername);
    290 }
    291 /*}}}1*/
    292 /*FUNCTION Model::FindParam(double* pparameter,char* parametername,int analysis_type,int sub_analysis_type) {{{1*/
    293 int   Model::FindParam(double* pparameter,char* parametername,int analysis_type,int sub_analysis_type){
     286        femmodel->FindParam(pparameter,enum_type);
     287}
     288/*}}}1*/
     289/*FUNCTION Model::FindParam(double* pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
     290int   Model::FindParam(double* pparameter,int enum_type,int analysis_type,int sub_analysis_type){
    294291       
    295292        FemModel* femmodel=NULL;
     
    301298
    302299        /*extract our parameter from the found formulation: */
    303         femmodel->FindParam(pparameter,parametername);
    304 }
    305 /*}}}1*/
    306 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int* pN,char* parametername,int analysis_type,int sub_analysis_type) {{{1*/
    307 int   Model::FindParam(double** pparameter,int* pM, int* pN,char* parametername,int analysis_type,int sub_analysis_type){
     300        femmodel->FindParam(pparameter,enum_type);
     301}
     302/*}}}1*/
     303/*FUNCTION Model::FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
     304int   Model::FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type,int sub_analysis_type){
    308305
    309306        FemModel* femmodel=NULL;
     
    315312
    316313        /*extract our parameter from the found formulation: */
    317         femmodel->FindParam(pparameter,pM, pN,parametername);
    318 }
    319 /*}}}1*/
    320 /*FUNCTION Model::FindParam(char** pparameter,char* parametername,int analysis_type,int sub_analysis_type) {{{1*/
    321 int   Model::FindParam(char** pparameter,char* parametername,int analysis_type,int sub_analysis_type){
     314        femmodel->FindParam(pparameter,pM, pN,enum_type);
     315}
     316/*}}}1*/
     317/*FUNCTION Model::FindParam(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
     318int   Model::FindParam(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type){
    322319
    323320        FemModel* femmodel=NULL;
     
    329326
    330327        /*extract our parameter from the found formulation: */
    331         femmodel->FindParam(pparameter,parametername);
    332 }
    333 /*}}}1*/
    334 /*FUNCTION Model::FindParam(int* pparameter,char* parametername,int analysis_type) {{{1*/
    335 int   Model::FindParam(int* pparameter,char* parametername,int analysis_type){
     328        femmodel->FindParam(pparameter,enum_type);
     329}
     330/*}}}1*/
     331/*FUNCTION Model::FindParam(int* pparameter,int enum_type,int analysis_type) {{{1*/
     332int   Model::FindParam(int* pparameter,int enum_type,int analysis_type){
    336333       
    337334        FemModel* femmodel=NULL;
     
    343340
    344341        /*extract our parameter from the found formulation: */
    345         femmodel->FindParam(pparameter,parametername);
    346 }
    347 /*}}}1*/
    348 /*FUNCTION Model::FindParam(double* pparameter,char* parametername,int analysis_type) {{{1*/
    349 int   Model::FindParam(double* pparameter,char* parametername,int analysis_type){
     342        femmodel->FindParam(pparameter,enum_type);
     343}
     344/*}}}1*/
     345/*FUNCTION Model::FindParam(double* pparameter,int enum_type,int analysis_type) {{{1*/
     346int   Model::FindParam(double* pparameter,int enum_type,int analysis_type){
    350347       
    351348        FemModel* femmodel=NULL;
     
    357354
    358355        /*extract our parameter from the found formulation: */
    359         femmodel->FindParam(pparameter,parametername);
    360 }
    361 /*}}}1*/
    362 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int* pN,char* parametername,int analysis_type) {{{1*/
    363 int   Model::FindParam(double** pparameter,int* pM, int* pN,char* parametername,int analysis_type){
     356        femmodel->FindParam(pparameter,enum_type);
     357}
     358/*}}}1*/
     359/*FUNCTION Model::FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type) {{{1*/
     360int   Model::FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type){
    364361
    365362        FemModel* femmodel=NULL;
     
    371368
    372369        /*extract our parameter from the found formulation: */
    373         femmodel->FindParam(pparameter,pM,pN,parametername);
    374 }
    375 /*}}}1*/
    376 /*FUNCTION Model::FindParam(char** pparameter,char* parametername,int analysis_type) {{{1*/
    377 int   Model::FindParam(char** pparameter,char* parametername,int analysis_type){
     370        femmodel->FindParam(pparameter,pM,pN,enum_type);
     371}
     372/*}}}1*/
     373/*FUNCTION Model::FindParam(char** pparameter,int enum_type,int analysis_type) {{{1*/
     374int   Model::FindParam(char** pparameter,int enum_type,int analysis_type){
    378375
    379376        FemModel* femmodel=NULL;
     
    385382
    386383        /*extract our parameter from the found formulation: */
    387         femmodel->FindParam(pparameter,parametername);
     384        femmodel->FindParam(pparameter,enum_type);
    388385}       
    389386/*}}}1*/
     
    407404
    408405                femmodel=(FemModel*)femmodels->GetObjectByOffset(i);
    409                 femmodel->FindParam(&femmodel_analysis_type,"analysis_type");
    410                 femmodel->FindParam(&femmodel_sub_analysis_type,"sub_analysis_type");
     406                femmodel->FindParam(&femmodel_analysis_type,AnalysisTypeEnum);
     407                femmodel->FindParam(&femmodel_sub_analysis_type,SubAnalysisTypeEnum);
    411408
    412409                if((analysis_type==femmodel_analysis_type) && (sub_analysis_type==femmodel_sub_analysis_type)){
     
    436433
    437434                femmodel=(FemModel*)femmodels->GetObjectByOffset(i);
    438                 femmodel->FindParam(&femmodel_analysis_type,"analysis_type");
     435                femmodel->FindParam(&femmodel_analysis_type,AnalysisTypeEnum);
    439436
    440437                if((analysis_type==femmodel_analysis_type)){
  • issm/trunk/src/c/objects/Model.h

    r3637 r3673  
    3535
    3636                /*all overloaded forms of the FindParam routine: */
    37                 int   FindParam(int* pparameter,char* parametername);
    38                 int   FindParam(double* pparameter,char* parametername);
    39                 int   FindParam(double** pparameter,int* pM,int* pN,char* parametername);
    40                 int   FindParam(char** pparameter,char* parametername);
     37                int   FindParam(int* pparameter,int enum_type);
     38                int   FindParam(double* pparameter,int enum_type);
     39                int   FindParam(double** pparameter,int* pM,int* pN,int enum_type);
     40                int   FindParam(char** pparameter,int enum_type);
    4141
    42                 int   FindParam(int* pparameter,char* parametername,int analysis_type,int sub_analysis_type);
    43                 int   FindParam(double* pparameter,char* parametername,int analysis_type,int sub_analysis_type);
    44                 int   FindParam(double** pparameter,int* pM, int* pN,char* parametername,int analysis_type,int sub_analysis_type);
    45                 int   FindParam(char** pparameter,char* parametername,int analysis_type,int sub_analysis_type);
     42                int   FindParam(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type);
     43                int   FindParam(double* pparameter,int enum_type,int analysis_type,int sub_analysis_type);
     44                int   FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type,int sub_analysis_type);
     45                int   FindParam(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type);
    4646
    47                 int   FindParam(int* pparameter,char* parametername,int analysis_type);
    48                 int   FindParam(double* pparameter,char* parametername,int analysis_type);
    49                 int   FindParam(double** pparameter,int* pM,int* pN,char* parametername,int analysis_type);
    50                 int   FindParam(char** pparameter,char* parametername,int analysis_type);
     47                int   FindParam(int* pparameter,int enum_type,int analysis_type);
     48                int   FindParam(double* pparameter,int enum_type,int analysis_type);
     49                int   FindParam(double** pparameter,int* pM,int* pN,int enum_type,int analysis_type);
     50                int   FindParam(char** pparameter,int enum_type,int analysis_type);
    5151
    5252                FemModel* GetFormulation(int analysis_type,int sub_analysis_type);
  • issm/trunk/src/c/objects/Node.cpp

    r3649 r3673  
    336336}
    337337/*}}}*/
    338 /*FUNCTION Node::GetId{{{2*/
    339 int    Node::GetId(void){ return id; }
    340 /*}}}*/
    341 /*FUNCTION Node::GetName{{{2*/
    342 char* Node::GetName(void){
    343         return "node";
    344 }
     338/*FUNCTION Node::Id{{{2*/
     339int    Node::Id(void){ return id; }
    345340/*}}}*/
    346341/*FUNCTION Node::GetVertexDof {{{2*/
  • issm/trunk/src/c/objects/Node.h

    r3649 r3673  
    4444                void  Echo();
    4545                int   Enum();
    46                 int   GetId(void);
    47                 char* GetName();
     46                int   Id(void);
    4847                int   GetVertexDof(void);
    4948                void  Marshall(char** pmarshalled_dataset);
  • issm/trunk/src/c/objects/Numericalflux.cpp

    r3649 r3673  
    3737}
    3838/*}}}*/
    39 /*FUNCTION Numericalflux::Numericalflux(int id, Hook* hnodes, Hook* helements, DataSet* parameters, Inputs* numericalflux_inputs) {{{1*/
     39/*FUNCTION Numericalflux::Numericalflux(int id, Hook* hnodes, Hook* helements, Parameters* parameters, Inputs* numericalflux_inputs) {{{1*/
    4040Numericalflux::Numericalflux(int numericalflux_id,Hook* numericalflux_hnodes, Hook* numericalflux_helements, Parameters* numericalflux_parameters, Inputs* numericalflux_inputs):
    4141        hnodes(numericalflux_hnodes),
     
    352352        /*recover parameters: */
    353353        if (analysis_type==Prognostic2AnalysisEnum){
    354                 parameters->FindParam(&dt,"dt");
     354                parameters->FindParam(&dt,DtEnum);
    355355        }
    356356        else if (analysis_type==Balancedthickness2AnalysisEnum){
     
    467467        /*recover parameters: */
    468468        if (analysis_type==Prognostic2AnalysisEnum){
    469                 parameters->FindParam(&dt,"dt");
     469                parameters->FindParam(&dt,DtEnum);
    470470        }
    471471        else if (analysis_type==Balancedthickness2AnalysisEnum){
     
    612612        /*recover parameters: */
    613613        if (analysis_type==Prognostic2AnalysisEnum){
    614                 parameters->FindParam(&dt,"dt");
     614                parameters->FindParam(&dt,DtEnum);
    615615        }
    616616        else if (analysis_type==Balancedthickness2AnalysisEnum){
     
    737737}
    738738/*}}}*/
    739 /*FUNCTION Numericalflux::GetId {{{1*/
    740 int    Numericalflux::GetId(void){
     739/*FUNCTION Numericalflux::Id {{{1*/
     740int    Numericalflux::Id(void){
    741741        return id;
    742742}
     
    778778}
    779779/*}}}*/
    780 /*FUNCTION Numericalflux::GetName {{{1*/
    781 char* Numericalflux::GetName(void){
    782         return "numericalflux";
    783 }
    784 /*}}}*/
    785780/*FUNCTION Numericalflux::GetNodalFunctions{{{1*/
    786781void Numericalflux::GetNodalFunctions(double* l1l4, double gauss_coord){
  • issm/trunk/src/c/objects/Numericalflux.h

    r3649 r3673  
    3838                void  Echo();
    3939                int   Enum();
    40                 int   GetId();
    41                 char* GetName();
     40                int   Id();
    4241                void  Marshall(char** pmarshalled_dataset);
    4342                int   MarshallSize();
  • issm/trunk/src/c/objects/Object.h

    r3463 r3673  
    1818                virtual void  Echo()=0;
    1919                virtual void  DeepEcho()=0;
    20                 virtual int   GetId()=0;
     20                virtual int   Id()=0;
    2121                virtual int   MyRank()=0;
    2222                virtual void  Marshall(char** pmarshalled_dataset)=0;
    2323                virtual int   MarshallSize()=0;
    24                 virtual char* GetName()=0;
    2524                virtual void  Demarshall(char** pmarshalled_dataset)=0;
    2625                virtual int   Enum()=0;
  • issm/trunk/src/c/objects/Pengrid.cpp

    r3647 r3673  
    5151}
    5252/*}}}*/
    53 /*FUNCTION Pengrid::Pengrid(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, DataSet* parameters, Inputs* pengrid_inputs) {{{1*/
     53/*FUNCTION Pengrid::Pengrid(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, Parameters* parameters, Inputs* pengrid_inputs) {{{1*/
    5454Pengrid::Pengrid(int pengrid_id,Hook* pengrid_hnode, Hook* pengrid_helement,Hook* pengrid_hmatpar, Parameters* pengrid_parameters, Inputs* pengrid_inputs):
    5555        hnode(pengrid_hnode),
     
    191191}
    192192/*}}}1*/
    193 /*FUNCTION Pengrid::GetId {{{1*/
    194 int    Pengrid::GetId(void){ return id; }
    195 /*}}}1*/
    196 /*FUNCTION Pengrid::GetName {{{1*/
    197 char* Pengrid::GetName(void){
    198         return "pengrid";
    199 }
     193/*FUNCTION Pengrid::Id {{{1*/
     194int    Pengrid::Id(void){ return id; }
    200195/*}}}1*/
    201196/*FUNCTION Pengrid::Marshall {{{1*/
     
    371366        meltingpoint=matpar->GetMeltingPoint();
    372367        beta=matpar->GetBeta();
    373         parameters->FindParam(&stabilize_constraints,"stabilize_constraints");
     368        parameters->FindParam(&stabilize_constraints,StabilizeConstraintsEnum);
    374369       
    375370        if(reset_penalties)zigzag_counter=0;
     
    467462       
    468463        /*recover parameters: */
    469         parameters->FindParam(&penalty_offset,"penalty_offset");
     464        parameters->FindParam(&penalty_offset,PenaltyOffsetEnum);
    470465
    471466        //Create elementary matrix: add penalty to contrain wb (wb=ub*db/dx+vb*db/dy)
     
    515510
    516511        /*recover parameters: */
    517         parameters->FindParam(&penalty_offset,"penalty_offset");
     512        parameters->FindParam(&penalty_offset,PenaltyOffsetEnum);
    518513
    519514        /*Get dof list: */
     
    549544
    550545        /*recover parameters: */
    551         parameters->FindParam(&penalty_offset,"penalty_offset");
     546        parameters->FindParam(&penalty_offset,PenaltyOffsetEnum);
    552547
    553548        /*Get dof list: */
     
    625620        penta->inputs->GetParameterValue(&temperature,node,TemperatureEnum);
    626621        inputs->GetParameterValue(&melting_offset,MeltingOffsetEnum);
    627         parameters->FindParam(&dt,"dt");
    628         parameters->FindParam(&penalty_offset,"penalty_offset");
     622        parameters->FindParam(&dt,DtEnum);
     623        parameters->FindParam(&penalty_offset,PenaltyOffsetEnum);
    629624
    630625        meltingpoint=matpar->GetMeltingPoint();
     
    690685        //First recover pressure  and penalty_offset
    691686        penta->inputs->GetParameterValue(&pressure,node,PressureEnum);
    692         parameters->FindParam(&penalty_offset,"penalty_offset");
     687        parameters->FindParam(&penalty_offset,PenaltyOffsetEnum);
    693688
    694689        //Compute pressure melting point
  • issm/trunk/src/c/objects/Pengrid.h

    r3637 r3673  
    4848                void  Echo();
    4949                int   Enum();
    50                 int   GetId();
    51                 char* GetName();
     50                int   Id();
    5251                void  Marshall(char** pmarshalled_dataset);
    5352                int   MarshallSize();
  • issm/trunk/src/c/objects/Penpair.cpp

    r3632 r3673  
    170170}
    171171/*}}}1*/
    172 /*FUNCTION Penpair::GetId {{{1*/
    173 int    Penpair::GetId(void){ return id; }
    174 /*}}}1*/
    175 /*FUNCTION Penpair::GetName {{{1*/
    176 char* Penpair::GetName(void){
    177         return "penpair";
    178 }
     172/*FUNCTION Penpair::Id {{{1*/
     173int    Penpair::Id(void){ return id; }
    179174/*}}}1*/
    180175/*FUNCTION Penpair::MyRank {{{1*/
  • issm/trunk/src/c/objects/Penpair.h

    r3637 r3673  
    3333                void  Marshall(char** pmarshalled_dataset);
    3434                int   MarshallSize();
    35                 char* GetName();
    3635                void  Demarshall(char** pmarshalled_dataset);
    3736                int   Enum();
    38                 int   GetId();
     37                int   Id();
    3938                int   MyRank();
    4039                void  Configure(DataSet* elements,DataSet* loads,DataSet* nodes,DataSet* vertices,DataSet* materials,Parameters* parameters);
  • issm/trunk/src/c/objects/Penta.cpp

    r3629 r3673  
    4141}
    4242/*}}}*/
    43 /*FUNCTION Penta::Penta(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, DataSet* parameters, Inputs* penta_inputs) {{{1*/
     43/*FUNCTION Penta::Penta(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, Parameters* parameters, Inputs* penta_inputs) {{{1*/
    4444Penta::Penta(int penta_id,Hook* penta_hnodes, Hook* penta_hmatice, Hook* penta_hmatpar, Parameters* penta_parameters, Inputs* penta_inputs):
    4545        hnodes(penta_hnodes),
     
    510510
    511511        /*retrieve some parameters: */
    512         this->parameters->FindParam(&stokesreconditioning,"stokesreconditioning");
     512        this->parameters->FindParam(&stokesreconditioning,StokesReconditioningEnum);
    513513       
    514514        if(!onbed){
     
    900900
    901901        /*retrieve some parameters: */
    902         this->parameters->FindParam(&viscosity_overshoot,"viscosity_overshoot");
     902        this->parameters->FindParam(&viscosity_overshoot,ViscosityOvershootEnum);
    903903
    904904        /*If on water, skip stiffness: */
     
    11441144
    11451145        /*retrieve some parameters: */
    1146         this->parameters->FindParam(&stokesreconditioning,"stokesreconditioning");
     1146        this->parameters->FindParam(&stokesreconditioning,StokesReconditioningEnum);
    11471147
    11481148        /* Get node coordinates and dof list: */
     
    16651665
    16661666        /*retrieve some parameters: */
    1667         this->parameters->FindParam(&dt,"dt");
    1668         this->parameters->FindParam(&artdiff,"art_diff");
    1669         this->parameters->FindParam(&epsvel,"epsvel");
     1667        this->parameters->FindParam(&dt,DtEnum);
     1668        this->parameters->FindParam(&artdiff,ArtDiffEnum);
     1669        this->parameters->FindParam(&epsvel,EpsVelEnum);
    16701670
    16711671        /* Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore
     
    21642164
    21652165        /*retrieve some parameters: */
    2166         this->parameters->FindParam(&stokesreconditioning,"stokesreconditioning");
     2166        this->parameters->FindParam(&stokesreconditioning,StokesReconditioningEnum);
    21672167
    21682168        /*If on water, skip load: */
     
    26132613
    26142614        /*retrieve some parameters: */
    2615         this->parameters->FindParam(&dt,"dt");
     2615        this->parameters->FindParam(&dt,DtEnum);
    26162616
    26172617        /*If on water, skip: */
     
    33683368}
    33693369/*}}}*/
    3370 /*FUNCTION GetId {{{1*/
    3371 int    Penta::GetId(void){
     3370/*FUNCTION Id {{{1*/
     3371int    Penta::Id(void){
    33723372        return id;
    33733373}
     
    37093709}
    37103710/*}}}*/
    3711 /*FUNCTION GetName {{{1*/
    3712 char* Penta::GetName(void){
    3713         return "penta";
    3714 }
    3715 /*}}}*/
    37163711/*FUNCTION GetNodalFunctions {{{1*/
    37173712void Penta::GetNodalFunctions(double* l1l6, double* gauss_coord){
  • issm/trunk/src/c/objects/Penta.h

    r3637 r3673  
    2020#include "./Matice.h"
    2121#include "./Tria.h"
     22#include "../shared/Exceptions/exceptions.h"
     23#include "../include/macros.h"
    2224#include "./Hook.h"
    2325#include "../ModelProcessorx/IoModel.h"
     
    5456                void  Echo();
    5557                int   Enum();
    56                 int   GetId();
    57                 char* GetName();
     58                int   Id();
    5859                void  Marshall(char** pmarshalled_dataset);
    5960                int   MarshallSize();
     
    147148                void  UpdateInputsBalancedthickness2( double* solution,int analysis_type,int sub_analysis_type);
    148149                void  UpdateInputsBalancedvelocities( double* solution,int analysis_type,int sub_analysis_type);
     150                void AddInput(double value, int enum_type){ISSMERROR("not supporte yet!");}
    149151
    150152                /*}}}*/
  • issm/trunk/src/c/objects/Result.cpp

    r3612 r3673  
    234234}
    235235/*}}}1*/
    236 /*FUNCTION Result::GetId {{{1*/
    237 int    Result::GetId(void){ return id; }
    238 /*}}}1*/
    239 /*FUNCTION Result::GetName {{{1*/
    240 char* Result::GetName(void){
    241         return "result";
    242 }
     236/*FUNCTION Result::Id {{{1*/
     237int    Result::Id(void){ return id; }
    243238/*}}}1*/
    244239/*FUNCTION Result::GetStep {{{1*/
  • issm/trunk/src/c/objects/Result.h

    r3637 r3673  
    3636                void  Echo();
    3737                void  DeepEcho();
    38                 int   GetId(void);
     38                int   Id(void);
    3939                int   MyRank(void);
    4040                void  Marshall(char** pmarshalled_dataset);
    4141                int   MarshallSize();
    42                 char* GetName();
    4342                void  Demarshall(char** pmarshalled_dataset);
    4443                int   Enum();
  • issm/trunk/src/c/objects/Rgb.cpp

    r3567 r3673  
    134134}
    135135/*}}}1*/
    136 /*FUNCTION Rgb::GetId {{{1*/
    137 int    Rgb::GetId(void){ return id; }
    138 /*}}}1*/
    139 /*FUNCTION Rgb::GetName {{{1*/
    140 char* Rgb::GetName(void){
    141         return "rgb";
    142 }
     136/*FUNCTION Rgb::Id {{{1*/
     137int    Rgb::Id(void){ return id; }
    143138/*}}}1*/
    144139/*FUNCTION Rgb::GetNodeId1{{{1*/
  • issm/trunk/src/c/objects/Rgb.h

    r3637 r3673  
    3030                void   Marshall(char** pmarshalled_dataset);
    3131                int    MarshallSize();
    32                 char*  GetName();
    3332                void   Demarshall(char** pmarshalled_dataset);
    3433                int    Enum();
    35                 int    GetId();
     34                int    Id();
    3635                int    MyRank();
    3736
  • issm/trunk/src/c/objects/Riftfront.cpp

    r3647 r3673  
    4141}
    4242/*}}}*/
    43 /*FUNCTION Riftfront::Riftfront(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, DataSet* parameters, Inputs* riftfront_inputs) {{{1*/
     43/*FUNCTION Riftfront::Riftfront(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, Parameters* parameters, Inputs* riftfront_inputs) {{{1*/
    4444Riftfront::Riftfront(int riftfront_id,Hook* riftfront_hnodes, Hook* riftfront_hmatpar, Parameters* riftfront_parameters, Inputs* riftfront_inputs):
    4545        hnodes(riftfront_hnodes),
     
    213213}
    214214/*}}}1*/
    215 /*FUNCTION Riftfront::GetId {{{1*/
    216 int    Riftfront::GetId(void){ return id; }
    217 /*}}}1*/
    218 /*FUNCTION Riftfront::GetName {{{1*/
    219 char* Riftfront::GetName(void){
    220         return "riftfront";
    221 }
     215/*FUNCTION Riftfront::Id {{{1*/
     216int    Riftfront::Id(void){ return id; }
    222217/*}}}1*/
    223218/*FUNCTION Riftfront::Marshall {{{1*/
     
    358353                this->fraction+=fractionincrement;
    359354                if (this->fraction>1)this->fraction=(double)1.0;
    360                 //printf("riftfront %i fraction: %g\n",this->GetId(),this->fraction);
     355                //printf("riftfront %i fraction: %g\n",this->Id(),this->fraction);
    361356        }
    362357
     
    373368        this->active=activate;
    374369
    375         //if ((penetration>0) & (this->active==1))printf("Riftfront %i wants to be released\n",GetId());
     370        //if ((penetration>0) & (this->active==1))printf("Riftfront %i wants to be released\n",Id());
    376371
    377372        /*assign output pointer: */
     
    504499
    505500        /*recover id of penalty: */
    506         row_id=this->GetId()-1; //c indexing, ids were matlab indexed
     501        row_id=this->Id()-1; //c indexing, ids were matlab indexed
    507502        value=(double)this->fraction;
    508503
     
    552547
    553548        /*Get some parameters: */
    554         this->parameters->FindParam(&penalty_offset,"penalty_offset");
     549        this->parameters->FindParam(&penalty_offset,PenaltyOffsetEnum);
    555550        this->inputs->GetParameterValue(&friction,FrictionEnum);
    556551
  • issm/trunk/src/c/objects/Riftfront.h

    r3637 r3673  
    5757                void  Echo();
    5858                int   Enum();
    59                 int   GetId();
    60                 char* GetName();
     59                int   Id();
    6160                void  Marshall(char** pmarshalled_dataset);
    6261                int   MarshallSize();
  • issm/trunk/src/c/objects/Sing.cpp

    r3622 r3673  
    451451}
    452452/*}}}*/
    453 /*FUNCTION Sing::GetId {{{1*/
    454 int    Sing::GetId(void){ return id; }
     453/*FUNCTION Sing::Id {{{1*/
     454int    Sing::Id(void){ return id; }
    455455/*}}}*/
    456456/*FUNCTION Sing::GetMatPar {{{1*/
     
    464464
    465465        return matpar;
    466 }
    467 /*}}}*/
    468 /*FUNCTION Sing::GetName {{{1*/
    469 char* Sing::GetName(void){
    470         return "sing";
    471466}
    472467/*}}}*/
  • issm/trunk/src/c/objects/Sing.h

    r3637 r3673  
    1313#include "./Matpar.h"
    1414#include "../ModelProcessorx/IoModel.h"
     15#include "../include/macros.h"
     16#include "../shared/Exceptions/exceptions.h"
    1517#include "./Hook.h"
    1618#include "../DataSet/Inputs.h"
     
    4850                void  Echo();
    4951                int   Enum();
    50                 int   GetId();
    51                 char* GetName();
     52                int   Id();
    5253                void  Marshall(char** pmarshalled_dataset);
    5354                int   MarshallSize();
     
    8384                double CostFunction(int,int);
    8485                double MassFlux(double* segment,double* ug);
     86                void AddInput(double value, int enum_type){ISSMERROR("not supporte yet!");}
    8587                /*}}}*/
    8688
  • issm/trunk/src/c/objects/SolPar.h

    r3637 r3673  
    3232                void  Echo();
    3333                void  DeepEcho();
    34                 int   GetId();
     34                int   Id();
    3535                int   MyRank();
    3636                void  Marshall(char** pmarshalled_dataset);
    3737                int   MarshallSize();
    38                 char* GetName();
    3938                void  Demarshall(char** pmarshalled_dataset);
    4039                int   Enum();
  • issm/trunk/src/c/objects/Spc.cpp

    r3567 r3673  
    139139}
    140140/*}}}1*/
    141 /*FUNCTION Spc::GetId {{{1*/
    142 int    Spc::GetId(void){ return sid; }
    143 /*}}}1*/
    144 /*FUNCTION Spc::GetName {{{1*/
    145 char* Spc::GetName(void){
    146         return "spc";
    147 }
     141/*FUNCTION Spc::Id {{{1*/
     142int    Spc::Id(void){ return sid; }
    148143/*}}}1*/
    149144/*FUNCTION Spc::GetNodeId {{{1*/
  • issm/trunk/src/c/objects/Spc.h

    r3637 r3673  
    3030                void   Marshall(char** pmarshalled_dataset);
    3131                int    MarshallSize();
    32                 char*  GetName();
    3332                void   Demarshall(char** pmarshalled_dataset);
    3433                int    Enum();
    35                 int    GetId();
     34                int    Id();
    3635                int    MyRank();
    3736                void   DistributeNumDofs(int* numdofspernode,int analysis_type);
  • issm/trunk/src/c/objects/Tria.cpp

    r3637 r3673  
    4747}
    4848/*}}}*/
    49 /*FUNCTION Tria::Tria(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, DataSet* parameters, Inputs* tria_inputs) {{{1*/
     49/*FUNCTION Tria::Tria(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, Parameters* parameters, Inputs* tria_inputs) {{{1*/
    5050Tria::Tria(int tria_id,Hook* tria_hnodes, Hook* tria_hmatice, Hook* tria_hmatpar, Parameters* tria_parameters, Inputs* tria_inputs):
    5151        hnodes(tria_hnodes),
     
    597597
    598598        /*retrieve some parameters: */
    599         this->parameters->FindParam(&control_type,"control_type");
    600         this->parameters->FindParam(&cm_noisedmp,"cm_noisedmp");
     599        this->parameters->FindParam(&control_type,ControlTypeEnum);
     600        this->parameters->FindParam(&cm_noisedmp,CmNoiseDmpEnum);
    601601
    602602        /* Get node coordinates and dof list: */
     
    773773
    774774        /*retrieve some parameters: */
    775         this->parameters->FindParam(&artdiff,"artdiff");
     775        this->parameters->FindParam(&artdiff,ArtDiffEnum);
    776776
    777777        //Create Artificial diffusivity once for all if requested
     
    10451045
    10461046        /*retrieve some parameters: */
    1047         this->parameters->FindParam(&artdiff,"artdiff");
     1047        this->parameters->FindParam(&artdiff,ArtDiffEnum);
    10481048
    10491049        /* Get node coordinates and dof list: */
     
    12211221
    12221222        /*retrieve some parameters: */
    1223         this->parameters->FindParam(&viscosity_overshoot,"viscosity_overshoot");
     1223        this->parameters->FindParam(&viscosity_overshoot,ViscosityOvershootEnum);
    12241224
    12251225        /*First, if we are on water, return empty matrix: */
     
    17631763
    17641764        /*retrieve some parameters: */
    1765         this->parameters->FindParam(&dt,"dt");
    1766         this->parameters->FindParam(&artdiff,"artdiff");
     1765        this->parameters->FindParam(&dt,DtEnum);
     1766        this->parameters->FindParam(&artdiff,ArtDiffEnum);
    17671767
    17681768        /* Get node coordinates and dof list: */
     
    19391939
    19401940        /*retrieve some parameters: */
    1941         this->parameters->FindParam(&dt,"dt");
     1941        this->parameters->FindParam(&dt,DtEnum);
    19421942
    19431943        /* Get node coordinates and dof list: */
     
    21472147
    21482148        /*retrieve some parameters: */
    2149         this->parameters->FindParam(&dt,"dt");
     2149        this->parameters->FindParam(&dt,DtEnum);
    21502150
    21512151        /* Get node coordinates and dof list: */
     
    27882788
    27892789        /*retrieve some parameters: */
    2790         this->parameters->FindParam(&dt,"dt");
     2790        this->parameters->FindParam(&dt,DtEnum);
    27912791
    27922792        /* Get node coordinates and dof list: */
     
    28772877
    28782878        /*retrieve some parameters: */
    2879         this->parameters->FindParam(&dt,"dt");
     2879        this->parameters->FindParam(&dt,DtEnum);
    28802880
    28812881        /* Get node coordinates and dof list: */
     
    30853085       
    30863086        /*retrieve some solution parameters: */
    3087         this->parameters->FindParam(&dt,"dt");
     3087        this->parameters->FindParam(&dt,DtEnum);
    30883088
    30893089        /* Ice/ocean heat exchange flux on ice shelf base */
     
    32013201
    32023202        /*retrieve some parameters: */
    3203         this->parameters->FindParam(&dt,"dt");
     3203        this->parameters->FindParam(&dt,DtEnum);
    32043204
    32053205
     
    33513351
    33523352        /*retrieve some parameters: */
    3353         this->parameters->FindParam(&meanvel,"meanvel");
    3354         this->parameters->FindParam(&epsvel,"epsvel");
     3353        this->parameters->FindParam(&meanvel,MeanVelEnum);
     3354        this->parameters->FindParam(&epsvel,EpsVelEnum);
    33553355
    33563356        /* Get node coordinates and dof list: */
     
    37903790}
    37913791/*}}}*/
    3792 /*FUNCTION Tria::GetId {{{1*/
    3793 int    Tria::GetId(){ return id; }
     3792/*FUNCTION Tria::Id {{{1*/
     3793int    Tria::Id(){ return id; }
    37943794/*}}}*/
    37953795/*FUNCTION Tria::GetJacobian {{{1*/
     
    39453945}
    39463946/*}}}*/
    3947 /*FUNCTION Tria::GetName {{{1*/
    3948 char* Tria::GetName(void){
    3949         return "tria";
    3950 }
    3951 /*}}}*/
    39523947/*FUNCTION Tria::GetNodalFunctions {{{1*/
    39533948void Tria::GetNodalFunctions(double* l1l2l3, double* gauss_l1l2l3){
     
    42264221
    42274222        /*retrieve some parameters: */
    4228         this->parameters->FindParam(&cm_noisedmp,"cm_noisedmp");
    4229         this->parameters->FindParam(&cm_mindmp_value,"cm_mindmp_value");
    4230         this->parameters->FindParam(&cm_mindmp_slope,"cm_mindmp_slope");
    4231         this->parameters->FindParam(&cm_maxdmp_value,"cm_maxdmp_value");
    4232         this->parameters->FindParam(&cm_maxdmp_slope,"cm_maxdmp_slope");
     4223        this->parameters->FindParam(&cm_noisedmp,CmNoiseDmpEnum);
     4224        this->parameters->FindParam(&cm_mindmp_value,CmMinDmpValueEnum);
     4225        this->parameters->FindParam(&cm_mindmp_slope,CmMinDmpSlopeEnum);
     4226        this->parameters->FindParam(&cm_maxdmp_value,CmMaxDmpValueEnum);
     4227        this->parameters->FindParam(&cm_maxdmp_slope,CmMaxDmpSlopeEnum);
    42334228
    42344229        /* Get node coordinates and dof list: */
     
    43944389
    43954390        /*retrieve some parameters: */
    4396         this->parameters->FindParam(&cm_noisedmp,"cm_noisedmp");
    4397         this->parameters->FindParam(&cm_mindmp_value,"cm_mindmp_value");
    4398         this->parameters->FindParam(&cm_mindmp_slope,"cm_mindmp_slope");
    4399         this->parameters->FindParam(&cm_maxdmp_value,"cm_maxdmp_value");
    4400         this->parameters->FindParam(&cm_maxdmp_slope,"cm_maxdmp_slope");
     4391        this->parameters->FindParam(&cm_noisedmp,CmNoiseDmpEnum);
     4392        this->parameters->FindParam(&cm_mindmp_value,CmMinDmpValueEnum);
     4393        this->parameters->FindParam(&cm_mindmp_slope,CmMinDmpSlopeEnum);
     4394        this->parameters->FindParam(&cm_maxdmp_value,CmMaxDmpValueEnum);
     4395        this->parameters->FindParam(&cm_maxdmp_slope,CmMaxDmpSlopeEnum);
     4396
    44014397
    44024398        /*Get out if shelf*/
     
    46004596
    46014597        /*retrieve some parameters: */
    4602         this->parameters->FindParam(&cm_noisedmp,"cm_noisedmp");
    4603         this->parameters->FindParam(&cm_mindmp_value,"cm_mindmp_value");
    4604         this->parameters->FindParam(&cm_mindmp_slope,"cm_mindmp_slope");
    4605         this->parameters->FindParam(&cm_maxdmp_value,"cm_maxdmp_value");
    4606         this->parameters->FindParam(&cm_maxdmp_slope,"cm_maxdmp_slope");
     4598        this->parameters->FindParam(&cm_noisedmp,CmNoiseDmpEnum);
     4599        this->parameters->FindParam(&cm_mindmp_value,CmMinDmpValueEnum);
     4600        this->parameters->FindParam(&cm_mindmp_slope,CmMinDmpSlopeEnum);
     4601        this->parameters->FindParam(&cm_maxdmp_value,CmMaxDmpValueEnum);
     4602        this->parameters->FindParam(&cm_maxdmp_slope,CmMaxDmpSlopeEnum);
    46074603
    46084604        /*Get out if shelf*/
     
    49064902
    49074903        /*retrieve some parameters: */
    4908         this->parameters->FindParam(&meanvel,"meanvel");
    4909         this->parameters->FindParam(&epsvel,"epsvel");
     4904        this->parameters->FindParam(&meanvel,MeanVelEnum);
     4905        this->parameters->FindParam(&epsvel,EpsVelEnum);
    49104906       
    49114907        /* Compute Misfit at the 3 nodes
     
    50845080        /*inputs: */
    50855081        bool onwater;
     5082        int  fit;
    50865083
    50875084        /*retrieve inputs :*/
     5085        inputs->GetParameterValue(&fit,FitEnum);
    50885086        inputs->GetParameterValue(&onwater,ElementOnWaterEnum);
     5087
     5088        /*If fit!=3, do not compute surface: */
     5089        if(fit!=3)return 0;
    50895090
    50905091        /*recover objects from hooks: */
  • issm/trunk/src/c/objects/Tria.h

    r3637 r3673  
    1010#include "./Object.h"
    1111#include "./Element.h"
     12#include "../include/macros.h"
     13#include "../shared/Exceptions/exceptions.h"
    1214#include "./Hook.h"
    1315#include "./Node.h"
     
    4547                void  Echo();
    4648                int   Enum();
    47                 int   GetId();
    48                 char* GetName();
     49                int   Id();
    4950                void  Marshall(char** pmarshalled_dataset);
    5051                int   MarshallSize();
     
    126127                void  UpdateInputsBalancedthickness2( double* solution,int analysis_type,int sub_analysis_type);
    127128                void  UpdateInputsBalancedvelocities( double* solution,int analysis_type,int sub_analysis_type);
     129                void  AddInput(double value, int enum_type){ISSMERROR("not supporte yet!");}
    128130
    129131                /*}}}*/
  • issm/trunk/src/c/objects/Vertex.cpp

    r3622 r3673  
    120120}
    121121/*}}}*/
    122 /*FUNCTION GetId{{{2*/
    123 int    Vertex::GetId(void){ return id; }
    124 /*}}}*/
    125 /*FUNCTION GetName{{{2*/
    126 char* Vertex::GetName(void){
    127         return "node";
    128 }
     122/*FUNCTION Id{{{2*/
     123int    Vertex::Id(void){ return id; }
    129124/*}}}*/
    130125/*FUNCTION Marshall {{{2*/
  • issm/trunk/src/c/objects/Vertex.h

    r3637 r3673  
    4343                void  Echo();
    4444                int   Enum();
    45                 int   GetId(void);
    46                 char* GetName();
     45                int   Id(void);
    4746                void  Marshall(char** pmarshalled_dataset);
    4847                int   MarshallSize();
  • issm/trunk/src/c/objects/objects.h

    r3649 r3673  
    2727#include "./Numericalflux.h"
    2828#include "./Param.h"
     29#include "./DoubleParam.h"
    2930#include "./Element.h"
    3031#include "./NodeSets.h"
     
    3334#include "./TriaVertexInput.h"
    3435#include "./Vertex.h"
    35 #include "./Numpar.h"
    3636#include "./BoolInput.h"
    3737#include "./IntInput.h"
  • issm/trunk/src/c/parallel/convergence.cpp

    r3332 r3673  
    66#include "../issm.h"
    77
    8 void convergence(int* pconverged, Mat Kff,Vec pf,Vec uf,Vec old_uf,DataSet* parameters){
     8void convergence(int* pconverged, Mat Kff,Vec pf,Vec uf,Vec old_uf,Parameters* parameters){
    99
    1010        /*output*/
  • issm/trunk/src/c/parallel/diagnostic.cpp

    r3595 r3673  
    3232        Result*  result=NULL;
    3333       
    34         ParameterInputs* inputs=NULL;
    3534        double waitonlock=0;
    3635        int    numberofnodes;
     
    4140        Param*  param=NULL;
    4241        int      count;
    43         DataSet* parameters=NULL;
     42        Parameters* parameters=NULL;
    4443
    4544        /*time*/
  • issm/trunk/src/c/parallel/parallel.h

    r3612 r3673  
    3030void diagnostic_core_nonlinear(Vec* pug,Mat* pK_ff0,Mat* pK_fs0, DataSet* loads, FemModel* fem,int analysis_type,int sub_analysis_type);
    3131void diagnostic_core_linear(Vec* ppg,FemModel* fem,int  analysis_type,int sub_analysis_type);
    32 void convergence(int* pconverged, Mat K_ff,Vec p_f,Vec u_f,Vec u_f_old,DataSet* parameters);
     32void convergence(int* pconverged, Mat K_ff,Vec p_f,Vec u_f,Vec u_f_old,Parameters* parameters);
    3333
    3434void transient_core(DataSet* results,Model* model);
  • issm/trunk/src/c/shared/Elements/ResolvePointers.cpp

    r3570 r3673  
    3030                /*Check whether existing objects are correct: */
    3131                if(objects[i]){
    32                         if(objects[i]->GetId()==object_ids[i]) continue; //this node is good.
     32                        if(objects[i]->Id()==object_ids[i]) continue; //this node is good.
    3333                        else objects[i]=NULL; //this node was incorrect, reset it.
    3434                }
     
    3939                         * we are good: */
    4040                        object=(Object*)dataset->GetObjectByOffset(object_offsets[i]);
    41                         if (object->GetId()==object_ids[i]){
     41                        if (object->Id()==object_ids[i]){
    4242                                objects[i]=object;
    4343                                continue;
     
    5050                        objects[i]=(Object*)dataset->GetObjectById(object_offsets+i,object_ids[i]); //remember the offset for later on.
    5151                        /*check the id is correct!: */
    52                         if (objects[i]->GetId()!=object_ids[i])ISSMERROR("%s%i%s%i%s"," wrong id: ",objects[i]->GetId()," vs ",object_ids[i],"  in resolved pointer!");
     52                        if (objects[i]->Id()!=object_ids[i])ISSMERROR("%s%i%s%i%s"," wrong id: ",objects[i]->Id()," vs ",object_ids[i],"  in resolved pointer!");
    5353                }
    5454        }
  • issm/trunk/src/c/shared/Numerics/OptFunc.cpp

    r3332 r3673  
    2020        double J;
    2121
    22         mxArray*   inputs[8];
     22        mxArray*   inputs[7];
    2323        mxArray*   psearch_scalar=NULL;
    2424        mxArray*   mxJ=NULL;
     
    2727        inputs[0]=psearch_scalar;
    2828        inputs[1]=optargs->models;
    29         inputs[2]=optargs->inputs;
    3029        inputs[3]=optargs->param_g;
    3130        inputs[4]=optargs->grad_g;
  • issm/trunk/src/c/shared/Numerics/numerics.h

    r1439 r3673  
    88#include "./GaussPoints.h"
    99#include "./isnan.h"
    10 #include "../../objects/objects.h"
     10#include "../../objects/OptArgs.h"
     11#include "../../objects/OptPars.h"
    1112
    1213double min(double a,double b);
Note: See TracChangeset for help on using the changeset viewer.