Changeset 11695


Ignore:
Timestamp:
03/13/12 19:59:59 (13 years ago)
Author:
Eric.Larour
Message:

Completed separation of Petsc from ISSM. Matrix and Vector
are now the vehicles for Mat and Vec objects when running with
Petsc, or double* when running with a custom made type of matrix (still
to be finished).

Location:
issm/trunk-jpl/src
Files:
15 added
9 deleted
147 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/Container/Elements.cpp

    r11525 r11695  
    175175        double *resultstimes = NULL;
    176176        double *vector_serial= NULL;
    177         Vec     vector       = NULL;
     177        Vector*     vector       = NULL;
    178178        bool   io_gather;
    179179        bool   results_as_patches;
     
    225225                        else if(resultssizes[i]==P0Enum) vectorsize=numberofelements;
    226226                        else _error_("Unkown result size: %s",EnumToStringx(resultssizes[i]));
    227                         vector=NewVec(vectorsize);
     227                        vector=new Vector(vectorsize);
    228228
    229229                        for(int j=0;j<this->Size();j++){
     
    231231                                element->GetVectorFromResults(vector,i,resultssizes[i]);
    232232                        }
    233                         VecAssemblyBegin(vector);
    234                         VecAssemblyEnd(vector);
     233                        vector->Assemble();
    235234
    236235                        /*Serialize and add to results*/
    237                         VecToMPISerial(&vector_serial,vector);
     236                        vector_serial=vector->ToMPISerial();
    238237                        if(my_rank==0){
    239238                                /*No need to add this vector for all cpus*/
     
    242241
    243242                        /*clean up*/
    244                         VecFree(&vector);
     243                        xdelete(&vector);
    245244                        xfree((void**)&vector_serial);
    246245                }
  • issm/trunk-jpl/src/c/Container/Parameters.cpp

    r10522 r11695  
    227227}
    228228/*}}}*/
    229 /*FUNCTION Parameters::FindParam(Vec* pvec,int enum_type){{{1*/
    230 void Parameters::FindParam(Vec* pvec,int enum_type){ _assert_(this);
     229/*FUNCTION Parameters::FindParam(Vector** pvec,int enum_type){{{1*/
     230void Parameters::FindParam(Vector** pvec,int enum_type){ _assert_(this);
    231231       
    232232        vector<Object*>::iterator object;
     
    245245}
    246246/*}}}*/
    247 /*FUNCTION Parameters::FindParam(Mat* pmat,int enum_type){{{1*/
    248 void Parameters::FindParam(Mat* pmat,int enum_type){ _assert_(this);
     247/*FUNCTION Parameters::FindParam(Matrix** pmat,int enum_type){{{1*/
     248void Parameters::FindParam(Matrix** pmat,int enum_type){ _assert_(this);
    249249       
    250250        vector<Object*>::iterator object;
     
    389389}
    390390/*}}}*/
    391 /*FUNCTION Parameters::SetParam(Vec vector,int enum_type);{{{1*/
    392 void   Parameters::SetParam(Vec vector,int enum_type){
     391/*FUNCTION Parameters::SetParam(Vector* vector,int enum_type);{{{1*/
     392void   Parameters::SetParam(Vector* vector,int enum_type){
    393393
    394394        Param* param=NULL;
     
    398398
    399399        if(param) param->SetValue(vector); //already exists, just set it.
    400         else this->AddObject(new PetscVecParam(enum_type,vector)); //just add the new parameter.
    401 }
    402 /*}}}*/
    403 /*FUNCTION Parameters::SetParam(Mat matrix,int enum_type);{{{1*/
    404 void   Parameters::SetParam(Mat matrix,int enum_type){
     400        else this->AddObject(new VectorParam(enum_type,vector)); //just add the new parameter.
     401}
     402/*}}}*/
     403/*FUNCTION Parameters::SetParam(Matrix* matrix,int enum_type);{{{1*/
     404void   Parameters::SetParam(Matrix* matrix,int enum_type){
    405405
    406406        Param* param=NULL;
     
    410410
    411411        if(param) param->SetValue(matrix); //already exists, just set it.
    412         else this->AddObject(new PetscMatParam(enum_type,matrix)); //just add the new parameter.
     412        else this->AddObject(new MatrixParam(enum_type,matrix)); //just add the new parameter.
    413413}
    414414/*}}}*/
  • issm/trunk-jpl/src/c/Container/Parameters.h

    r10522 r11695  
    77
    88/*forward declarations */
     9class Matrix;
     10class Vector;
    911class Materials;
    1012class Parameters;
     
    3739                void  FindParam(double** pdoublearray,int* pM,int* pN,int enum_type);
    3840                void  FindParam(double*** parray,int* pM, int** pmdims_array,int** pndims_array,int enum_type);
    39                 void  FindParam(Vec* pvec,int enum_type);
    40                 void  FindParam(Mat* pmat,int enum_type);
     41                void  FindParam(Vector** pvec,int enum_type);
     42                void  FindParam(Matrix** pmat,int enum_type);
    4143                void  FindParam(FILE** pfid,int enum_type);
    4244               
     
    5052                void  SetParam(int* intarray,int M,int enum_type);
    5153                void  SetParam(int* intarray,int M,int N,int enum_type);
    52                 void  SetParam(Vec vec,int enum_type);
    53                 void  SetParam(Mat mat,int enum_type);
     54                void  SetParam(Vector* vec,int enum_type);
     55                void  SetParam(Matrix* mat,int enum_type);
    5456                void  SetParam(FILE* fid,int enum_type);
    5557                void  UnitConversion(int direction_enum);
  • issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h

    r11643 r11695  
    264264        PentaEnum,
    265265        PentaP1InputEnum,
    266         PetscMatParamEnum,
    267         PetscVecParamEnum,
     266        MatrixParamEnum,
     267        VectorParamEnum,
    268268        RiftfrontEnum,
    269269        SegmentEnum,
  • issm/trunk-jpl/src/c/Makefile.am

    r11679 r11695  
    7979                                        ./objects/ExternalResults/StringExternalResult.h\
    8080                                        ./objects/ExternalResults/StringExternalResult.cpp\
    81                                         ./objects/ExternalResults/PetscVecExternalResult.h\
    82                                         ./objects/ExternalResults/PetscVecExternalResult.cpp\
    8381                                        ./objects/Elements/Tria.h\
    8482                                        ./objects/Elements/Tria.cpp\
     
    137135                                        ./objects/Params/FileParam.cpp\
    138136                                        ./objects/Params/FileParam.h\
    139                                         ./objects/Params/PetscMatParam.cpp\
    140                                         ./objects/Params/PetscMatParam.h\
    141137                                        ./objects/Params/StringArrayParam.cpp\
    142138                                        ./objects/Params/StringArrayParam.h\
     
    149145                                        ./objects/Params/DoubleVecParam.cpp\
    150146                                        ./objects/Params/DoubleVecParam.h\
    151                                         ./objects/Params/PetscVecParam.cpp\
    152                                         ./objects/Params/PetscVecParam.h\
    153147                                        ./objects/Params/StringParam.cpp\
    154148                                        ./objects/Params/StringParam.h\
     149                                        ./objects/Params/MatrixParam.h\
     150                                        ./objects/Params/MatrixParam.cpp\
     151                                        ./objects/Params/VectorParam.h\
     152                                        ./objects/Params/VectorParam.cpp\
    155153                                        ./Container/Container.h\
    156154                                        ./Container/Constraints.h\
     
    195193                                        ./shared/Numerics/XZvectorsToCoordinateSystem.cpp\
    196194                                        ./shared/Numerics/UnitConversion.cpp\
    197                                         ./shared/Numerics/PetscOptionsFromAnalysis.cpp\
     195                                        ./shared/Numerics/OptionsFromAnalysis.cpp\
    198196                                        ./shared/Exceptions/exceptions.h\
    199197                                        ./shared/Exceptions/Exceptions.cpp\
     
    209207                                        ./shared/Elements/GetNumberOfDofs.cpp\
    210208                                        ./shared/String/sharedstring.h\
    211                                         ./toolkits/petsc\
    212                                         ./toolkits/petsc/patches\
    213                                         ./toolkits/petsc/patches/SolverEnum.h\
    214                                         ./toolkits/petsc/patches/petscpatches.h\
    215                                         ./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp\
    216                                         ./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp\
    217                                         ./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp\
    218                                         ./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp\
    219                                         ./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp\
    220                                         ./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp\
    221                                         ./toolkits/petsc/patches/PetscDetermineLocalSize.cpp\
    222                                         ./toolkits/petsc/patches/VecTranspose.cpp\
    223                                         ./toolkits/petsc/patches/VecToMPISerial.cpp\
    224                                         ./toolkits/petsc/patches/MatToSerial.cpp\
    225                                         ./toolkits/petsc/patches/VecMerge.cpp\
    226                                         ./toolkits/petsc/patches/NewVec.cpp\
    227                                         ./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp\
    228                                         ./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp\
    229                                         ./toolkits/petsc/patches/NewMat.cpp\
    230                                         ./toolkits/petsc/patches/SerialToVec.cpp\
    231                                         ./toolkits/petsc/patches/VecFree.cpp\
    232                                         ./toolkits/petsc/patches/VecDuplicatePatch.cpp\
    233                                         ./toolkits/petsc/patches/KSPFree.cpp\
    234                                         ./toolkits/petsc/patches/ISFree.cpp\
    235                                         ./toolkits/petsc/patches/MatFree.cpp\
    236                                         ./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp\
    237                                         ./toolkits/petsc/patches/VecPartition.cpp\
    238                                         ./toolkits/petsc/patches/MatPartition.cpp\
    239                                         ./toolkits/petsc/patches/MatInvert.cpp\
    240                                         ./toolkits/petsc/patches/MatMultPatch.cpp\
    241                                         ./toolkits/petsc/petscincludes.h\
    242209                                        ./toolkits/mpi/mpiincludes.h\
    243210                                        ./toolkits/mpi/patches/mpipatches.h\
     211                                        ./toolkits/mpi/patches/DetermineLocalSize.cpp\
    244212                                        ./toolkits/mpi/patches/MPI_Upperrow.cpp\
    245213                                        ./toolkits/mpi/patches/MPI_Lowerrow.cpp\
     
    249217                                        ./toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp\
    250218                                        ./toolkits/triangle/triangleincludes.h\
     219                                        ./toolkitsenums.h\
    251220                                        ./toolkits.h\
    252221                                        ./io/io.h\
     
    268237                                        ./modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp\
    269238                                        ./modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp\
    270                                         ./modules/ParsePetscOptionsx/ParsePetscOptionsx.h\
    271                                         ./modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp\
    272239                                        ./modules/NodesDofx/NodesDofx.h\
    273240                                        ./modules/NodesDofx/NodesDofx.cpp\
     
    344311                                        ./modules/ResetCoordinateSystemx/ResetCoordinateSystemx.cpp\
    345312                                        ./modules/Solverx/Solverx.cpp\
    346                                         ./modules/Solverx/SolverxPetsc.cpp\
    347313                                        ./modules/Solverx/Solverx.h\
    348                                         ./modules/Solverx/DofTypesToIndexSet.cpp\
    349314                                        ./modules/VecMergex/VecMergex.cpp\
    350315                                        ./modules/VecMergex/VecMergex.h\
     
    731696                                    ./toolkits/matlab/MatlabMatrixToMatrix.cpp\
    732697                                    ./toolkits/matlab/MatlabVectorToVector.cpp\
     698                                    ./toolkits/double/MatlabVectorToDoubleVector.cpp\
     699                                    ./toolkits/double/double.h\
     700                                    ./toolkits/double/MatlabMatrixToDoubleMatrix.cpp\
    733701                                    ./io/Matlab/matlabio.h\
    734702                                    ./io/Matlab/WriteMatlabData.cpp\
    735703                                    ./io/Matlab/FetchMatlabData.cpp\
    736704                                    ./io/Matlab/OptionParse.cpp
     705#}}}
     706#Petsc sources  {{{1
     707petsc_sources= ./toolkits/petsc\
     708                                        ./toolkits/petsc/patches\
     709                                        ./toolkits/petsc/patches/SolverEnum.h\
     710                                        ./toolkits/petsc/patches/petscpatches.h\
     711                                        ./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp\
     712                                        ./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp\
     713                                        ./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp\
     714                                        ./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp\
     715                                        ./toolkits/petsc/patches/VecTranspose.cpp\
     716                                        ./toolkits/petsc/patches/VecToMPISerial.cpp\
     717                                        ./toolkits/petsc/patches/MatToSerial.cpp\
     718                                        ./toolkits/petsc/patches/VecMerge.cpp\
     719                                        ./toolkits/petsc/patches/NewVec.cpp\
     720                                        ./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp\
     721                                        ./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp\
     722                                        ./toolkits/petsc/patches/NewMat.cpp\
     723                                        ./toolkits/petsc/patches/SerialToVec.cpp\
     724                                        ./toolkits/petsc/patches/VecFree.cpp\
     725                                        ./toolkits/petsc/patches/VecDuplicatePatch.cpp\
     726                                        ./toolkits/petsc/patches/KSPFree.cpp\
     727                                        ./toolkits/petsc/patches/ISFree.cpp\
     728                                        ./toolkits/petsc/patches/MatFree.cpp\
     729                                        ./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp\
     730                                        ./toolkits/petsc/patches/VecPartition.cpp\
     731                                        ./toolkits/petsc/patches/MatPartition.cpp\
     732                                        ./toolkits/petsc/patches/MatInvert.cpp\
     733                                        ./toolkits/petsc/patches/MatMultPatch.cpp\
     734                                        ./toolkits/petsc/patches/ISSMToPetscInsertMode.cpp\
     735                                        ./toolkits/petsc/patches/ISSMToPetscNormMode.cpp\
     736                                        ./toolkits/petsc/petscincludes.h\
     737                                        ./shared/Numerics/PetscOptionsFromAnalysis.cpp\
     738                                        ./modules/ParsePetscOptionsx/ParsePetscOptionsx.h\
     739                                        ./modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp\
     740                                        ./modules/Solverx/SolverxPetsc.cpp\
     741                                        ./modules/Solverx/DofTypesToIndexSet.cpp
     742
    737743#}}}
    738744#Serialsources  {{{1
     
    835841endif
    836842
     843if PETSC
     844issm_sources  +=  $(petsc_sources)
     845issm_psources +=  $(petsc_psources)
     846endif
     847
    837848if TRANSIENT
    838849issm_sources  +=  $(transient_sources)
     
    898909
    899910#ISSM serial library {{{1
     911if SERIAL
    900912libISSM_a_SOURCES  = $(issm_sources)
    901913libISSM_a_SOURCES += $(serial_sources)
     
    910922libISSM_a_CXXFLAGS += -DMX_COMPAT_32
    911923endif
     924endif
    912925#}}}
    913926#ISSM parallel library {{{1
     927if PARALLEL
    914928libpISSM_a_SOURCES  = $(issm_sources)
    915929libpISSM_a_SOURCES += $(issm_psources)
    916930libpISSM_a_CXXFLAGS = -fPIC -D_PARALLEL_   -D_C_ $(CXXFLAGS) $(CXXOPTFLAGS)
     931endif
    917932#}}}
    918933#Overload library, to overload any non-standard symbols. {{{1
  • issm/trunk-jpl/src/c/io/Matlab/FetchMatlabData.cpp

    r11675 r11695  
    276276}
    277277/*}}}*/
    278 /*FUNCTION FetchMatlabData(Mat* pmatrix,const mxArray* dataref){{{1*/
    279 void FetchMatlabData(Mat* pmatrix,const mxArray* dataref){
    280        
    281         Mat outmatrix=NULL;
    282         int dummy=0;
    283 
    284         if (mxIsClass(dataref,"double") ){
    285 
    286                 /*Check dataref is not pointing to NaN: */
    287                 if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetM(dataref)==1) && (mxGetN(dataref)==1) ){
    288                         outmatrix=NULL;
    289                 }
    290                 else{
    291 
    292                         /*Convert matlab matrix to petsc matrix: */
    293                         MatlabMatrixToPetscMatrix(&outmatrix,&dummy,&dummy,dataref);
    294                 }
    295         }
    296         else{
    297                 /*This is an error: we don't have the correct input!: */
    298                 _error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
    299         }
    300 
    301         /*Assign output pointers:*/
    302         *pmatrix=outmatrix;
    303 }
    304 /*}}}*/
    305278/*FUNCTION FetchMatlabData(Matrix** pmatrix,const mxArray* dataref){{{1*/
    306279void FetchMatlabData(Matrix** pmatrix,const mxArray* dataref){
     
    451424        *pvector=outvector;
    452425        if (pM)*pM=outvector_rows;
    453 }
    454 /*}}}*/
    455 /*FUNCTION FetchMatlabData(Vec* pvector,const mxArray* dataref){{{1*/
    456 void FetchMatlabData(Vec* pvector,const mxArray* dataref){
    457 
    458         Vec vector=NULL;
    459         int dummy;
    460 
    461         if(mxIsEmpty(dataref)){
    462                 /*Nothing to pick up. Just initialize matrix pointer to NULL: */
    463                 vector=NULL;
    464         }
    465         else if (mxIsClass(dataref,"double") ){
    466 
    467                 /*Convert matlab vector to petsc vector: */
    468                 MatlabVectorToPetscVector(&vector,&dummy,dataref);
    469         }
    470         else{
    471                 /*This is an error: we don't have the correct input!: */
    472                 _error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
    473         }
    474 
    475         /*Assign output pointers:*/
    476         *pvector=vector;
    477426}
    478427/*}}}*/
  • issm/trunk-jpl/src/c/io/Matlab/WriteMatlabData.cpp

    r11670 r11695  
    4141}
    4242/*}}}*/
    43 /*FUNCTION WriteMatlabData(mxArray** pdataref,Mat matrix){{{1*/
    44 void WriteMatlabData(mxArray** pdataref,Mat matrix){
    45                
    46         mxArray* dataref=NULL;
    47        
    48         if(matrix){
    49                
    50                 /*call toolkit routine: */
    51                 PetscMatrixToMatlabMatrix(&dataref,matrix);
    52         }
    53         else{
    54                 dataref = mxCreateDoubleMatrix(0,0,mxREAL);
    55         }
    56 
    57         *pdataref=dataref;
    58 }
    59 /*}}}*/
    6043/*FUNCTION WriteMatlabData(mxArray** pdataref,Matrix* matrix){{{1*/
    6144void WriteMatlabData(mxArray** pdataref,Matrix* matrix){
     
    123106        }
    124107        *pdataref=dataref;
    125 }
    126 /*}}}*/
    127 /*FUNCTION WriteMatlabData(mxArray** pdataref,Vec vector){{{1*/
    128 void WriteMatlabData(mxArray** pdataref,Vec vector){
    129        
    130         mxArray* dataref=NULL;
    131        
    132         if(vector){
    133                
    134                 /*call toolkit routine: */
    135                 PetscVectorToMatlabVector(&dataref,vector);
    136         }
    137         else{
    138                 dataref = mxCreateDoubleMatrix(0,0,mxREAL);
    139         }
    140         *pdataref=dataref;
    141 
    142108}
    143109/*}}}*/
  • issm/trunk-jpl/src/c/io/Matlab/matlabio.h

    r11670 r11695  
    1616#include <mex.h>
    1717void WriteMatlabData(mxArray** pdataref,DataSet* dataset);
    18 void WriteMatlabData(mxArray** pdataref,Mat matrix);
    1918void WriteMatlabData(mxArray** pdataref,Matrix* matrix);
    2019void WriteMatlabData(mxArray** pdataref,double* matrix, int M,int N);
    2120void WriteMatlabData(mxArray** pdataref,int*    matrix, int M,int N);
    22 void WriteMatlabData(mxArray** pdataref,Vec vector);
    2321void WriteMatlabData(mxArray** pdataref,Vector* vector);
    2422void WriteMatlabData(mxArray** pdataref,double* vector, int M);
     
    3533void FetchMatlabData(bool** pmatrix,int* pM,int *pN,const mxArray* dataref);
    3634void FetchMatlabData(bool** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref);
    37 void FetchMatlabData(Mat* pmatrix,const mxArray* dataref);
    3835void FetchMatlabData(Matrix** pmatrix,const mxArray* dataref);
    3936void FetchMatlabData(int** pvector,int* pM,const mxArray* dataref);
     
    4138void FetchMatlabData(double** pvector,int* pM,const mxArray* dataref);
    4239void FetchMatlabData(bool** pvector,int* pM,const mxArray* dataref);
    43 void FetchMatlabData(Vec* pvector,const mxArray* dataref);
    4440void FetchMatlabData(Vector** pvector,const mxArray* dataref);
    4541void FetchMatlabData(char** pstring,const mxArray* dataref);
  • issm/trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp

    r9650 r11695  
    2929
    3030        /*output: */
    31         Vec partition_contributions=NULL;
    32         Vec partition_areas=NULL;
    33         Vec vec_average=NULL;
     31        Vector* partition_contributions=NULL;
     32        Vector* partition_areas=NULL;
     33        Vector* vec_average=NULL;
    3434        double* average=NULL;
    3535
     
    4444
    4545        /*allocate: */
    46         partition_contributions=NewVec(npart);
    47         partition_areas=NewVec(npart);
    48         vec_average=NewVec(npart);
     46        partition_contributions=new Vector(npart);
     47        partition_areas=new Vector(npart);
     48        vec_average=new Vector(npart);
    4949
    5050        /*loop on each element, and add contribution of the element to the partition (surface weighted average): */
     
    5555
    5656        /*Assemble: */
    57         VecAssemblyBegin(partition_contributions);
    58         VecAssemblyEnd(partition_contributions);
    59 
    60         VecAssemblyBegin(partition_areas);
    61         VecAssemblyEnd(partition_areas);
     57        partition_contributions->Assemble();
     58        partition_areas->Assemble();
    6259
    6360        /*We have the partition_areas and the partition_contributions for each partition -> compute the surfae weighted average: */
    64         VecPointwiseDivide(vec_average,partition_contributions,partition_areas);
     61        vec_average->PointwiseDivide(partition_contributions,partition_areas);
    6562
    6663        /*serialize:*/
    67         VecToMPISerial(&average,vec_average);
     64        average=vec_average->ToMPISerial();
    6865
    6966        /*Free ressources:*/
    7067        xfree((void**)&qmu_part);
    71         VecFree(&partition_contributions);
    72         VecFree(&partition_areas);
    73         VecFree(&vec_average);
     68        xdelete(&partition_contributions);
     69        xdelete(&partition_areas);
     70        xdelete(&vec_average);
    7471
    7572        /*Assign output pointers:*/
  • issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp

    r9725 r11695  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void    ComputeBasalStressx( Vec* psigma,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){
     12void    ComputeBasalStressx( Vector** psigma,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){
    1313
    1414        /*Intermediary*/
     
    1919
    2020        /*output: */
    21         Vec sigma=NULL;
     21        Vector* sigma=NULL;
    2222
    2323        /*Recover numberofelements: */
     
    2525
    2626        /*Allocate sigma on numberofelements: */
    27         sigma=NewVec((int)numberofelements);
     27        sigma=new Vector((int)numberofelements);
    2828
    2929        /*Compute basal stress for each element: */
     
    3434
    3535        /*Assemble vector: */
    36         VecAssemblyBegin(sigma);
    37         VecAssemblyEnd(sigma);
     36        sigma->Assemble();
    3837
    3938        /*Assign output pointers: */
  • issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.h

    r4405 r11695  
    1010
    1111/* local prototypes: */
    12 void    ComputeBasalStressx( Vec* pp_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
     12void    ComputeBasalStressx( Vector** pp_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
    1313
    1414#endif  /* _COMPUTEBASALSTRESSX_H */
  • issm/trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.cpp

    r9725 r11695  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void    ComputeStrainRatex( Vec* peps,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){
     12void    ComputeStrainRatex( Vector** peps,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){
    1313
    1414        /*Intermediary*/
     
    1919
    2020        /*output: */
    21         Vec eps=NULL;
     21        Vector* eps=NULL;
    2222
    2323        /*Recover numberofelements: */
     
    2525
    2626        /*Allocate eps on numberofelements (only 1 dof): */
    27         eps=NewVec(numberofelements);
     27        eps=new Vector(numberofelements);
    2828
    2929        /*Compute basal stress for each element: */
     
    3434
    3535        /*Assemble vector: */
    36         VecAssemblyBegin(eps);
    37         VecAssemblyEnd(eps);
     36        eps->Assemble();
    3837
    3938        /*Assign output pointers: */
  • issm/trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.h

    r4405 r11695  
    1010
    1111/* local prototypes: */
    12 void    ComputeStrainRatex(Vec* eps_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
     12void    ComputeStrainRatex(Vector** eps_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
    1313
    1414#endif  /* _COMPUTESTRAINRATEX_H */
  • issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp

    r9320 r11695  
    1111#include "./ContourToMeshx.h"
    1212
    13 int ContourToMeshx( Vec* pin_nod,Vec* pin_elem, double* index, double* x, double* y,Contour** contours,int numcontours,char* interptype,int nel,int nods, int edgevalue) {
     13int ContourToMeshx( Vector** pin_nod,Vector** pin_elem, double* index, double* x, double* y,Contour** contours,int numcontours,char* interptype,int nel,int nods, int edgevalue) {
    1414
    1515        int noerr=1;
     
    3030
    3131        /*output: */
    32         Vec in_nod=NULL;
    33         Vec in_elem=NULL;
     32        Vector* in_nod=NULL;
     33        Vector* in_elem=NULL;
    3434
    35         in_nod=NewVec(nods);
    36         in_elem=NewVec(nel);
     35        in_nod=new Vector(nods);
     36        in_elem=new Vector(nel);
    3737
    3838        /*initialize thread parameters: */
     
    4949
    5050        /*Assemble in_nod: */
    51         VecAssemblyBegin(in_nod);
    52         VecAssemblyEnd(in_nod);
     51        in_nod->Assemble();
    5352
    5453        /*Get in_nod serialised for next operation: */
    55         VecToMPISerial(&in_nod_serial,in_nod);
     54        in_nod_serial=in_nod->ToMPISerial();
    5655
    5756        /*Take care of the case where an element interpolation has been requested: */
     
    5958                for (n=0;n<nel;n++){
    6059                        if ( (in_nod_serial[ (int)*(index+3*n+0) -1] == 1) && (in_nod_serial[ (int)*(index+3*n+1) -1] == 1) && (in_nod_serial[ (int)*(index+3*n+2) -1] == 1) ){
    61                                 value=1; VecSetValues(in_elem,1,&n,&value,INSERT_VALUES);
     60                                value=1; in_elem->SetValue(n,value,INS_VAL);
    6261                        }
    6362                }
     
    6564
    6665        /*Assemble vectors: */
    67         VecAssemblyBegin(in_elem);
    68         VecAssemblyEnd(in_elem);
     66        in_elem->Assemble();
    6967
    7068        /*Assign output pointers: */
  • issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h

    r3913 r11695  
    1717        int nods;
    1818        int edgevalue;
    19         Vec in_nod;
     19        Vector* in_nod;
    2020        double* x;
    2121        double* y;
     
    2525
    2626/* local prototypes: */
    27 int ContourToMeshx( Vec* pin_nods,Vec* pin_elem, double* index, double* x, double* y,Contour** contours,int numcontours,char* interptype,int nel,int nods, int edgevalue);
     27int ContourToMeshx( Vector** pin_nods,Vector** pin_elem, double* index, double* x, double* y,Contour** contours,int numcontours,char* interptype,int nel,int nods, int edgevalue);
    2828
    2929void* ContourToMeshxt(void* vContourToMeshxThreadStruct);
  • issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp

    r11401 r11695  
    3939        double* x=NULL;
    4040        double* y=NULL;
    41         Vec in_nod=NULL;
     41        Vector* in_nod=NULL;
    4242
    4343
  • issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp

    r11401 r11695  
    44#include "./ContourToNodesx.h"
    55
    6 int ContourToNodesx( Vec* pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue){
     6int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue){
    77
    88        int i;
     
    1717
    1818        /*output: */
    19         Vec flags=NULL;
     19        Vector* flags=NULL;
    2020
    21         flags=NewVec(nods);
     21        flags=new Vector(nods);
    2222
    2323        /*Loop through all contours: */
     
    3131
    3232        /*Assemble vector: */
    33         VecAssemblyBegin(flags);
    34         VecAssemblyEnd(flags);
     33        flags->Assemble();
    3534
    3635        /*Assign output pointers: */
  • issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h

    r3913 r11695  
    1111
    1212/* local prototypes: */
    13 int ContourToNodesx( Vec* pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue);
     13int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue);
    1414
    1515#endif /* _CONTOURTONODESX_H */
  • issm/trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp

    r11313 r11695  
    99#include "../../EnumDefinitions/EnumDefinitions.h"
    1010
    11 void ControlInputGetGradientx( Vec* pgradient, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
     11void ControlInputGetGradientx( Vector** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
    1212
    1313        /*Intermediaries*/
    1414        int  num_controls;
    1515        int *control_type = NULL;
    16         Vec  gradient=NULL;
     16        Vector*  gradient=NULL;
    1717
    1818        /*Retrieve some parameters*/
     
    2121
    2222        /*Allocate and populate gradient*/
    23         gradient=NewVec(num_controls*vertices->NumberOfVertices());
     23        gradient=new Vector(num_controls*vertices->NumberOfVertices());
    2424
    2525        for(int i=0;i<num_controls;i++){
     
    3030        }
    3131
    32         VecAssemblyBegin(gradient);
    33         VecAssemblyEnd(gradient);
     32        gradient->Assemble();
    3433
    3534        /*Clean up and return*/
  • issm/trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h

    r11313 r11695  
    88#include "../../Container/Container.h"
    99
    10 void    ControlInputGetGradientx( Vec* pgradient, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
     10void    ControlInputGetGradientx( Vector** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
    1111
    1212#endif
  • issm/trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp

    r11313 r11695  
    3030
    3131}
    32 void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vec gradient){
     32void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* gradient){
    3333
    3434        /*Serialize gradient*/
    3535        double* serial_gradient=NULL;
    36         VecToMPISerial(&serial_gradient,gradient);
     36        serial_gradient=gradient->ToMPISerial();
    3737
    3838        ControlInputSetGradientx(elements,nodes,vertices, loads, materials, parameters,serial_gradient);
  • issm/trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h

    r11313 r11695  
    99
    1010void    ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* gradient);
    11 void    ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vec gradient);
     11void    ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* gradient);
    1212
    1313#endif
  • issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp

    r11509 r11695  
    260260                case PentaEnum : return "Penta";
    261261                case PentaP1InputEnum : return "PentaP1Input";
    262                 case PetscMatParamEnum : return "PetscMatParam";
    263                 case PetscVecParamEnum : return "PetscVecParam";
     262                case MatrixParamEnum : return "MatrixParam";
     263                case VectorParamEnum : return "VectorParam";
    264264                case RiftfrontEnum : return "Riftfront";
    265265                case SegmentEnum : return "Segment";
  • issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp

    r11318 r11695  
    99#include "../../EnumDefinitions/EnumDefinitions.h"
    1010
    11 void GetVectorFromControlInputsx(Vec* pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,const char* data){
     11void GetVectorFromControlInputsx(Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,const char* data){
    1212
    1313        int  num_controls;
    1414        int *control_type = NULL;
    15         Vec  vector=NULL;
     15        Vector*  vector=NULL;
    1616
    1717        /*Retrieve some parameters*/
     
    2020
    2121        /*Allocate and populate gradient*/
    22         vector=NewVec(num_controls*vertices->NumberOfVertices());
     22        vector=new Vector(num_controls*vertices->NumberOfVertices());
    2323
    2424        for(int i=0;i<num_controls;i++){
     
    2929        }
    3030
    31         VecAssemblyBegin(vector);
    32         VecAssemblyEnd(vector);
     31        vector->Assemble();
    3332
    3433        /*Assign output pointers:*/
     
    4342       
    4443        /*intermediary: */
    45         Vec vec_vector=NULL;
     44        Vector* vec_vector=NULL;
    4645
    4746        GetVectorFromControlInputsx( &vec_vector, elements,nodes, vertices, loads, materials, parameters,data);
    48         VecToMPISerial(&vector,vec_vector);
     47        vector=vec_vector->ToMPISerial();
    4948
    5049        /*Free ressources:*/
    51         VecFree(&vec_vector);
     50        xdelete(&vec_vector);
    5251
    5352        /*Assign output pointers:*/
  • issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h

    r11318 r11695  
    99
    1010/* local prototypes: */
    11 void    GetVectorFromControlInputsx( Vec* pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
     11void    GetVectorFromControlInputsx( Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
    1212void    GetVectorFromControlInputsx( double** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
    1313
  • issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp

    r11317 r11695  
    99#include "../../EnumDefinitions/EnumDefinitions.h"
    1010
    11 void GetVectorFromInputsx( Vec* pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name, int type){
     11void GetVectorFromInputsx( Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name, int type){
    1212
    1313        int i;
    14         Vec vector=NULL;
     14        Vector* vector=NULL;
    1515
    1616        if(type==VertexEnum){
    1717
    1818                /*Allocate vector*/
    19                 vector=NewVec(vertices->NumberOfVertices());
     19                vector=new Vector(vertices->NumberOfVertices());
    2020
    2121                /*Look up in elements*/
     
    3535        }
    3636
    37         VecAssemblyBegin(vector);
    38         VecAssemblyEnd(vector);
     37        vector->Assemble();
    3938
    4039        /*Assign output pointers:*/
     
    4847       
    4948        /*intermediary: */
    50         Vec vec_vector=NULL;
     49        Vector* vec_vector=NULL;
    5150
    5251        GetVectorFromInputsx( &vec_vector, elements,nodes, vertices, loads, materials, parameters, name, type);
    53         VecToMPISerial(&vector,vec_vector);
     52        vector=vec_vector->ToMPISerial();
    5453
    5554        /*Free ressources:*/
    56         VecFree(&vec_vector);
     55        xdelete(&vec_vector);
    5756
    5857        /*Assign output pointers:*/
  • issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h

    r7177 r11695  
    99
    1010/* local prototypes: */
    11 void    GetVectorFromInputsx( Vec* pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int name,int type);
     11void    GetVectorFromInputsx( Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int name,int type);
    1212void    GetVectorFromInputsx( double** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int name,int type);
    1313
  • issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp

    r11317 r11695  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void Gradjx(Vec* pgradient,double** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
     12void Gradjx(Vector** pgradient,double** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
    1313
    1414        int     i,j,numberofvertices;
     
    1717        double *norm_list       = NULL;
    1818        int    *control_type    = NULL;
    19         Vec     gradient        = NULL;
    20         Vec    *gradient_list   = NULL;
     19        Vector*     gradient        = NULL;
     20        Vector*    *gradient_list   = NULL;
    2121       
    2222        /*retrieve some parameters: */
     
    2626
    2727        /*Allocate gradient_list */
    28         gradient_list = (Vec*)xmalloc(num_controls*sizeof(Vec));
     28        gradient_list = (Vector**)xmalloc(num_controls*sizeof(Vector*));
    2929        norm_list = (double*)xmalloc(num_controls*sizeof(double));
    3030        for(i=0;i<num_controls;i++){
    31                 gradient_list[i]=NewVec(num_controls*numberofvertices);
     31                gradient_list[i]=new Vector(num_controls*numberofvertices);
    3232        }
    33         gradient=NewVec(num_controls*numberofvertices);
     33        gradient=new Vector(num_controls*numberofvertices);
    3434
    3535        /*Compute all gradient_list*/
     
    4141                }
    4242
    43                 VecAssemblyBegin(gradient_list[i]);
    44                 VecAssemblyEnd(gradient_list[i]);
     43                gradient_list[i]->Assemble();
    4544
    46                 VecNorm(gradient_list[i],NORM_INFINITY,&norm_list[i]);
     45                norm_list[i]=gradient_list[i]->Norm(NORM_INF);
    4746        }
    4847
    4948        /*Add all gradient_list together*/
    5049        for(i=0;i<num_controls;i++){
    51                 VecAXPY(gradient,1.,gradient_list[i]);
    52                 VecFree(&gradient_list[i]);
     50                gradient->AXPY(gradient_list[i],1.0);
     51                xdelete(&gradient_list[i]);
    5352        }
    5453
    5554        /*Check that gradient is clean*/
    56         VecNorm(gradient,NORM_INFINITY,&norm_inf);
     55        norm_inf=gradient->Norm(NORM_INF);
    5756        if(norm_inf<=0)    _error_("||∂J/∂α||∞ = 0    gradient norm is zero");
    5857        if(isnan(norm_inf))_error_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
  • issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.h

    r11313 r11695  
    1010
    1111/* local prototypes: */
    12 void Gradjx(Vec* pgrad_g,double** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters);
     12void Gradjx(Vector** pgrad_g,double** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters);
    1313
    1414#endif  /* _GRADJX_H */
  • issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp

    r10400 r11695  
    1717        double*  vertices_ungrounding             = NULL;
    1818        double*  old_floatingice                  = NULL;
    19         Vec      vec_old_floatingice              = NULL;
     19        Vector*      vec_old_floatingice              = NULL;
    2020        Element* element                          = NULL;
    2121       
     
    3939        /*Create vector with vertices initially floating and serialize*/
    4040        vec_old_floatingice=CreateNodesOnFloatingIce(nodes,analysis_type);
    41         VecToMPISerial(&old_floatingice,vec_old_floatingice);
     41        old_floatingice=vec_old_floatingice->ToMPISerial();
    4242
    4343        /*Migrate grounding line : */
     
    4848
    4949        /*free ressouces: */
    50         VecFree(&vec_old_floatingice);
     50        xdelete(&vec_old_floatingice);
    5151        xfree((void**)&vertices_potentially_ungrounding);
    5252        xfree((void**)&vertices_ungrounding);
     
    5555
    5656/*FUNCTION CreateNodesOnFloatingIce {{{1*/
    57 Vec CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){
     57Vector* CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){
    5858
    5959        int     i,numnods;
    60         Vec   vec_nodes_on_floatingice = NULL;
     60        Vector*   vec_nodes_on_floatingice = NULL;
    6161        Node *node                     = NULL;
    6262
    6363        /*First, initialize nodes_on_floatingice, which will track which nodes have changed status: */
    6464        numnods=nodes->NumberOfNodes(configuration_type);
    65         vec_nodes_on_floatingice=NewVec(numnods);
     65        vec_nodes_on_floatingice=new Vector(numnods);
    6666
    6767        /*Loop through nodes, and fill vec_nodes_on_floatingice: */
     
    7070                if(node->InAnalysis(configuration_type)){
    7171                        if(node->IsFloating()){
    72                                 VecSetValue(vec_nodes_on_floatingice,node->Sid(),1.0,INSERT_VALUES);
     72                                vec_nodes_on_floatingice->SetValue(node->Sid(),1.0,INS_VAL);
    7373                        }
    7474                }
     
    7676
    7777        /*Assemble vector: */
    78         VecAssemblyBegin(vec_nodes_on_floatingice);
    79         VecAssemblyEnd(vec_nodes_on_floatingice);
     78        vec_nodes_on_floatingice->Assemble();
    8079
    8180        return vec_nodes_on_floatingice;
     
    8786        int      i,numberofvertices;
    8887        double*  vertices_potentially_ungrounding      = NULL;
    89         Vec      vec_vertices_potentially_ungrounding  = NULL;
     88        Vector*      vec_vertices_potentially_ungrounding  = NULL;
    9089        Element* element                               = NULL;
    9190
    9291        /*Initialize vector with number of vertices*/
    9392        numberofvertices=vertices->NumberOfVertices();
    94         vec_vertices_potentially_ungrounding=NewVec(numberofvertices); //grounded vertex that could start floating
     93        vec_vertices_potentially_ungrounding=new Vector(numberofvertices); //grounded vertex that could start floating
    9594
    9695        /*Fill vector vertices_potentially_floating: */
     
    101100
    102101        /*Assemble vector and serialize */
    103         VecAssemblyBegin(vec_vertices_potentially_ungrounding);
    104         VecAssemblyEnd(vec_vertices_potentially_ungrounding);
    105         VecToMPISerial(&vertices_potentially_ungrounding,vec_vertices_potentially_ungrounding);
     102        vec_vertices_potentially_ungrounding->Assemble();
     103        vertices_potentially_ungrounding=vec_vertices_potentially_ungrounding->ToMPISerial();
    106104
    107105        /*free ressouces and return: */
    108         VecFree(&vec_vertices_potentially_ungrounding);
     106        xdelete(&vec_vertices_potentially_ungrounding);
    109107        return vertices_potentially_ungrounding;
    110108}
     
    118116        double*  nodes_on_floatingice                  = NULL;
    119117        double*  elements_neighboring_floatingce      = NULL;
    120         Vec      vec_elements_neighboring_floatingice = NULL;
    121         Vec      vec_nodes_on_floatingice              = NULL;
     118        Vector*      vec_elements_neighboring_floatingice = NULL;
     119        Vector*      vec_nodes_on_floatingice              = NULL;
    122120        Node*    node                                  = NULL;
    123121        Element* element                               = NULL;
     
    130128        /*recover vec_nodes_on_floatingice*/
    131129        vec_nodes_on_floatingice=CreateNodesOnFloatingIce(nodes,analysis_type);
    132         VecToMPISerial(&nodes_on_floatingice,vec_nodes_on_floatingice);
     130        nodes_on_floatingice=vec_nodes_on_floatingice->ToMPISerial();
    133131
    134132        nflipped=1; //bootstrap
     
    136134               
    137135                /*Vector of size number of elements*/
    138                 vec_elements_neighboring_floatingice=NewVec(elements->NumberOfElements(),true);
     136                vec_elements_neighboring_floatingice=new Vector(elements->NumberOfElements(),true);
    139137
    140138                /*Figure out if any of the nodes of the element will be floating -> elements neighbouting the floating ice*/
    141139                for(i=0;i<elements->Size();i++){
    142140                        element=(Element*)elements->GetObjectByOffset(i);
    143                         VecSetValue(vec_elements_neighboring_floatingice,element->Sid(),element->IsNodeOnShelfFromFlags(nodes_on_floatingice)?1.0:0.0,INSERT_VALUES);
     141                        vec_elements_neighboring_floatingice->SetValue(element->Sid(),element->IsNodeOnShelfFromFlags(nodes_on_floatingice)?1.0:0.0,INS_VAL);
    144142                }
    145143
    146144                /*Assemble vector and serialize: */
    147                 VecAssemblyBegin(vec_elements_neighboring_floatingice);
    148                 VecAssemblyEnd(vec_elements_neighboring_floatingice);
    149                 VecToMPISerial(&elements_neighboring_floatingce,vec_elements_neighboring_floatingice);
     145                vec_elements_neighboring_floatingice->Assemble();
     146                elements_neighboring_floatingce=vec_elements_neighboring_floatingice->ToMPISerial();
    150147
    151148                /*Go through elements_neighboring_floatingce, and update vector of the nodes that will start floating*/
     
    157154                        }
    158155                }
    159                 VecAssemblyBegin(vec_nodes_on_floatingice);
    160                 VecAssemblyEnd(vec_nodes_on_floatingice);
     156                vec_nodes_on_floatingice->Assemble();
    161157               
    162158                MPI_Allreduce(&local_nflipped,&nflipped,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
     
    168164
    169165                /*Assemble and serialize:*/
    170                 VecFree(&vec_elements_neighboring_floatingice);
    171                 VecToMPISerial(&nodes_on_floatingice,vec_nodes_on_floatingice);
     166                xdelete(&vec_elements_neighboring_floatingice);
     167                nodes_on_floatingice=vec_nodes_on_floatingice->ToMPISerial();
    172168        }
    173169
    174170        /*Free ressources:*/
    175         VecFree(&vec_nodes_on_floatingice);
     171        xdelete(&vec_nodes_on_floatingice);
    176172        xfree((void**)&elements_neighboring_floatingce);
    177173
  • issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h

    r10400 r11695  
    1414void       GroundinglineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
    1515
    16 Vec        CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type);
     16Vector*        CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type);
    1717double*    PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters);
    1818double*    PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding);
  • issm/trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.cpp

    r7177 r11695  
    99#include "../../EnumDefinitions/EnumDefinitions.h"
    1010
    11 void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vec vector, int name, int type){
     11void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* vector, int name, int type){
    1212
    1313        double* serial_vector=NULL;
    1414
    15         VecToMPISerial(&serial_vector,vector);
     15        serial_vector=vector->ToMPISerial();
    1616
    1717        InputUpdateFromVectorDakotax( elements,nodes, vertices, loads, materials, parameters,serial_vector,name, type);
  • issm/trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h

    r7177 r11695  
    1010
    1111/* local prototypes: */
    12 void    InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vec vector, int name,int type);
     12void    InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* vector, int name,int type);
    1313void    InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* vector, int name,int type);
    1414void    InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int* vector, int name,int type);
  • issm/trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp

    r7177 r11695  
    99#include "../../EnumDefinitions/EnumDefinitions.h"
    1010
    11 void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vec vector, int name, int type){
     11void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* vector, int name, int type){
    1212
    1313        double* serial_vector=NULL;
    1414
    15         VecToMPISerial(&serial_vector,vector);
     15        serial_vector=vector->ToMPISerial();
    1616
    1717        InputUpdateFromVectorx( elements,nodes, vertices, loads, materials, parameters,serial_vector,name, type);
  • issm/trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h

    r7177 r11695  
    1010
    1111/* local prototypes: */
    12 void    InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vec vector, int name,int type);
     12void    InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* vector, int name,int type);
    1313void    InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* vector, int name,int type);
    1414void    InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int* vector, int name,int type);
  • issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp

    r9320 r11695  
    1616
    1717/*InterpFromGridToMeshx{{{*/
    18 int InterpFromGridToMeshx( Vec* pdata_mesh,double* x_in, int x_rows, double* y_in, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods,double default_value, int interpenum){
     18int InterpFromGridToMeshx( Vector** pdata_mesh,double* x_in, int x_rows, double* y_in, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods,double default_value, int interpenum){
    1919
    2020        /*output: */
    21         Vec data_mesh=NULL;
     21        Vector* data_mesh=NULL;
    2222       
    2323        /*Intermediary*/
     
    4646
    4747        /*Allocate output vector: */
    48         data_mesh=NewVec(nods);
     48        data_mesh=new Vector(nods);
    4949
    5050        /*Find out what kind of coordinates (x_in,y_in) have been given is input*/
     
    124124        double *y             = gate->y;
    125125        int     nods          = gate->nods;
    126         Vec     data_mesh     = gate->data_mesh;
     126        Vector*     data_mesh     = gate->data_mesh;
    127127        double *data          = gate->data;
    128128        double  default_value = gate->default_value;
     
    179179                }
    180180
    181                 VecSetValue(data_mesh,i,data_value,INSERT_VALUES);
     181                data_mesh->SetValue(i,data_value,INS_VAL);
    182182        }
    183183}/*}}}*/
  • issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h

    r7447 r11695  
    2323        double* x_mesh;
    2424        double* y_mesh;
    25         Vec     data_mesh;
     25        Vector*     data_mesh;
    2626} InterpFromGridToMeshxThreadStruct;
    2727
    28 int    InterpFromGridToMeshx( Vec* pdata_mesh,double* x, int x_rows, double* y, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods, double default_value, int interpenum=BilinearInterpEnum);
     28int    InterpFromGridToMeshx( Vector** pdata_mesh,double* x, int x_rows, double* y, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods, double default_value, int interpenum=BilinearInterpEnum);
    2929void*  InterpFromGridToMeshxt(void* vInterpFromGridToMeshxThreadStruct);
    3030bool   findindices(int* pn,int* pm,double* x,int x_rows, double* y,int y_rows, double xgrid,double ygrid);
  • issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp

    r8403 r11695  
    1010#include "../modules.h"
    1111
    12 int InterpFromMesh2dx( Vec* pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
     12int InterpFromMesh2dx( Vector** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
    1313                double* default_values,int num_default_values,Contour** contours,int numcontours){
    1414
    1515       
    1616        /*Output*/
    17         Vec data_prime=NULL;
     17        Vector* data_prime=NULL;
    1818
    1919        /*Intermediary*/
     
    2828
    2929        /*contours: */
    30         Vec    vec_incontour=NULL;
     30        Vector*    vec_incontour=NULL;
    3131        double*    incontour=NULL;
    3232
     
    7272
    7373        /*Initialize output*/
    74         data_prime=NewVec(nods_prime);
     74        data_prime=new Vector(nods_prime);
    7575        if(num_default_values){
    76                 if(num_default_values==1)for (i=0;i<nods_prime;i++) VecSetValue(data_prime,i,default_values[0],INSERT_VALUES);
    77                 else for (i=0;i<nods_prime;i++) VecSetValue(data_prime,i,default_values[i],INSERT_VALUES);
     76                if(num_default_values==1)for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_values[0],INS_VAL);
     77                else for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_values[i],INS_VAL);
    7878        }
    7979
     
    8181        if(numcontours){
    8282                ContourToNodesx( &vec_incontour,x_prime,y_prime,nods_prime,contours,numcontours,1);
    83                 VecToMPISerial(&incontour,vec_incontour);
     83                incontour=vec_incontour->ToMPISerial();
    8484        }
    8585        else{
  • issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h

    r7145 r11695  
    2323        double ymin,ymax;
    2424        int    nods_prime;
    25         Vec    data_prime;
     25        Vector*    data_prime;
    2626        double* x_prime;
    2727        double* y_prime;
     
    3333} InterpFromMesh2dxThreadStruct;
    3434
    35 int InterpFromMesh2dx( Vec* pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
     35int InterpFromMesh2dx( Vector** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
    3636                double* default_values,int num_default_values,Contour** contours,int numcontours);
    3737
  • issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp

    r11401 r11695  
    2424        double ymin,ymax;
    2525        int    nods_prime;
    26         Vec    data_prime=NULL;
     26        Vector*    data_prime=NULL;
    2727        double* x_prime=NULL;
    2828        double* y_prime=NULL;
     
    120120
    121121                                        /*insert value and go to the next point*/
    122                                         VecSetValue(data_prime,j,data_value,INSERT_VALUES);
     122                                        data_prime->SetValue(j,data_value,INS_VAL);
    123123                                }
    124124                        }
  • issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp

    r6412 r11695  
    3232
    3333        /*default values: */
    34         Vec    vec_incontour=NULL;
     34        Vector*    vec_incontour=NULL;
    3535        double*    incontour=NULL;
    3636        bool   skip_bamg=false;
     
    5151        if(num_default_values){
    5252                ContourToNodesx( &vec_incontour,x_interp,y_interp,nods_interp,contours,numcontours,1);
    53                 VecToMPISerial(&incontour,vec_incontour);
     53                incontour=vec_incontour->ToMPISerial();
    5454        }
    5555
  • issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp

    r6412 r11695  
    77#include "../../include/include.h"
    88
    9 int InterpFromMeshToMesh3dx( Vec* pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value) {
     9int InterpFromMeshToMesh3dx( Vector** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value) {
    1010
    1111        /*Output*/
    12         Vec data_prime=NULL;
     12        Vector* data_prime=NULL;
    1313
    1414        /*Intermediary*/
     
    5454
    5555        /*Initialize output*/
    56         data_prime=NewVec(nods_prime);
    57         for (i=0;i<nods_prime;i++) VecSetValue(data_prime,i,default_value,INSERT_VALUES);
     56        data_prime=new Vector(nods_prime);
     57        for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_value,INS_VAL);
    5858
    5959        /*Loop over the elements*/
     
    127127
    128128                                        /*insert value and go to the next point*/
    129                                         VecSetValue(data_prime,j,data_value,INSERT_VALUES);
     129                                        data_prime->SetValue(j,data_value,INS_VAL);
    130130                                }
    131131                        }
  • issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h

    r3913 r11695  
    88#include "../../toolkits/toolkits.h"
    99
    10 int InterpFromMeshToMesh3dx( Vec* pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value);
     10int InterpFromMeshToMesh3dx( Vector** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value);
    1111
    1212#endif /* _INTERPFROMMESHTOMESH3DX_H */
  • issm/trunk-jpl/src/c/modules/Orthx/Orthx.cpp

    r7907 r11695  
    55#include "./Orthx.h"
    66
    7 void    Orthx( Vec* pnewgradj, Vec gradj, Vec oldgradj){
     7void    Orthx( Vector** pnewgradj, Vector* gradj, Vector* oldgradj){
    88       
    99        /*output: */
    10         Vec newgradj=NULL;
     10        Vector* newgradj=NULL;
    1111
    1212        /*intermediary:*/
     
    1414
    1515        /*Initialize output*/
    16         VecDuplicate(gradj,&newgradj);
    17         VecCopy(gradj,newgradj);
     16        newgradj=gradj->Duplicate();
     17        gradj->Copy(newgradj);
    1818
    1919        /*rough orthagonalization
    2020        gradient=gradient-(gradient'*oldgradient)*oldgradient /norm(oldgradient)^2; */
    2121        if(oldgradj){
    22                 VecNorm(oldgradj,NORM_2,&norm_old);
     22                norm_old=oldgradj->Norm(NORM_TWO);
    2323                _assert_(norm_old!=0);
    24                 VecDot(newgradj,oldgradj,&dot_product);
     24                dot_product=newgradj->Dot(oldgradj);
    2525                _assert_(dot_product!=NAN);
    26                 VecAXPY(newgradj, -dot_product/pow(norm_old,2), oldgradj);
     26                newgradj->AXPY(oldgradj,-dot_product/pow(norm_old,2));
    2727        }
    2828
  • issm/trunk-jpl/src/c/modules/Orthx/Orthx.h

    r3913 r11695  
    1111
    1212/* local prototypes: */
    13 void    Orthx( Vec* pnewgradj, Vec gradj, Vec oldgradj);
     13void    Orthx( Vector** pnewgradj, Vector* gradj, Vector* oldgradj);
    1414
    1515#endif  /* _ORTHX_H */
  • issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp

    r11401 r11695  
    44#include "./PointCloudFindNeighborsx.h"
    55
    6 int PointCloudFindNeighborsx( Vec* pflags,double* x, double* y, int nods, double mindistance,double multithread){
     6int PointCloudFindNeighborsx( Vector** pflags,double* x, double* y, int nods, double mindistance,double multithread){
    77
    88        /*output: */
    9         Vec flags=NULL;
    10         flags=NewVec(nods);
     9        Vector* flags=NULL;
     10        flags=new Vector(nods);
    1111
    1212        /*threading: */
     
    3131
    3232        /*Assemble vector: */
    33         VecAssemblyBegin(flags);
    34         VecAssemblyEnd(flags);
     33        flags->Assemble();
    3534
    3635        /*Assign output pointers: */
  • issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h

    r7640 r11695  
    1111
    1212/* local prototypes: */
    13 int PointCloudFindNeighborsx( Vec* pflags,double* x, double* y, int nods, double mindistance,double multithread);
     13int PointCloudFindNeighborsx( Vector** pflags,double* x, double* y, int nods, double mindistance,double multithread);
    1414
    1515/*threading: */
     
    2020        int nods;
    2121        double mindistance;
    22         Vec flags;
     22        Vector* flags;
    2323
    2424
  • issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp

    r11401 r11695  
    1717        int     nods;
    1818        double  mindistance;
    19         Vec     flags;
     19        Vector*     flags;
    2020
    2121        /*recover handle and gate: */
     
    6262
    6363                                /*insert value and go to the next point*/
    64                                 if(!already[i]) VecSetValue(flags,i,1,INSERT_VALUES);
    65                                 if(!already[j]) VecSetValue(flags,j,2,INSERT_VALUES);
     64                                if(!already[i]) flags->SetValue(i,1,INS_VAL);
     65                                if(!already[j]) flags->SetValue(j,2,INS_VAL);
    6666                                already[i]=true;
    6767                                already[j]=true;
  • issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp

    r11317 r11695  
    2828}
    2929
    30 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vec vector){
     30void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* vector){
    3131       
    3232        double* serial_vector=NULL;
    3333
    34         VecToMPISerial(&serial_vector,vector);
     34        serial_vector=vector->ToMPISerial();
    3535
    3636        SetControlInputsFromVectorx(elements,nodes, vertices, loads, materials, parameters,serial_vector);
  • issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h

    r11317 r11695  
    99
    1010/* local prototypes: */
    11 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vec vector);
     11void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* vector);
    1212void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* vector);
    1313
  • issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp

    r11687 r11695  
    2020        uf=new Vector();
    2121
     22        /*Intermediary: */
     23        int analysis_type;
     24
    2225        #ifdef _HAVE_PETSC_
    2326        Vec uf0_vector = NULL;
     
    2629        if(df)  df_vector = df->vector;
    2730
    28         SolverxPetsc(&uf->vector,Kff->matrix,pf->vector,uf0_vector,df_vector,parameters);
     31        /*In serial mode, the Petsc Options database has not been initialized properly: */
     32        #ifdef _SERIAL_
     33        parameters->FindParam(&analysis_type,AnalysisTypeEnum);
     34        PetscOptionsFromAnalysis(parameters,analysis_type);
     35        #endif
     36
     37        SolverxPetsc(&uf->vector, Kff->matrix, pf->vector, uf0_vector, df->vector, parameters);
    2938        VecGetSize(uf->vector,&uf->M);
    3039        #else
  • issm/trunk-jpl/src/c/modules/Solverx/Solverx.h

    r11679 r11695  
    66#define _SOLVERX_H
    77
     8#ifdef HAVE_CONFIG_H
     9        #include <config.h>
     10#else
     11#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
     12#endif
     13
    814#include "../../objects/objects.h"
    915
    1016/* local prototypes: */
    1117void    Solverx(Vector** puf, Matrix* Kff, Vector* pf, Vector* uf0,Vector* df, Parameters* parameters);
     18
     19#ifdef _HAVE_PETSC_
    1220void    SolverxPetsc(Vec* puf, Mat Kff, Vec pf, Vec uf0,Vec df, Parameters* parameters);
    1321void    DofTypesToIndexSet(IS* pisv, IS* pisp, Vec df,int typeenum);
     22#endif
     23
    1424#endif  /* _SOLVERX_H */
    1525
  • issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp

    r11509 r11695  
    267267              else if (strcmp(name,"Penta")==0) return PentaEnum;
    268268              else if (strcmp(name,"PentaP1Input")==0) return PentaP1InputEnum;
    269               else if (strcmp(name,"PetscMatParam")==0) return PetscMatParamEnum;
    270               else if (strcmp(name,"PetscVecParam")==0) return PetscVecParamEnum;
     269              else if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum;
     270              else if (strcmp(name,"VectorParam")==0) return VectorParamEnum;
    271271              else if (strcmp(name,"Riftfront")==0) return RiftfrontEnum;
    272272              else if (strcmp(name,"Segment")==0) return SegmentEnum;
  • issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp

    r11691 r11695  
    9090
    9191        /*Now, figure out maximum value of K_gg, so that we can penalize it correctly: */
    92         kmax=Kff->Norm(NORM_INFINITY);
     92        kmax=Kff->Norm(NORM_INF);
    9393
    9494        /*Now, deal with penalties*/
  • issm/trunk-jpl/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp

    r11245 r11695  
    1313
    1414        int     i;
    15         Vec     vz        = NULL;
     15        Vector*     vz        = NULL;
    1616        Vertex *vertex    = NULL;
    1717        double *thickness = NULL;
     
    2323
    2424        /*Allocate vector*/
    25         vz=NewVec(vertices->NumberOfVertices());
     25        vz=new Vector(vertices->NumberOfVertices());
    2626
    2727        /*Update verices new geometry: */
     
    3232
    3333        /*Assemble mesh velocity*/
    34         VecAssemblyBegin(vz);
    35         VecAssemblyEnd(vz);
     34        vz->Assemble();
    3635
    3736        /*Update element inputs*/
     
    4140        xfree((void**)&thickness);
    4241        xfree((void**)&bed);
    43         VecFree(&vz);
     42        delete vz;
    4443        return 1;
    4544}
  • issm/trunk-jpl/src/c/objects/ElementResults/BoolElementResult.cpp

    r11001 r11695  
    185185/*}}}*/
    186186/*FUNCTION BoolElementResult::GetVectorFromResults{{{1*/
    187 void BoolElementResult::GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs){
     187void BoolElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
    188188
    189189        _error_("cannot return vector on vertices");
    190190} /*}}}*/
    191191/*FUNCTION BoolElementResult::GetElementVectorFromResults{{{1*/
    192 void BoolElementResult::GetElementVectorFromResults(Vec vector,int dof){
     192void BoolElementResult::GetElementVectorFromResults(Vector* vector,int dof){
    193193
    194         VecSetValue(vector,dof,(double)value,INSERT_VALUES);
     194        vector->SetValue(dof,value,INS_VAL);
    195195} /*}}}*/
  • issm/trunk-jpl/src/c/objects/ElementResults/BoolElementResult.h

    r11001 r11695  
    5353                /*BoolElementResult management: {{{1*/
    5454                int   InstanceEnum();
    55                 void GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs);
    56                 void GetElementVectorFromResults(Vec vector,int dof);
     55                void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
     56                void GetElementVectorFromResults(Vector* vector,int dof);
    5757                /*}}}*/
    5858};
  • issm/trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.h

    r11001 r11695  
    5353                /*DoubleElementResult management: {{{1*/
    5454                int   InstanceEnum();
    55                 void GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs){_error_("not implemented");};
    56                 void GetElementVectorFromResults(Vec vector,int dof){_error_("not implemented");};
     55                void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){_error_("not implemented");};
     56                void GetElementVectorFromResults(Vector* vector,int dof){_error_("not implemented");};
    5757                /*}}}*/
    5858};
  • issm/trunk-jpl/src/c/objects/ElementResults/ElementResult.h

    r11001 r11695  
    2525                virtual void    PatchFill(int row, Patch* patch)=0;
    2626                virtual int     InstanceEnum()=0;
    27                 virtual void    GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdof)=0;
    28                 virtual void    GetElementVectorFromResults(Vec vector,int dof)=0;
     27                virtual void    GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdof)=0;
     28                virtual void    GetElementVectorFromResults(Vector* vector,int dof)=0;
    2929
    3030};
  • issm/trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.cpp

    r11292 r11695  
    195195/*}}}*/
    196196/*FUNCTION PentaP1ElementResult::GetVectorFromResults{{{1*/
    197 void PentaP1ElementResult::GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs){
     197void PentaP1ElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
    198198
    199199        double data[6];
     
    201201        if(numdofs!=6)_error_("Result %s is a PentaP1ElementResult and cannot write vector of %i dofs",numdofs);
    202202        for(int i=0;i<6;i++) data[i]=this->values[i]/(double)connectivitylist[i];
    203         VecSetValues(vector,numdofs,doflist,(const double*)&data,ADD_VALUES);
     203        vector->SetValues(numdofs,doflist,&data[0],ADD_VAL);
    204204
    205205} /*}}}*/
    206206/*FUNCTION PentaP1ElementResult::GetElementVectorFromResults{{{1*/
    207 void PentaP1ElementResult::GetElementVectorFromResults(Vec vector,int dof){
     207void PentaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){
    208208
    209209        _error_("Result %s is a PentaP1ElementResult and should not write vector of size numberofelemenrs",EnumToStringx(enum_type));
  • issm/trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.h

    r11292 r11695  
    5252                /*PentaP1ElementResult management: {{{1*/
    5353                int   InstanceEnum();
    54                 void GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs);
    55                 void GetElementVectorFromResults(Vec vector,int dof);
     54                void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
     55                void GetElementVectorFromResults(Vector* vector,int dof);
    5656                /*}}}*/
    5757
  • issm/trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.cpp

    r11292 r11695  
    184184/*}}}*/
    185185/*FUNCTION TriaP1ElementResult::GetVectorFromResults{{{1*/
    186 void TriaP1ElementResult::GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs){
     186void TriaP1ElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
    187187
    188188        double data[3];
     
    190190        if(numdofs!=3)_error_("Result %s is a TriaP1ElementResult and cannot write vector of %i dofs",numdofs);
    191191        for(int i=0;i<3;i++) data[i]=this->values[i]/(double)connectivitylist[i];
    192         VecSetValues(vector,numdofs,doflist,(const double*)&data,ADD_VALUES);
     192        vector->SetValues(numdofs,doflist,&data[0],ADD_VAL);
    193193
    194194} /*}}}*/
    195195/*FUNCTION TriaP1ElementResult::GetElementVectorFromResults{{{1*/
    196 void TriaP1ElementResult::GetElementVectorFromResults(Vec vector,int dof){
    197 
     196void TriaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){
    198197        _error_("Result %s is a TriaP1ElementResult and should not write vector of size numberofelemenrs",EnumToStringx(enum_type));
    199198} /*}}}*/
  • issm/trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.h

    r11292 r11695  
    5151                /*TriaP1ElementResult management: {{{1*/
    5252                int   InstanceEnum();
    53                 void GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs);
    54                 void GetElementVectorFromResults(Vec vector,int dof);
     53                void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
     54                void GetElementVectorFromResults(Vector* vector,int dof);
    5555                /*}}}*/
    5656
  • issm/trunk-jpl/src/c/objects/Elements/Element.h

    r11679 r11695  
    4646                virtual double SurfaceArea(void)=0;
    4747                virtual void   InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum)=0;
    48                 virtual void   ComputeBasalStress(Vec sigma_b)=0;
    49                 virtual void   ComputeStrainRate(Vec eps)=0;
     48                virtual void   ComputeBasalStress(Vector* sigma_b)=0;
     49                virtual void   ComputeStrainRate(Vector* eps)=0;
    5050                virtual void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes)=0;
    5151                virtual void   PatchFill(int* pcount, Patch* patch)=0;
     
    6262                virtual int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units)=0;
    6363                virtual void   InputScale(int enum_type,double scale_factor)=0;
    64                 virtual void   GetVectorFromInputs(Vec vector, int name_enum)=0;
    65                 virtual void   GetVectorFromResults(Vec vector,int id,int interp)=0;
     64                virtual void   GetVectorFromInputs(Vector* vector, int name_enum)=0;
     65                virtual void   GetVectorFromResults(Vector* vector,int id,int interp)=0;
    6666                virtual void   InputArtificialNoise(int enum_type,double min,double max)=0;
    6767                virtual bool   InputConvergence(double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums)=0;
    68                 virtual void   AverageOntoPartition(Vec partition_contributions,Vec partition_areas,double* vertex_response,double* qmu_part)=0;
     68                virtual void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,double* vertex_response,double* qmu_part)=0;
    6969                virtual int*   GetHorizontalNeighboorSids(void)=0;
    7070                virtual double TimeAdapt()=0;
    7171                virtual void   MigrateGroundingLine(double* old_floating_ice,double* sheet_ungrounding)=0;
    72                 virtual void   PotentialSheetUngrounding(Vec potential_sheet_ungrounding)=0;
     72                virtual void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding)=0;
    7373                virtual void   PositiveDegreeDay(void)=0;
    74                 virtual int    UpdatePotentialSheetUngrounding(double* potential_sheet_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf)=0;
     74                virtual int    UpdatePotentialSheetUngrounding(double* potential_sheet_ungrounding,Vector* vec_nodes_on_iceshelf,double* nodes_on_iceshelf)=0;
    7575                virtual void   ResetCoordinateSystem()=0;
    76                 virtual void   SmearFunction(Vec smearedvector,double (*WeightFunction)(double distance,double radius),double radius)=0;
     76                virtual void   SmearFunction(Vector* smearedvector,double (*WeightFunction)(double distance,double radius),double radius)=0;
    7777
    7878                #ifdef _HAVE_RESPONSES_
     
    9494
    9595                #ifdef _HAVE_CONTROL_
    96                 virtual void   Gradj(Vec gradient,int control_type,int control_index)=0;
     96                virtual void   Gradj(Vector* gradient,int control_type,int control_index)=0;
    9797                virtual double ThicknessAbsMisfit(bool process_units  ,int weight_index)=0;
    9898                virtual double SurfaceAbsVelMisfit(bool process_units ,int weight_index)=0;
     
    104104                virtual double RheologyBbarAbsGradient(bool process_units,int weight_index)=0;
    105105                virtual double DragCoefficientAbsGradient(bool process_units,int weight_index)=0;
    106                 virtual void   ControlInputGetGradient(Vec gradient,int enum_type,int control_index)=0;
     106                virtual void   ControlInputGetGradient(Vector* gradient,int enum_type,int control_index)=0;
    107107                virtual void   ControlInputSetGradient(double* gradient,int enum_type,int control_index)=0;
    108108                virtual void   ControlInputScaleGradient(int enum_type, double scale)=0;
    109                 virtual void   GetVectorFromControlInputs(Vec gradient,int control_enum,int control_index,const char* data)=0;
     109                virtual void   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data)=0;
    110110                virtual void   SetControlInputsFromVector(double* vector,int control_enum,int control_index)=0;
    111111                virtual void   InputControlUpdate(double scalar,bool save_parameter)=0;
  • issm/trunk-jpl/src/c/objects/Elements/Penta.cpp

    r11679 r11695  
    302302/*Other*/
    303303/*FUNCTION Penta::AverageOntoPartition {{{1*/
    304 void  Penta::AverageOntoPartition(Vec partition_contributions,Vec partition_areas,double* vertex_response,double* qmu_part){
     304void  Penta::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,double* vertex_response,double* qmu_part){
    305305        _error_("Not supported yet!");
    306306}
     
    383383/*}}}*/
    384384/*FUNCTION Penta::ComputeBasalStress {{{1*/
    385 void  Penta::ComputeBasalStress(Vec sigma_b){
     385void  Penta::ComputeBasalStress(Vector* sigma_b){
    386386
    387387        int         i,j,ig;
     
    417417        if(!IsOnBed()){
    418418                //put zero
    419                 VecSetValue(sigma_b,id-1,0.0,INSERT_VALUES);
     419                sigma_b->SetValue(id-1,0.0,INS_VAL);
    420420                return;
    421421        }
     
    469469
    470470        /*Add value to output*/
    471         VecSetValue(sigma_b,id-1,value,INSERT_VALUES);
     471        sigma_b->SetValue(id-1,value,INS_VAL);
    472472}
    473473/*}}}*/
    474474/*FUNCTION Penta::ComputeStrainRate {{{1*/
    475 void  Penta::ComputeStrainRate(Vec eps){
     475void  Penta::ComputeStrainRate(Vector* eps){
    476476
    477477        _error_("Not implemented yet");
     
    12181218/*}}}*/
    12191219/*FUNCTION Penta::GetVectorFromInputs{{{1*/
    1220 void  Penta::GetVectorFromInputs(Vec vector,int input_enum){
     1220void  Penta::GetVectorFromInputs(Vector* vector,int input_enum){
    12211221
    12221222        int doflist1[NUMVERTICES];
     
    12371237/*}}}*/
    12381238/*FUNCTION Penta::GetVectorFromResults{{{1*/
    1239 void  Penta::GetVectorFromResults(Vec vector,int offset,int interp){
     1239void  Penta::GetVectorFromResults(Vector* vector,int offset,int interp){
    12401240
    12411241        /*Get result*/
     
    24162416/*}}}*/
    24172417/*FUNCTION Penta::PotentialSheetUngrounding{{{1*/
    2418 void  Penta::PotentialSheetUngrounding(Vec potential_sheet_ungrounding){
     2418void  Penta::PotentialSheetUngrounding(Vector* potential_sheet_ungrounding){
    24192419
    24202420        int     i;
     
    24382438                        if (bed_hydro>ba[i]){
    24392439                                /*Vertex that could potentially unground, flag it*/
    2440                                 VecSetValue(potential_sheet_ungrounding,nodes[i]->Sid(),1,INSERT_VALUES);
     2440                                potential_sheet_ungrounding->SetValue(nodes[i]->Sid(),1,INS_VAL);
    24412441                        }
    24422442                }
     
    29362936/*}}}*/
    29372937/*FUNCTION Penta::UpdatePotentialSheetUngrounding{{{1*/
    2938 int Penta::UpdatePotentialSheetUngrounding(double* vertices_potentially_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf){
     2938int Penta::UpdatePotentialSheetUngrounding(double* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,double* nodes_on_iceshelf){
    29392939
    29402940        int i;
     
    29442944        for(i=0;i<NUMVERTICES;i++){
    29452945                if (vertices_potentially_ungrounding[nodes[i]->Sid()]){
    2946                         VecSetValue(vec_nodes_on_iceshelf,nodes[i]->Sid(),1,INSERT_VALUES);
     2946                        vec_nodes_on_iceshelf->SetValue(nodes[i]->Sid(),1,INS_VAL);
    29472947               
    29482948                        /*If node was not on ice shelf, we flipped*/
     
    30043004/*}}}*/
    30053005/*FUNCTION Penta::SmearFunction {{{1*/
    3006 void  Penta::SmearFunction(Vec smearedvector,double (*WeightFunction)(double distance,double radius),double radius){
     3006void  Penta::SmearFunction(Vector* smearedvector,double (*WeightFunction)(double distance,double radius),double radius){
    30073007        _error_("not implemented yet");
    30083008}
     
    42034203
    42044204        /*Add value to global vector*/
    4205         solution->SetValues(numdof,doflist,values,INSERT_VALUES);
     4205        solution->SetValues(numdof,doflist,values,INS_VAL);
    42064206
    42074207        /*Free ressources:*/
     
    42344234
    42354235        /*Add value to global vector*/
    4236         solution->SetValues(numdof,doflist,values,INSERT_VALUES);
     4236        solution->SetValues(numdof,doflist,values,INS_VAL);
    42374237
    42384238        /*Free ressources:*/
     
    43944394#ifdef _HAVE_CONTROL_
    43954395/*FUNCTION Penta::ControlInputGetGradient{{{1*/
    4396 void Penta::ControlInputGetGradient(Vec gradient,int enum_type,int control_index){
     4396void Penta::ControlInputGetGradient(Vector* gradient,int enum_type,int control_index){
    43974397
    43984398        int doflist1[NUMVERTICES];
     
    47194719/*}}}*/
    47204720/*FUNCTION Penta::Gradj {{{1*/
    4721 void  Penta::Gradj(Vec gradient,int control_type,int control_index){
     4721void  Penta::Gradj(Vector* gradient,int control_type,int control_index){
    47224722        /*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/
    47234723
     
    48104810/*}}}*/
    48114811/*FUNCTION Penta::GradjDragMacAyeal {{{1*/
    4812 void  Penta::GradjDragMacAyeal(Vec gradient,int control_index){
     4812void  Penta::GradjDragMacAyeal(Vector* gradient,int control_index){
    48134813
    48144814        /*Gradient is 0 if on shelf or not on bed*/
     
    48224822} /*}}}*/
    48234823/*FUNCTION Penta::GradjDragPattyn {{{1*/
    4824 void  Penta::GradjDragPattyn(Vec gradient,int control_index){
     4824void  Penta::GradjDragPattyn(Vector* gradient,int control_index){
    48254825
    48264826        int        i,j,ig;
     
    48854885                }
    48864886        }
    4887         VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)grade_g,ADD_VALUES);
     4887        gradient->SetValues(NUMVERTICES,doflist1,grade_g,ADD_VAL);
    48884888
    48894889        /*Clean up and return*/
     
    48934893/*}}}*/
    48944894/*FUNCTION Penta::GradjDragStokes {{{1*/
    4895 void  Penta::GradjDragStokes(Vec gradient,int control_index){
     4895void  Penta::GradjDragStokes(Vector* gradient,int control_index){
    48964896
    48974897        int        i,j,ig;
     
    49784978        }
    49794979
    4980         VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)grade_g,ADD_VALUES);
     4980        gradient->SetValues(NUMVERTICES,doflist1,grade_g,ADD_VAL);
    49814981
    49824982        delete friction;
     
    49854985/*}}}*/
    49864986/*FUNCTION Penta::GradjBbarMacAyeal {{{1*/
    4987 void  Penta::GradjBbarMacAyeal(Vec gradient,int control_index){
     4987void  Penta::GradjBbarMacAyeal(Vector* gradient,int control_index){
    49884988
    49894989        /*This element should be collapsed into a tria element at its base*/
     
    50035003} /*}}}*/
    50045004/*FUNCTION Penta::GradjBbarPattyn {{{1*/
    5005 void  Penta::GradjBbarPattyn(Vec gradient,int control_index){
     5005void  Penta::GradjBbarPattyn(Vector* gradient,int control_index){
    50065006
    50075007        /*Gradient is computed on bed only (Bbar)*/
     
    50205020} /*}}}*/
    50215021/*FUNCTION Penta::GradjBbarStokes {{{1*/
    5022 void  Penta::GradjBbarStokes(Vec gradient,int control_index){
     5022void  Penta::GradjBbarStokes(Vector* gradient,int control_index){
    50235023
    50245024        /*Gradient is computed on bed only (Bbar)*/
     
    53965396/*}}}*/
    53975397/*FUNCTION Penta::GetVectorFromControlInputs{{{1*/
    5398 void  Penta::GetVectorFromControlInputs(Vec vector,int control_enum,int control_index,const char* data){
     5398void  Penta::GetVectorFromControlInputs(Vector* vector,int control_enum,int control_index,const char* data){
    53995399
    54005400        int doflist1[NUMVERTICES];
     
    78747874
    78757875        /*Add value to global vector*/
    7876         solution->SetValues(numdof,doflist,values,INSERT_VALUES);
     7876        solution->SetValues(numdof,doflist,values,INS_VAL);
    78777877
    78787878        /*Free ressources:*/
     
    79107910
    79117911        /*Add value to global vector*/
    7912         solution->SetValues(numdof,doflist,values,INSERT_VALUES);
     7912        solution->SetValues(numdof,doflist,values,INS_VAL);
    79137913
    79147914        /*Free ressources:*/
     
    79437943
    79447944        /*Add value to global vector*/
    7945         solution->SetValues(numdof,doflist,values,INSERT_VALUES);
     7945        solution->SetValues(numdof,doflist,values,INS_VAL);
    79467946
    79477947        /*Free ressources:*/
     
    79887988
    79897989        /*Add value to global vector*/
    7990         solution->SetValues(numdof,doflist,values,INSERT_VALUES);
     7990        solution->SetValues(numdof,doflist,values,INS_VAL);
    79917991
    79927992        /*Free ressources:*/
  • issm/trunk-jpl/src/c/objects/Elements/Penta.h

    r11679 r11695  
    7979                /*}}}*/
    8080                /*Element virtual functions definitions: {{{1*/
    81                 void   AverageOntoPartition(Vec partition_contributions,Vec partition_areas,double* vertex_response,double* qmu_part);
     81                void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,double* vertex_response,double* qmu_part);
    8282                void   BasalFrictionCreateInput(void);
    83                 void   ComputeBasalStress(Vec sigma_b);
    84                 void   ComputeStrainRate(Vec eps);
     83                void   ComputeBasalStress(Vector* sigma_b);
     84                void   ComputeStrainRate(Vector* eps);
    8585                void   ComputeStressTensor();
    8686                void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
     
    9393                void   GetSolutionFromInputs(Vector* solution);
    9494                double GetZcoord(GaussPenta* gauss);
    95                 void   GetVectorFromInputs(Vec vector,int name_enum);
    96                 void   GetVectorFromResults(Vec vector,int offset,int interp);
     95                void   GetVectorFromInputs(Vector* vector,int name_enum);
     96                void   GetVectorFromResults(Vector* vector,int offset,int interp);
    9797               
    9898                int    Sid();
     
    107107                void   InputToResult(int enum_type,int step,double time);
    108108                void   MigrateGroundingLine(double* old_floating_ice,double* sheet_ungrounding);
    109                 void   PotentialSheetUngrounding(Vec potential_sheet_ungrounding);
     109                void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding);
    110110                void   RequestedOutput(int output_enum,int step,double time);
    111111                void   ListResultsInfo(int** results_enums,int** results_size,double** results_times,int** results_steps,int* num_results);
     
    117117                double SurfaceArea(void);
    118118                void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
    119                 int    UpdatePotentialSheetUngrounding(double* potential_sheet_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf);
     119                int    UpdatePotentialSheetUngrounding(double* potential_sheet_ungrounding,Vector* vec_nodes_on_iceshelf,double* nodes_on_iceshelf);
    120120                int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units);
    121121                double TimeAdapt();
    122122                int*   GetHorizontalNeighboorSids(void);
    123123                void   ViscousHeatingCreateInput(void);
    124                 void   SmearFunction(Vec smearedvector,double (*WeightFunction)(double distance,double radius),double radius);
     124                void   SmearFunction(Vector* smearedvector,double (*WeightFunction)(double distance,double radius),double radius);
    125125
    126126                 #ifdef _HAVE_RESPONSES_
     
    144144                double DragCoefficientAbsGradient(bool process_units,int weight_index);
    145145                void   GradientIndexing(int* indexing,int control_index);
    146                 void   Gradj(Vec gradient,int control_type,int control_index);
    147                 void   GradjDragMacAyeal(Vec gradient,int control_index);
    148                 void   GradjDragPattyn(Vec gradient,int control_index);
    149                 void   GradjDragStokes(Vec gradient,int control_index);
    150                 void   GradjBbarMacAyeal(Vec gradient,int control_index);
    151                 void   GradjBbarPattyn(Vec gradient,int control_index);
    152                 void   GradjBbarStokes(Vec gradient,int control_index);
    153                 void   GetVectorFromControlInputs(Vec gradient,int control_enum,int control_index,const char* data);
     146                void   Gradj(Vector* gradient,int control_type,int control_index);
     147                void   GradjDragMacAyeal(Vector* gradient,int control_index);
     148                void   GradjDragPattyn(Vector* gradient,int control_index);
     149                void   GradjDragStokes(Vector* gradient,int control_index);
     150                void   GradjBbarMacAyeal(Vector* gradient,int control_index);
     151                void   GradjBbarPattyn(Vector* gradient,int control_index);
     152                void   GradjBbarStokes(Vector* gradient,int control_index);
     153                void   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data);
    154154                void   SetControlInputsFromVector(double* vector,int control_enum,int control_index);
    155                 void   ControlInputGetGradient(Vec gradient,int enum_type,int control_index);
     155                void   ControlInputGetGradient(Vector* gradient,int enum_type,int control_index);
    156156                void   ControlInputScaleGradient(int enum_type,double scale);
    157157                void   ControlInputSetGradient(double* gradient,int enum_type,int control_index);
  • issm/trunk-jpl/src/c/objects/Elements/Tria.cpp

    r11679 r11695  
    279279/*Other*/
    280280/*FUNCTION Tria::AverageOntoPartition {{{1*/
    281 void  Tria::AverageOntoPartition(Vec partition_contributions,Vec partition_areas,double* vertex_response,double* qmu_part){
     281void  Tria::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,double* vertex_response,double* qmu_part){
    282282
    283283        bool      already=false;
     
    312312                }
    313313                if(!already){
    314                         VecSetValue(partition_contributions,partition[i],mean*area,ADD_VALUES);
    315                         VecSetValue(partition_areas,partition[i],area,ADD_VALUES);
     314                        partition_contributions->SetValue(partition[i],mean*area,ADD_VAL);
     315                        partition_areas->SetValue(partition[i],area,ADD_VAL);
    316316                };
    317317        }
     
    925925/*}}}*/
    926926/*FUNCTION Tria::ComputeBasalStress {{{1*/
    927 void  Tria::ComputeBasalStress(Vec eps){
     927void  Tria::ComputeBasalStress(Vector* eps){
    928928        _error_("Not Implemented yet");
    929929}
    930930/*}}}*/
    931931/*FUNCTION Tria::ComputeStrainRate {{{1*/
    932 void  Tria::ComputeStrainRate(Vec eps){
     932void  Tria::ComputeStrainRate(Vector* eps){
    933933        _error_("Not Implemented yet");
    934934}
     
    13241324/*}}}*/
    13251325/*FUNCTION Tria::GetVectorFromInputs{{{1*/
    1326 void  Tria::GetVectorFromInputs(Vec vector,int input_enum){
     1326void  Tria::GetVectorFromInputs(Vector* vector,int input_enum){
    13271327
    13281328        int doflist1[NUMVERTICES];
     
    13431343/*}}}*/
    13441344/*FUNCTION Tria::GetVectorFromResults{{{1*/
    1345 void  Tria::GetVectorFromResults(Vec vector,int offset,int interp){
     1345void  Tria::GetVectorFromResults(Vector* vector,int offset,int interp){
    13461346
    13471347        /*Get result*/
     
    22062206/*}}}*/
    22072207/*FUNCTION Tria::PotentialSheetUngrounding{{{1*/
    2208 void  Tria::PotentialSheetUngrounding(Vec potential_sheet_ungrounding){
     2208void  Tria::PotentialSheetUngrounding(Vector* potential_sheet_ungrounding){
    22092209
    22102210        int     i;
     
    22282228                        if (bed_hydro>ba[i]){
    22292229                                /*Vertex that could potentially unground, flag it*/
    2230                                 VecSetValue(potential_sheet_ungrounding,nodes[i]->Sid(),1,INSERT_VALUES);
     2230                                potential_sheet_ungrounding->SetValue(nodes[i]->Sid(),1,INS_VAL);
    22312231                        }
    22322232                }
     
    22862286/*}}}1*/
    22872287/*FUNCTION Tria::SmearFunction {{{1*/
    2288 void  Tria::SmearFunction(Vec smearedvector,double (*WeightFunction)(double distance,double radius),double radius){
     2288void  Tria::SmearFunction(Vector* smearedvector,double (*WeightFunction)(double distance,double radius),double radius){
    22892289        _error_("not implemented yet");
    22902290
     
    25072507/*}}}*/
    25082508/*FUNCTION Tria::UpdatePotentialSheetUngrounding{{{1*/
    2509 int Tria::UpdatePotentialSheetUngrounding(double* vertices_potentially_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf){
     2509int Tria::UpdatePotentialSheetUngrounding(double* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,double* nodes_on_iceshelf){
    25102510
    25112511        int i;
     
    25152515        for(i=0;i<3;i++){
    25162516                if (vertices_potentially_ungrounding[nodes[i]->Sid()]){
    2517                         VecSetValue(vec_nodes_on_iceshelf,nodes[i]->Sid(),1,INSERT_VALUES);
     2517                        vec_nodes_on_iceshelf->SetValue(nodes[i]->Sid(),1,INS_VAL);
    25182518               
    25192519                        /*If node was not on ice shelf, we flipped*/
     
    31703170        }
    31713171
    3172         solution->SetValues(numdof,doflist,values,INSERT_VALUES);
     3172        solution->SetValues(numdof,doflist,values,INS_VAL);
    31733173
    31743174        /*Free ressources:*/
     
    32093209        }
    32103210
    3211         solution->SetValues(numdof,doflist,values,INSERT_VALUES);
     3211        solution->SetValues(numdof,doflist,values,INS_VAL);
    32123212
    32133213        /*Free ressources:*/
     
    33773377/*}}}*/
    33783378/*FUNCTION Tria::ControlInputGetGradient{{{1*/
    3379 void Tria::ControlInputGetGradient(Vec gradient,int enum_type,int control_index){
     3379void Tria::ControlInputGetGradient(Vector* gradient,int enum_type,int control_index){
    33803380
    33813381        int doflist1[NUMVERTICES];
     
    34363436}/*}}}*/
    34373437/*FUNCTION Tria::Gradj {{{1*/
    3438 void  Tria::Gradj(Vec gradient,int control_type,int control_index){
     3438void  Tria::Gradj(Vector* gradient,int control_type,int control_index){
    34393439        /*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/
    34403440
     
    34953495/*}}}*/
    34963496/*FUNCTION Tria::GradjBGradient{{{1*/
    3497 void  Tria::GradjBGradient(Vec gradient,int weight_index,int control_index){
     3497void  Tria::GradjBGradient(Vector* gradient,int weight_index,int control_index){
    34983498
    34993499        int        i,ig;
     
    35283528                for (i=0;i<NUMVERTICES;i++) grade_g[i]+=-weight*Jdet*gauss->weight*(dbasis[0][i]*dk[0]+dbasis[1][i]*dk[1]);
    35293529        }
    3530         VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)grade_g,ADD_VALUES);
     3530        gradient->SetValues(NUMVERTICES,doflist1,grade_g,ADD_VAL);
    35313531
    35323532        /*Clean up and return*/
     
    35353535/*}}}*/
    35363536/*FUNCTION Tria::GradjBMacAyeal{{{1*/
    3537 void  Tria::GradjBMacAyeal(Vec gradient,int control_index){
     3537void  Tria::GradjBMacAyeal(Vector* gradient,int control_index){
    35383538
    35393539        /*Intermediaries*/
     
    35853585        }
    35863586
    3587         VecSetValues(gradient,NUMVERTICES,doflist,(const double*)grad,ADD_VALUES);
     3587        gradient->SetValues(NUMVERTICES,doflist,grad,ADD_VAL);
    35883588
    35893589        /*clean-up*/
     
    35923592/*}}}*/
    35933593/*FUNCTION Tria::GradjDragMacAyeal {{{1*/
    3594 void  Tria::GradjDragMacAyeal(Vec gradient,int control_index){
     3594void  Tria::GradjDragMacAyeal(Vector* gradient,int control_index){
    35953595
    35963596        int        i,ig;
     
    36723672        /*End Analytical gradient*/
    36733673
    3674         VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)grade_g,ADD_VALUES);
     3674        gradient->SetValues(NUMVERTICES,doflist1,grade_g,ADD_VAL);
    36753675
    36763676        /*Clean up and return*/
     
    36803680/*}}}*/
    36813681/*FUNCTION Tria::GradjDragGradient{{{1*/
    3682 void  Tria::GradjDragGradient(Vec gradient, int weight_index,int control_index){
     3682void  Tria::GradjDragGradient(Vector* gradient, int weight_index,int control_index){
    36833683
    36843684        int        i,ig;
     
    37173717                }
    37183718        }
    3719         VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)grade_g,ADD_VALUES);
     3719        gradient->SetValues(NUMVERTICES,doflist1,grade_g,ADD_VAL);
    37203720
    37213721        /*Clean up and return*/
     
    37243724/*}}}*/
    37253725/*FUNCTION Tria::GradjDhDtBalancedthickness{{{1*/
    3726 void  Tria::GradjDhDtBalancedthickness(Vec gradient,int control_index){
     3726void  Tria::GradjDhDtBalancedthickness(Vector* gradient,int control_index){
    37273727
    37283728        /*Intermediaries*/
     
    37363736        for(int i=0;i<NUMVERTICES;i++) gradient_g[i]=-lambda[i];
    37373737
    3738         VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)gradient_g,INSERT_VALUES);
     3738        gradient->SetValues(NUMVERTICES,doflist1,gradient_g,INS_VAL);
    37393739}
    37403740/*}}}*/
    37413741/*FUNCTION Tria::GradjVxBalancedthickness{{{1*/
    3742 void  Tria::GradjVxBalancedthickness(Vec gradient,int control_index){
     3742void  Tria::GradjVxBalancedthickness(Vector* gradient,int control_index){
    37433743
    37443744        /*Intermediaries*/
     
    37763776        }
    37773777
    3778         VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)grade_g,ADD_VALUES);
     3778        gradient->SetValues(NUMVERTICES,doflist1,grade_g,ADD_VAL);
    37793779
    37803780        /*Clean up and return*/
     
    37833783/*}}}*/
    37843784/*FUNCTION Tria::GradjVyBalancedthickness{{{1*/
    3785 void  Tria::GradjVyBalancedthickness(Vec gradient,int control_index){
     3785void  Tria::GradjVyBalancedthickness(Vector* gradient,int control_index){
    37863786
    37873787        /*Intermediaries*/
     
    38183818                for(i=0;i<NUMVERTICES;i++) grade_g[i]+=thickness*Dlambda[1]*Jdet*gauss->weight*basis[i];
    38193819        }
    3820         VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)grade_g,ADD_VALUES);
     3820        gradient->SetValues(NUMVERTICES,doflist1,grade_g,ADD_VAL);
    38213821
    38223822        /*Clean up and return*/
     
    49124912/*}}}*/
    49134913/*FUNCTION Tria::GetVectorFromControlInputs{{{1*/
    4914 void  Tria::GetVectorFromControlInputs(Vec vector,int control_enum,int control_index,const char* data){
     4914void  Tria::GetVectorFromControlInputs(Vector* vector,int control_enum,int control_index,const char* data){
    49154915
    49164916        int doflist1[NUMVERTICES];
     
    52145214        }
    52155215
    5216         solution->SetValues(numdof,doflist,values,INSERT_VALUES);
     5216        solution->SetValues(numdof,doflist,values,INS_VAL);
    52175217
    52185218        /*Free ressources:*/
  • issm/trunk-jpl/src/c/objects/Elements/Tria.h

    r11679 r11695  
    7676                /*}}}*/
    7777                /*Element virtual functions definitions: {{{1*/
    78                 void   AverageOntoPartition(Vec partition_contributions,Vec partition_areas,double* vertex_response,double* qmu_part);
    79                 void   ComputeBasalStress(Vec sigma_b);
    80                 void   ComputeStrainRate(Vec eps);
     78                void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,double* vertex_response,double* qmu_part);
     79                void   ComputeBasalStress(Vector* sigma_b);
     80                void   ComputeStrainRate(Vector* eps);
    8181                void   ComputeStressTensor();
    8282                void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
     
    9393                bool   IsOnWater();
    9494                void   GetSolutionFromInputs(Vector* solution);
    95                 void   GetVectorFromInputs(Vec vector, int name_enum);
    96                 void   GetVectorFromResults(Vec vector,int offset,int interp);
     95                void   GetVectorFromInputs(Vector* vector, int name_enum);
     96                void   GetVectorFromResults(Vector* vector,int offset,int interp);
    9797                void   InputArtificialNoise(int enum_type,double min, double max);
    9898                bool   InputConvergence(double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums);
     
    107107                void   MigrateGroundingLine(double* oldfloating,double* sheet_ungrounding);
    108108                int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units);
    109                 void   PotentialSheetUngrounding(Vec potential_sheet_ungrounding);
     109                void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding);
    110110                void   PositiveDegreeDay(void);
    111111                void   RequestedOutput(int output_enum,int step,double time);
     
    117117                double SurfaceArea(void);
    118118                void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
    119                 int    UpdatePotentialSheetUngrounding(double* vertices_potentially_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf);
     119                int    UpdatePotentialSheetUngrounding(double* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,double* nodes_on_iceshelf);
    120120                double TimeAdapt();
    121121                int*   GetHorizontalNeighboorSids(void);
    122                 void   SmearFunction(Vec smearedvector,double (*WeightFunction)(double distance,double radius),double radius);
     122                void   SmearFunction(Vector* smearedvector,double (*WeightFunction)(double distance,double radius),double radius);
    123123
    124124                #ifdef _HAVE_RESPONSES_
     
    143143                double DragCoefficientAbsGradient(bool process_units,int weight_index);
    144144                void   GradientIndexing(int* indexing,int control_index);
    145                 void   Gradj(Vec gradient,int control_type,int control_index);
    146                 void   GradjBGradient(Vec gradient,int weight_index,int control_index);
    147                 void   GradjBMacAyeal(Vec gradient,int control_index);
    148                 void   GradjDragMacAyeal(Vec gradient,int control_index);
    149                 void   GradjDragStokes(Vec gradient,int control_index);
    150                 void   GradjDragGradient(Vec gradient,int weight_index,int control_index);
    151                 void   GradjDhDtBalancedthickness(Vec gradient,int control_index);
    152                 void   GradjVxBalancedthickness(Vec gradient,int control_index);
    153                 void   GradjVyBalancedthickness(Vec gradient,int control_index);
    154                 void   GetVectorFromControlInputs(Vec gradient,int control_enum,int control_index,const char* data);
     145                void   Gradj(Vector* gradient,int control_type,int control_index);
     146                void   GradjBGradient(Vector* gradient,int weight_index,int control_index);
     147                void   GradjBMacAyeal(Vector* gradient,int control_index);
     148                void   GradjDragMacAyeal(Vector* gradient,int control_index);
     149                void   GradjDragStokes(Vector* gradient,int control_index);
     150                void   GradjDragGradient(Vector* gradient,int weight_index,int control_index);
     151                void   GradjDhDtBalancedthickness(Vector* gradient,int control_index);
     152                void   GradjVxBalancedthickness(Vector* gradient,int control_index);
     153                void   GradjVyBalancedthickness(Vector* gradient,int control_index);
     154                void   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data);
    155155                void   SetControlInputsFromVector(double* vector,int control_enum,int control_index);
    156                 void   ControlInputGetGradient(Vec gradient,int enum_type,int control_index);
     156                void   ControlInputGetGradient(Vector* gradient,int enum_type,int control_index);
    157157                void   ControlInputScaleGradient(int enum_type,double scale);
    158158                void   ControlInputSetGradient(double* gradient,int enum_type,int control_index);
  • issm/trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.cpp

    r11205 r11695  
    2727/*}}}*/
    2828/*FUNCTION PetscVecExternalResult::PetscVecExternalResult(int enum_type,IssmPetscVec value){{{1*/
    29 PetscVecExternalResult::PetscVecExternalResult(int in_id, int in_enum_type,Vec in_value,int in_step, double in_time){
     29PetscVecExternalResult::PetscVecExternalResult(int in_id, int in_enum_type,Vector* in_value,int in_step, double in_time){
    3030
    3131        id=in_id;
     
    3535
    3636        if(in_value){
    37                 VecDuplicate(in_value,&value);
    38                 VecCopy(in_value,value);
     37                value=in_value->Duplicate();
     38                in_value->Copy(value);
    3939        }
    4040        else value=NULL;
  • issm/trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.h

    r11202 r11695  
    3333                int id;
    3434                int enum_type;
    35                 Vec value;
     35                Vector* value;
    3636                int step;
    3737                double time;
     
    4040                /*PetscVecExternalResult constructors, destructors: {{{1*/
    4141                PetscVecExternalResult();
    42                 PetscVecExternalResult(int id,int enum_type,Vec value, int step, double time);
     42                PetscVecExternalResult(int id,int enum_type,Vector* value, int step, double time);
    4343                ~PetscVecExternalResult();
    4444                /*}}}*/
  • issm/trunk-jpl/src/c/objects/FemModel.cpp

    r11130 r11695  
    144144        this->loads->SetCurrentConfiguration(elements, loads, nodes,vertices, materials,parameters);
    145145
     146        #ifdef _HAVE_PETSC_
    146147        /*take care of petsc options, that depend on this analysis type (present only after model processor)*/
    147148        if(this->parameters->Exist(PetscOptionsStringsEnum)){
     
    149150                _printf_(VerboseSolver(),"      petsc Options set for analysis type: %s\n",EnumToStringx(analysis_type));
    150151        }
     152        #endif
    151153
    152154}
  • issm/trunk-jpl/src/c/objects/Inputs/BoolInput.cpp

    r10431 r11695  
    233233/*}}}*/
    234234/*FUNCTION BoolInput::GetVectorFromInputs{{{1*/
    235 void BoolInput::GetVectorFromInputs(Vec vector,int* doflist){
     235void BoolInput::GetVectorFromInputs(Vector* vector,int* doflist){
    236236
    237237        _error_(" not supporte yet!");
  • issm/trunk-jpl/src/c/objects/Inputs/BoolInput.h

    r10431 r11695  
    8181                void Extrude(void);
    8282                void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
    83                 void GetVectorFromInputs(Vec vector,int* doflist);
     83                void GetVectorFromInputs(Vector* vector,int* doflist);
    8484                void GetValuesPtr(double** pvalues,int* pnum_values);
    8585                /*}}}*/
  • issm/trunk-jpl/src/c/objects/Inputs/ControlInput.cpp

    r11318 r11695  
    355355}/*}}}*/
    356356/*FUNCTION ControlInput::GetGradient{{{1*/
    357 void ControlInput::GetGradient(Vec gradient_vec,int* doflist){
     357void ControlInput::GetGradient(Vector* gradient_vec,int* doflist){
    358358        if(gradient) gradient->GetVectorFromInputs(gradient_vec,doflist);
    359359}/*}}}*/
     
    406406        return gradient->SpawnResult(step,time);
    407407}/*}}}*/
    408 /*FUNCTION ControlInput::GetVectorFromInputs(Vec vector,int* doflist){{{1*/
    409 void ControlInput::GetVectorFromInputs(Vec vector,int* doflist){
     408/*FUNCTION ControlInput::GetVectorFromInputs(Vector* vector,int* doflist){{{1*/
     409void ControlInput::GetVectorFromInputs(Vector* vector,int* doflist){
    410410        values->GetVectorFromInputs(vector,doflist);
    411411}/*}}}*/
    412 /*FUNCTION ControlInput::GetVectorFromInputs(Vec vector,int* doflist,const char* data){{{1*/
    413 void ControlInput::GetVectorFromInputs(Vec vector,int* doflist,const char* data){
     412/*FUNCTION ControlInput::GetVectorFromInputs(Vector* vector,int* doflist,const char* data){{{1*/
     413void ControlInput::GetVectorFromInputs(Vector* vector,int* doflist,const char* data){
    414414         if(strcmp(data,"value")==0){
    415415                 _assert_(values);
  • issm/trunk-jpl/src/c/objects/Inputs/ControlInput.h

    r11318 r11695  
    8787                void Extrude(void);
    8888                void VerticallyIntegrate(Input* thickness_input);
    89                 void GetVectorFromInputs(Vec vector,int* doflist,const char* data);
    90                 void GetVectorFromInputs(Vec vector,int* doflist);
     89                void GetVectorFromInputs(Vector* vector,int* doflist,const char* data);
     90                void GetVectorFromInputs(Vector* vector,int* doflist);
    9191                void GetValuesPtr(double** pvalues,int* pnum_values){_error_("not implemented yet");};
    9292                ElementResult* SpawnGradient(int step, double time);
    93                 void GetGradient(Vec gradient_vec,int* doflist);
     93                void GetGradient(Vector* gradient_vec,int* doflist);
    9494                void ScaleGradient(double scale);
    9595                void SetGradient(Input* gradient_in);
  • issm/trunk-jpl/src/c/objects/Inputs/DatasetInput.h

    r10135 r11695  
    8282                void Extrude(void){_error_("not implemented yet");};
    8383                void VerticallyIntegrate(Input* thickness_input){_error_("not implemented yet");};
    84                 void GetVectorFromInputs(Vec vector,int* doflist){_error_("not implemented yet");};
     84                void GetVectorFromInputs(Vector* vector,int* doflist){_error_("not implemented yet");};
    8585                void GetValuesPtr(double** pvalues,int* pnum_values){_error_("not implemented yet");};
    8686                ElementResult* SpawnGradient(int step, double time){_error_("not implemented yet");};
    87                 void GetGradient(Vec gradient_vec,int* doflist){_error_("not implemented yet");};
     87                void GetGradient(Vector* gradient_vec,int* doflist){_error_("not implemented yet");};
    8888                void ScaleGradient(double scale){_error_("not implemented yet");};
    8989                void SetGradient(Input* gradient_in){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/objects/Inputs/DoubleInput.cpp

    r11291 r11695  
    310310/*}}}*/
    311311/*FUNCTION DoubleInput::GetVectorFromInputs{{{1*/
    312 void DoubleInput::GetVectorFromInputs(Vec vector,int* doflist){
     312void DoubleInput::GetVectorFromInputs(Vector* vector,int* doflist){
    313313
    314314        _error_(" not supporte yet!");
  • issm/trunk-jpl/src/c/objects/Inputs/DoubleInput.h

    r10135 r11695  
    8080                void Extrude(void){_error_("not supported yet");};
    8181                void VerticallyIntegrate(Input* thickness_input);
    82                 void GetVectorFromInputs(Vec vector,int* doflist);
     82                void GetVectorFromInputs(Vector* vector,int* doflist);
    8383                void GetValuesPtr(double** pvalues,int* pnum_values);
    8484                /*}}}*/
  • issm/trunk-jpl/src/c/objects/Inputs/Input.h

    r10135 r11695  
    5656                virtual void   VerticallyIntegrate(Input* thickness_input)=0;
    5757                virtual void   Extrude()=0;
    58                 virtual void   GetVectorFromInputs(Vec vector,int* doflist)=0;
     58                virtual void   GetVectorFromInputs(Vector* vector,int* doflist)=0;
    5959                virtual void   GetValuesPtr(double** pvalues,int* pnum_values)=0;
    6060               
  • issm/trunk-jpl/src/c/objects/Inputs/IntInput.cpp

    r11070 r11695  
    231231/*}}}*/
    232232/*FUNCTION IntInput::GetVectorFromInputs{{{1*/
    233 void IntInput::GetVectorFromInputs(Vec vector,int* doflist){
     233void IntInput::GetVectorFromInputs(Vector* vector,int* doflist){
    234234
    235235        _error_(" not supporte yet!");
  • issm/trunk-jpl/src/c/objects/Inputs/IntInput.h

    r10135 r11695  
    8181                void Extrude(void){_error_("not supported yet");};
    8282                void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
    83                 void GetVectorFromInputs(Vec vector,int* doflist);
     83                void GetVectorFromInputs(Vector* vector,int* doflist);
    8484                void GetValuesPtr(double** pvalues,int* pnum_values);
    8585                /*}}}*/
  • issm/trunk-jpl/src/c/objects/Inputs/PentaP1Input.cpp

    r11292 r11695  
    660660/*}}}*/
    661661/*FUNCTION PentaP1Input::GetVectorFromInputs{{{1*/
    662 void PentaP1Input::GetVectorFromInputs(Vec vector,int* doflist){
     662void PentaP1Input::GetVectorFromInputs(Vector* vector,int* doflist){
    663663
    664664        const int numvertices=6;
    665         VecSetValues(vector,numvertices,doflist,(const double*)this->values,INSERT_VALUES);
     665        vector->SetValues(numvertices,doflist,this->values,INS_VAL);
    666666
    667667} /*}}}*/
  • issm/trunk-jpl/src/c/objects/Inputs/PentaP1Input.h

    r11292 r11695  
    8282                void Extrude(void);
    8383                void VerticallyIntegrate(Input* thickness_input);
    84                 void GetVectorFromInputs(Vec vector,int* doflist);
     84                void GetVectorFromInputs(Vector* vector,int* doflist);
    8585                void GetValuesPtr(double** pvalues,int* pnum_values);
    8686                /*}}}*/
  • issm/trunk-jpl/src/c/objects/Inputs/TransientInput.cpp

    r11197 r11695  
    440440/*}}}*/
    441441/*FUNCTION TransientInput::GetVectorFromInputs{{{1*/
    442 void TransientInput::GetVectorFromInputs(Vec vector,int* doflist){
     442void TransientInput::GetVectorFromInputs(Vector* vector,int* doflist){
    443443
    444444        double time;
  • issm/trunk-jpl/src/c/objects/Inputs/TransientInput.h

    r10135 r11695  
    8484                void Extrude(void){_error_("not supported yet");}
    8585                void VerticallyIntegrate(Input* thickness_forcing){_error_("not supported yet");};
    86                 void GetVectorFromInputs(Vec vector,int* doflist);
     86                void GetVectorFromInputs(Vector* vector,int* doflist);
    8787                void GetValuesPtr(double** pvalues,int* pnum_values){_error_("not supported yet");};
    8888      void GetTimeValues(double* values,double time){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/objects/Inputs/TriaP1Input.cpp

    r11292 r11695  
    391391/*}}}*/
    392392/*FUNCTION TriaP1Input::GetVectorFromInputs{{{1*/
    393 void TriaP1Input::GetVectorFromInputs(Vec vector,int* doflist){
     393void TriaP1Input::GetVectorFromInputs(Vector* vector,int* doflist){
    394394
    395395        const int numvertices=3;
    396         VecSetValues(vector,numvertices,doflist,(const double*)this->values,INSERT_VALUES);
     396        vector->SetValues(numvertices,doflist,this->values,INS_VAL);
    397397
    398398} /*}}}*/
  • issm/trunk-jpl/src/c/objects/Inputs/TriaP1Input.h

    r11291 r11695  
    8282                void Extrude(void){_error_("not supported yet");};
    8383                void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
    84                 void GetVectorFromInputs(Vec vector,int* doflist);
     84                void GetVectorFromInputs(Vector* vector,int* doflist);
    8585                void GetValuesPtr(double** pvalues,int* pnum_values);
    8686                /*}}}*/
  • issm/trunk-jpl/src/c/objects/Materials/Material.h

    r8386 r11695  
    2222                virtual void   InputDuplicate(int original_enum,int new_enum)=0;
    2323                virtual void   Configure(Elements* elements)=0;
    24                 virtual void   GetVectorFromInputs(Vec vector,int input_enum)=0;
     24                virtual void   GetVectorFromInputs(Vector* vector,int input_enum)=0;
    2525
    2626};
  • issm/trunk-jpl/src/c/objects/Materials/Matice.cpp

    r11332 r11695  
    229229/*}}}*/
    230230/*FUNCTION Matice::GetVectorFromInputs{{{1*/
    231 void  Matice::GetVectorFromInputs(Vec vector,int input_enum){
     231void  Matice::GetVectorFromInputs(Vector* vector,int input_enum){
    232232
    233233        /*Intermediaries*/
  • issm/trunk-jpl/src/c/objects/Materials/Matice.h

    r11332 r11695  
    6060                void   InputDuplicate(int original_enum,int new_enum);
    6161                void   Configure(Elements* elements);
    62                 void   GetVectorFromInputs(Vec vector,int input_enum);
     62                void   GetVectorFromInputs(Vector* vector,int input_enum);
    6363                /*}}}*/
    6464                /*Matice Numerics: {{{1*/
  • issm/trunk-jpl/src/c/objects/Materials/Matpar.h

    r10576 r11695  
    7171                void   InputDuplicate(int original_enum,int new_enum){_error_("not implemented yet");};
    7272                void   Configure(Elements* elements);
    73                 void   GetVectorFromInputs(Vec vector,int input_enum){return;}
     73                void   GetVectorFromInputs(Vector* vector,int input_enum){return;}
    7474                /*}}}*/
    7575                /*Numerics: {{{1*/
  • issm/trunk-jpl/src/c/objects/Node.cpp

    r11679 r11695  
    568568/*}}}*/
    569569/*FUNCTION Node::CreateVecSets {{{1*/
    570 void  Node::CreateVecSets(Vec pv_g,Vec pv_f,Vec pv_s){
     570void  Node::CreateVecSets(Vector* pv_g,Vector* pv_f,Vector* pv_s){
    571571
    572572        double gvalue=1.0; //all nodes are in the g set;
     
    578578
    579579                /*g set: */
    580                 VecSetValues(pv_g,1,&indexing.gdoflist[i],&gvalue,INSERT_VALUES);
     580                pv_g->SetValue(indexing.gdoflist[i],gvalue,INS_VAL);
    581581               
    582582                /*f set: */
    583583                value=(double)this->indexing.f_set[i];
    584                 VecSetValues(pv_f,1,&indexing.gdoflist[i],&value,INSERT_VALUES);
     584                pv_f->SetValue(indexing.gdoflist[i],value,INS_VAL);
    585585
    586586                /*s set: */
    587587                value=(double)this->indexing.s_set[i];
    588                 VecSetValues(pv_s,1,&indexing.gdoflist[i],&value,INSERT_VALUES);
     588                pv_s->SetValue(indexing.gdoflist[i],value,INS_VAL);
    589589
    590590        }
     
    613613               
    614614                /*Add values into constraint vector: */
    615                 ys->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INSERT_VALUES);
     615                ys->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS_VAL);
    616616        }
    617617
     
    897897
    898898                        /*Add values into ug: */
    899                         ug->SetValues(this->indexing.fsize,indices,values,INSERT_VALUES);
     899                        ug->SetValues(this->indexing.fsize,indices,values,INS_VAL);
    900900                }
    901901        }
     
    915915
    916916                        /*Add values into ug: */
    917                         ug->SetValues(this->indexing.ssize,indices,values,INSERT_VALUES);
     917                        ug->SetValues(this->indexing.ssize,indices,values,INS_VAL);
    918918                }
    919919        }
     
    945945
    946946                        /*Add values into ug: */
    947                         vector->SetValues(this->indexing.fsize,this->indexing.fdoflist,values,INSERT_VALUES);
     947                        vector->SetValues(this->indexing.fsize,this->indexing.fdoflist,values,INS_VAL);
    948948                }
    949949        }
     
    961961
    962962                        /*Add values into ug: */
    963                         vector->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INSERT_VALUES);
     963                        vector->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS_VAL);
    964964                }
    965965        }
  • issm/trunk-jpl/src/c/objects/Node.h

    r11679 r11695  
    8787                void   DofInFSet(int dof);
    8888                int    GetDof(int dofindex,int setenum);
    89                 void   CreateVecSets(Vec pv_g,Vec pv_f,Vec pv_s);
     89                void   CreateVecSets(Vector* pv_g,Vector* pv_f,Vector* pv_s);
    9090                int    GetConnectivity();
    9191                void   GetDofList(int* poutdoflist,int approximation_enum,int setenum);
  • issm/trunk-jpl/src/c/objects/Numerics/Matrix.cpp

    r11679 r11695  
    1717#include "../../Container/Container.h"
    1818#include "../../include/include.h"
     19#include "../../toolkits/toolkits.h"
    1920#include "./Matrix.h"
     21       
    2022/*}}}*/
    2123
     
    6163        #ifdef _HAVE_PETSC_
    6264        this->matrix=NewMat(pM,pN,sparsity);
     65        #else
     66        this->matrix=(double*)xcalloc(pM*pN,sizeof(double));
     67        #endif
     68        #ifdef _HAVE_ADOLC_
     69        this->amatrix=(adouble*)xmalloc(pM*pN*sizeof(adouble));
     70        #endif
     71}
     72/*}}}*/
     73/*FUNCTION Matrix::Matrix(double* serial_mat, int M,int N,double sparsity){{{1*/
     74Matrix::Matrix(double* serial_mat, int pM,int pN,double sparsity){
     75
     76        this->M=pM;
     77        this->N=pN;
     78
     79        #ifdef _HAVE_PETSC_
     80        int     i;
     81        int*    idxm=NULL;
     82        int*    idxn=NULL;
     83
     84        this->matrix=NewMat(pM,pN,sparsity);
     85
     86        idxm=(int*)xmalloc(M*sizeof(int));
     87        idxn=(int*)xmalloc(N*sizeof(int));
     88        for(i=0;i<M;i++)idxm[i]=i;
     89        for(i=0;i<N;i++)idxn[i]=i;
     90
     91        MatSetValues(this->matrix,M,idxm,N,idxn,serial_mat,INSERT_VALUES);
     92
     93        MatAssemblyBegin(this->matrix,MAT_FINAL_ASSEMBLY);
     94        MatAssemblyEnd(this->matrix,MAT_FINAL_ASSEMBLY);
     95
     96        xfree((void**)&idxm);
     97        xfree((void**)&idxn);
    6398        #else
    6499        this->matrix=(double*)xcalloc(pM*pN,sizeof(double));
     
    160195/*}}}*/
    161196/*FUNCTION Matrix::Norm{{{1*/
    162 double Matrix::Norm(int norm_type){
     197double Matrix::Norm(NormMode norm_type){
    163198       
    164199        double norm=0;
    165200        #ifdef _HAVE_PETSC_
    166             MatNorm(this->matrix,(NormType)norm_type,&norm);
     201            MatNorm(this->matrix,ISSMToPetscNormMode(norm_type),&norm);
    167202        #else
    168203                _error_("not implemented yet!");
     
    201236}
    202237/*}}}*/
     238/*FUNCTION Matrix::Duplicate{{{1*/
     239Matrix* Matrix::Duplicate(void){
     240
     241        Matrix* output=NULL;
     242
     243        output=new Matrix();
     244
     245        #ifdef _HAVE_PETSC
     246                MatDuplicate(this->matrix,MAT_COPY_VALUES,&output->matrix);
     247        #else
     248                _error_("not implemented yet!");
     249        #endif
     250}
     251/*}}}*/
     252/*FUNCTION Matrix::ToSerial{{{1*/
     253double* Matrix::ToSerial(void){
     254
     255        double* output=NULL;
     256
     257        #ifdef _HAVE_PETSC
     258                MatToSerial(&output,this->matrix);
     259        #else
     260                _error_("not implemented yet!");
     261        #endif
     262        return output;
     263}
     264/*}}}*/
  • issm/trunk-jpl/src/c/objects/Numerics/Matrix.h

    r11679 r11695  
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    1515#endif
    16 #include "../Object.h"
    1716#include "../../toolkits/toolkits.h"
    1817#include "../../EnumDefinitions/EnumDefinitions.h"
     
    4847                Matrix(int M,int N);
    4948                Matrix(int M,int N,double sparsity);
     49                Matrix(double* serial_mat,int M,int N,double sparsity);
    5050                Matrix(int M,int N,int connectivity,int numberofdofspernode);
    5151                ~Matrix();
     
    5757                #endif
    5858                void Assemble(void);
    59                 double Norm(int norm_type);
     59                double Norm(NormMode norm_type);
    6060                void GetSize(int* pM,int* pN);
    6161                void GetLocalSize(int* pM,int* pN);
    6262                void MatMult(Vector* X,Vector* AX);
     63                Matrix* Duplicate(void);
     64                double* ToSerial(void);
    6365                /*}}}*/
    6466
  • issm/trunk-jpl/src/c/objects/Numerics/Vector.cpp

    r11690 r11695  
    1717#include "../../Container/Container.h"
    1818#include "../../include/include.h"
     19#include "../../toolkits/toolkits.h"
    1920#include "./Vector.h"
    2021/*}}}*/
     
    4950}
    5051/*}}}*/
    51 /*FUNCTION Vector::~Vector(){{{1*/
     52/*FUNCTION Vector::Vector(double* serial_vec,int M){{{1*/
     53Vector::Vector(double* serial_vec,int pM){
     54
     55        int i,j;
     56
     57        #ifdef _HAVE_PETSC_
     58                int* idxm=NULL;
     59
     60                this->vector=NewVec(pM);
     61               
     62                idxm=(int*)xmalloc(M*sizeof(int));
     63                for(i=0;i<M;i++)idxm[i]=i;
     64                VecSetValues(this->vector,M,idxm,serial_vec,INSERT_VALUES);
     65
     66                VecAssemblyBegin(this->vector);
     67                VecAssemblyEnd(this->vector);
     68
     69                xfree((void**)&idxm);
     70
     71        #else
     72                this->M=pM;
     73                this->vector=(double*)xcalloc(pM,sizeof(double));
     74        #endif
     75        #ifdef _HAVE_ADOLC_
     76                this->avector=(adouble*)xmalloc(pM*sizeof(adouble));
     77        #endif
     78}
     79/*}}}*/
     80                /*FUNCTION Vector::~Vector(){{{1*/
    5281Vector::~Vector(){
    5382
     
    6291}
    6392/*}}}*/
     93
    6494
    6595/*Vector specific routines: */
     
    116146/*}}}*/
    117147/*FUNCTION Vector::SetValues{{{1*/
    118 void Vector::SetValues(int ssize, int* list, double* values, int mode){
    119                
    120                
    121         #ifdef _HAVE_PETSC_
    122         VecSetValues(this->vector,ssize,list,values,(InsertMode)mode);
    123         #else
    124                 _error_("not implemented yet!");
    125         #endif
    126 
    127 }
    128 /*}}}*/
     148void Vector::SetValues(int ssize, int* list, double* values, InsMode mode){
     149               
     150               
     151        #ifdef _HAVE_PETSC_
     152                VecSetValues(this->vector,ssize,list,values,ISSMToPetscInsertMode(mode));
     153        #else
     154                _error_("not implemented yet!");
     155        #endif
     156
     157}
     158/*}}}*/
     159/*FUNCTION Vector::SetValue{{{1*/
     160void Vector::SetValue(int dof, double value, InsMode mode){
     161               
     162               
     163        #ifdef _HAVE_PETSC_
     164                VecSetValues(this->vector,1,&dof,&value,ISSMToPetscInsertMode(mode));
     165        #else
     166                _error_("not implemented yet!");
     167        #endif
     168
     169}
     170/*}}}*/
     171/*FUNCTION Vector::GetValue{{{1*/
     172void Vector::GetValue(double* pvalue,int dof){
     173               
     174               
     175        #ifdef _HAVE_PETSC_
     176        VecGetValues(this->vector,1,&dof,pvalue);
     177        #else
     178                _error_("not implemented yet!");
     179        #endif
     180
     181}
     182/*}}}*/
     183               
    129184/*FUNCTION Vector::GetSize{{{1*/
    130185void Vector::GetSize(int* pM){
     
    226281/*}}}*/
    227282/*FUNCTION Vector::Norm{{{1*/
    228 double Vector::Norm(int norm_type){
     283double Vector::Norm(NormMode norm_type){
    229284       
    230285        double norm=0;
    231286        #ifdef _HAVE_PETSC_
    232             VecNorm(this->vector,(NormType)norm_type,&norm);
     287            VecNorm(this->vector,ISSMToPetscNormMode(norm_type),&norm);
    233288        #else
    234289                _error_("not implemented yet!");
     
    247302}
    248303/*}}}*/
     304/*FUNCTION Vector::Scale{{{1*/
     305double Vector::Dot(Vector* vector){
     306
     307        double dot;
     308        #ifdef _HAVE_PETSC_
     309            VecDot(this->vector,vector->vector,&dot);
     310        #else
     311                _error_("not implemented yet!");
     312        #endif
     313        return dot;
     314}
     315/*}}}*/
     316/*FUNCTION Vector::PointwiseDivide{{{1*/
     317void Vector::PointwiseDivide(Vector* x,Vector* y){
     318
     319        #ifdef _HAVE_PETSC_
     320                VecPointwiseDivide(this->vector,x->vector,y->vector);
     321        #else
     322                _error_("not implemented yet!");
     323        #endif
     324}
     325/*}}}*/
  • issm/trunk-jpl/src/c/objects/Numerics/Vector.h

    r11679 r11695  
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    1515#endif
    16 #include "../Object.h"
    1716#include "../../toolkits/toolkits.h"
    1817#include "../../EnumDefinitions/EnumDefinitions.h"
     
    2221#endif
    2322               
    24 
    2523#ifdef _SERIAL_
    2624#include "mex.h"
     
    4745                Vector();
    4846                Vector(int M,bool fromlocalsize=false);
     47                Vector(double* serial_vec,int pM);
    4948                ~Vector();
    5049                /*}}}*/
     
    5554                #endif
    5655                void Assemble(void);
    57                 void SetValues(int ssize, int* list, double* values, int mode);
     56                void SetValues(int ssize, int* list, double* values, InsMode mode);
     57                void SetValue(int dof, double value, InsMode  mode);
     58                void GetValue(double* pvalue, int dof);
    5859                void GetSize(int* pM);
    5960                void GetLocalSize(int* pM);
     
    6465                double* ToMPISerial(void);
    6566                void Copy(Vector* to);
    66                 double Norm(int norm_type);
     67                double Norm(NormMode norm_type);
    6768                void Scale(double scale_factor);
     69                void PointwiseDivide(Vector* x,Vector* y);
     70                double Dot(Vector* vector);
    6871                /*}}}*/
    6972};
  • issm/trunk-jpl/src/c/objects/Params/BoolParam.h

    r11358 r11695  
    6161                void  GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("Bool param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
    6262                void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("Bool param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}
    63                 void  GetParameterValue(Vec* pvec){_error_("Bool param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
    64                 void  GetParameterValue(Mat* pmat){_error_("Bool param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
     63                void  GetParameterValue(Vector** pvec){_error_("Bool param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
     64                void  GetParameterValue(Matrix** pmat){_error_("Bool param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
    6565                void  GetParameterValue(FILE** pfid){_error_("Bool param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));}
    6666
     
    7474                void  SetValue(int* intarray,int M){_error_("Bool param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));}
    7575                void  SetValue(int* pintarray,int M,int N){_error_("Bool param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));}
    76                 void  SetValue(Vec vec){_error_("Bool param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
    77                 void  SetValue(Mat mat){_error_("Bool param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
     76                void  SetValue(Vector* vec){_error_("Bool param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
     77                void  SetValue(Matrix* mat){_error_("Bool param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
    7878                void  SetValue(FILE* fid){_error_("Bool param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
    7979                void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("Bool param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
  • issm/trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.h

    r11358 r11695  
    6464                void  GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("DoubleMatArray param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
    6565                void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims);
    66                 void  GetParameterValue(Vec* pvec){_error_("DoubleMatArray param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
    67                 void  GetParameterValue(Mat* pmat){_error_("DoubleMatArray param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
     66                void  GetParameterValue(Vector** pvec){_error_("DoubleMatArray param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
     67                void  GetParameterValue(Matrix** pmat){_error_("DoubleMatArray param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
    6868                void  GetParameterValue(FILE** pfid){_error_("DoubleMatArray param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));}
    6969
     
    7777                void  SetValue(int* intarray,int M){_error_("DoubleMatArray param of enum %i (%s) cannot hold a int vec array",enum_type,EnumToStringx(enum_type));}
    7878                void  SetValue(int* intarray,int M,int N){_error_("DoubleMatArray param of enum %i (%s) cannot hold a int mat array",enum_type,EnumToStringx(enum_type));}
    79                 void  SetValue(Vec vec){_error_("DoubleMatArray param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
    80                 void  SetValue(Mat mat){_error_("DoubleMatArray param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
     79                void  SetValue(Vector* vec){_error_("DoubleMatArray param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
     80                void  SetValue(Matrix* mat){_error_("DoubleMatArray param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
    8181                void  SetValue(FILE* fid){_error_("Bool param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
    8282                void  SetValue(double** array, int M, int* mdim_array, int* ndim_array);
  • issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.h

    r11358 r11695  
    6363                void  GetParameterValue(double** pdoublearray,int* pM,int* pN);
    6464                void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("DoubleMat param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}
    65                 void  GetParameterValue(Vec* pvec){_error_("DoubleMat param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
    66                 void  GetParameterValue(Mat* pmat){_error_("DoubleMat param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
     65                void  GetParameterValue(Vector** pvec){_error_("DoubleMat param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
     66                void  GetParameterValue(Matrix** pmat){_error_("DoubleMat param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
    6767                void  GetParameterValue(FILE** pfid){_error_("DoubleMat param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));}
    6868
     
    7676                void  SetValue(int* intarray,int M){_error_("DoubleMat param of enum %i (%s) cannot hold a int vec array",enum_type,EnumToStringx(enum_type));}
    7777                void  SetValue(int* intarray,int M,int N){_error_("DoubleMat param of enum %i (%s) cannot hold a int mat array",enum_type,EnumToStringx(enum_type));};
    78                 void  SetValue(Vec vec){_error_("DoubleMat param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
    79                 void  SetValue(Mat mat){_error_("DoubleMat param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
     78                void  SetValue(Vector* vec){_error_("DoubleMat param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
     79                void  SetValue(Matrix* mat){_error_("DoubleMat param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
    8080                void  SetValue(FILE* fid){_error_("DoubleMat param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
    8181                void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("DoubleMat param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
  • issm/trunk-jpl/src/c/objects/Params/DoubleParam.h

    r11358 r11695  
    6262                void  GetParameterValue(double** pdoublearray,int* pM, int* pN);
    6363                void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("Double param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}
    64                 void  GetParameterValue(Vec* pvec){_error_("Double param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
    65                 void  GetParameterValue(Mat* pmat){_error_("Double param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
     64                void  GetParameterValue(Vector** pvec){_error_("Double param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
     65                void  GetParameterValue(Matrix** pmat){_error_("Double param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
    6666                void  GetParameterValue(FILE** pfid){_error_("Double param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));}
    6767
     
    7575                void  SetValue(int* intarray,int M){_error_("Double param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));}
    7676                void  SetValue(int* pintarray,int M,int N){_error_("Double param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));}
    77                 void  SetValue(Vec vec){_error_("Double param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
    78                 void  SetValue(Mat mat){_error_("Double param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
     77                void  SetValue(Vector* vec){_error_("Double param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
     78                void  SetValue(Matrix* mat){_error_("Double param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
    7979                void  SetValue(FILE* fid){_error_("Double param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
    8080                void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("Double param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
  • issm/trunk-jpl/src/c/objects/Params/DoubleVecParam.h

    r11358 r11695  
    6262                void  GetParameterValue(double** pdoublearray,int* pM, int* pN);
    6363                void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("DoubleVec param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}
    64                 void  GetParameterValue(Vec* pvec){_error_("DoubleVec param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
    65                 void  GetParameterValue(Mat* pmat){_error_("DoubleVec param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
     64                void  GetParameterValue(Vector** pvec){_error_("DoubleVec param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
     65                void  GetParameterValue(Matrix** pmat){_error_("DoubleVec param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
    6666                void  GetParameterValue(FILE** pfid){_error_("DoubleVec param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));}
    6767
     
    7575                void  SetValue(int* intarray,int M){_error_("DoubleVec param of enum %i (%s) cannot hold a int mat array",enum_type,EnumToStringx(enum_type));};
    7676                void  SetValue(int* pintarray,int M,int N){_error_("DoubleVec param of enum %i (%s) cannot hold a int mat array",enum_type,EnumToStringx(enum_type));}
    77                 void  SetValue(Vec vec){_error_("DoubleVec param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
    78                 void  SetValue(Mat mat){_error_("DoubleVec param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
     77                void  SetValue(Vector* vec){_error_("DoubleVec param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
     78                void  SetValue(Matrix* mat){_error_("DoubleVec param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
    7979                void  SetValue(FILE* fid){_error_("DoubleVec param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
    8080                void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("DoubleVec param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
  • issm/trunk-jpl/src/c/objects/Params/FileParam.h

    r11358 r11695  
    6161                void  GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("FileParam of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
    6262                void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("File param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}
    63                 void  GetParameterValue(Vec* pvec){_error_("FileParam of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
    64                 void  GetParameterValue(Mat* pmat){_error_("FileParam of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
     63                void  GetParameterValue(Vector** pvec){_error_("FileParam of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
     64                void  GetParameterValue(Matrix** pmat){_error_("FileParam of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
    6565                void  GetParameterValue(FILE** pfid){*pfid=value;};
    6666
     
    7474                void  SetValue(int* intarray,int M){_error_("FileParam of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));}
    7575                void  SetValue(int* pintarray,int M,int N){_error_("FileParam of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));}
    76                 void  SetValue(Vec vec){_error_("FileParam of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
    77                 void  SetValue(Mat mat){_error_("FileParam of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
     76                void  SetValue(Vector* vec){_error_("FileParam of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
     77                void  SetValue(Matrix* mat){_error_("FileParam of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
    7878                void  SetValue(FILE* fid){_error_("File param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
    7979                void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("File param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
  • issm/trunk-jpl/src/c/objects/Params/IntMatParam.h

    r11358 r11695  
    6363                void  GetParameterValue(double** pdoublearray,int* pM,int* pN){_error_("IntMat param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));};
    6464                void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("IntMat param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}
    65                 void  GetParameterValue(Vec* pvec){_error_("IntMat param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
    66                 void  GetParameterValue(Mat* pmat){_error_("IntMat param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
     65                void  GetParameterValue(Vector** pvec){_error_("IntMat param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
     66                void  GetParameterValue(Matrix** pmat){_error_("IntMat param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
    6767                void  GetParameterValue(FILE** pfid){_error_("IntMat param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));}
    6868
     
    7676                void  SetValue(int* intarray,int M){_error_("IntMat param of enum %i (%s) cannot hold a int vec array",enum_type,EnumToStringx(enum_type));};
    7777                void  SetValue(int* intarray,int M,int N);
    78                 void  SetValue(Vec vec){_error_("IntMat param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
    79                 void  SetValue(Mat mat){_error_("IntMat param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
     78                void  SetValue(Vector* vec){_error_("IntMat param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
     79                void  SetValue(Matrix* mat){_error_("IntMat param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
    8080                void  SetValue(FILE* fid){_error_("IntMat param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
    8181                void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("IntMat param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
  • issm/trunk-jpl/src/c/objects/Params/IntParam.h

    r11358 r11695  
    6262                void  GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("Int param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
    6363                void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("Int param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}
    64                 void  GetParameterValue(Vec* pvec){_error_("Int param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
    65                 void  GetParameterValue(Mat* pmat){_error_("Int param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
     64                void  GetParameterValue(Vector** pvec){_error_("Int param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
     65                void  GetParameterValue(Matrix** pmat){_error_("Int param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
    6666                void  GetParameterValue(FILE** pfid){_error_("Int param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));}
    6767
     
    7575                void  SetValue(double* doublearray,int M){_error_("Int param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}
    7676                void  SetValue(double* pdoublearray,int M,int N){_error_("Int param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}
    77                 void  SetValue(Vec vec){_error_("Int param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
    78                 void  SetValue(Mat mat){_error_("Int param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
     77                void  SetValue(Vector* vec){_error_("Int param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
     78                void  SetValue(Matrix* mat){_error_("Int param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
    7979                void  SetValue(FILE* fid){_error_("Int param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
    8080                void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("Int param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
  • issm/trunk-jpl/src/c/objects/Params/IntVecParam.h

    r11202 r11695  
    6363                void  GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("IntVec param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
    6464                void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("IntVec param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}
    65                 void  GetParameterValue(Vec* pvec){_error_("IntVec param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
    66                 void  GetParameterValue(Mat* pmat){_error_("IntVec param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
     65                void  GetParameterValue(Vector** pvec){_error_("IntVec param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
     66                void  GetParameterValue(Matrix** pmat){_error_("IntVec param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
    6767                void  GetParameterValue(FILE** pfid){_error_("IntVec param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));}
    6868
     
    7676                void  SetValue(int* intarray,int M);
    7777                void  SetValue(int* pintarray,int M,int N){_error_("IntVec param of enum %i (%s) cannot hold a int mat array",enum_type,EnumToStringx(enum_type));}
    78                 void  SetValue(Vec vec){_error_("IntVec param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
    79                 void  SetValue(Mat mat){_error_("IntVec param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
     78                void  SetValue(Vector* vec){_error_("IntVec param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
     79                void  SetValue(Matrix* mat){_error_("IntVec param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
    8080                void  SetValue(FILE* fid){_error_("IntVec param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
    8181                void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("IntVec param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
  • issm/trunk-jpl/src/c/objects/Params/Param.h

    r11202 r11695  
    4141                virtual void  GetParameterValue(double** pdoublearray,int* pM,int* pN)=0;
    4242                virtual void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims)=0;
    43                 virtual void  GetParameterValue(Vec* pvec)=0;
    44                 virtual void  GetParameterValue(Mat* pmat)=0;
     43                virtual void  GetParameterValue(Vector** pvec)=0;
     44                virtual void  GetParameterValue(Matrix** pmat)=0;
    4545                virtual void  GetParameterValue(FILE** pfid)=0;
    4646               
     
    5454                virtual void  SetValue(int* intarray,int M)=0;
    5555                virtual void  SetValue(int* pintarray,int M,int N)=0;
    56                 virtual void  SetValue(Vec vec)=0;
    57                 virtual void  SetValue(Mat mat)=0;
     56                virtual void  SetValue(Vector* vec)=0;
     57                virtual void  SetValue(Matrix* mat)=0;
    5858                virtual void  SetValue(FILE* fid)=0;
    5959                virtual void  SetValue(double** array, int M, int* mdim_array, int* ndim_array)=0;
  • issm/trunk-jpl/src/c/objects/Params/StringArrayParam.h

    r11202 r11695  
    6464                void  GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("StringArray param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
    6565                void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("Vec param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}
    66                 void  GetParameterValue(Vec* pvec){_error_("StringArray param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
    67                 void  GetParameterValue(Mat* pmat){_error_("StringArray param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
     66                void  GetParameterValue(Vector** pvec){_error_("StringArray param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
     67                void  GetParameterValue(Matrix** pmat){_error_("StringArray param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
    6868                void  GetParameterValue(FILE** pfid){_error_("StringArray param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));}
    6969
     
    7777                void  SetValue(int* intarray,int M){_error_("StringArray param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));}
    7878                void  SetValue(int* pintarray,int M,int N){_error_("StringArray param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));}
    79                 void  SetValue(Vec vec){_error_("StringArray param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
    80                 void  SetValue(Mat mat){_error_("StringArray param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
     79                void  SetValue(Vector* vec){_error_("StringArray param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
     80                void  SetValue(Matrix* mat){_error_("StringArray param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
    8181                void  SetValue(FILE* fid){_error_("StringArray param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
    8282                void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("StringArray param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
  • issm/trunk-jpl/src/c/objects/Params/StringParam.h

    r11358 r11695  
    6262                void  GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("String param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
    6363                void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("String param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}
    64                 void  GetParameterValue(Vec* pvec){_error_("String param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
    65                 void  GetParameterValue(Mat* pmat){_error_("String param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
     64                void  GetParameterValue(Vector** pvec){_error_("String param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));}
     65                void  GetParameterValue(Matrix** pmat){_error_("String param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));}
    6666                void  GetParameterValue(FILE** pfid){_error_("Bool param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));}
    6767
     
    7575                void  SetValue(int* intarray,int M){_error_("String param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));}
    7676                void  SetValue(int* pintarray,int M,int N){_error_("String param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));}
    77                 void  SetValue(Vec vec){_error_("String param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
    78                 void  SetValue(Mat mat){_error_("String param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
     77                void  SetValue(Vector* vec){_error_("String param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));}
     78                void  SetValue(Matrix* mat){_error_("String param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));}
    7979                void  SetValue(FILE* fid){_error_("String param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));}
    8080                void  SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("String param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}
  • issm/trunk-jpl/src/c/objects/Vertex.cpp

    r11246 r11695  
    273273/*}}}*/
    274274/*FUNCTION Vertex::UpdateVertexPosition {{{1*/
    275 void  Vertex::UpdatePosition(Vec vz,Parameters* parameters,double* thickness,double* bed){
     275void  Vertex::UpdatePosition(Vector* vz,Parameters* parameters,double* thickness,double* bed){
    276276
    277277        double oldz,newz;
     
    288288
    289289        /*put vz in vector*/
    290         VecSetValue(vz,this->dof,velz,INSERT_VALUES);
    291 }
    292 /*}}}*/
     290        vz->SetValue(this->dof,velz,INS_VAL);
     291}
     292/*}}}*/
  • issm/trunk-jpl/src/c/objects/Vertex.h

    r11242 r11695  
    1010#include "./Object.h"
    1111class IoModel;
     12class Vector;
     13class Parameters;
    1214#include "../shared/Exceptions/exceptions.h"
    1315#include "../toolkits/toolkits.h"
     
    6365                int   Sid(void);
    6466                int   Connectivity(void);
    65                 void  UpdatePosition(Vec vz,Parameters* parameters,double* thickness,double* bed);
     67                void  UpdatePosition(Vector* vz,Parameters* parameters,double* thickness,double* bed);
    6668                /*}}}*/
    6769};
  • issm/trunk-jpl/src/c/objects/objects.h

    r11670 r11695  
    135135#include "./Params/FileParam.h"
    136136#include "./Params/Param.h"
    137 #include "./Params/PetscMatParam.h"
    138 #include "./Params/PetscVecParam.h"
     137#include "./Params/MatrixParam.h"
     138#include "./Params/VectorParam.h"
    139139#include "./Params/StringArrayParam.h"
    140140#include "./Params/StringParam.h"
  • issm/trunk-jpl/src/c/shared/Exp/IsInPoly.cpp

    r9320 r11695  
    1515
    1616/*IsInPoly {{{1*/
    17 int IsInPoly(Vec in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
     17int IsInPoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
    1818
    1919        int i;
     
    3737
    3838                //Get current value of value[i] -> do not change it if != 0
    39                 VecGetValues(in,1,&i,&value);
     39                in->GetValue(&value,i);
    4040                if (value){
    4141                        /*this vertex already is inside one of the contours, continue*/
     
    5151                        value=pnpoly(numvertices,xc,yc,x0,y0,edgevalue);
    5252                }
    53                 VecSetValues(in,1,&i,&value,INSERT_VALUES);
     53                in->SetValue(i,value,INS_VAL);
    5454        }
    5555         return 1;
    5656}/*}}}*/
    5757/*IsOutsidePoly {{{1*/
    58 int IsOutsidePoly(Vec in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
     58int IsOutsidePoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
    5959
    6060        int i,j;
     
    7878
    7979                //Get current value of value[i] -> do not change it if != 0
    80                 VecGetValues(in,1,&i,&value);
     80                in->GetValue(&value,i);
    8181                if (value){
    8282                        /*this vertex already is inside one of the contours, continue*/
     
    9292                        value=1-pnpoly(numvertices,xc,yc,x0,y0,edgevalue);
    9393                }
    94                 VecSetValues(in,1,&i,&value,INSERT_VALUES);
     94                in->SetValue(i,value,INS_VAL);
    9595        }
    9696        return 1;
  • issm/trunk-jpl/src/c/shared/Exp/exp.h

    r9258 r11695  
    99#include "../../toolkits/toolkits.h"
    1010
    11 int IsInPoly(Vec in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
    12 int IsOutsidePoly(Vec in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
     11int IsInPoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
     12int IsOutsidePoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
    1313int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue);
    1414int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname,bool whole);
  • issm/trunk-jpl/src/c/shared/Matlab/ModuleBoot.cpp

    r10206 r11695  
    55
    66#include "../../toolkits/toolkits.h"
     7
     8#ifdef HAVE_CONFIG_H
     9        #include <config.h>
     10#else
     11#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
     12#endif
     13
    714
    815int my_rank;
     
    1623
    1724        /*Some test for MPI_Init crash with mpich2 1.4 on larsen, just ignore*/
    18         #if _PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 1
    19         if(0){
    20                 int              mp_init = 0;
    21                 PetscErrorCode   ierr;
    22                 extern PetscBool PetscBeganMPI;
    23                 MPI_Initialized(&mp_init);
    24                 if(mp_init!=1){
    25                         MPI_Init(NULL,NULL);
    26                         PetscBeganMPI = PETSC_TRUE;
     25        #ifdef _HAVE_PETSC_
     26                #if _PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 1
     27                if(0){
     28                        int              mp_init = 0;
     29                        PetscErrorCode   ierr;
     30                        extern PetscBool PetscBeganMPI;
     31                        MPI_Initialized(&mp_init);
     32                        if(mp_init!=1){
     33                                MPI_Init(NULL,NULL);
     34                                PetscBeganMPI = PETSC_TRUE;
     35                                ierr=PetscInitializeNoArguments();CHKERRQ(ierr);
     36                        }
     37                }
     38                else if (0){
     39                        PetscErrorCode   ierr;
     40                        PetscBool flg;
     41                        ierr=PetscInitialized(&flg);CHKERRQ(ierr);
     42                        if(flg){
     43                                extern PetscBool PetscBeganMPI;
     44                                PetscBeganMPI = PETSC_FALSE;
     45                                ierr=PetscFinalize();CHKERRQ(ierr);
     46                        }
    2747                        ierr=PetscInitializeNoArguments();CHKERRQ(ierr);
    28                 }
    29         }
    30         else if (0){
    31                 PetscErrorCode   ierr;
    32                 PetscBool flg;
    33                 ierr=PetscInitialized(&flg);CHKERRQ(ierr);
    34                 if(flg){
    35                         extern PetscBool PetscBeganMPI;
    36                         PetscBeganMPI = PETSC_FALSE;
    37                         ierr=PetscFinalize();CHKERRQ(ierr);
     48                        ierr=PetscPopSignalHandler();CHKERRQ(ierr);
    3849                }
    39                 ierr=PetscInitializeNoArguments();CHKERRQ(ierr);
    40                 ierr=PetscPopSignalHandler();CHKERRQ(ierr);
    41         }
     50                #endif
     51
     52                /*Initialize Petsc: */
     53                PetscInitializeNoArguments();
    4254        #endif
    43 
    44         /*Initialize Petsc: */
    45         PetscInitializeNoArguments();
    4655
    4756        return 1;
  • issm/trunk-jpl/src/c/shared/Numerics/PetscOptionsFromAnalysis.cpp

    r9826 r11695  
    1515void PetscOptionsFromAnalysis(Parameters* parameters,int analysis_type){
    1616
    17         int     dummy;
    18         double* analyses=NULL;
    19         char**  strings=NULL;
    20         int     numanalyses;
    21         char*   string=NULL;
    22         int     found=-1;
    23         int     i;
     17        /*intermediary: */
     18        char* options=NULL;
    2419
    25         numanalyses=0;
    26         parameters->FindParam(&strings,&numanalyses,PetscOptionsStringsEnum);
    27 
    28         #ifdef _SERIAL_ //do not take this away, because ISSM loads analyses as a Double Param instead of a DoubleVec Param  when running with only 1 analysis
    29         if(numanalyses==1){ analyses=(double*)xmalloc(1*sizeof(double)); parameters->FindParam(analyses,PetscOptionsAnalysesEnum);
    30         }
    31         else parameters->FindParam(&analyses,&dummy,PetscOptionsAnalysesEnum);
    32         #else
    33         parameters->FindParam(&analyses,&dummy,PetscOptionsAnalysesEnum);
    34         #endif
    35 
    36         if(numanalyses==0)return; //we did not find petsc options, don't bother.
    37 
    38         /*ok, go through analyses and figure out if it corresponds to our analysis_type: */
    39         found=-1;
    40         for(i=0;i<numanalyses;i++){
    41                 if (analyses[i]==analysis_type){
    42                         /*found the analysis, get out of here: */
    43                         found=i;
    44                         break;
    45                 }
    46         }
    47         if(found==-1){
    48                 /*still haven't found a list of petsc options, go find the default one, for analysis type NoneAnalysisEnum: */
    49                 for(i=0;i<numanalyses;i++){
    50                         if (analyses[i]==NoneAnalysisEnum){
    51                                 /*found the default analysis, get out of here: */
    52                                 found=i;
    53                                 break;
    54                         }
    55                 }
    56         }
    57         if (found==-1){
    58                 /*ok, we did not find anything, this is not good! error out: */
    59                 _error_("%s%s","could find neither a default analysis  nor analysis ",EnumToStringx(analysis_type));
    60         }
    61 
    62         /*ok, grab the petsc option string: */
    63         string=strings[found];
     20        /*Recover first the options string for this analysis: */
     21        options=OptionsFromAnalysis(parameters,analysis_type);
    6422
    6523        /*now, reset the options database with this string. Taken from petsc/install/src/sys/objects/pinit.c. This
     
    7230        //PetscOptionsCheckInitial_Components();
    7331        PetscOptionsSetFromOptions();
    74         PetscOptionsInsertMultipleString(string); //our patch
     32        PetscOptionsInsertMultipleString(options); //our patch
    7533        #else
    7634        PetscOptionsSetFromOptions();
    7735        PetscOptionsClear();
    7836        //PetscOptionsSetFromOptions();
    79         PetscOptionsInsertMultipleString(string); //our patch
     37        PetscOptionsInsertMultipleString(options); //our patch
    8038        #endif
    8139
    82 
    83         /*Free ressources*/
    84         xfree((void**)&analyses);
    85         for(i=0;i<numanalyses;i++){
    86                 string=strings[i];
    87                 xfree((void**)&string);
    88         }
    89         xfree((void**)&strings);
    90 
     40        /*Free ressources:*/
     41        xfree((void**)&options);
    9142}
  • issm/trunk-jpl/src/c/shared/Numerics/numerics.h

    r10367 r11695  
    2727void   UnitConversion(double* values, int numvalues,int direction_enum, int type_enum);
    2828double UnitConversion(double value, int direction_enum, int type_enum);
     29char*  OptionsFromAnalysis(Parameters* parameters,int analysis_type);
     30void   XZvectorsToCoordinateSystem(double* T,double* xzvectors);
     31#ifdef _HAVE_PETSC_
    2932void   PetscOptionsFromAnalysis(Parameters* parameters,int analysis_type);
    30 void   XZvectorsToCoordinateSystem(double* T,double* xzvectors);
     33#endif
    3134
    3235#endif //ifndef _NUMERICS_H_
  • issm/trunk-jpl/src/c/solutions/convergence.cpp

    r11679 r11695  
    5252
    5353                //compute norm(KUF), norm(F) and residue
    54                 nKUF=KUF->Norm(NORM_2);
    55                 nF=pf->Norm(NORM_2);
     54                nKUF=KUF->Norm(NORM_TWO);
     55                nF=pf->Norm(NORM_TWO);
    5656                solver_residue=nKUF/nF;
    5757                _printf_(true,"\n%s%g\n","   solver residue: norm(KU-F)/norm(F)=",solver_residue);
     
    6767        KUold=uf->Duplicate(); Kff->MatMult(old_uf,KUold);
    6868        KUoldF=KUold->Duplicate();KUold->Copy(KUoldF); KUoldF->AYPX(pf,-1.0);
    69         nKUoldF=KUoldF->Norm(NORM_2);
    70         nF=pf->Norm(NORM_2);
     69        nKUoldF=KUoldF->Norm(NORM_TWO);
     70        nF=pf->Norm(NORM_TWO);
    7171        res=nKUoldF/nF;
    7272        if (isnan(res)){
     
    9494                //compute norm(du)/norm(u)
    9595                duf=old_uf->Duplicate(); old_uf->Copy(duf); duf->AYPX(uf,-1.0);
    96                 ndu=duf->Norm(NORM_2); nu=old_uf->Norm(NORM_2);
     96                ndu=duf->Norm(NORM_TWO); nu=old_uf->Norm(NORM_TWO);
    9797
    9898                if (isnan(ndu) || isnan(nu)) _error_("convergence criterion is NaN!");
     
    120120                //compute max(du)
    121121                duf=old_uf->Duplicate(); old_uf->Copy(duf); duf->AYPX(uf,-1.0);
    122                 ndu=duf->Norm(NORM_2); nduinf=duf->Norm(NORM_INFINITY);
     122                ndu=duf->Norm(NORM_TWO); nduinf=duf->Norm(NORM_INF);
    123123                if (isnan(ndu) || isnan(nu)) _error_("convergence criterion is NaN!");
    124124
  • issm/trunk-jpl/src/c/solutions/gradient_core.cpp

    r11313 r11695  
    1818        double  norm_inf;
    1919        double *norm_list    = NULL;
    20         Vec     new_gradient = NULL;
    21         Vec     gradient     = NULL;
    22         Vec     old_gradient = NULL;
     20        Vector*     new_gradient = NULL;
     21        Vector*     gradient     = NULL;
     22        Vector*     old_gradient = NULL;
    2323
    2424        /*Compute gradient*/
     
    2929                _printf_(VerboseControl(),"   orthogonalization\n");
    3030                ControlInputGetGradientx(&old_gradient,femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters);
    31                 Orthx(&new_gradient,gradient,old_gradient); VecFree(&old_gradient); VecFree(&gradient);
     31                Orthx(&new_gradient,gradient,old_gradient); xdelete(&old_gradient); xdelete(&gradient);
    3232        }
    3333        else{
     
    3636
    3737        /*Check that gradient is clean*/
    38         VecNorm(new_gradient,NORM_INFINITY,&norm_inf);
     38        norm_inf=new_gradient->Norm(NORM_INF);
    3939        if(norm_inf<=0)    _error_("||∂J/∂α||∞ = 0    gradient norm is zero");
    4040        if(isnan(norm_inf))_error_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
     
    4242        /*plug back into inputs: */
    4343        ControlInputSetGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,new_gradient);
    44         VecFree(&new_gradient);
     44        xdelete(&new_gradient);
    4545
    4646        /*Scale Gradients*/
  • issm/trunk-jpl/src/c/solutions/issm.cpp

    r11275 r11695  
    3737        double   start_core, finish_core;
    3838        double   start_init, finish_init;
     39        int      ierr;
    3940
    4041        MODULEBOOT();
     
    4445        #endif
    4546
    46         /*Initialize Petsc and get start time*/
    47         int ierr=PetscInitialize(&argc,&argv,(char*)0,""); 
     47        /*Initialize environments: Petsc, MPI, etc...: */
     48        #ifdef _HAVE_PETSC_
     49        ierr=PetscInitialize(&argc,&argv,(char*)0,""); 
    4850        if(ierr) _error_("Could not initialize Petsc");
     51        #else
     52        MPI_Init(&argc,&argv);
     53        #endif
     54
    4955        MPI_Barrier(MPI_COMM_WORLD); start=MPI_Wtime();
    5056
     
    130136        _printf_(true,"   %-34s %f seconds  \n","Core solution elapsed time:",finish_core-start_core);
    131137        _printf_(true,"\n   %s %i hrs %i min %i sec\n\n","Total elapsed time:",int((finish-start)/3600),int(int(finish-start)%3600/60),int(finish-start)%60);
     138       
     139       
    132140        _printf_(true,"closing MPI and Petsc\n");
     141        #ifdef _HAVE_PETSC_
    133142        PetscFinalize();
     143        #else
     144        MPI_Finalize();
     145        #endif
    134146       
    135147        /*end module: */
  • issm/trunk-jpl/src/c/toolkits/mpi/patches/MPI_Boundariesfromrange.cpp

    r1 r11695  
    44 */
    55
    6 #include "../../petsc/patches/petscpatches.h"
    76#include "./mpipatches.h"
    87#include "../../../shared/shared.h"
  • issm/trunk-jpl/src/c/toolkits/mpi/patches/MPI_Lowerrow.cpp

    r365 r11695  
    77 */
    88
    9 #include "../../petsc/patches/petscpatches.h"
    109#include "./mpipatches.h"
    1110
     
    1918
    2019        /*First, figure out our range : */
    21         range=PetscDetermineLocalSize(n);
     20        range=DetermineLocalSize(n);
    2221
    2322        /*Now determien upper and lower boundaries: */
  • issm/trunk-jpl/src/c/toolkits/mpi/patches/MPI_Upperrow.cpp

    r1 r11695  
    77 */
    88
    9 #include "../../petsc/patches/petscpatches.h"
    109#include "./mpipatches.h"
    1110
     
    1716
    1817        /*First, figure out our range : */
    19         range=PetscDetermineLocalSize(n);
     18        range=DetermineLocalSize(n);
    2019
    2120        /*Now determien upper and lower boundaries: */
  • issm/trunk-jpl/src/c/toolkits/mpi/patches/mpipatches.h

    r1 r11695  
    1111int MPI_Lowerrow(int n);
    1212int MPI_Upperrow(int n);
     13int DetermineLocalSize(int global_size);
    1314
    1415
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp

    r11197 r11695  
    1515
    1616#include "../../../shared/shared.h"
     17#include "../../mpi/patches/mpipatches.h"
    1718
    1819int MatPartition(Mat* poutmatrix,Mat matrixA,double* row_partition_vector,int row_partition_vector_size ,
     
    9798
    9899                /*Call MatGetSubMatrix*/
    99                 csize=PetscDetermineLocalSize(col_partition_vector_size);
     100                csize=DetermineLocalSize(col_partition_vector_size);
    100101                if(col_partition_vector_size==row_partition_vector_size){
    101102                        #if _PETSC_MAJOR_ >= 3
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/MatToSerial.cpp

    r3332 r11695  
    22 * \brief gather a Petsc Mat matrix onto cpu 0
    33 */
     4
     5#ifdef HAVE_CONFIG_H
     6        #include <config.h>
     7#else
     8#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
     9#endif
     10
    411
    512#include "../petscincludes.h"
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/NewMat.cpp

    r9826 r11695  
    1818#include "../../../shared/shared.h"
    1919#include "../../../include/include.h"
     20#include "../../mpi/patches/mpipatches.h"
    2021
    2122/*NewMat(int M,int N){{{1*/
     
    3132
    3233        /*Determine local sizes: */
    33         m=PetscDetermineLocalSize(M);
    34         n=PetscDetermineLocalSize(N);
     34        m=DetermineLocalSize(M);
     35        n=DetermineLocalSize(N);
    3536       
    3637        nnz=(int)((double)M*(double)N*sparsity); //number of non zeros.
     
    5556
    5657        /*Determine local sizes: */
    57         m=PetscDetermineLocalSize(M);
    58         n=PetscDetermineLocalSize(N);
     58        m=DetermineLocalSize(M);
     59        n=DetermineLocalSize(N);
    5960       
    6061        nnz=(int)((double)M*(double)N*sparsity); //number of non zeros.
     
    8586
    8687        /*Determine local sizes: */
    87         m=PetscDetermineLocalSize(M);
    88         n=PetscDetermineLocalSize(N);
     88        m=DetermineLocalSize(M);
     89        n=DetermineLocalSize(N);
    8990
    9091        /*Figure out number of non zeros per row: */
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/NewVec.cpp

    r9320 r11695  
    1515
    1616#include "./petscpatches.h"
     17#include "../../mpi/patches/mpipatches.h"
    1718
    1819Vec NewVec(int size,bool fromlocalsize){
     
    2930        }
    3031        else{
    31                 local_size=PetscDetermineLocalSize(size);
     32                local_size=DetermineLocalSize(size);
    3233        }
    3334       
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/VecToMPISerial.cpp

    r3595 r11695  
    22 * \brief gather a Petsc Vector spread across the cluster, onto node 0, and then broadcast to all nodes.
    33 */
     4
     5#ifdef HAVE_CONFIG_H
     6        #include <config.h>
     7#else
     8#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
     9#endif
     10
    411
    512#include "../petscincludes.h"
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/petscpatches.h

    r9291 r11695  
    1212
    1313#include "./SolverEnum.h"
     14#include "../../toolkitsenums.h"
    1415
    1516class Parameters;
     
    2122int PetscMatrixToMatlabMatrix(mxArray** pdataref,Mat matrix);
    2223int PetscVectorToMatlabVector(mxArray** pdataref,Vec vector);
    23 int MatlabMatrixToDoubleMatrix(double** pmatrix,int* pmatrix_rows,int* pmatrix_cols,const mxArray* mxmatrix);
    24 int MatlabVectorToDoubleVector(double** pvector,int* pvector_rows,const mxArray* mxvector);
    2524#endif
    2625
    27 int PetscDetermineLocalSize(int global_size);
    2826Vec NewVec(int size,bool fromlocalsize=false);
    2927Mat NewMat(int M,int N);
     
    4947void VecDuplicatePatch(Vec* output, Vec input);
    5048Vec  SerialToVec(double* vector,int vector_size);
     49InsertMode ISSMToPetscInsertMode(InsMode mode);
     50NormType ISSMToPetscNormMode(NormMode mode);
    5151
    5252#endif
  • issm/trunk-jpl/src/c/toolkits/petsc/petscincludes.h

    r9320 r11695  
    55#ifndef _PETSC_INCLUDES_H_
    66#define _PETSC_INCLUDES_H_
     7
     8#ifdef _HAVE_PETSC_
    79
    810/*Petsc includes: */
     
    1618
    1719#endif
     20#endif
  • issm/trunk-jpl/src/c/toolkits/plapack/plapackincludes.h

    r9320 r11695  
    66#define _PLA_INCLUDES_H_
    77
     8#ifdef HAVE_CONFIG_H
     9        #include <config.h>
     10#else
     11#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
     12#endif
     13
     14
    815#include "PLA.h"
    916
     
    1219
    1320/*our own patches: */
     21#ifdef _HAVE_PETSC_
    1422#include "patches/petscpatches.h"
     23#endif
    1524
    1625
  • issm/trunk-jpl/src/c/toolkits/toolkits.h

    r8901 r11695  
    66#define _TOOLKITS_H_
    77
     8#ifdef HAVE_CONFIG_H
     9        #include <config.h>
     10#else
     11#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
     12#endif
     13
     14#ifdef _HAVE_PETSC_
    815#include "./petsc/petscincludes.h"
     16#endif
     17
    918#include "./mpi/mpiincludes.h"
    1019#include "./metis/metisincludes.h"
    1120#include "./triangle/triangleincludes.h"
    1221#include "./matlab/matlabincludes.h"
     22#include "./double/double.h"
     23#include "./toolkitsenums.h"
    1324
    1425#endif
  • issm/trunk-jpl/src/mex/ComputeBasalStress/ComputeBasalStress.cpp

    r8910 r11695  
    1717
    1818        /* output datasets: */
    19         Vec sigma_g=NULL;
     19        Vector* sigma_g=NULL;
    2020
    2121        /*Boot module: */
     
    5151        delete loads;
    5252        delete parameters;
    53         VecFree(&sigma_g);
     53        xdelete(&sigma_g);
    5454
    5555        /*end module: */
  • issm/trunk-jpl/src/mex/ContourToMesh/ContourToMesh.cpp

    r8910 r11695  
    3333
    3434        /* output: */
    35         Vec  in_nod=NULL;
     35        Vector*  in_nod=NULL;
    3636        int  nods;
    37         Vec  in_elem=NULL;
     37        Vector*  in_elem=NULL;
    3838        int  nel;
    3939
  • issm/trunk-jpl/src/mex/ContourToNodes/ContourToNodes.cpp

    r8910 r11695  
    3535
    3636        /* output: */
    37         Vec  flags=NULL;
     37        Vector*  flags=NULL;
    3838        int  nods;
    3939
  • issm/trunk-jpl/src/mex/ControlInputGetGradient/ControlInputGetGradient.cpp

    r11313 r11695  
    1414        Materials  *materials  = NULL;
    1515        Parameters *parameters = NULL;
    16         Vec         gradient   = NULL;
     16        Vector*         gradient   = NULL;
    1717
    1818        /* output datasets: elements and loads*/
  • issm/trunk-jpl/src/mex/GetVectorFromInputs/GetVectorFromInputs.cpp

    r8910 r11695  
    1616        int name_enum;
    1717        int type_enum;
    18         Vec      ug=NULL;
     18        Vector*      ug=NULL;
    1919
    2020        /* output datasets: elements and loads*/
  • issm/trunk-jpl/src/mex/Gradj/Gradj.cpp

    r11313 r11695  
    1818
    1919        /* output datasets: */
    20         Vec         gradient       = NULL;
     20        Vector*         gradient       = NULL;
    2121
    2222        /*Boot module: */
     
    5454        delete materials;
    5555        delete parameters;
    56         VecFree(&gradient);
     56        xdelete(&gradient);
    5757
    5858        /*end module: */
  • issm/trunk-jpl/src/mex/InterpFromGridToMesh/InterpFromGridToMesh.cpp

    r10949 r11695  
    3737
    3838        /* output: */
    39         Vec  data_mesh=NULL;
     39        Vector*  data_mesh=NULL;
    4040
    4141        /*Boot module: */
  • issm/trunk-jpl/src/mex/InterpFromMesh2d/InterpFromMesh2d.cpp

    r8910 r11695  
    6161
    6262        /* output: */
    63         Vec  data_prime=NULL;
     63        Vector*  data_prime=NULL;
    6464
    6565        /*Boot module: */
  • issm/trunk-jpl/src/mex/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp

    r10949 r11695  
    5555
    5656        /* output: */
    57         Vec  data_prime=NULL;
     57        Vector*  data_prime=NULL;
    5858
    5959        /*Boot module: */
  • issm/trunk-jpl/src/mex/Makefile.am

    r11435 r11695  
    7676                                SurfaceArea\
    7777                                SystemMatrices\
    78                                 Test\
    7978                                TimeAdapt\
    8079                                TriaSearch\
     
    206205                          GroundinglineMigration/GroundinglineMigration.h
    207206
    208 Test_SOURCES = Test/Test.cpp\
    209                           Test/Test.h
    210 
    211207HoleFiller_SOURCES = HoleFiller/HoleFiller.cpp\
    212208                          HoleFiller/HoleFiller.h
  • issm/trunk-jpl/src/mex/Orth/Orth.cpp

    r8910 r11695  
    88
    99        /*input datasets: */
    10         Vec gradj=NULL;
    11         Vec oldgradj=NULL;
     10        Vector* gradj=NULL;
     11        Vector* oldgradj=NULL;
    1212
    1313        /* output datasets: */
    14         Vec newgradj=NULL;
     14        Vector* newgradj=NULL;
    1515
    1616        /*Boot module: */
     
    3131
    3232        /*Free ressources: */
    33         VecFree(&gradj);
    34         VecFree(&oldgradj);
    35         VecFree(&newgradj);
     33        xdelete(&gradj);
     34        xdelete(&oldgradj);
     35        xdelete(&newgradj);
    3636
    3737        /*end module: */
  • issm/trunk-jpl/src/mex/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp

    r8910 r11695  
    1717
    1818        /* output: */
    19         Vec  flags=NULL;
     19        Vector*  flags=NULL;
    2020
    2121        /*Boot module: */
  • issm/trunk-jpl/src/mex/ResetCoordinateSystem/ResetCoordinateSystem.cpp

    r10440 r11695  
    1717
    1818        /* output datasets: */
    19         Vec sigma_g=NULL;
     19        Vector* sigma_g=NULL;
    2020
    2121        /*Boot module: */
  • issm/trunk-jpl/src/mex/Solver/Solver.cpp

    r11686 r11695  
    1515        Parameters *parameters    = NULL;
    1616        int         analysis_type;
    17         char        option[100];
    18         #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)
    19         PetscTruth  flag;
    20         #else
    21         PetscBool flag;
    22         #endif
    23        
    24         /*Matlab solver: */
     17        char*       options=NULL;
     18        char*       token=NULL;
     19        char*       option=NULL;
     20
     21        /*For use of matlab solver: */
    2522        mxArray* array[2];
    2623
     24        /*Start module: */
    2725        MODULEBOOT();
    2826
     
    3432
    3533        /*In serial mode, we have not set any petsc options, do it now: */
    36         #ifdef _SERIAL_
    37         parameters->FindParam(&analysis_type,AnalysisTypeEnum);
    38         PetscOptionsFromAnalysis(parameters,analysis_type);
    39         #endif
    4034       
    41         /*Retrieve solver type: */
    42         PetscOptionsGetString(PETSC_NULL,"-ksp_type",&option[0],100,&flag);
     35        options=OptionsFromAnalysis(parameters,analysis_type);
     36        token=strstr(options,"--ksp_type");
    4337
    4438        /*Fetch rest of data only if not running the matlab solver: */
    45         if (strcmp(option,"matlab")!=0){
     39        if ((token==NULL) || (strncmp(token+10,"matlab",6)!=0)){
    4640       
    4741                /*Input datasets: */
     
    5852        }
    5953        else{
    60                 /*Matlab solver: */
     54                /*Call Matlab solver: */
    6155                if (VerboseModule()) printf("   Solving\n");
    6256                array[0]=KFF;
Note: See TracChangeset for help on using the changeset viewer.