Changeset 3751


Ignore:
Timestamp:
05/15/10 19:36:18 (15 years ago)
Author:
Eric.Larour
Message:

Final build that compiles in serial and parallel model

Location:
issm/trunk/src
Files:
85 edited

Legend:

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

    r3570 r3751  
    1010#include "../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void ControlConstrainx( double* p_g, int numdofnodes, double cm_min, double cm_max,char* control_type){
     12void ControlConstrainx( double* p_g, int numdofnodes, double cm_min, double cm_max,int control_type){
    1313
    1414        int i;
  • issm/trunk/src/c/ControlConstrainx/ControlConstrainx.h

    r2354 r3751  
    99
    1010/* local prototypes: */
    11 void ControlConstrainx( double* p_g, int numberofnodes, double cm_min, double cm_max,char* control_type);
     11void ControlConstrainx( double* p_g, int numberofnodes, double cm_min, double cm_max,int control_type);
    1212
    1313#endif  /* _CONTROLCONSTRAINX_H */
  • issm/trunk/src/c/DataSet/DataSet.cpp

    r3732 r3751  
    14021402}
    14031403/*}}}*/
     1404/*FUNCTION DataSet::UpdateInputsFromVector{{{1*/
     1405void  DataSet::UpdateInputsFromVector(int* vec, int name, int type){
     1406
     1407        vector<Object*>::iterator object;
     1408        for ( object=objects.begin() ; object < objects.end(); object++ ){
     1409
     1410                (*object)->UpdateInputsFromVector(vec,name,type);
     1411        }
     1412}
     1413/*}}}*/
     1414/*FUNCTION DataSet::UpdateInputsFromVector{{{1*/
     1415void  DataSet::UpdateInputsFromVector(bool* vec, int name, int type){
     1416
     1417        vector<Object*>::iterator object;
     1418        for ( object=objects.begin() ; object < objects.end(); object++ ){
     1419
     1420                (*object)->UpdateInputsFromVector(vec,name,type);
     1421        }
     1422}
     1423/*}}}*/
    14041424/*FUNCTION DataSet::UpdateVertexPositions{{{1*/
    14051425void  DataSet::UpdateVertexPositions(double* thickness,double* bed){
  • issm/trunk/src/c/DataSet/DataSet.h

    r3732 r3751  
    7575                void  UpdateInputsFromConstant(bool constant, int name);
    7676                void  UpdateInputsFromVector(double* vector,int name, int type);
     77                void  UpdateInputsFromVector(int* vector,int name, int type);
     78                void  UpdateInputsFromVector(bool* vector,int name, int type);
    7779                void  UpdateInputsFromSolution(double* solution,int analysis_type,int sub_analysis_type);
    7880                void  PenaltyCreateKMatrix(Mat Kgg,double kmax,int analysis_type,int sub_analysis_type);
  • issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h

    r3729 r3751  
    4141        SteadyAnalysisEnum,
    4242        //slope
     43        SurfaceAnalysisEnum,
    4344        SlopecomputeAnalysisEnum,
    4445        BedXAnalysisEnum,
    4546        BedYAnalysisEnum,
     47        BedAnalysisEnum,
    4648        SurfaceXAnalysisEnum,
    4749        SurfaceYAnalysisEnum,
     
    200202        SurfaceSlopeyEnum,
    201203        TemperatureEnum,
     204        TemperatureAverageEnum,
    202205        ThicknessEnum,
    203206        TypeEnum,
  • issm/trunk/src/c/Makefile.am

    r3723 r3751  
    885885bin_PROGRAMS =
    886886else
    887 dnl bin_PROGRAMS = diagnostic.exe thermal.exe prognostic.exe prognostic2.exe balancedthickness.exe balancedthickness2.exe balancedvelocities.exe transient.exe steadystate.exe slopecompute.exe
    888 bin_PROGRAMS = diagnostic.exe
     887bin_PROGRAMS = diagnostic.exe thermal.exe prognostic.exe prognostic2.exe balancedthickness.exe balancedthickness2.exe balancedvelocities.exe transient.exe steadystate.exe slopecompute.exe
    889888endif
    890889
  • issm/trunk/src/c/UpdateInputsFromVectorx/UpdateInputsFromVectorx.cpp

    r3703 r3751  
    99#include "../EnumDefinitions/EnumDefinitions.h"
    1010
     11void UpdateInputsFromVectorx( DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,Vec vector, int NameEnum, int TypeEnum){
     12
     13        double* serial_vector=NULL;
     14
     15        VecToMPISerial(&serial_vector,vector);
     16
     17        UpdateInputsFromVectorx( elements,nodes, vertices, loads, materials, parameters,serial_vector,NameEnum, TypeEnum);
     18
     19        /*Free ressources:*/
     20        xfree((void**)&serial_vector);
     21}
     22
     23       
    1124void UpdateInputsFromVectorx( DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,double* vector, int NameEnum, int TypeEnum){
    1225
     
    2639
    2740}
     41
     42void UpdateInputsFromVectorx( DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,int* vector, int NameEnum, int TypeEnum){
     43
     44        /*First, get elements and loads configured: */
     45        elements->Configure(elements,loads, nodes,vertices, materials,parameters);
     46        loads->Configure(elements, loads, nodes,vertices, materials,parameters);
     47        nodes->Configure(elements, loads, nodes,vertices, materials,parameters);
     48        parameters->Configure(elements,loads, nodes,vertices, materials,parameters);
     49
     50        /*Update elements, nodes, loads and materials from inputs: */
     51        elements->UpdateInputsFromVector(vector,NameEnum,TypeEnum);
     52        nodes->UpdateInputsFromVector(vector,NameEnum,TypeEnum);
     53        vertices->UpdateInputsFromVector(vector,NameEnum,TypeEnum);
     54        loads->UpdateInputsFromVector(vector,NameEnum,TypeEnum);
     55        materials->UpdateInputsFromVector(vector,NameEnum,TypeEnum);
     56        parameters->UpdateInputsFromVector(vector,NameEnum,TypeEnum);
     57
     58}
     59
     60void UpdateInputsFromVectorx( DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,bool* vector, int NameEnum, int TypeEnum){
     61
     62        /*First, get elements and loads configured: */
     63        elements->Configure(elements,loads, nodes,vertices, materials,parameters);
     64        loads->Configure(elements, loads, nodes,vertices, materials,parameters);
     65        nodes->Configure(elements, loads, nodes,vertices, materials,parameters);
     66        parameters->Configure(elements,loads, nodes,vertices, materials,parameters);
     67
     68        /*Update elements, nodes, loads and materials from inputs: */
     69        elements->UpdateInputsFromVector(vector,NameEnum,TypeEnum);
     70        nodes->UpdateInputsFromVector(vector,NameEnum,TypeEnum);
     71        vertices->UpdateInputsFromVector(vector,NameEnum,TypeEnum);
     72        loads->UpdateInputsFromVector(vector,NameEnum,TypeEnum);
     73        materials->UpdateInputsFromVector(vector,NameEnum,TypeEnum);
     74        parameters->UpdateInputsFromVector(vector,NameEnum,TypeEnum);
     75
     76}
  • issm/trunk/src/c/UpdateInputsFromVectorx/UpdateInputsFromVectorx.h

    r3715 r3751  
    1010
    1111/* local prototypes: */
     12void    UpdateInputsFromVectorx( DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,  Parameters* parameters,Vec vector, int NameEnum,int TypeEnum);
    1213void    UpdateInputsFromVectorx( DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,  Parameters* parameters,double* vector, int NameEnum,int TypeEnum);
     14void    UpdateInputsFromVectorx( DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,  Parameters* parameters,int* vector, int NameEnum,int TypeEnum);
     15void    UpdateInputsFromVectorx( DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,  Parameters* parameters,bool* vector, int NameEnum,int TypeEnum);
    1316
    1417#endif  /* _UPDATEINPUTSFROMVECTORXX_H */
  • issm/trunk/src/c/objects/Constraints/Rgb.h

    r3732 r3751  
    3535                int    MyRank();
    3636                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     37                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     38                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    3739                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    3840                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Constraints/Spc.h

    r3732 r3751  
    4040                Object* copy();
    4141                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     42                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     43                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    4244                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    4345                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/DofVec.h

    r3732 r3751  
    4848                int   Size();
    4949                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     50                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     51                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    5052                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5153                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Elements/Beam.cpp

    r3732 r3751  
    774774}
    775775/*}}}*/
    776 
     776/*FUNCTION Beam::UpdateInputsFromVector(int* vector, int name, int type);{{{1*/
     777void  Beam::UpdateInputsFromVector(int* vector, int name, int type){
     778        ISSMERROR(" not supported yet!");
     779}
     780/*}}}*/
     781/*FUNCTION Beam::UpdateInputsFromVector(bool* vector, int name, int type);{{{1*/
     782void  Beam::UpdateInputsFromVector(bool* vector, int name, int type){
     783        ISSMERROR(" not supported yet!");
     784}
     785/*}}}*/
  • issm/trunk/src/c/objects/Elements/Beam.h

    r3732 r3751  
    5454                void  SetClone(int* minranks);
    5555                void    UpdateInputsFromVector(double* vector, int name, int type);
     56                void    UpdateInputsFromVector(int* vector, int name, int type);
     57                void    UpdateInputsFromVector(bool* vector, int name, int type);
    5658                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5759                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r3732 r3751  
    44854485}
    44864486/*}}}*/
     4487/*FUNCTION Penta::UpdateInputsFromVector(int* vector, int name, int type);{{{1*/
     4488void  Penta::UpdateInputsFromVector(int* vector, int name, int type){
     4489        ISSMERROR(" not supported yet!");
     4490}
     4491/*}}}*/
     4492/*FUNCTION Penta::UpdateInputsFromVector(bool* vector, int name, int type);{{{1*/
     4493void  Penta::UpdateInputsFromVector(bool* vector, int name, int type){
     4494        ISSMERROR(" not supported yet!");
     4495}
     4496/*}}}*/
  • issm/trunk/src/c/objects/Elements/Penta.h

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

    r3732 r3751  
    562562}
    563563/*}}}*/
     564/*FUNCTION Sing::UpdateInputsFromVector(int* vector, int name, int type);{{{1*/
     565void  Sing::UpdateInputsFromVector(int* vector, int name, int type){
     566        ISSMERROR(" not supported yet!");
     567}
     568/*}}}*/
     569/*FUNCTION Sing::UpdateInputsFromVector(bool* vector, int name, int type);{{{1*/
     570void  Sing::UpdateInputsFromVector(bool* vector, int name, int type){
     571        ISSMERROR(" not supported yet!");
     572}
     573/*}}}*/
  • issm/trunk/src/c/objects/Elements/Sing.h

    r3732 r3751  
    5454                int   MyRank();
    5555                void  UpdateInputsFromVector(double* vector, int name, int type);
     56                void  UpdateInputsFromVector(int* vector, int name, int type);
     57                void  UpdateInputsFromVector(bool* vector, int name, int type);
    5658                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5759                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r3732 r3751  
    51775177}
    51785178/*}}}*/
     5179/*FUNCTION Tria::UpdateInputsFromVector(int* vector, int name, int type);{{{1*/
     5180void  Tria::UpdateInputsFromVector(int* vector, int name, int type){
     5181        ISSMERROR(" not supported yet!");
     5182}
     5183/*}}}*/
     5184/*FUNCTION Tria::UpdateInputsFromVector(bool* vector, int name, int type);{{{1*/
     5185void  Tria::UpdateInputsFromVector(bool* vector, int name, int type){
     5186        ISSMERROR(" not supported yet!");
     5187}
     5188/*}}}*/
  • issm/trunk/src/c/objects/Elements/Tria.h

    r3732 r3751  
    5151                void  SetClone(int* minranks);
    5252                void    UpdateInputsFromVector(double* vector, int name, int type);
     53                void    UpdateInputsFromVector(int* vector, int name, int type);
     54                void    UpdateInputsFromVector(bool* vector, int name, int type);
    5355                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5456                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/FemModel.cpp

    r3732 r3751  
    319319}
    320320/*}}}*/
     321/*FUNCTION FemModel::UpdateInputsFromVector(Vec vector, int name, int type){{{1*/
     322void FemModel::UpdateInputsFromVector(Vec vector, int name, int type){
     323
     324        double* serial_vector=NULL;
     325
     326        if(vector==NULL)return; //don't bother
     327
     328        VecToMPISerial(&serial_vector,vector);
     329
     330        this->UpdateInputsFromVector(serial_vector,name,type);
     331
     332        /*Free ressources:*/
     333        xfree((void**)&serial_vector);
     334}
     335/*}}}*/
    321336/*FUNCTION FemModel::UpdateInputsFromVector(double* vector, int name, int type){{{1*/
    322337void FemModel::UpdateInputsFromVector(double* vector, int name, int type){
     
    333348}
    334349/*}}}*/
     350/*FUNCTION FemModel::UpdateInputsFromVector(int* vector, int name, int type){{{1*/
     351void FemModel::UpdateInputsFromVector(int* vector, int name, int type){
     352
     353        if(vector==NULL)return; //don't bother
     354
     355        elements->UpdateInputsFromVector(vector,name,type);
     356        nodes->UpdateInputsFromVector(vector,name,type);
     357        vertices->UpdateInputsFromVector(vector,name,type);
     358        loads->UpdateInputsFromVector(vector,name,type);
     359        materials->UpdateInputsFromVector(vector,name,type);
     360        parameters->UpdateInputsFromVector(vector,name,type);
     361
     362}
     363/*}}}*/
     364/*FUNCTION FemModel::UpdateInputsFromVector(bool* vector, int name, int type){{{1*/
     365void FemModel::UpdateInputsFromVector(bool* vector, int name, int type){
     366
     367        if(vector==NULL)return; //don't bother
     368
     369        elements->UpdateInputsFromVector(vector,name,type);
     370        nodes->UpdateInputsFromVector(vector,name,type);
     371        vertices->UpdateInputsFromVector(vector,name,type);
     372        loads->UpdateInputsFromVector(vector,name,type);
     373        materials->UpdateInputsFromVector(vector,name,type);
     374        parameters->UpdateInputsFromVector(vector,name,type);
     375
     376}
     377/*}}}*/
    335378/*FUNCTION FemModel::UpdateInputsFromConstant(double constant, int name){{{1*/
    336379void    FemModel::UpdateInputsFromConstant(double constant, int name){
  • issm/trunk/src/c/objects/FemModel.h

    r3732 r3751  
    8181                Mat      get_Gmn(void);
    8282
     83                void    UpdateInputsFromVector(Vec vector, int name, int type);
    8384                void    UpdateInputsFromVector(double* vector, int name, int type);
     85                void    UpdateInputsFromVector(bool* vector, int name, int type);
     86                void    UpdateInputsFromVector(int* vector, int name, int type);
     87
    8488                void    UpdateInputsFromConstant(double constant, int name);
    8589                void    UpdateInputsFromConstant(int constant, int name);
    8690                void    UpdateInputsFromConstant(bool constant, int name);
     91
    8792                void    UpdateInputsFromSolution(Vec solution, int analysis_type, int sub_analysis_type);
    8893                void    UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type);
  • issm/trunk/src/c/objects/Inputs/BeamVertexInput.h

    r3732 r3751  
    3939                int   EnumType();
    4040                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     41                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     42                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    4143                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    4244                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Inputs/BoolInput.h

    r3732 r3751  
    3939                int   EnumType();
    4040                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     41                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     42                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    4143                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    4244                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Inputs/DoubleInput.h

    r3732 r3751  
    3939                int   EnumType();
    4040                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     41                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     42                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    4143                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    4244                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Inputs/IntInput.h

    r3732 r3751  
    3939                int   EnumType();
    4040                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     41                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     42                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    4143                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    4244                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Inputs/PentaVertexInput.h

    r3732 r3751  
    3838                int   EnumType();
    3939                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     40                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     41                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    4042                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    4143                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Inputs/SingVertexInput.h

    r3732 r3751  
    3838                int   EnumType();
    3939                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     40                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     41                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    4042                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    4143                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Inputs/TriaVertexInput.h

    r3732 r3751  
    3838                int   EnumType();
    3939                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     40                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     41                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    4042                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    4143                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Loads/Icefront.h

    r3732 r3751  
    5151                int   MyRank();
    5252                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     53                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    5355                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5456                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Loads/Load.h

    r3683 r3751  
    3434                virtual void  PenaltyCreateKMatrix(Mat Kgg,double kmax,int analysis_type,int sub_analysis_type)=0;
    3535                virtual void  PenaltyCreatePVector(Vec pg,double kmax,int analysis_type,int sub_analysis_type)=0;
    36 
    37                 int           Enum();
    38 
    3936};
    4037#endif
  • issm/trunk/src/c/objects/Loads/Numericalflux.h

    r3732 r3751  
    4646                int   MyRank();
    4747                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     48                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     49                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    4850                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    4951                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Loads/Pengrid.h

    r3732 r3751  
    5252                int   MyRank();
    5353                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    5456                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5557                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Loads/Penpair.h

    r3732 r3751  
    4444                Object* copy();
    4545                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     46                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     47                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    4648                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    4749                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Loads/Riftfront.h

    r3732 r3751  
    6161                int   MyRank();
    6262                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     63                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     64                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    6365                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    6466                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Materials/Material.h

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

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

    r3732 r3751  
    5858                Object* copy();
    5959                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     60                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     61                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    6062                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    6163                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Model.cpp

    r3732 r3751  
    313313}
    314314/*}}}1*/
    315 /*FUNCTION Model::FindParam(bool* pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
    316 int   Model::FindParam(bool* pparameter,int enum_type,int analysis_type,int sub_analysis_type){
     315/*FUNCTION Model::FindParamByAnalysisAndSub(bool* pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
     316int   Model::FindParamByAnalysisAndSub(bool* pparameter,int enum_type,int analysis_type,int sub_analysis_type){
    317317       
    318318        FemModel* femmodel=NULL;
     
    327327}
    328328/*}}}1*/
    329 /*FUNCTION Model::FindParam(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
    330 int   Model::FindParam(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type){
     329/*FUNCTION Model::FindParamByAnalysisAndSub(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
     330int   Model::FindParamByAnalysisAndSub(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type){
    331331       
    332332        FemModel* femmodel=NULL;
     
    341341}
    342342/*}}}1*/
    343 /*FUNCTION Model::FindParam(double* pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
    344 int   Model::FindParam(double* pparameter,int enum_type,int analysis_type,int sub_analysis_type){
     343/*FUNCTION Model::FindParamByAnalysisAndSub(double* pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
     344int   Model::FindParamByAnalysisAndSub(double* pparameter,int enum_type,int analysis_type,int sub_analysis_type){
    345345       
    346346        FemModel* femmodel=NULL;
     
    355355}
    356356/*}}}1*/
    357 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
    358 int   Model::FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type,int sub_analysis_type){
     357/*FUNCTION Model::FindParamByAnalysisAndSub(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
     358int   Model::FindParamByAnalysisAndSub(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type,int sub_analysis_type){
    359359
    360360        FemModel* femmodel=NULL;
     
    369369}
    370370/*}}}1*/
    371 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
    372 int   Model::FindParam(double** pparameter,int* pM, int enum_type,int analysis_type,int sub_analysis_type){
     371/*FUNCTION Model::FindParamByAnalysisAndSub(double** pparameter,int* pM, int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
     372int   Model::FindParamByAnalysisAndSub(double** pparameter,int* pM, int enum_type,int analysis_type,int sub_analysis_type){
    373373
    374374        FemModel* femmodel=NULL;
     
    383383}
    384384/*}}}1*/
    385 /*FUNCTION Model::FindParam(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
    386 int   Model::FindParam(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type){
     385/*FUNCTION Model::FindParamByAnalysisAndSub(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/
     386int   Model::FindParamByAnalysisAndSub(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type){
    387387
    388388        FemModel* femmodel=NULL;
     
    397397}
    398398/*}}}1*/
    399 /*FUNCTION Model::FindParam(bool* pparameter,int enum_type,int analysis_type) {{{1*/
    400 int   Model::FindParam(bool* pparameter,int enum_type,int analysis_type){
     399/*FUNCTION Model::FindParamByAnalysis(bool* pparameter,int enum_type,int analysis_type) {{{1*/
     400int   Model::FindParamByAnalysis(bool* pparameter,int enum_type,int analysis_type){
    401401       
    402402        FemModel* femmodel=NULL;
     
    411411}
    412412/*}}}1*/
    413 /*FUNCTION Model::FindParam(int* pparameter,int enum_type,int analysis_type) {{{1*/
    414 int   Model::FindParam(int* pparameter,int enum_type,int analysis_type){
     413/*FUNCTION Model::FindParamByAnalysis(int* pparameter,int enum_type,int analysis_type) {{{1*/
     414int   Model::FindParamByAnalysis(int* pparameter,int enum_type,int analysis_type){
    415415       
    416416        FemModel* femmodel=NULL;
     
    425425}
    426426/*}}}1*/
    427 /*FUNCTION Model::FindParam(double* pparameter,int enum_type,int analysis_type) {{{1*/
    428 int   Model::FindParam(double* pparameter,int enum_type,int analysis_type){
     427/*FUNCTION Model::FindParamByAnalysis(double* pparameter,int enum_type,int analysis_type) {{{1*/
     428int   Model::FindParamByAnalysis(double* pparameter,int enum_type,int analysis_type){
    429429       
    430430        FemModel* femmodel=NULL;
     
    439439}
    440440/*}}}1*/
    441 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type) {{{1*/
    442 int   Model::FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type){
     441/*FUNCTION Model::FindParamByAnalysis(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type) {{{1*/
     442int   Model::FindParamByAnalysis(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type){
    443443
    444444        FemModel* femmodel=NULL;
     
    453453}
    454454/*}}}1*/
    455 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int enum_type,int analysis_type) {{{1*/
    456 int   Model::FindParam(double** pparameter,int* pM, int enum_type,int analysis_type){
     455/*FUNCTION Model::FindParamByAnalysis(double** pparameter,int* pM, int enum_type,int analysis_type) {{{1*/
     456int   Model::FindParamByAnalysis(double** pparameter,int* pM, int enum_type,int analysis_type){
    457457
    458458        FemModel* femmodel=NULL;
     
    467467}
    468468/*}}}1*/
    469 /*FUNCTION Model::FindParam(char** pparameter,int enum_type,int analysis_type) {{{1*/
    470 int   Model::FindParam(char** pparameter,int enum_type,int analysis_type){
     469/*FUNCTION Model::FindParamByAnalysis(char** pparameter,int enum_type,int analysis_type) {{{1*/
     470int   Model::FindParamByAnalysis(char** pparameter,int enum_type,int analysis_type){
    471471
    472472        FemModel* femmodel=NULL;
     
    600600}
    601601/*}}}1*/
     602/*FUNCTION Model::UpdateInputsFromVector(Vec vector,int name, int type);{{{1*/
     603void  Model::UpdateInputsFromVector(Vec vector,int name, int type){
     604
     605        int i;
     606        FemModel* femmodel=NULL;
     607        double* serial_vector=NULL;
     608
     609        if(vector==NULL)return; //don't bother
     610
     611        VecToMPISerial(&serial_vector,vector);
     612
     613        //call double* idential routine.
     614        this->UpdateInputsFromVector(serial_vector,name,type);
     615
     616        /*Free ressources:*/
     617        xfree((void**)&serial_vector);
     618}
     619/*}}}1*/
    602620/*FUNCTION Model::UpdateInputsFromSolution(double* vector,int analysis_type, int sub_analysis_type);{{{1*/
    603621void  Model::UpdateInputsFromSolution(double* vector,int analysis_type, int sub_analysis_type){
  • issm/trunk/src/c/objects/Model.h

    r3732 r3751  
    4242                int   FindParam(char** pparameter,int enum_type);
    4343
    44                 int   FindParam(bool* pparameter,int enum_type,int analysis_type,int sub_analysis_type);
    45                 int   FindParam(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type);
    46                 int   FindParam(double* pparameter,int enum_type,int analysis_type,int sub_analysis_type);
    47                 int   FindParam(double** pparameter,int* pM, int enum_type,int analysis_type,int sub_analysis_type);
    48                 int   FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type,int sub_analysis_type);
    49                 int   FindParam(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type);
     44                int   FindParamByAnalysisAndSub(bool* pparameter,int enum_type,int analysis_type,int sub_analysis_type);
     45                int   FindParamByAnalysisAndSub(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type);
     46                int   FindParamByAnalysisAndSub(double* pparameter,int enum_type,int analysis_type,int sub_analysis_type);
     47                int   FindParamByAnalysisAndSub(double** pparameter,int* pM, int enum_type,int analysis_type,int sub_analysis_type);
     48                int   FindParamByAnalysisAndSub(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type,int sub_analysis_type);
     49                int   FindParamByAnalysisAndSub(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type);
    5050
    51                 int   FindParam(bool* pparameter,int enum_type,int analysis_type);
    52                 int   FindParam(int* pparameter,int enum_type,int analysis_type);
    53                 int   FindParam(double* pparameter,int enum_type,int analysis_type);
    54                 int   FindParam(double** pparameter,int* pM,int enum_type,int analysis_type);
    55                 int   FindParam(double** pparameter,int* pM,int* pN,int enum_type,int analysis_type);
    56                 int   FindParam(char** pparameter,int enum_type,int analysis_type);
     51                int   FindParamByAnalysis(bool* pparameter,int enum_type,int analysis_type);
     52                int   FindParamByAnalysis(int* pparameter,int enum_type,int analysis_type);
     53                int   FindParamByAnalysis(double* pparameter,int enum_type,int analysis_type);
     54                int   FindParamByAnalysis(double** pparameter,int* pM,int enum_type,int analysis_type);
     55                int   FindParamByAnalysis(double** pparameter,int* pM,int* pN,int enum_type,int analysis_type);
     56                int   FindParamByAnalysis(char** pparameter,int enum_type,int analysis_type);
    5757
    5858                FemModel* GetFormulation(int analysis_type,int sub_analysis_type);
    5959                FemModel* GetFormulation(int analysis_type);
    6060
     61                void    UpdateInputsFromVector(Vec vector, int name, int type);
    6162                void    UpdateInputsFromVector(double* vector, int name, int type);
     63                void    UpdateInputsFromVector(int* vector, int name, int type);
     64                void    UpdateInputsFromVector(bool* vector, int name, int type);
    6265                void    UpdateInputsFromConstant(double constant, int name);
    6366                void    UpdateInputsFromConstant(int constant, int name);
  • issm/trunk/src/c/objects/Node.h

    r3732 r3751  
    5252                void  SetVertexDof(int in_dof);
    5353                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    5456                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5557                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Object.h

    r3732 r3751  
    2626                virtual Object* copy()=0;
    2727                virtual void  UpdateInputsFromVector(double* vector, int name, int type)=0;
     28                virtual void  UpdateInputsFromVector(int* vector, int name, int type)=0;
     29                virtual void  UpdateInputsFromVector(bool* vector, int name, int type)=0;
    2830                virtual void  UpdateInputsFromConstant(double constant, int name)=0;
    2931                virtual void  UpdateInputsFromConstant(int constant, int name)=0;
  • issm/trunk/src/c/objects/Params/BoolParam.h

    r3732 r3751  
    3030class BoolParam: public Param{
    3131
    32         private:
     32        public:
    3333                /*just hold 3 values for 3 vertices: */
    3434                int enum_type;
    3535                IssmBool value;
    3636
    37         public:
    3837                /*constructors, destructors: {{{1*/
    3938                BoolParam();
     
    5251                int   MyRank();
    5352                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     53                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    5455                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5556                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Params/DoubleMatParam.h

    r3732 r3751  
    5454                int   MyRank();
    5555                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     56                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     57                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    5658                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5759                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Params/DoubleParam.h

    r3732 r3751  
    5252                int   MyRank();
    5353                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    5456                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5557                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Params/DoubleVecParam.h

    r3732 r3751  
    5353                int   MyRank();
    5454                void  UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     55                void  UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     56                void  UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    5557                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5658                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Params/IntParam.h

    r3732 r3751  
    5252                int   MyRank();
    5353                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    5456                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5557                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Params/PetscMatParam.h

    r3732 r3751  
    5252                int   MyRank();
    5353                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    5456                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5557                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Params/PetscVecParam.h

    r3732 r3751  
    5252                int   MyRank();
    5353                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    5456                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5557                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Params/StringArrayParam.h

    r3732 r3751  
    5454                int   MyRank();
    5555                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     56                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     57                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    5658                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5759                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Params/StringParam.h

    r3732 r3751  
    5252                int   MyRank();
    5353                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     55                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    5456                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5557                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Result.h

    r3732 r3751  
    4444                Object* copy();
    4545                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     46                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     47                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    4648                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    4749                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/SolPar.h

    r3732 r3751  
    4040                Object* copy();
    4141                void    UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     42                void    UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     43                void    UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    4244                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    4345                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/objects/Vertex.h

    r3732 r3751  
    5151                void  UpdatePosition(double* thickness,double* bed);
    5252                void  UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     53                void  UpdateInputsFromVector(int* vector, int name, int type){ISSMERROR("Not implemented yet!");}
     54                void  UpdateInputsFromVector(bool* vector, int name, int type){ISSMERROR("Not implemented yet!");}
    5355                void    UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");}
    5456                void    UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");}
  • issm/trunk/src/c/parallel/ControlInitialization.cpp

    r3732 r3751  
    2929        Vec slopex=NULL;
    3030        Vec slopey=NULL;
     31        double* vx=NULL;
     32        double* vy=NULL;
     33        double* vz=NULL;
     34        double* pressure=NULL;
    3135
    3236        /*flags: */
     
    8791
    8892        //Add in inputs
    89         inputs->Add("bedslopex",slopex,numberofdofspernode_sl,numberofnodes);
    90         inputs->Add("bedslopey",slopey,numberofdofspernode_sl,numberofnodes);
     93        model->UpdateInputsFromVector(slopex,BedSlopexEnum,VertexEnum);
     94        model->UpdateInputsFromVector(slopey,BedSlopeyEnum,VertexEnum);
    9195        VecFree(&slopex); VecFree(&slopey);
    9296
     
    99103        VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->vertices,fem_dh->loads,fem_dh-> materials,fem_dh->parameters,"velocity",1);
    100104
     105        //Add to inputs:
     106        SplitSolutionVector(ug_horiz,numberofnodes,numberofdofspernode_dh,&vx,&vy);
     107        model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);
     108        model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);
     109       
     110
    101111        //vertical velocity
    102112        if(verbose)_printf_("%s\n"," computing vertical velocities...");
    103         inputs->Add("velocity",ug_horiz,numberofdofspernode_dh,numberofnodes);
    104113        diagnostic_core_linear(&ug_vert,fem_dv,DiagnosticAnalysisEnum,VertAnalysisEnum);
    105114
     
    120129
    121130        //Add in inputs
    122         inputs->Add("velocity",ug_stokes,numberofdofspernode_ds,numberofnodes);
     131        SplitSolutionVector(ug_stokes,numberofnodes,numberofdofspernode_ds,&vx,&vy,&vz,&pressure);
     132        model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);
     133        model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);
     134        model->UpdateInputsFromVector(vz,VzEnum,VertexEnum);
     135        model->UpdateInputsFromVector(pressure,PressureEnum,VertexEnum);
    123136        VecFree(&ug_stokes);
    124137
     
    136149
    137150        //Add in inputs
    138         inputs->Add("velocity",ug,numberofdofspernode_ds,numberofnodes);
     151        xfree((void**)&vx); xfree((void**)&vy); xfree((void**)&vz); xfree((void**)&pressure);
     152        SplitSolutionVector(ug,numberofnodes,numberofdofspernode_ds,&vx,&vy,&vz,&pressure);
     153        model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);
     154        model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);
     155        model->UpdateInputsFromVector(vz,VzEnum,VertexEnum);
     156        model->UpdateInputsFromVector(pressure,PressureEnum,VertexEnum);
    139157
    140158        /*Assign output*/
     
    143161        /*Free ressources:*/
    144162        xfree((void**)&dofset);
     163        xfree((void**)&vx);
     164        xfree((void**)&vy);
     165        xfree((void**)&vz);
     166        xfree((void**)&pressure);
    145167        VecFree(&ug);
    146168        VecFree(&ug_horiz);
  • issm/trunk/src/c/parallel/ControlRestart.cpp

    r3717 r3751  
    66#include "./parallel.h"
    77#include "../modules.h"
     8#include "../EnumDefinitions/EnumDefinitions.h"
    89
    910void ControlRestart(Model* model,double* param_g){
  • issm/trunk/src/c/parallel/balancedthickness.cpp

    r3732 r3751  
    22 * \brief: balancedthickness solution
    33 */
    4 
    5 #include "../modules.h"
    6 #include "./parallel.h"
    7 
    84#ifdef HAVE_CONFIG_H
    95        #include "config.h"
     
    128#endif
    139
     10#include "../objects/objects.h"
     11#include "../shared/shared.h"
     12#include "../DataSet/DataSet.h"
     13#include "../EnumDefinitions/EnumDefinitions.h"
     14#include "../include/globals.h"
     15#include "./parallel.h"
    1416
    1517int main(int argc,char* *argv){
  • issm/trunk/src/c/parallel/balancedthickness2.cpp

    r3732 r3751  
    22 * \brief: balancedthickness2 solution
    33 */
    4 
    5 #include "../modules.h"
    6 #include "./parallel.h"
    74
    85#ifdef HAVE_CONFIG_H
     
    129#endif
    1310
     11#include "../objects/objects.h"
     12#include "../shared/shared.h"
     13#include "../DataSet/DataSet.h"
     14#include "../EnumDefinitions/EnumDefinitions.h"
     15#include "../include/globals.h"
     16#include "./parallel.h"
    1417
    1518int main(int argc,char* *argv){
  • issm/trunk/src/c/parallel/balancedthickness2_core.cpp

    r3732 r3751  
    4545
    4646        _printf_("depth averaging velocity...\n");
    47         vx_g=inputs->Get("vx",&dofs[0],1);
    48         vy_g=inputs->Get("vy",&dofs[0],1);
     47        //vx_g=inputs->Get("vx",&dofs[0],1);
     48        //vy_g=inputs->Get("vy",&dofs[0],1);
    4949        /* NOT WORKING YET....
    5050        FieldDepthAveragex(vx_g, fem_p->elements,fem_p->nodes, fem_p->vertices,fem_p->loads, fem_p->materials,fem_p->parameters,"vx");
    5151        FieldDepthAveragex(vy_g, fem_p->elements,fem_p->nodes, fem_p->vertices,fem_p->loads, fem_p->materials,fem_p->parameters,"vy");
    5252        */
    53         inputs->Add("vx_average",vx_g,1,numberofvertices);
    54         inputs->Add("vy_average",vy_g,1,numberofvertices);
     53        //inputs->Add("vx_average",vx_g,1,numberofvertices);
     54        //inputs->Add("vy_average",vy_g,1,numberofvertices);
     55        ISSMERROR("not supported yet!");
    5556       
    5657        _printf_("call computational core:\n");
  • issm/trunk/src/c/parallel/balancedthickness_core.cpp

    r3732 r3751  
    4343
    4444        _printf_("depth averaging velocity...\n");
    45         u_g=inputs->Get("velocity",&dofs[0],2); //take (vx,vy) from inputs velocity
    46         FieldDepthAveragex( u_g, fem_p->elements,fem_p->nodes, fem_p->vertices,fem_p->loads, fem_p->materials,fem_p->parameters,"velocity");
    47         inputs->Add("velocity_average",u_g,2,numberofnodes);
     45        //u_g=inputs->Get("velocity",&dofs[0],2); //take (vx,vy) from inputs velocity
     46        //FieldDepthAveragex( u_g, fem_p->elements,fem_p->nodes, fem_p->vertices,fem_p->loads, fem_p->materials,fem_p->parameters,"velocity");
     47        //inputs->Add("velocity_average",u_g,2,numberofnodes);
     48        ISSMERROR("not supported yet!");
    4849       
    4950        _printf_("call computational core:\n");
  • issm/trunk/src/c/parallel/balancedvelocities.cpp

    r3732 r3751  
    22 * \brief: balancedvelocities solution
    33 */
    4 
    5 #include "../modules.h"
    6 #include "./parallel.h"
    74
    85#ifdef HAVE_CONFIG_H
     
    129#endif
    1310
     11#include "../objects/objects.h"
     12#include "../shared/shared.h"
     13#include "../DataSet/DataSet.h"
     14#include "../EnumDefinitions/EnumDefinitions.h"
     15#include "../include/globals.h"
     16#include "./parallel.h"
    1417
    1518int main(int argc,char* *argv){
  • issm/trunk/src/c/parallel/balancedvelocities_core.cpp

    r3732 r3751  
    4242
    4343        _printf_("depth averaging velocity...\n");
    44         u_g=inputs->Get("velocity",&dofs[0],2); //take (vx,vy) from inputs velocity
    45         FieldDepthAveragex( u_g, fem_p->elements,fem_p->nodes, fem_p->vertices,fem_p->loads, fem_p->materials,fem_p->parameters,"velocity");
    46         inputs->Add("velocity_average",u_g,2,numberofnodes);
     44        //u_g=inputs->Get("velocity",&dofs[0],2); //take (vx,vy) from inputs velocity
     45        //FieldDepthAveragex( u_g, fem_p->elements,fem_p->nodes, fem_p->vertices,fem_p->loads, fem_p->materials,fem_p->parameters,"velocity");
     46        //inputs->Add("velocity_average",u_g,2,numberofnodes);
     47        ISSMERROR(" not supported yet!");
    4748       
    4849        _printf_("call computational core:\n");
  • issm/trunk/src/c/parallel/control_core.cpp

    r3732 r3751  
    2525        Vec     m_g=NULL;
    2626        double  search_scalar;
    27         int     control_type=NULL;
     27        int     control_type;
    2828        double* fit=NULL;
    2929        double* optscal=NULL;
     
    5252        int     control_steady;
    5353        int verbose=0;
    54         int convergence=0;
     54        int converged=0;
    5555        int numberofnodes;
    5656
     
    8686                _printf_("\n%s%i%s%i\n","   control method step ",n+1,"/",nsteps);
    8787                model->UpdateInputsFromVector(param_g,control_type,VertexEnum);
    88                 model->UpdateInputsFromVector(&fit[n],FitEnum,ConstantEnum);
     88                model->UpdateInputsFromConstant(fit[n],FitEnum);
    8989               
    9090                /*In case we are running a steady state control method, compute new temperature field using new parameter
     
    169169                                        if ((J[i]-J[n])/J[n] <= eps_cm){
    170170                                                //convergence if convergence criteria fullfilled
    171                                                 convergence=1;
     171                                                converged=1;
    172172                                                _printf_("%s%g%s%g\n","      Convergence criterion: dJ/J = ",(J[i]-J[n])/J[n],"<",eps_cm);
    173173                                        }
     
    181181                }
    182182                //stop if convergence has been reached
    183                 if(convergence) break;
     183                if(converged) break;
    184184
    185185                //some temporary saving
     
    206206        }
    207207        else{
    208                 inputs->Add(control_type,param_g,1,numberofnodes);
     208                model->UpdateInputsFromVector(param_g,control_type,VertexEnum);
    209209                diagnostic_results=new DataSet(ResultsEnum);
    210210                diagnostic_core(diagnostic_results,model);
  • issm/trunk/src/c/parallel/convergence.cpp

    r3732 r3751  
    77#include "../EnumDefinitions/EnumDefinitions.h"
    88
    9 void convergence(double* pconverged, Mat Kff,Vec pf,Vec uf,Vec old_uf,Parameters* parameters){
     9void convergence(int* pconverged, Mat Kff,Vec pf,Vec uf,Vec old_uf,Parameters* parameters){
    1010
    1111        /*output*/
  • issm/trunk/src/c/parallel/diagnostic.cpp

    r3722 r3751  
    22 * \brief: diagnostic solution
    33 */
    4 
    5 #include "../objects/objects.h"
    6 #include "../shared/shared.h"
    7 #include "../DataSet/DataSet.h"
    8 #include "./parallel.h"
    94
    105#ifdef HAVE_CONFIG_H
     
    149#endif
    1510
     11#include "../objects/objects.h"
     12#include "../shared/shared.h"
     13#include "../DataSet/DataSet.h"
     14#include "../EnumDefinitions/EnumDefinitions.h"
     15#include "../include/globals.h"
     16#include "./parallel.h"
    1617
    1718int main(int argc,char* *argv){
  • issm/trunk/src/c/parallel/diagnostic_core.cpp

    r3732 r3751  
    3131        Vec ug_stokes=NULL;
    3232        Vec pg=NULL;
    33         Vec slopex=NULL;
    34         Vec slopey=NULL;
    3533        Vec riftproperties=NULL;
    3634        double* u_g_initial=NULL;
     
    5250        int numrifts=0;
    5351
     52        /*slopes: */
     53        Vec surfaceslopex=NULL;
     54        Vec surfaceslopey=NULL;
     55        Vec bedslopex=NULL;
     56        Vec bedslopey=NULL;
     57
    5458        double stokesreconditioning;
    5559
     
    8791        //for qmu analysis, be sure the velocity input we are starting from  is the one in the parameters: */
    8892        if(qmu_analysis){
    89                 model->FindParam(&vx,&dummy,VxEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);
    90                 model->FindParam(&vy,&dummy,VyEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);
    91                 model->FindParam(&vz,&dummy,VzEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vz,VzEnum,VertexEnum);
     93                model->FindParamByAnalysisAndSub(&vx,&dummy,VxEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);
     94                model->FindParamByAnalysisAndSub(&vy,&dummy,VyEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);
     95                model->FindParamByAnalysisAndSub(&vz,&dummy,VzEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vz,VzEnum,VertexEnum);
    9296        }
    9397
    9498        /*Compute slopes: */
    95         slope_core(&surfaceslopex,&surfaceslopey,model,SurfaceAnalysisEnum);
    96         slope_core(&bedslopex,&bedslopey,model,BedAnalysisEnum);
     99        slope_core(&surfaceslopex,&surfaceslopey,fem_sl,SurfaceAnalysisEnum);
     100        slope_core(&bedslopex,&bedslopey,fem_sl,BedAnalysisEnum);
    97101               
    98102        /*Update: */
     
    102106        model->UpdateInputsFromVector(bedslopey,BedSlopeyEnum,VertexEnum);
    103107
     108       
    104109        if(ishutter){
    105110                       
     
    189194        xfree((void**)&dofset);
    190195        xfree((void**)&u_g_initial);
     196       
     197        VecFree(&surfaceslopex);
     198        VecFree(&surfaceslopey);
     199        VecFree(&bedslopex);
     200        VecFree(&bedslopey);
     201
    191202
    192203}
  • issm/trunk/src/c/parallel/diagnostic_core_nonlinear.cpp

    r3732 r3751  
    110110               
    111111                /*add converged to inputs: */
    112                 fem->UpdateInputsFromVector(&converged,ConvergedEnum,ConstantEnum);
     112                fem->UpdateInputsFromConstant(converged,ConvergedEnum);
    113113
    114114                //rift convergence
  • issm/trunk/src/c/parallel/gradjcompute_core.cpp

    r3732 r3751  
    1313#endif
    1414
    15 void gradjcompute_core(DataSet* results,Model* model, ParameterInputs* inputs){
     15void gradjcompute_core(DataSet* results,Model* model){
    1616       
    1717       
     
    2828       
    2929        Vec u_g=NULL;
    30         double* u_g_double=NULL;
    3130
    3231        Vec du_g=NULL;
     
    3635        Vec lambda_f=NULL;
    3736        Vec lambda_g=NULL;
    38         double* lambda_g_double=NULL;
     37        double* lambdax=NULL;
     38        double* lambday=NULL;
     39        double* vx=NULL;
     40        double* vy=NULL;
     41        double* vz=NULL;
    3942
    4043        Mat K_ff0=NULL;
     
    6366
    6467        _printf_("%s\n","      recover solution for this stiffness and right hand side:");
    65         diagnostic_core_nonlinear(&u_g,&K_ff0,&K_fs0,NULL, femmodel,inputs,DiagnosticAnalysisEnum,sub_analysis_type);
    66         VecToMPISerial(&u_g_double,u_g); VecFree(&u_g);
    67         inputs->Add("velocity",u_g_double,numberofdofspernode,numberofnodes);
     68        diagnostic_core_nonlinear(&u_g,&K_ff0,&K_fs0,NULL, femmodel,DiagnosticAnalysisEnum,sub_analysis_type);
    6869
    6970        _printf_("%s\n","      buid Du, difference between observed velocity and model velocity:");
    70         Dux( &du_g, femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,inputs,analysis_type,sub_analysis_type);
     71        Dux( &du_g, femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,analysis_type,sub_analysis_type);
    7172
    7273        _printf_("%s\n","      reduce adjoint load from g-set to f-set:");
     
    8283        VecFree(&lambda_f);
    8384
     85        /*add to inputs: */
     86        SplitSolutionVector(lambda_g,numberofnodes,numberofdofspernode,&lambdax,&lambday);
     87        model->UpdateInputsFromVector(lambdax,AdjointxEnum,VertexEnum);
     88        model->UpdateInputsFromVector(lambday,AdjointyEnum,VertexEnum);
     89        VecFree(&lambda_g);
     90       
    8491        _printf_("%s\n","      compute gradJ:");
    85         VecToMPISerial(&lambda_g_double,lambda_g);VecFree(&lambda_g);
    86         inputs->Add("adjoint",lambda_g_double,numberofdofspernode,numberofnodes);
    87 
    8892        Gradjx( &grad_g, numberofnodes,femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,
    89                                 inputs,analysis_type,sub_analysis_type,control_type);
     93                                analysis_type,sub_analysis_type,control_type);
    9094
    9195        if (dim==3 && extrude_param){
     
    97101        if(control_steady){
    98102                diagnostic_results=new DataSet(ResultsEnum);
    99                 diagnostic_core(diagnostic_results,model, inputs);
     103                diagnostic_core(diagnostic_results,model);
    100104
    101105                //extract u_g and add it to input (3d velocity needed by thermal_core)
    102106                diagnostic_results->FindResult(&u_g,"u_g");
    103                 inputs->Add("velocity",u_g,3,numberofnodes);
     107               
     108                SplitSolutionVector(u_g,numberofnodes,3,&vx,&vy,&vz);
     109                model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);
     110                model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);
     111                model->UpdateInputsFromVector(vz,VzEnum,VertexEnum);
     112
    104113                delete diagnostic_results;
    105114        }
     
    114123        xfree((void**)&solverstring);
    115124        xfree((void**)&control_type);
    116         xfree((void**)&u_g_double);
    117         xfree((void**)&lambda_g_double);
     125        xfree((void**)&lambdax);
     126        xfree((void**)&lambday);
     127        xfree((void**)&vx);
     128        xfree((void**)&vy);
     129        xfree((void**)&vz);
    118130
    119131}
  • issm/trunk/src/c/parallel/objectivefunctionC.cpp

    r3717 r3751  
    55#include "../modules.h"
    66#include "./parallel.h"
     7#include "../EnumDefinitions/EnumDefinitions.h"
    78
    89#ifdef HAVE_CONFIG_H
     
    2526        double* param_g=NULL;
    2627        double* grad_g=NULL;
    27         ParameterInputs* inputs=NULL;
    2828        int numberofdofspernode;
    2929        int n;
     
    3535        double  cm_min;
    3636        double  cm_max;
    37         char*   control_type=NULL;
     37        int   control_type;
    3838        double* param_g_copy=NULL;
    3939        int     analysis_type;
     
    4343        Vec     u_g_full=NULL;
    4444        double* u_g_double=NULL;
     45        double* vx=NULL;
     46        double* vy=NULL;
     47        double* vz=NULL;
    4548        int     numberofnodes;
    4649               
     
    5962        param_g=optargs->param_g;
    6063        grad_g=optargs->grad_g;
    61         inputs=optargs->inputs;
    6264        n=optargs->n;
    6365
    6466        gsize=femmodel->nodesets->GetGSize();
    6567        femmodel->parameters->FindParam(&optscal,NULL,NULL,OptScalEnum);
    66         femmodel->parameters->FindParam(&control_type,ControlTypeEnum);
    6768        femmodel->parameters->FindParam(&fit,NULL,NULL,FitEnum);
    6869        femmodel->parameters->FindParam(&cm_min,CmMinEnum);
     
    8788
    8889        /*Add new parameter to inputs: */
    89         inputs->Add(control_type,param_g_copy,1,numberofnodes);
     90        femmodel->UpdateInputsFromVector(param_g_copy,control_type,VertexEnum);
    9091
    9192        /*Run diagnostic with updated parameters.*/
    9293        if(!control_steady){
    93                 diagnostic_core_nonlinear(&u_g,NULL,NULL,NULL,femmodel,inputs,DiagnosticAnalysisEnum,sub_analysis_type);
    94                 VecToMPISerial(&u_g_double,u_g); VecFree(&u_g);
    95                 inputs->Add("velocity",u_g_double,numberofdofspernode,numberofnodes);
     94                diagnostic_core_nonlinear(&u_g,NULL,NULL,NULL,femmodel,DiagnosticAnalysisEnum,sub_analysis_type);
     95                femmodel->UpdateInputsFromSolution(u_g,DiagnosticAnalysisEnum,sub_analysis_type);
     96                VecFree(&u_g);
    9697        }
    9798        else{
    9899                //We need a 3D velocity!! (vz is required for the next thermal run)
    99100                diagnostic_results=new DataSet(ResultsEnum);
    100                 diagnostic_core(diagnostic_results,model, inputs);
     101                diagnostic_core(diagnostic_results,model);
    101102
    102103                //extract u_g and add it to input (3d velocity needed by thermal_core)
    103104                diagnostic_results->FindResult(&u_g,"u_g");
    104                 inputs->Add("velocity",u_g,3,numberofnodes);
     105               
     106                SplitSolutionVector(u_g,numberofnodes,3,&vx,&vy,&vz);
     107                femmodel->UpdateInputsFromVector(vx,VxEnum,VertexEnum);
     108                femmodel->UpdateInputsFromVector(vy,VxEnum,VertexEnum);
     109                femmodel->UpdateInputsFromVector(vz,VxEnum,VertexEnum);
     110               
    105111                delete diagnostic_results;
    106112        }
    107113
    108114        /*Compute misfit for this velocity field.*/
    109         inputs->Add("fit",fit[n]);
    110         CostFunctionx( &J, femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials, femmodel->parameters,inputs,analysis_type,sub_analysis_type);
     115        femmodel->UpdateInputsFromConstant(fit[n],FitEnum);
     116        CostFunctionx( &J, femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials, femmodel->parameters,analysis_type,sub_analysis_type);
    111117
    112118        /*Free ressources:*/
    113119        xfree((void**)&fit);
    114120        xfree((void**)&optscal);
    115         xfree((void**)&control_type);
    116121        xfree((void**)&param_g_copy);
    117         xfree((void**)&u_g_double);
    118122        xfree((void**)&dofset);
     123        xfree((void**)&vx);
     124        xfree((void**)&vy);
     125        xfree((void**)&vz);
    119126
    120127        return J;
  • issm/trunk/src/c/parallel/prognostic.cpp

    r3717 r3751  
    22 * \brief: prognostic solution
    33 */
    4 
    5 #include "../modules.h"
    6 #include "./parallel.h"
    74
    85#ifdef HAVE_CONFIG_H
     
    129#endif
    1310
     11#include "../objects/objects.h"
     12#include "../shared/shared.h"
     13#include "../DataSet/DataSet.h"
     14#include "../EnumDefinitions/EnumDefinitions.h"
     15#include "../include/globals.h"
     16#include "./parallel.h"
    1417
    1518int main(int argc,char* *argv){
     
    3235        Result*  result=NULL;
    3336
    34         ParameterInputs* inputs=NULL;
    3537        Param*   param=NULL;
    3638
     
    8385                _printf_("call computational core:\n");
    8486                MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    85                 prognostic_core(results,model,inputs);
     87                prognostic_core(results,model);
    8688                MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    8789
     
    9496                #ifdef _HAVE_DAKOTA_
    9597                MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    96                 Qmux(model,inputs,PrognosticAnalysisEnum,NoneAnalysisEnum);
     98                Qmux(model,PrognosticAnalysisEnum,NoneAnalysisEnum);
    9799                MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    98100                #else
     
    120122        delete results;
    121123        delete model;
    122         delete inputs;
    123124
    124125        /*Get finish time and close*/
  • issm/trunk/src/c/parallel/prognostic2.cpp

    r3717 r3751  
    22 * \brief: prognostic2 solution
    33 */
    4 
    5 #include "../modules.h"
    6 #include "./parallel.h"
    74
    85#ifdef HAVE_CONFIG_H
     
    129#endif
    1310
     11#include "../objects/objects.h"
     12#include "../shared/shared.h"
     13#include "../DataSet/DataSet.h"
     14#include "../EnumDefinitions/EnumDefinitions.h"
     15#include "../include/globals.h"
     16#include "./parallel.h"
    1417
    1518int main(int argc,char* *argv){
     
    3235        Result*  result=NULL;
    3336
    34         ParameterInputs* inputs=NULL;
    3537        Param*   param=NULL;
    3638
     
    8486                _printf_("call computational core:\n");
    8587                MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    86                 prognostic2_core(results,model,inputs);
     88                prognostic2_core(results,model);
    8789                MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    8890
     
    9597                #ifdef _HAVE_DAKOTA_
    9698                MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    97                 Qmux(model,inputs,Prognostic2AnalysisEnum,NoneAnalysisEnum);
     99                Qmux(model,Prognostic2AnalysisEnum,NoneAnalysisEnum);
    98100                MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    99101                #else
     
    121123        delete results;
    122124        delete model;
    123         delete inputs;
    124125
    125126        /*Get finish time and close*/
  • issm/trunk/src/c/parallel/prognostic2_core.cpp

    r3717 r3751  
    1010#include "../modules.h"
    1111
    12 void prognostic2_core(DataSet* results,Model* model,ParameterInputs* inputs){
     12void prognostic2_core(DataSet* results,Model* model){
    1313
    1414        extern int my_rank;
     
    4747       
    4848        _printf_("call computational core:\n");
    49         diagnostic_core_linear(&h_g,fem_p,inputs,Prognostic2AnalysisEnum,NoneAnalysisEnum);
     49        diagnostic_core_linear(&h_g,fem_p,Prognostic2AnalysisEnum,NoneAnalysisEnum);
    5050
    5151        _printf_("Averaging over vertices:\n");
  • issm/trunk/src/c/parallel/prognostic_core.cpp

    r3717 r3751  
    1010#include "../modules.h"
    1111
    12 void prognostic_core(DataSet* results,Model* model,ParameterInputs* inputs){
     12void prognostic_core(DataSet* results,Model* model){
    1313
    1414        extern int my_rank;
     
    4242
    4343        _printf_("depth averaging velocity...\n");
    44         u_g=inputs->Get("velocity",&dofs[0],2); //take (vx,vy) from inputs velocity
     44        //u_g=inputs->Get("velocity",&dofs[0],2);
     45        ISSMERROR("not supported yet!");
    4546        FieldDepthAveragex( u_g, fem_p->elements,fem_p->nodes, fem_p->vertices,fem_p->loads, fem_p->materials,fem_p->parameters,"velocity");
    46         inputs->Add("velocity_average",u_g,2,numberofnodes);
     47        //inputs->Add("velocity_average",u_g,2,numberofnodes);
    4748       
    4849        _printf_("call computational core:\n");
    49         diagnostic_core_linear(&h_g,fem_p,inputs,PrognosticAnalysisEnum,NoneAnalysisEnum);
     50        diagnostic_core_linear(&h_g,fem_p,PrognosticAnalysisEnum,NoneAnalysisEnum);
    5051
    5152        _printf_("extrude computed thickness on all layers:\n");
  • issm/trunk/src/c/parallel/slope_core.cpp

    r3732 r3751  
    33 */
    44
     5#include "./parallel.h"
    56#include "../toolkits/toolkits.h"
    67#include "../objects/objects.h"
     
    89#include "../modules.h"
    910
    10 void slope_core(Vec* pslopex,Vec* pslopey,Model* model,int AnalysisEnum){
     11void slope_core(Vec* pslopex,Vec* pslopey,FemModel* fem, int AnalysisEnum){
    1112
    1213        /*parameters: */
    1314        int verbose;
    1415        int dim;
     16        bool isstokes;
     17        bool ishutter;
    1518        int xanalysis;
    1619        int yanalysis;
     
    2023        Vec slopey=NULL;
    2124
    22         /*femmodel used to compute slopes: */
    23         FemModel* fem=NULL;
    24 
    25         /*Recover fem model: */
    26         fem=model->fem_sl;
    27 
    28 
    2925        /*Recover some parameters: */
    30         model->parameters->FindParam(&verbose,VerboseEnum);
    31         model->parameters->FindParam(&dim,DimEnum);
    32         model->parameters->FindParam(&isstokes,DimEnum);
    33         model->parameters->FindParam(&ishutter,DimEnum);
     26        fem->parameters->FindParam(&verbose,VerboseEnum);
     27        fem->parameters->FindParam(&dim,DimEnum);
     28        fem->parameters->FindParam(&isstokes,DimEnum);
     29        fem->parameters->FindParam(&ishutter,DimEnum);
    3430
    3531        if(verbose)_printf_("%s\n","computing surface slope (x and y derivatives)...");
  • issm/trunk/src/c/parallel/slopecompute.cpp

    r3717 r3751  
    22 * \brief: slopecompute solution
    33 */
    4 
    5 #include "../modules.h"
    6 #include "./parallel.h"
    74
    85#ifdef HAVE_CONFIG_H
     
    118#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    129#endif
     10
     11#include "../objects/objects.h"
     12#include "../shared/shared.h"
     13#include "../DataSet/DataSet.h"
     14#include "../EnumDefinitions/EnumDefinitions.h"
     15#include "../include/globals.h"
     16#include "./parallel.h"
    1317
    1418
     
    3034        Result*  result=NULL;
    3135
    32         ParameterInputs* inputs=NULL;
    3336        Param*   param=NULL;
    3437
     
    8083        _printf_("call computational core:\n");
    8184        MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    82         slopecompute_core(results,model,inputs);
     85        slopecompute_core(results,model);
    8386        MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    8487
     
    102105        delete results;
    103106        delete model;
    104         delete inputs;
    105107
    106108        /*Get finish time and close*/
  • issm/trunk/src/c/parallel/slopecompute_core.cpp

    r3717 r3751  
    1010#include "../modules.h"
    1111
    12 void slopecompute_core(DataSet* results,Model* model,ParameterInputs* inputs){
     12void slopecompute_core(DataSet* results,Model* model){
    1313
    1414        extern int my_rank;
     
    3939
    4040        _printf_("call computational core:\n");
    41         diagnostic_core_linear(&sx_g,fem_sl,inputs,SlopecomputeAnalysisEnum,SurfaceXAnalysisEnum);
    42         diagnostic_core_linear(&sy_g,fem_sl,inputs,SlopecomputeAnalysisEnum,SurfaceYAnalysisEnum);
     41        diagnostic_core_linear(&sx_g,fem_sl,SlopecomputeAnalysisEnum,SurfaceXAnalysisEnum);
     42        diagnostic_core_linear(&sy_g,fem_sl,SlopecomputeAnalysisEnum,SurfaceYAnalysisEnum);
    4343
    4444        _printf_("extrude computed slope on all layers:\n");
  • issm/trunk/src/c/parallel/steadystate.cpp

    r3717 r3751  
    22 * \brief: steadystate solution
    33 */
    4 
    5 #include "../modules.h"
    6 #include "./parallel.h"
    74
    85#ifdef HAVE_CONFIG_H
     
    129#endif
    1310
     11#include "../objects/objects.h"
     12#include "../shared/shared.h"
     13#include "../DataSet/DataSet.h"
     14#include "../EnumDefinitions/EnumDefinitions.h"
     15#include "../include/globals.h"
     16#include "./parallel.h"
    1417
    1518int main(int argc,char* *argv){
     
    3538        Result* result=NULL;
    3639       
    37         ParameterInputs* inputs=NULL;
    3840        double           waitonlock=0;
    3941       
     
    4345        double* weights=NULL;
    4446        double  dt;
    45         Param*  param=NULL;
     47        BoolParam*  param=NULL;
    4648
    4749        /*time*/
     
    114116                        _printf_("call computational core:\n");
    115117                        MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    116                         steadystate_core(results,model,inputs);
     118                        steadystate_core(results,model);
    117119                        MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    118120
     
    128130                        fem_dh=model->GetFormulation(DiagnosticAnalysisEnum,HorizAnalysisEnum);
    129131                        fem_ds=model->GetFormulation(DiagnosticAnalysisEnum,StokesAnalysisEnum);
    130                         param=(Param*)fem_dh->parameters->FindParamObject(ControlSteadyEnum);
    131                         param->SetDouble(1);
    132                         param=(Param*)fem_ds->parameters->FindParamObject(ControlSteadyEnum);
    133                         param->SetDouble(1);
     132
     133                        param=(BoolParam*)fem_dh->parameters->FindParamObject(ControlSteadyEnum); param->value=true;
     134                        param=(BoolParam*)fem_ds->parameters->FindParamObject(ControlSteadyEnum); param->value=true;
     135
    134136                        /*run control analysis: */
    135137                        _printf_("call computational core:\n");
    136138                        MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    137                         control_core(results,model,inputs);
     139                        control_core(results,model);
    138140                        MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    139141
     
    159161                #ifdef _HAVE_DAKOTA_
    160162                MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    161                 Qmux(model,inputs,SteadystateAnalysisEnum,NoneAnalysisEnum);
     163                Qmux(model,SteadystateAnalysisEnum,NoneAnalysisEnum);
    162164                MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    163165                #else
     
    178180        delete results;
    179181        delete processed_results;
    180         delete inputs;
    181182
    182183        /*Get finish time and close*/
  • issm/trunk/src/c/parallel/steadystate_core.cpp

    r3717 r3751  
    1010#include "../modules.h"
    1111
    12 void steadystate_core(DataSet* results,Model* model, ParameterInputs* inputs){
     12void steadystate_core(DataSet* results,Model* model){
    1313
    1414        extern int my_rank;
     
    7878
    7979                //first compute temperature at steady state.
    80                 if (step>1){
    81                         inputs->Add("velocity",u_g,ndof,numberofnodes);
    82                 }
    8380                results_thermal=new DataSet(ResultsEnum);
    84                 thermal_core(results_thermal,model,inputs);
     81                thermal_core(results_thermal,model);
    8582       
    8683                //get t_g and m_g;
     
    9390                VecDuplicatePatch(&t_g_average,t_g);
    9491                FieldDepthAveragex( t_g_average, fem_t->elements,fem_t->nodes, fem_t->vertices,fem_t->loads, fem_t->materials,fem_t->parameters,"temperature");
    95                 inputs->Add("temperature_average",t_g_average,1,numberofnodes);
    96                 inputs->Add("temperature",t_g,1,numberofnodes);
     92                model->UpdateInputsFromVector(t_g_average,TemperatureAverageEnum,VertexEnum);
     93                model->UpdateInputsFromVector(t_g,TemperatureEnum,VertexEnum);
    9794                VecFree(&t_g_average); //not needed anymore
    9895
    9996                //now compute diagnostic velocity using the steady state temperature.
    10097                results_diagnostic=new DataSet(ResultsEnum);
    101                 diagnostic_core(results_diagnostic,model, inputs);
     98                diagnostic_core(results_diagnostic,model);
    10299
    103100                //get p_g and u_g
  • issm/trunk/src/c/parallel/thermal.cpp

    r3717 r3751  
    22 * \brief: thermal solution
    33 */
    4 
    5 #include "../modules.h"
    6 #include "./parallel.h"
    74
    85#ifdef HAVE_CONFIG_H
     
    118#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    129#endif
     10
     11#include "../objects/objects.h"
     12#include "../shared/shared.h"
     13#include "../DataSet/DataSet.h"
     14#include "../EnumDefinitions/EnumDefinitions.h"
     15#include "../include/globals.h"
     16#include "./parallel.h"
    1317
    1418int main(int argc,char* *argv){
     
    3337        Result*  result=NULL;
    3438       
    35         ParameterInputs* inputs=NULL;
    3639        Param*           param=NULL;
    3740        double  dt;
     
    8790                _printf_("call computational core:\n");
    8891                MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    89                 thermal_core(results,model,inputs);
     92                thermal_core(results,model);
    9093                MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    9194
     
    106109                #ifdef _HAVE_DAKOTA_
    107110                MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    108                 Qmux(model,inputs,ThermalAnalysisEnum,NoneAnalysisEnum);
     111                Qmux(model,ThermalAnalysisEnum,NoneAnalysisEnum);
    109112                MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    110113                #else
     
    122125        delete results;
    123126        delete processed_results;
    124         delete inputs;
    125127
    126128        /*Get finish time and close*/
  • issm/trunk/src/c/parallel/thermal_core.cpp

    r3717 r3751  
    1010#include "../modules.h"
    1111
    12 void thermal_core(DataSet* results,Model* model, ParameterInputs* inputs){
     12void thermal_core(DataSet* results,Model* model){
    1313
    1414        extern int my_rank;
     
    6565
    6666                if(verbose)_printf_("computing temperatures:\n");
    67                 thermal_core_nonlinear(&t_g[0],&melting_offset,fem_t,inputs,ThermalAnalysisEnum,NoneAnalysisEnum);
    68                 inputs->Add("temperature",t_g[0],1,numberofnodes);
    69                 inputs->Add("melting_offset",melting_offset);
     67                thermal_core_nonlinear(&t_g[0],&melting_offset,fem_t,ThermalAnalysisEnum,NoneAnalysisEnum);
     68                model->UpdateInputsFromVector(t_g[0],TemperatureEnum,VertexEnum);
     69                model->UpdateInputsFromConstant(melting_offset,MeltingOffsetEnum);
    7070               
    7171                if(verbose)_printf_("computing melting:\n");
    72                 diagnostic_core_linear(&m_g[0],fem_m,inputs,MeltingAnalysisEnum,NoneAnalysisEnum);
     72                diagnostic_core_linear(&m_g[0],fem_m,MeltingAnalysisEnum,NoneAnalysisEnum);
    7373        }
    7474        else{
     
    8686                t_g[0]=SerialToVec(t_g_serial,numberofnodes);
    8787                xfree((void**)&t_g_serial);
    88                 fem_m->FindParam(&m_g_serial,NULL,NULL,MeltingEnum);
     88                fem_m->FindParam(&m_g_serial,NULL,NULL,MeltingRateEnum);
    8989                m_g[0]=SerialToVec(m_g_serial,numberofnodes);
    9090                xfree((void**)&m_g_serial);
     
    9595                       
    9696                        if(verbose)_printf_("computing temperatures:\n");
    97                         inputs->Add("temperature",t_g[i],1,numberofnodes);
    98                         thermal_core_nonlinear(&t_g[i+1],&melting_offset,fem_t,inputs,ThermalAnalysisEnum,NoneAnalysisEnum);
     97                        model->UpdateInputsFromVector(t_g[i],TemperatureEnum,VertexEnum);
     98                        thermal_core_nonlinear(&t_g[i+1],&melting_offset,fem_t,ThermalAnalysisEnum,NoneAnalysisEnum);
    9999                       
    100100                        if(verbose)_printf_("computing melting:\n");
    101                         inputs->Add("temperature",t_g[i+1],1,numberofnodes);
    102                         inputs->Add("melting_offset",melting_offset);
    103                         diagnostic_core_linear(&m_g[i+1],fem_m,inputs,MeltingAnalysisEnum,NoneAnalysisEnum);
     101                        model->UpdateInputsFromVector(t_g[i+1],TemperatureEnum,VertexEnum);
     102                        model->UpdateInputsFromConstant(melting_offset,MeltingOffsetEnum);
     103                        diagnostic_core_linear(&m_g[i+1],fem_m,MeltingAnalysisEnum,NoneAnalysisEnum);
    104104                }
    105105        }
  • issm/trunk/src/c/parallel/thermal_core_nonlinear.cpp

    r3732 r3751  
    3131        int numberofnodes;
    3232        int min_thermal_constraints;
     33        bool reset_penalties;
    3334
    3435        /*parameters:*/
     
    5758
    5859                if(count==1) reset_penalties=1; else reset_penalties=0;
    59                 fem->UpdateInputsFromVector(&reset_penalties,ResetPenaltiesEnum,ConstantEnum);
     60                fem->UpdateInputsFromConstant(reset_penalties,ResetPenaltiesEnum);
    6061
    6162                //*Generate system matrices
     
    109110                //Deal with penalty loads
    110111                if (verbose) _printf_("   penalty constraints\n");
    111                 PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,inputs,analysis_type,sub_analysis_type);
     112                PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,analysis_type,sub_analysis_type);
    112113               
    113                 inputs->Add("temperature",tg,numberofdofspernode,numberofnodes);
     114                fem->UpdateInputsFromVector(tg,TemperatureEnum,VertexEnum);
    114115
    115116                if (!converged){
  • issm/trunk/src/c/parallel/transient.cpp

    r3717 r3751  
    22 * \brief: transient solution
    33 */
    4 
    5 #include "../modules.h"
    6 #include "./parallel.h"
    74
    85#ifdef HAVE_CONFIG_H
     
    129#endif
    1310
     11#include "../objects/objects.h"
     12#include "../shared/shared.h"
     13#include "../DataSet/DataSet.h"
     14#include "../EnumDefinitions/EnumDefinitions.h"
     15#include "../include/globals.h"
     16#include "./parallel.h"
    1417
    1518int main(int argc,char* *argv){
     
    3336        Result*  result=NULL;
    3437       
    35         ParameterInputs* inputs=NULL;
    36        
    37         /*inputs: */
    3838        Param*  param=NULL;
    3939
     
    111111                _printf_("call computational core:\n");
    112112                MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    113                 transient_core(results,model,inputs);
     113                transient_core(results,model);
    114114                MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    115115       
     
    130130                #ifdef _HAVE_DAKOTA_
    131131                MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
    132                 Qmux(model,inputs,TransientAnalysisEnum,NoneAnalysisEnum);
     132                Qmux(model,TransientAnalysisEnum,NoneAnalysisEnum);
    133133                MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
    134134                #else
     
    146146        delete processed_results;
    147147        delete model;
    148         delete inputs;
    149148
    150149        /*Get finish time and close*/
  • issm/trunk/src/c/parallel/transient_core.cpp

    r3717 r3751  
    1010#include "../modules.h"
    1111
    12 void transient_core(DataSet* results,Model* model, ParameterInputs* inputs){
     12void transient_core(DataSet* results,Model* model){
    1313
    1414        extern int my_rank;
     
    2121        //branch out
    2222        if(dim==2){
    23                 transient_core_2d(results,model,inputs);
     23                transient_core_2d(results,model);
    2424        }
    2525        else if(dim==3){
    26                 transient_core_3d(results,model,inputs);
     26                transient_core_3d(results,model);
    2727        }
    2828        else ISSMERROR("%s%i%s"," dimension ",dim," not supported yet!");
  • issm/trunk/src/c/parallel/transient_core_2d.cpp

    r3717 r3751  
    1010#include "../modules.h"
    1111
    12 void transient_core_2d(DataSet* results,Model* model, ParameterInputs* inputs){
     12void transient_core_2d(DataSet* results,Model* model){
    1313
    1414        extern int my_rank;
     
    3838        Vec b_g=NULL;
    3939        Vec new_b_g=NULL;
     40        double* vx=NULL;
     41        double* vy=NULL;
    4042
    4143        /*intermediary: */
     
    8587                _printf_("%s\n","computing new velocity");
    8688                diagnostic_results=new DataSet(ResultsEnum);
    87                 diagnostic_core(diagnostic_results,model, inputs);
     89                diagnostic_core(diagnostic_results,model);
    8890
    8991                //extract u_g and p_g from diagnostic_results, and erase diagnostic_results;
     
    9597                _printf_("%s\n","computing new thickness");
    9698               
    97                 inputs->Add("velocity",u_g,2,numberofnodes);
     99                SplitSolutionVector(u_g,numberofnodes,2,&vx,&vy);
     100                model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);
     101                model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);
     102                xfree((void**)&vx); xfree((void**)&vy);
     103               
    98104                prognostic_results=new DataSet(ResultsEnum);
    99                 prognostic_core(prognostic_results,model, inputs);
     105                prognostic_core(prognostic_results,model);
    100106       
    101107                //extract h_g prognostic_results, and erase prognostic_results;
     
    120126
    121127                //update inputs
    122                 inputs->Add("thickness",h_g,1,numberofnodes);
    123                 inputs->Add("surface",s_g,1,numberofnodes);
    124                 inputs->Add("bed",b_g,1,numberofnodes);
    125                 inputs->Add("velocity",u_g,2,numberofnodes);
     128                model->UpdateInputsFromVector(h_g,ThicknessEnum,VertexEnum);
     129                model->UpdateInputsFromVector(s_g,SurfaceEnum,VertexEnum);
     130                model->UpdateInputsFromVector(b_g,BedEnum,VertexEnum);
     131       
     132                SplitSolutionVector(u_g,numberofnodes,2,&vx,&vy);
     133                model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);
     134                model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);
    126135
    127136        }
     
    133142        VecFree(&s_g);
    134143        VecFree(&b_g);
     144        xfree((void**)&vx);
     145        xfree((void**)&vy);
    135146}
  • issm/trunk/src/c/parallel/transient_core_3d.cpp

    r3717 r3751  
    1010#include "../modules.h"
    1111
    12 void transient_core_3d(DataSet* results,Model* model, ParameterInputs* inputs){
     12void transient_core_3d(DataSet* results,Model* model){
    1313
    1414        extern int my_rank;
     
    3030        int step;
    3131        double time;
     32       
     33        double* vx=NULL;
     34        double* vy=NULL;
     35        double* vz=NULL;
    3236       
    3337        Vec u_g=NULL;
     
    8993                //Deal with temperature first
    9094                if(verbose)_printf_("%s\n","computing temperature");
    91                 thermal_core_nonlinear(&t_g,&melting_offset,fem_t,inputs,ThermalAnalysisEnum,TransientAnalysisEnum);
     95                thermal_core_nonlinear(&t_g,&melting_offset,fem_t,ThermalAnalysisEnum,TransientAnalysisEnum);
    9296                if(verbose)_printf_("%s\n","computing melting");
    93                 inputs->Add("temperature",t_g,1,numberofnodes);
    94                 inputs->Add("melting_offset",melting_offset);
    95                 diagnostic_core_linear(&m_g,fem_m,inputs,MeltingAnalysisEnum,TransientAnalysisEnum);
     97                model->UpdateInputsFromVector(t_g,TemperatureEnum,VertexEnum);
     98                model->UpdateInputsFromConstant(melting_offset,MeltingOffsetEnum);
     99                diagnostic_core_linear(&m_g,fem_m,MeltingAnalysisEnum,TransientAnalysisEnum);
    96100
    97101                //Compute depth averaged temperature and add to inputs
     
    99103                VecDuplicatePatch(&t_g_average,t_g);
    100104                FieldDepthAveragex( t_g_average, fem_t->elements,fem_t->nodes, fem_t->vertices,fem_t->loads, fem_t->materials,fem_t->parameters,"temperature");
    101                 inputs->Add("temperature_average",t_g_average,1,numberofnodes);
     105                model->UpdateInputsFromVector(t_g_average,TemperatureAverageEnum,VertexEnum);
    102106                VecFree(&t_g_average); //not needed anymore
    103107
    104108                //Deal with velocities.
    105109                diagnostic_results=new DataSet(ResultsEnum);
    106                 diagnostic_core(diagnostic_results,model, inputs);
     110                diagnostic_core(diagnostic_results,model);
    107111
    108112                //extract u_g and p_g from diagnostic_results, and erase diagnostic_results;
     
    113117                //compute new thickness
    114118                if(verbose)_printf_("%s\n","computing new thickness");
    115                
    116                 inputs->Add("velocity",u_g,3,numberofnodes);
    117                 prognostic_results=new DataSet(ResultsEnum); prognostic_core(prognostic_results,model, inputs);
     119       
     120                SplitSolutionVector(u_g,numberofnodes,3,&vx,&vy,&vz);
     121                model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);
     122                model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);
     123                model->UpdateInputsFromVector(vz,VzEnum,VertexEnum);
     124                xfree((void**)&vx); xfree((void**)&vy); xfree((void**)&vz);
     125       
     126                prognostic_results=new DataSet(ResultsEnum); prognostic_core(prognostic_results,model);
    118127       
    119128                //extract h_g prognostic_results, and erase prognostic_results;
     
    146155
    147156                //update inputs
    148                 inputs->Add("thickness",h_g,1,numberofnodes);
    149                 inputs->Add("surface",s_g,1,numberofnodes);
    150                 inputs->Add("bed",b_g,1,numberofnodes);
    151                 inputs->Add("velocity",u_g,3,numberofnodes);
    152                 inputs->Add("pressure",p_g,1,numberofnodes);
    153                 inputs->Add("temperature",t_g,1,numberofnodes);
     157                model->UpdateInputsFromVector(h_g,ThicknessEnum,VertexEnum);
     158                model->UpdateInputsFromVector(s_g,SurfaceEnum,VertexEnum);
     159                model->UpdateInputsFromVector(b_g,BedEnum,VertexEnum);
     160       
     161                SplitSolutionVector(u_g,numberofnodes,3,&vx,&vy,&vz);
     162                model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);
     163                model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);
     164                model->UpdateInputsFromVector(vz,VzEnum,VertexEnum);
     165                xfree((void**)&vx); xfree((void**)&vy); xfree((void**)&vz);
     166               
     167                model->UpdateInputsFromVector(p_g,PressureEnum,VertexEnum);
     168                model->UpdateInputsFromVector(t_g,TemperatureEnum,VertexEnum);
    154169
    155170                //Save temporary results every 5 steps
     
    179194        VecFree(&t_g);
    180195        VecFree(&m_g);
     196        xfree((void**)&vx);
     197        xfree((void**)&vy);
     198        xfree((void**)&vz);
    181199}
  • issm/trunk/src/mex/ControlConstrain/ControlConstrain.cpp

    r3712 r3751  
    1414        double   cm_min;
    1515        double   cm_max;
    16         char*    control_type=NULL;
     16        int      control_type=NULL;
    1717        int      gsize;
    1818        Parameters* parameters=NULL;
     
    3939
    4040        /*Free ressources: */
    41         xfree((void**)&control_type);
    4241        delete parameters;
    4342
Note: See TracChangeset for help on using the changeset viewer.