Changeset 11695
- Timestamp:
- 03/13/12 19:59:59 (13 years ago)
- 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 175 175 double *resultstimes = NULL; 176 176 double *vector_serial= NULL; 177 Vec vector = NULL;177 Vector* vector = NULL; 178 178 bool io_gather; 179 179 bool results_as_patches; … … 225 225 else if(resultssizes[i]==P0Enum) vectorsize=numberofelements; 226 226 else _error_("Unkown result size: %s",EnumToStringx(resultssizes[i])); 227 vector= NewVec(vectorsize);227 vector=new Vector(vectorsize); 228 228 229 229 for(int j=0;j<this->Size();j++){ … … 231 231 element->GetVectorFromResults(vector,i,resultssizes[i]); 232 232 } 233 VecAssemblyBegin(vector); 234 VecAssemblyEnd(vector); 233 vector->Assemble(); 235 234 236 235 /*Serialize and add to results*/ 237 VecToMPISerial(&vector_serial,vector);236 vector_serial=vector->ToMPISerial(); 238 237 if(my_rank==0){ 239 238 /*No need to add this vector for all cpus*/ … … 242 241 243 242 /*clean up*/ 244 VecFree(&vector);243 xdelete(&vector); 245 244 xfree((void**)&vector_serial); 246 245 } -
issm/trunk-jpl/src/c/Container/Parameters.cpp
r10522 r11695 227 227 } 228 228 /*}}}*/ 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*/ 230 void Parameters::FindParam(Vector** pvec,int enum_type){ _assert_(this); 231 231 232 232 vector<Object*>::iterator object; … … 245 245 } 246 246 /*}}}*/ 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*/ 248 void Parameters::FindParam(Matrix** pmat,int enum_type){ _assert_(this); 249 249 250 250 vector<Object*>::iterator object; … … 389 389 } 390 390 /*}}}*/ 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*/ 392 void Parameters::SetParam(Vector* vector,int enum_type){ 393 393 394 394 Param* param=NULL; … … 398 398 399 399 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*/ 404 void Parameters::SetParam(Matrix* matrix,int enum_type){ 405 405 406 406 Param* param=NULL; … … 410 410 411 411 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. 413 413 } 414 414 /*}}}*/ -
issm/trunk-jpl/src/c/Container/Parameters.h
r10522 r11695 7 7 8 8 /*forward declarations */ 9 class Matrix; 10 class Vector; 9 11 class Materials; 10 12 class Parameters; … … 37 39 void FindParam(double** pdoublearray,int* pM,int* pN,int enum_type); 38 40 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); 41 43 void FindParam(FILE** pfid,int enum_type); 42 44 … … 50 52 void SetParam(int* intarray,int M,int enum_type); 51 53 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); 54 56 void SetParam(FILE* fid,int enum_type); 55 57 void UnitConversion(int direction_enum); -
issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
r11643 r11695 264 264 PentaEnum, 265 265 PentaP1InputEnum, 266 PetscMatParamEnum,267 PetscVecParamEnum,266 MatrixParamEnum, 267 VectorParamEnum, 268 268 RiftfrontEnum, 269 269 SegmentEnum, -
issm/trunk-jpl/src/c/Makefile.am
r11679 r11695 79 79 ./objects/ExternalResults/StringExternalResult.h\ 80 80 ./objects/ExternalResults/StringExternalResult.cpp\ 81 ./objects/ExternalResults/PetscVecExternalResult.h\82 ./objects/ExternalResults/PetscVecExternalResult.cpp\83 81 ./objects/Elements/Tria.h\ 84 82 ./objects/Elements/Tria.cpp\ … … 137 135 ./objects/Params/FileParam.cpp\ 138 136 ./objects/Params/FileParam.h\ 139 ./objects/Params/PetscMatParam.cpp\140 ./objects/Params/PetscMatParam.h\141 137 ./objects/Params/StringArrayParam.cpp\ 142 138 ./objects/Params/StringArrayParam.h\ … … 149 145 ./objects/Params/DoubleVecParam.cpp\ 150 146 ./objects/Params/DoubleVecParam.h\ 151 ./objects/Params/PetscVecParam.cpp\152 ./objects/Params/PetscVecParam.h\153 147 ./objects/Params/StringParam.cpp\ 154 148 ./objects/Params/StringParam.h\ 149 ./objects/Params/MatrixParam.h\ 150 ./objects/Params/MatrixParam.cpp\ 151 ./objects/Params/VectorParam.h\ 152 ./objects/Params/VectorParam.cpp\ 155 153 ./Container/Container.h\ 156 154 ./Container/Constraints.h\ … … 195 193 ./shared/Numerics/XZvectorsToCoordinateSystem.cpp\ 196 194 ./shared/Numerics/UnitConversion.cpp\ 197 ./shared/Numerics/ PetscOptionsFromAnalysis.cpp\195 ./shared/Numerics/OptionsFromAnalysis.cpp\ 198 196 ./shared/Exceptions/exceptions.h\ 199 197 ./shared/Exceptions/Exceptions.cpp\ … … 209 207 ./shared/Elements/GetNumberOfDofs.cpp\ 210 208 ./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\242 209 ./toolkits/mpi/mpiincludes.h\ 243 210 ./toolkits/mpi/patches/mpipatches.h\ 211 ./toolkits/mpi/patches/DetermineLocalSize.cpp\ 244 212 ./toolkits/mpi/patches/MPI_Upperrow.cpp\ 245 213 ./toolkits/mpi/patches/MPI_Lowerrow.cpp\ … … 249 217 ./toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp\ 250 218 ./toolkits/triangle/triangleincludes.h\ 219 ./toolkitsenums.h\ 251 220 ./toolkits.h\ 252 221 ./io/io.h\ … … 268 237 ./modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp\ 269 238 ./modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp\ 270 ./modules/ParsePetscOptionsx/ParsePetscOptionsx.h\271 ./modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp\272 239 ./modules/NodesDofx/NodesDofx.h\ 273 240 ./modules/NodesDofx/NodesDofx.cpp\ … … 344 311 ./modules/ResetCoordinateSystemx/ResetCoordinateSystemx.cpp\ 345 312 ./modules/Solverx/Solverx.cpp\ 346 ./modules/Solverx/SolverxPetsc.cpp\347 313 ./modules/Solverx/Solverx.h\ 348 ./modules/Solverx/DofTypesToIndexSet.cpp\349 314 ./modules/VecMergex/VecMergex.cpp\ 350 315 ./modules/VecMergex/VecMergex.h\ … … 731 696 ./toolkits/matlab/MatlabMatrixToMatrix.cpp\ 732 697 ./toolkits/matlab/MatlabVectorToVector.cpp\ 698 ./toolkits/double/MatlabVectorToDoubleVector.cpp\ 699 ./toolkits/double/double.h\ 700 ./toolkits/double/MatlabMatrixToDoubleMatrix.cpp\ 733 701 ./io/Matlab/matlabio.h\ 734 702 ./io/Matlab/WriteMatlabData.cpp\ 735 703 ./io/Matlab/FetchMatlabData.cpp\ 736 704 ./io/Matlab/OptionParse.cpp 705 #}}} 706 #Petsc sources {{{1 707 petsc_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 737 743 #}}} 738 744 #Serialsources {{{1 … … 835 841 endif 836 842 843 if PETSC 844 issm_sources += $(petsc_sources) 845 issm_psources += $(petsc_psources) 846 endif 847 837 848 if TRANSIENT 838 849 issm_sources += $(transient_sources) … … 898 909 899 910 #ISSM serial library {{{1 911 if SERIAL 900 912 libISSM_a_SOURCES = $(issm_sources) 901 913 libISSM_a_SOURCES += $(serial_sources) … … 910 922 libISSM_a_CXXFLAGS += -DMX_COMPAT_32 911 923 endif 924 endif 912 925 #}}} 913 926 #ISSM parallel library {{{1 927 if PARALLEL 914 928 libpISSM_a_SOURCES = $(issm_sources) 915 929 libpISSM_a_SOURCES += $(issm_psources) 916 930 libpISSM_a_CXXFLAGS = -fPIC -D_PARALLEL_ -D_C_ $(CXXFLAGS) $(CXXOPTFLAGS) 931 endif 917 932 #}}} 918 933 #Overload library, to overload any non-standard symbols. {{{1 -
issm/trunk-jpl/src/c/io/Matlab/FetchMatlabData.cpp
r11675 r11695 276 276 } 277 277 /*}}}*/ 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 /*}}}*/305 278 /*FUNCTION FetchMatlabData(Matrix** pmatrix,const mxArray* dataref){{{1*/ 306 279 void FetchMatlabData(Matrix** pmatrix,const mxArray* dataref){ … … 451 424 *pvector=outvector; 452 425 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;477 426 } 478 427 /*}}}*/ -
issm/trunk-jpl/src/c/io/Matlab/WriteMatlabData.cpp
r11670 r11695 41 41 } 42 42 /*}}}*/ 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 /*}}}*/60 43 /*FUNCTION WriteMatlabData(mxArray** pdataref,Matrix* matrix){{{1*/ 61 44 void WriteMatlabData(mxArray** pdataref,Matrix* matrix){ … … 123 106 } 124 107 *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 142 108 } 143 109 /*}}}*/ -
issm/trunk-jpl/src/c/io/Matlab/matlabio.h
r11670 r11695 16 16 #include <mex.h> 17 17 void WriteMatlabData(mxArray** pdataref,DataSet* dataset); 18 void WriteMatlabData(mxArray** pdataref,Mat matrix);19 18 void WriteMatlabData(mxArray** pdataref,Matrix* matrix); 20 19 void WriteMatlabData(mxArray** pdataref,double* matrix, int M,int N); 21 20 void WriteMatlabData(mxArray** pdataref,int* matrix, int M,int N); 22 void WriteMatlabData(mxArray** pdataref,Vec vector);23 21 void WriteMatlabData(mxArray** pdataref,Vector* vector); 24 22 void WriteMatlabData(mxArray** pdataref,double* vector, int M); … … 35 33 void FetchMatlabData(bool** pmatrix,int* pM,int *pN,const mxArray* dataref); 36 34 void FetchMatlabData(bool** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref); 37 void FetchMatlabData(Mat* pmatrix,const mxArray* dataref);38 35 void FetchMatlabData(Matrix** pmatrix,const mxArray* dataref); 39 36 void FetchMatlabData(int** pvector,int* pM,const mxArray* dataref); … … 41 38 void FetchMatlabData(double** pvector,int* pM,const mxArray* dataref); 42 39 void FetchMatlabData(bool** pvector,int* pM,const mxArray* dataref); 43 void FetchMatlabData(Vec* pvector,const mxArray* dataref);44 40 void FetchMatlabData(Vector** pvector,const mxArray* dataref); 45 41 void FetchMatlabData(char** pstring,const mxArray* dataref); -
issm/trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp
r9650 r11695 29 29 30 30 /*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; 34 34 double* average=NULL; 35 35 … … 44 44 45 45 /*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); 49 49 50 50 /*loop on each element, and add contribution of the element to the partition (surface weighted average): */ … … 55 55 56 56 /*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(); 62 59 63 60 /*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); 65 62 66 63 /*serialize:*/ 67 VecToMPISerial(&average,vec_average);64 average=vec_average->ToMPISerial(); 68 65 69 66 /*Free ressources:*/ 70 67 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); 74 71 75 72 /*Assign output pointers:*/ -
issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp
r9725 r11695 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void ComputeBasalStressx( Vec * psigma,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){12 void ComputeBasalStressx( Vector** psigma,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){ 13 13 14 14 /*Intermediary*/ … … 19 19 20 20 /*output: */ 21 Vec sigma=NULL;21 Vector* sigma=NULL; 22 22 23 23 /*Recover numberofelements: */ … … 25 25 26 26 /*Allocate sigma on numberofelements: */ 27 sigma= NewVec((int)numberofelements);27 sigma=new Vector((int)numberofelements); 28 28 29 29 /*Compute basal stress for each element: */ … … 34 34 35 35 /*Assemble vector: */ 36 VecAssemblyBegin(sigma); 37 VecAssemblyEnd(sigma); 36 sigma->Assemble(); 38 37 39 38 /*Assign output pointers: */ -
issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.h
r4405 r11695 10 10 11 11 /* local prototypes: */ 12 void ComputeBasalStressx( Vec * pp_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters);12 void ComputeBasalStressx( Vector** pp_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters); 13 13 14 14 #endif /* _COMPUTEBASALSTRESSX_H */ -
issm/trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.cpp
r9725 r11695 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void ComputeStrainRatex( Vec * peps,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){12 void ComputeStrainRatex( Vector** peps,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){ 13 13 14 14 /*Intermediary*/ … … 19 19 20 20 /*output: */ 21 Vec eps=NULL;21 Vector* eps=NULL; 22 22 23 23 /*Recover numberofelements: */ … … 25 25 26 26 /*Allocate eps on numberofelements (only 1 dof): */ 27 eps= NewVec(numberofelements);27 eps=new Vector(numberofelements); 28 28 29 29 /*Compute basal stress for each element: */ … … 34 34 35 35 /*Assemble vector: */ 36 VecAssemblyBegin(eps); 37 VecAssemblyEnd(eps); 36 eps->Assemble(); 38 37 39 38 /*Assign output pointers: */ -
issm/trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.h
r4405 r11695 10 10 11 11 /* local prototypes: */ 12 void ComputeStrainRatex(Vec * eps_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters);12 void ComputeStrainRatex(Vector** eps_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters); 13 13 14 14 #endif /* _COMPUTESTRAINRATEX_H */ -
issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp
r9320 r11695 11 11 #include "./ContourToMeshx.h" 12 12 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) {13 int 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) { 14 14 15 15 int noerr=1; … … 30 30 31 31 /*output: */ 32 Vec in_nod=NULL;33 Vec in_elem=NULL;32 Vector* in_nod=NULL; 33 Vector* in_elem=NULL; 34 34 35 in_nod= NewVec(nods);36 in_elem= NewVec(nel);35 in_nod=new Vector(nods); 36 in_elem=new Vector(nel); 37 37 38 38 /*initialize thread parameters: */ … … 49 49 50 50 /*Assemble in_nod: */ 51 VecAssemblyBegin(in_nod); 52 VecAssemblyEnd(in_nod); 51 in_nod->Assemble(); 53 52 54 53 /*Get in_nod serialised for next operation: */ 55 VecToMPISerial(&in_nod_serial,in_nod);54 in_nod_serial=in_nod->ToMPISerial(); 56 55 57 56 /*Take care of the case where an element interpolation has been requested: */ … … 59 58 for (n=0;n<nel;n++){ 60 59 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); 62 61 } 63 62 } … … 65 64 66 65 /*Assemble vectors: */ 67 VecAssemblyBegin(in_elem); 68 VecAssemblyEnd(in_elem); 66 in_elem->Assemble(); 69 67 70 68 /*Assign output pointers: */ -
issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h
r3913 r11695 17 17 int nods; 18 18 int edgevalue; 19 Vec in_nod;19 Vector* in_nod; 20 20 double* x; 21 21 double* y; … … 25 25 26 26 /* 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);27 int 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); 28 28 29 29 void* ContourToMeshxt(void* vContourToMeshxThreadStruct); -
issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp
r11401 r11695 39 39 double* x=NULL; 40 40 double* y=NULL; 41 Vec in_nod=NULL;41 Vector* in_nod=NULL; 42 42 43 43 -
issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp
r11401 r11695 4 4 #include "./ContourToNodesx.h" 5 5 6 int ContourToNodesx( Vec * pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue){6 int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue){ 7 7 8 8 int i; … … 17 17 18 18 /*output: */ 19 Vec flags=NULL;19 Vector* flags=NULL; 20 20 21 flags= NewVec(nods);21 flags=new Vector(nods); 22 22 23 23 /*Loop through all contours: */ … … 31 31 32 32 /*Assemble vector: */ 33 VecAssemblyBegin(flags); 34 VecAssemblyEnd(flags); 33 flags->Assemble(); 35 34 36 35 /*Assign output pointers: */ -
issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h
r3913 r11695 11 11 12 12 /* local prototypes: */ 13 int ContourToNodesx( Vec * pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue);13 int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue); 14 14 15 15 #endif /* _CONTOURTONODESX_H */ -
issm/trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp
r11313 r11695 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void ControlInputGetGradientx( Vec * pgradient, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){11 void ControlInputGetGradientx( Vector** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){ 12 12 13 13 /*Intermediaries*/ 14 14 int num_controls; 15 15 int *control_type = NULL; 16 Vec gradient=NULL;16 Vector* gradient=NULL; 17 17 18 18 /*Retrieve some parameters*/ … … 21 21 22 22 /*Allocate and populate gradient*/ 23 gradient= NewVec(num_controls*vertices->NumberOfVertices());23 gradient=new Vector(num_controls*vertices->NumberOfVertices()); 24 24 25 25 for(int i=0;i<num_controls;i++){ … … 30 30 } 31 31 32 VecAssemblyBegin(gradient); 33 VecAssemblyEnd(gradient); 32 gradient->Assemble(); 34 33 35 34 /*Clean up and return*/ -
issm/trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h
r11313 r11695 8 8 #include "../../Container/Container.h" 9 9 10 void ControlInputGetGradientx( Vec * pgradient, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters);10 void ControlInputGetGradientx( Vector** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters); 11 11 12 12 #endif -
issm/trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp
r11313 r11695 30 30 31 31 } 32 void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vec gradient){32 void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* gradient){ 33 33 34 34 /*Serialize gradient*/ 35 35 double* serial_gradient=NULL; 36 VecToMPISerial(&serial_gradient,gradient);36 serial_gradient=gradient->ToMPISerial(); 37 37 38 38 ControlInputSetGradientx(elements,nodes,vertices, loads, materials, parameters,serial_gradient); -
issm/trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h
r11313 r11695 9 9 10 10 void 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);11 void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector* gradient); 12 12 13 13 #endif -
issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
r11509 r11695 260 260 case PentaEnum : return "Penta"; 261 261 case PentaP1InputEnum : return "PentaP1Input"; 262 case PetscMatParamEnum : return "PetscMatParam";263 case PetscVecParamEnum : return "PetscVecParam";262 case MatrixParamEnum : return "MatrixParam"; 263 case VectorParamEnum : return "VectorParam"; 264 264 case RiftfrontEnum : return "Riftfront"; 265 265 case SegmentEnum : return "Segment"; -
issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp
r11318 r11695 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void GetVectorFromControlInputsx(Vec * pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,const char* data){11 void GetVectorFromControlInputsx(Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,const char* data){ 12 12 13 13 int num_controls; 14 14 int *control_type = NULL; 15 Vec vector=NULL;15 Vector* vector=NULL; 16 16 17 17 /*Retrieve some parameters*/ … … 20 20 21 21 /*Allocate and populate gradient*/ 22 vector= NewVec(num_controls*vertices->NumberOfVertices());22 vector=new Vector(num_controls*vertices->NumberOfVertices()); 23 23 24 24 for(int i=0;i<num_controls;i++){ … … 29 29 } 30 30 31 VecAssemblyBegin(vector); 32 VecAssemblyEnd(vector); 31 vector->Assemble(); 33 32 34 33 /*Assign output pointers:*/ … … 43 42 44 43 /*intermediary: */ 45 Vec vec_vector=NULL;44 Vector* vec_vector=NULL; 46 45 47 46 GetVectorFromControlInputsx( &vec_vector, elements,nodes, vertices, loads, materials, parameters,data); 48 VecToMPISerial(&vector,vec_vector);47 vector=vec_vector->ToMPISerial(); 49 48 50 49 /*Free ressources:*/ 51 VecFree(&vec_vector);50 xdelete(&vec_vector); 52 51 53 52 /*Assign output pointers:*/ -
issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h
r11318 r11695 9 9 10 10 /* local prototypes: */ 11 void GetVectorFromControlInputsx( Vec * pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,const char* data="value");11 void GetVectorFromControlInputsx( Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,const char* data="value"); 12 12 void GetVectorFromControlInputsx( double** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,const char* data="value"); 13 13 -
issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp
r11317 r11695 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void GetVectorFromInputsx( Vec * pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name, int type){11 void GetVectorFromInputsx( Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name, int type){ 12 12 13 13 int i; 14 Vec vector=NULL;14 Vector* vector=NULL; 15 15 16 16 if(type==VertexEnum){ 17 17 18 18 /*Allocate vector*/ 19 vector= NewVec(vertices->NumberOfVertices());19 vector=new Vector(vertices->NumberOfVertices()); 20 20 21 21 /*Look up in elements*/ … … 35 35 } 36 36 37 VecAssemblyBegin(vector); 38 VecAssemblyEnd(vector); 37 vector->Assemble(); 39 38 40 39 /*Assign output pointers:*/ … … 48 47 49 48 /*intermediary: */ 50 Vec vec_vector=NULL;49 Vector* vec_vector=NULL; 51 50 52 51 GetVectorFromInputsx( &vec_vector, elements,nodes, vertices, loads, materials, parameters, name, type); 53 VecToMPISerial(&vector,vec_vector);52 vector=vec_vector->ToMPISerial(); 54 53 55 54 /*Free ressources:*/ 56 VecFree(&vec_vector);55 xdelete(&vec_vector); 57 56 58 57 /*Assign output pointers:*/ -
issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h
r7177 r11695 9 9 10 10 /* local prototypes: */ 11 void GetVectorFromInputsx( Vec * pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,int name,int type);11 void GetVectorFromInputsx( Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,int name,int type); 12 12 void GetVectorFromInputsx( double** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,int name,int type); 13 13 -
issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp
r11317 r11695 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void Gradjx(Vec * pgradient,double** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){12 void Gradjx(Vector** pgradient,double** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){ 13 13 14 14 int i,j,numberofvertices; … … 17 17 double *norm_list = NULL; 18 18 int *control_type = NULL; 19 Vec gradient = NULL;20 Vec *gradient_list = NULL;19 Vector* gradient = NULL; 20 Vector* *gradient_list = NULL; 21 21 22 22 /*retrieve some parameters: */ … … 26 26 27 27 /*Allocate gradient_list */ 28 gradient_list = (Vec *)xmalloc(num_controls*sizeof(Vec));28 gradient_list = (Vector**)xmalloc(num_controls*sizeof(Vector*)); 29 29 norm_list = (double*)xmalloc(num_controls*sizeof(double)); 30 30 for(i=0;i<num_controls;i++){ 31 gradient_list[i]= NewVec(num_controls*numberofvertices);31 gradient_list[i]=new Vector(num_controls*numberofvertices); 32 32 } 33 gradient= NewVec(num_controls*numberofvertices);33 gradient=new Vector(num_controls*numberofvertices); 34 34 35 35 /*Compute all gradient_list*/ … … 41 41 } 42 42 43 VecAssemblyBegin(gradient_list[i]); 44 VecAssemblyEnd(gradient_list[i]); 43 gradient_list[i]->Assemble(); 45 44 46 VecNorm(gradient_list[i],NORM_INFINITY,&norm_list[i]);45 norm_list[i]=gradient_list[i]->Norm(NORM_INF); 47 46 } 48 47 49 48 /*Add all gradient_list together*/ 50 49 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]); 53 52 } 54 53 55 54 /*Check that gradient is clean*/ 56 VecNorm(gradient,NORM_INFINITY,&norm_inf);55 norm_inf=gradient->Norm(NORM_INF); 57 56 if(norm_inf<=0) _error_("||∂J/∂α||∞ = 0 gradient norm is zero"); 58 57 if(isnan(norm_inf))_error_("||∂J/∂α||∞ = NaN gradient norm is NaN"); -
issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.h
r11313 r11695 10 10 11 11 /* local prototypes: */ 12 void Gradjx(Vec * pgrad_g,double** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters);12 void Gradjx(Vector** pgrad_g,double** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters); 13 13 14 14 #endif /* _GRADJX_H */ -
issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
r10400 r11695 17 17 double* vertices_ungrounding = NULL; 18 18 double* old_floatingice = NULL; 19 Vec vec_old_floatingice = NULL;19 Vector* vec_old_floatingice = NULL; 20 20 Element* element = NULL; 21 21 … … 39 39 /*Create vector with vertices initially floating and serialize*/ 40 40 vec_old_floatingice=CreateNodesOnFloatingIce(nodes,analysis_type); 41 VecToMPISerial(&old_floatingice,vec_old_floatingice);41 old_floatingice=vec_old_floatingice->ToMPISerial(); 42 42 43 43 /*Migrate grounding line : */ … … 48 48 49 49 /*free ressouces: */ 50 VecFree(&vec_old_floatingice);50 xdelete(&vec_old_floatingice); 51 51 xfree((void**)&vertices_potentially_ungrounding); 52 52 xfree((void**)&vertices_ungrounding); … … 55 55 56 56 /*FUNCTION CreateNodesOnFloatingIce {{{1*/ 57 Vec CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){57 Vector* CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){ 58 58 59 59 int i,numnods; 60 Vec vec_nodes_on_floatingice = NULL;60 Vector* vec_nodes_on_floatingice = NULL; 61 61 Node *node = NULL; 62 62 63 63 /*First, initialize nodes_on_floatingice, which will track which nodes have changed status: */ 64 64 numnods=nodes->NumberOfNodes(configuration_type); 65 vec_nodes_on_floatingice= NewVec(numnods);65 vec_nodes_on_floatingice=new Vector(numnods); 66 66 67 67 /*Loop through nodes, and fill vec_nodes_on_floatingice: */ … … 70 70 if(node->InAnalysis(configuration_type)){ 71 71 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); 73 73 } 74 74 } … … 76 76 77 77 /*Assemble vector: */ 78 VecAssemblyBegin(vec_nodes_on_floatingice); 79 VecAssemblyEnd(vec_nodes_on_floatingice); 78 vec_nodes_on_floatingice->Assemble(); 80 79 81 80 return vec_nodes_on_floatingice; … … 87 86 int i,numberofvertices; 88 87 double* vertices_potentially_ungrounding = NULL; 89 Vec vec_vertices_potentially_ungrounding = NULL;88 Vector* vec_vertices_potentially_ungrounding = NULL; 90 89 Element* element = NULL; 91 90 92 91 /*Initialize vector with number of vertices*/ 93 92 numberofvertices=vertices->NumberOfVertices(); 94 vec_vertices_potentially_ungrounding= NewVec(numberofvertices); //grounded vertex that could start floating93 vec_vertices_potentially_ungrounding=new Vector(numberofvertices); //grounded vertex that could start floating 95 94 96 95 /*Fill vector vertices_potentially_floating: */ … … 101 100 102 101 /*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(); 106 104 107 105 /*free ressouces and return: */ 108 VecFree(&vec_vertices_potentially_ungrounding);106 xdelete(&vec_vertices_potentially_ungrounding); 109 107 return vertices_potentially_ungrounding; 110 108 } … … 118 116 double* nodes_on_floatingice = NULL; 119 117 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; 122 120 Node* node = NULL; 123 121 Element* element = NULL; … … 130 128 /*recover vec_nodes_on_floatingice*/ 131 129 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(); 133 131 134 132 nflipped=1; //bootstrap … … 136 134 137 135 /*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); 139 137 140 138 /*Figure out if any of the nodes of the element will be floating -> elements neighbouting the floating ice*/ 141 139 for(i=0;i<elements->Size();i++){ 142 140 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); 144 142 } 145 143 146 144 /*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(); 150 147 151 148 /*Go through elements_neighboring_floatingce, and update vector of the nodes that will start floating*/ … … 157 154 } 158 155 } 159 VecAssemblyBegin(vec_nodes_on_floatingice); 160 VecAssemblyEnd(vec_nodes_on_floatingice); 156 vec_nodes_on_floatingice->Assemble(); 161 157 162 158 MPI_Allreduce(&local_nflipped,&nflipped,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD); … … 168 164 169 165 /*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(); 172 168 } 173 169 174 170 /*Free ressources:*/ 175 VecFree(&vec_nodes_on_floatingice);171 xdelete(&vec_nodes_on_floatingice); 176 172 xfree((void**)&elements_neighboring_floatingce); 177 173 -
issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h
r10400 r11695 14 14 void GroundinglineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters); 15 15 16 Vec CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type);16 Vector* CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type); 17 17 double* PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters); 18 18 double* PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding); -
issm/trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.cpp
r7177 r11695 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vec vector, int name, int type){11 void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* vector, int name, int type){ 12 12 13 13 double* serial_vector=NULL; 14 14 15 VecToMPISerial(&serial_vector,vector);15 serial_vector=vector->ToMPISerial(); 16 16 17 17 InputUpdateFromVectorDakotax( elements,nodes, vertices, loads, materials, parameters,serial_vector,name, type); -
issm/trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h
r7177 r11695 10 10 11 11 /* local prototypes: */ 12 void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vec vector, int name,int type);12 void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector* vector, int name,int type); 13 13 void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,double* vector, int name,int type); 14 14 void 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 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vec vector, int name, int type){11 void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* vector, int name, int type){ 12 12 13 13 double* serial_vector=NULL; 14 14 15 VecToMPISerial(&serial_vector,vector);15 serial_vector=vector->ToMPISerial(); 16 16 17 17 InputUpdateFromVectorx( elements,nodes, vertices, loads, materials, parameters,serial_vector,name, type); -
issm/trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h
r7177 r11695 10 10 11 11 /* local prototypes: */ 12 void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vec vector, int name,int type);12 void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector* vector, int name,int type); 13 13 void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,double* vector, int name,int type); 14 14 void 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 16 16 17 17 /*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){18 int 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){ 19 19 20 20 /*output: */ 21 Vec data_mesh=NULL;21 Vector* data_mesh=NULL; 22 22 23 23 /*Intermediary*/ … … 46 46 47 47 /*Allocate output vector: */ 48 data_mesh= NewVec(nods);48 data_mesh=new Vector(nods); 49 49 50 50 /*Find out what kind of coordinates (x_in,y_in) have been given is input*/ … … 124 124 double *y = gate->y; 125 125 int nods = gate->nods; 126 Vec data_mesh = gate->data_mesh;126 Vector* data_mesh = gate->data_mesh; 127 127 double *data = gate->data; 128 128 double default_value = gate->default_value; … … 179 179 } 180 180 181 VecSetValue(data_mesh,i,data_value,INSERT_VALUES);181 data_mesh->SetValue(i,data_value,INS_VAL); 182 182 } 183 183 }/*}}}*/ -
issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h
r7447 r11695 23 23 double* x_mesh; 24 24 double* y_mesh; 25 Vec data_mesh;25 Vector* data_mesh; 26 26 } InterpFromGridToMeshxThreadStruct; 27 27 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);28 int 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); 29 29 void* InterpFromGridToMeshxt(void* vInterpFromGridToMeshxThreadStruct); 30 30 bool 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 10 10 #include "../modules.h" 11 11 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,12 int 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, 13 13 double* default_values,int num_default_values,Contour** contours,int numcontours){ 14 14 15 15 16 16 /*Output*/ 17 Vec data_prime=NULL;17 Vector* data_prime=NULL; 18 18 19 19 /*Intermediary*/ … … 28 28 29 29 /*contours: */ 30 Vec vec_incontour=NULL;30 Vector* vec_incontour=NULL; 31 31 double* incontour=NULL; 32 32 … … 72 72 73 73 /*Initialize output*/ 74 data_prime= NewVec(nods_prime);74 data_prime=new Vector(nods_prime); 75 75 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); 78 78 } 79 79 … … 81 81 if(numcontours){ 82 82 ContourToNodesx( &vec_incontour,x_prime,y_prime,nods_prime,contours,numcontours,1); 83 VecToMPISerial(&incontour,vec_incontour);83 incontour=vec_incontour->ToMPISerial(); 84 84 } 85 85 else{ -
issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h
r7145 r11695 23 23 double ymin,ymax; 24 24 int nods_prime; 25 Vec data_prime;25 Vector* data_prime; 26 26 double* x_prime; 27 27 double* y_prime; … … 33 33 } InterpFromMesh2dxThreadStruct; 34 34 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,35 int 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, 36 36 double* default_values,int num_default_values,Contour** contours,int numcontours); 37 37 -
issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp
r11401 r11695 24 24 double ymin,ymax; 25 25 int nods_prime; 26 Vec data_prime=NULL;26 Vector* data_prime=NULL; 27 27 double* x_prime=NULL; 28 28 double* y_prime=NULL; … … 120 120 121 121 /*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); 123 123 } 124 124 } -
issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
r6412 r11695 32 32 33 33 /*default values: */ 34 Vec vec_incontour=NULL;34 Vector* vec_incontour=NULL; 35 35 double* incontour=NULL; 36 36 bool skip_bamg=false; … … 51 51 if(num_default_values){ 52 52 ContourToNodesx( &vec_incontour,x_interp,y_interp,nods_interp,contours,numcontours,1); 53 VecToMPISerial(&incontour,vec_incontour);53 incontour=vec_incontour->ToMPISerial(); 54 54 } 55 55 -
issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp
r6412 r11695 7 7 #include "../../include/include.h" 8 8 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) {9 int 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) { 10 10 11 11 /*Output*/ 12 Vec data_prime=NULL;12 Vector* data_prime=NULL; 13 13 14 14 /*Intermediary*/ … … 54 54 55 55 /*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); 58 58 59 59 /*Loop over the elements*/ … … 127 127 128 128 /*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); 130 130 } 131 131 } -
issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h
r3913 r11695 8 8 #include "../../toolkits/toolkits.h" 9 9 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);10 int 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); 11 11 12 12 #endif /* _INTERPFROMMESHTOMESH3DX_H */ -
issm/trunk-jpl/src/c/modules/Orthx/Orthx.cpp
r7907 r11695 5 5 #include "./Orthx.h" 6 6 7 void Orthx( Vec * pnewgradj, Vec gradj, Vecoldgradj){7 void Orthx( Vector** pnewgradj, Vector* gradj, Vector* oldgradj){ 8 8 9 9 /*output: */ 10 Vec newgradj=NULL;10 Vector* newgradj=NULL; 11 11 12 12 /*intermediary:*/ … … 14 14 15 15 /*Initialize output*/ 16 VecDuplicate(gradj,&newgradj);17 VecCopy(gradj,newgradj);16 newgradj=gradj->Duplicate(); 17 gradj->Copy(newgradj); 18 18 19 19 /*rough orthagonalization 20 20 gradient=gradient-(gradient'*oldgradient)*oldgradient /norm(oldgradient)^2; */ 21 21 if(oldgradj){ 22 VecNorm(oldgradj,NORM_2,&norm_old);22 norm_old=oldgradj->Norm(NORM_TWO); 23 23 _assert_(norm_old!=0); 24 VecDot(newgradj,oldgradj,&dot_product);24 dot_product=newgradj->Dot(oldgradj); 25 25 _assert_(dot_product!=NAN); 26 VecAXPY(newgradj, -dot_product/pow(norm_old,2), oldgradj);26 newgradj->AXPY(oldgradj,-dot_product/pow(norm_old,2)); 27 27 } 28 28 -
issm/trunk-jpl/src/c/modules/Orthx/Orthx.h
r3913 r11695 11 11 12 12 /* local prototypes: */ 13 void Orthx( Vec * pnewgradj, Vec gradj, Vecoldgradj);13 void Orthx( Vector** pnewgradj, Vector* gradj, Vector* oldgradj); 14 14 15 15 #endif /* _ORTHX_H */ -
issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp
r11401 r11695 4 4 #include "./PointCloudFindNeighborsx.h" 5 5 6 int PointCloudFindNeighborsx( Vec * pflags,double* x, double* y, int nods, double mindistance,double multithread){6 int PointCloudFindNeighborsx( Vector** pflags,double* x, double* y, int nods, double mindistance,double multithread){ 7 7 8 8 /*output: */ 9 Vec flags=NULL;10 flags= NewVec(nods);9 Vector* flags=NULL; 10 flags=new Vector(nods); 11 11 12 12 /*threading: */ … … 31 31 32 32 /*Assemble vector: */ 33 VecAssemblyBegin(flags); 34 VecAssemblyEnd(flags); 33 flags->Assemble(); 35 34 36 35 /*Assign output pointers: */ -
issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h
r7640 r11695 11 11 12 12 /* local prototypes: */ 13 int PointCloudFindNeighborsx( Vec * pflags,double* x, double* y, int nods, double mindistance,double multithread);13 int PointCloudFindNeighborsx( Vector** pflags,double* x, double* y, int nods, double mindistance,double multithread); 14 14 15 15 /*threading: */ … … 20 20 int nods; 21 21 double mindistance; 22 Vec flags;22 Vector* flags; 23 23 24 24 -
issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp
r11401 r11695 17 17 int nods; 18 18 double mindistance; 19 Vec flags;19 Vector* flags; 20 20 21 21 /*recover handle and gate: */ … … 62 62 63 63 /*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); 66 66 already[i]=true; 67 67 already[j]=true; -
issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp
r11317 r11695 28 28 } 29 29 30 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vec vector){30 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* vector){ 31 31 32 32 double* serial_vector=NULL; 33 33 34 VecToMPISerial(&serial_vector,vector);34 serial_vector=vector->ToMPISerial(); 35 35 36 36 SetControlInputsFromVectorx(elements,nodes, vertices, loads, materials, parameters,serial_vector); -
issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h
r11317 r11695 9 9 10 10 /* local prototypes: */ 11 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vec vector);11 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector* vector); 12 12 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,double* vector); 13 13 -
issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp
r11687 r11695 20 20 uf=new Vector(); 21 21 22 /*Intermediary: */ 23 int analysis_type; 24 22 25 #ifdef _HAVE_PETSC_ 23 26 Vec uf0_vector = NULL; … … 26 29 if(df) df_vector = df->vector; 27 30 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); 29 38 VecGetSize(uf->vector,&uf->M); 30 39 #else -
issm/trunk-jpl/src/c/modules/Solverx/Solverx.h
r11679 r11695 6 6 #define _SOLVERX_H 7 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 8 14 #include "../../objects/objects.h" 9 15 10 16 /* local prototypes: */ 11 17 void Solverx(Vector** puf, Matrix* Kff, Vector* pf, Vector* uf0,Vector* df, Parameters* parameters); 18 19 #ifdef _HAVE_PETSC_ 12 20 void SolverxPetsc(Vec* puf, Mat Kff, Vec pf, Vec uf0,Vec df, Parameters* parameters); 13 21 void DofTypesToIndexSet(IS* pisv, IS* pisp, Vec df,int typeenum); 22 #endif 23 14 24 #endif /* _SOLVERX_H */ 15 25 -
issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
r11509 r11695 267 267 else if (strcmp(name,"Penta")==0) return PentaEnum; 268 268 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; 271 271 else if (strcmp(name,"Riftfront")==0) return RiftfrontEnum; 272 272 else if (strcmp(name,"Segment")==0) return SegmentEnum; -
issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
r11691 r11695 90 90 91 91 /*Now, figure out maximum value of K_gg, so that we can penalize it correctly: */ 92 kmax=Kff->Norm(NORM_INF INITY);92 kmax=Kff->Norm(NORM_INF); 93 93 94 94 /*Now, deal with penalties*/ -
issm/trunk-jpl/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp
r11245 r11695 13 13 14 14 int i; 15 Vec vz = NULL;15 Vector* vz = NULL; 16 16 Vertex *vertex = NULL; 17 17 double *thickness = NULL; … … 23 23 24 24 /*Allocate vector*/ 25 vz= NewVec(vertices->NumberOfVertices());25 vz=new Vector(vertices->NumberOfVertices()); 26 26 27 27 /*Update verices new geometry: */ … … 32 32 33 33 /*Assemble mesh velocity*/ 34 VecAssemblyBegin(vz); 35 VecAssemblyEnd(vz); 34 vz->Assemble(); 36 35 37 36 /*Update element inputs*/ … … 41 40 xfree((void**)&thickness); 42 41 xfree((void**)&bed); 43 VecFree(&vz);42 delete vz; 44 43 return 1; 45 44 } -
issm/trunk-jpl/src/c/objects/ElementResults/BoolElementResult.cpp
r11001 r11695 185 185 /*}}}*/ 186 186 /*FUNCTION BoolElementResult::GetVectorFromResults{{{1*/ 187 void BoolElementResult::GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs){187 void BoolElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){ 188 188 189 189 _error_("cannot return vector on vertices"); 190 190 } /*}}}*/ 191 191 /*FUNCTION BoolElementResult::GetElementVectorFromResults{{{1*/ 192 void BoolElementResult::GetElementVectorFromResults(Vec vector,int dof){192 void BoolElementResult::GetElementVectorFromResults(Vector* vector,int dof){ 193 193 194 VecSetValue(vector,dof,(double)value,INSERT_VALUES);194 vector->SetValue(dof,value,INS_VAL); 195 195 } /*}}}*/ -
issm/trunk-jpl/src/c/objects/ElementResults/BoolElementResult.h
r11001 r11695 53 53 /*BoolElementResult management: {{{1*/ 54 54 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); 57 57 /*}}}*/ 58 58 }; -
issm/trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.h
r11001 r11695 53 53 /*DoubleElementResult management: {{{1*/ 54 54 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");}; 57 57 /*}}}*/ 58 58 }; -
issm/trunk-jpl/src/c/objects/ElementResults/ElementResult.h
r11001 r11695 25 25 virtual void PatchFill(int row, Patch* patch)=0; 26 26 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; 29 29 30 30 }; -
issm/trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.cpp
r11292 r11695 195 195 /*}}}*/ 196 196 /*FUNCTION PentaP1ElementResult::GetVectorFromResults{{{1*/ 197 void PentaP1ElementResult::GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs){197 void PentaP1ElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){ 198 198 199 199 double data[6]; … … 201 201 if(numdofs!=6)_error_("Result %s is a PentaP1ElementResult and cannot write vector of %i dofs",numdofs); 202 202 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); 204 204 205 205 } /*}}}*/ 206 206 /*FUNCTION PentaP1ElementResult::GetElementVectorFromResults{{{1*/ 207 void PentaP1ElementResult::GetElementVectorFromResults(Vec vector,int dof){207 void PentaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){ 208 208 209 209 _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 52 52 /*PentaP1ElementResult management: {{{1*/ 53 53 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); 56 56 /*}}}*/ 57 57 -
issm/trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.cpp
r11292 r11695 184 184 /*}}}*/ 185 185 /*FUNCTION TriaP1ElementResult::GetVectorFromResults{{{1*/ 186 void TriaP1ElementResult::GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs){186 void TriaP1ElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){ 187 187 188 188 double data[3]; … … 190 190 if(numdofs!=3)_error_("Result %s is a TriaP1ElementResult and cannot write vector of %i dofs",numdofs); 191 191 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); 193 193 194 194 } /*}}}*/ 195 195 /*FUNCTION TriaP1ElementResult::GetElementVectorFromResults{{{1*/ 196 void TriaP1ElementResult::GetElementVectorFromResults(Vec vector,int dof){ 197 196 void TriaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){ 198 197 _error_("Result %s is a TriaP1ElementResult and should not write vector of size numberofelemenrs",EnumToStringx(enum_type)); 199 198 } /*}}}*/ -
issm/trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.h
r11292 r11695 51 51 /*TriaP1ElementResult management: {{{1*/ 52 52 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); 55 55 /*}}}*/ 56 56 -
issm/trunk-jpl/src/c/objects/Elements/Element.h
r11679 r11695 46 46 virtual double SurfaceArea(void)=0; 47 47 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; 50 50 virtual void PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes)=0; 51 51 virtual void PatchFill(int* pcount, Patch* patch)=0; … … 62 62 virtual int NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units)=0; 63 63 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; 66 66 virtual void InputArtificialNoise(int enum_type,double min,double max)=0; 67 67 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,Vecpartition_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; 69 69 virtual int* GetHorizontalNeighboorSids(void)=0; 70 70 virtual double TimeAdapt()=0; 71 71 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; 73 73 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; 75 75 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; 77 77 78 78 #ifdef _HAVE_RESPONSES_ … … 94 94 95 95 #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; 97 97 virtual double ThicknessAbsMisfit(bool process_units ,int weight_index)=0; 98 98 virtual double SurfaceAbsVelMisfit(bool process_units ,int weight_index)=0; … … 104 104 virtual double RheologyBbarAbsGradient(bool process_units,int weight_index)=0; 105 105 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; 107 107 virtual void ControlInputSetGradient(double* gradient,int enum_type,int control_index)=0; 108 108 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; 110 110 virtual void SetControlInputsFromVector(double* vector,int control_enum,int control_index)=0; 111 111 virtual void InputControlUpdate(double scalar,bool save_parameter)=0; -
issm/trunk-jpl/src/c/objects/Elements/Penta.cpp
r11679 r11695 302 302 /*Other*/ 303 303 /*FUNCTION Penta::AverageOntoPartition {{{1*/ 304 void Penta::AverageOntoPartition(Vec partition_contributions,Vecpartition_areas,double* vertex_response,double* qmu_part){304 void Penta::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,double* vertex_response,double* qmu_part){ 305 305 _error_("Not supported yet!"); 306 306 } … … 383 383 /*}}}*/ 384 384 /*FUNCTION Penta::ComputeBasalStress {{{1*/ 385 void Penta::ComputeBasalStress(Vec sigma_b){385 void Penta::ComputeBasalStress(Vector* sigma_b){ 386 386 387 387 int i,j,ig; … … 417 417 if(!IsOnBed()){ 418 418 //put zero 419 VecSetValue(sigma_b,id-1,0.0,INSERT_VALUES);419 sigma_b->SetValue(id-1,0.0,INS_VAL); 420 420 return; 421 421 } … … 469 469 470 470 /*Add value to output*/ 471 VecSetValue(sigma_b,id-1,value,INSERT_VALUES);471 sigma_b->SetValue(id-1,value,INS_VAL); 472 472 } 473 473 /*}}}*/ 474 474 /*FUNCTION Penta::ComputeStrainRate {{{1*/ 475 void Penta::ComputeStrainRate(Vec eps){475 void Penta::ComputeStrainRate(Vector* eps){ 476 476 477 477 _error_("Not implemented yet"); … … 1218 1218 /*}}}*/ 1219 1219 /*FUNCTION Penta::GetVectorFromInputs{{{1*/ 1220 void Penta::GetVectorFromInputs(Vec vector,int input_enum){1220 void Penta::GetVectorFromInputs(Vector* vector,int input_enum){ 1221 1221 1222 1222 int doflist1[NUMVERTICES]; … … 1237 1237 /*}}}*/ 1238 1238 /*FUNCTION Penta::GetVectorFromResults{{{1*/ 1239 void Penta::GetVectorFromResults(Vec vector,int offset,int interp){1239 void Penta::GetVectorFromResults(Vector* vector,int offset,int interp){ 1240 1240 1241 1241 /*Get result*/ … … 2416 2416 /*}}}*/ 2417 2417 /*FUNCTION Penta::PotentialSheetUngrounding{{{1*/ 2418 void Penta::PotentialSheetUngrounding(Vec potential_sheet_ungrounding){2418 void Penta::PotentialSheetUngrounding(Vector* potential_sheet_ungrounding){ 2419 2419 2420 2420 int i; … … 2438 2438 if (bed_hydro>ba[i]){ 2439 2439 /*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); 2441 2441 } 2442 2442 } … … 2936 2936 /*}}}*/ 2937 2937 /*FUNCTION Penta::UpdatePotentialSheetUngrounding{{{1*/ 2938 int Penta::UpdatePotentialSheetUngrounding(double* vertices_potentially_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf){2938 int Penta::UpdatePotentialSheetUngrounding(double* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,double* nodes_on_iceshelf){ 2939 2939 2940 2940 int i; … … 2944 2944 for(i=0;i<NUMVERTICES;i++){ 2945 2945 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); 2947 2947 2948 2948 /*If node was not on ice shelf, we flipped*/ … … 3004 3004 /*}}}*/ 3005 3005 /*FUNCTION Penta::SmearFunction {{{1*/ 3006 void Penta::SmearFunction(Vec smearedvector,double (*WeightFunction)(double distance,double radius),double radius){3006 void Penta::SmearFunction(Vector* smearedvector,double (*WeightFunction)(double distance,double radius),double radius){ 3007 3007 _error_("not implemented yet"); 3008 3008 } … … 4203 4203 4204 4204 /*Add value to global vector*/ 4205 solution->SetValues(numdof,doflist,values,INS ERT_VALUES);4205 solution->SetValues(numdof,doflist,values,INS_VAL); 4206 4206 4207 4207 /*Free ressources:*/ … … 4234 4234 4235 4235 /*Add value to global vector*/ 4236 solution->SetValues(numdof,doflist,values,INS ERT_VALUES);4236 solution->SetValues(numdof,doflist,values,INS_VAL); 4237 4237 4238 4238 /*Free ressources:*/ … … 4394 4394 #ifdef _HAVE_CONTROL_ 4395 4395 /*FUNCTION Penta::ControlInputGetGradient{{{1*/ 4396 void Penta::ControlInputGetGradient(Vec gradient,int enum_type,int control_index){4396 void Penta::ControlInputGetGradient(Vector* gradient,int enum_type,int control_index){ 4397 4397 4398 4398 int doflist1[NUMVERTICES]; … … 4719 4719 /*}}}*/ 4720 4720 /*FUNCTION Penta::Gradj {{{1*/ 4721 void Penta::Gradj(Vec gradient,int control_type,int control_index){4721 void Penta::Gradj(Vector* gradient,int control_type,int control_index){ 4722 4722 /*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/ 4723 4723 … … 4810 4810 /*}}}*/ 4811 4811 /*FUNCTION Penta::GradjDragMacAyeal {{{1*/ 4812 void Penta::GradjDragMacAyeal(Vec gradient,int control_index){4812 void Penta::GradjDragMacAyeal(Vector* gradient,int control_index){ 4813 4813 4814 4814 /*Gradient is 0 if on shelf or not on bed*/ … … 4822 4822 } /*}}}*/ 4823 4823 /*FUNCTION Penta::GradjDragPattyn {{{1*/ 4824 void Penta::GradjDragPattyn(Vec gradient,int control_index){4824 void Penta::GradjDragPattyn(Vector* gradient,int control_index){ 4825 4825 4826 4826 int i,j,ig; … … 4885 4885 } 4886 4886 } 4887 VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)grade_g,ADD_VALUES);4887 gradient->SetValues(NUMVERTICES,doflist1,grade_g,ADD_VAL); 4888 4888 4889 4889 /*Clean up and return*/ … … 4893 4893 /*}}}*/ 4894 4894 /*FUNCTION Penta::GradjDragStokes {{{1*/ 4895 void Penta::GradjDragStokes(Vec gradient,int control_index){4895 void Penta::GradjDragStokes(Vector* gradient,int control_index){ 4896 4896 4897 4897 int i,j,ig; … … 4978 4978 } 4979 4979 4980 VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)grade_g,ADD_VALUES);4980 gradient->SetValues(NUMVERTICES,doflist1,grade_g,ADD_VAL); 4981 4981 4982 4982 delete friction; … … 4985 4985 /*}}}*/ 4986 4986 /*FUNCTION Penta::GradjBbarMacAyeal {{{1*/ 4987 void Penta::GradjBbarMacAyeal(Vec gradient,int control_index){4987 void Penta::GradjBbarMacAyeal(Vector* gradient,int control_index){ 4988 4988 4989 4989 /*This element should be collapsed into a tria element at its base*/ … … 5003 5003 } /*}}}*/ 5004 5004 /*FUNCTION Penta::GradjBbarPattyn {{{1*/ 5005 void Penta::GradjBbarPattyn(Vec gradient,int control_index){5005 void Penta::GradjBbarPattyn(Vector* gradient,int control_index){ 5006 5006 5007 5007 /*Gradient is computed on bed only (Bbar)*/ … … 5020 5020 } /*}}}*/ 5021 5021 /*FUNCTION Penta::GradjBbarStokes {{{1*/ 5022 void Penta::GradjBbarStokes(Vec gradient,int control_index){5022 void Penta::GradjBbarStokes(Vector* gradient,int control_index){ 5023 5023 5024 5024 /*Gradient is computed on bed only (Bbar)*/ … … 5396 5396 /*}}}*/ 5397 5397 /*FUNCTION Penta::GetVectorFromControlInputs{{{1*/ 5398 void Penta::GetVectorFromControlInputs(Vec vector,int control_enum,int control_index,const char* data){5398 void Penta::GetVectorFromControlInputs(Vector* vector,int control_enum,int control_index,const char* data){ 5399 5399 5400 5400 int doflist1[NUMVERTICES]; … … 7874 7874 7875 7875 /*Add value to global vector*/ 7876 solution->SetValues(numdof,doflist,values,INS ERT_VALUES);7876 solution->SetValues(numdof,doflist,values,INS_VAL); 7877 7877 7878 7878 /*Free ressources:*/ … … 7910 7910 7911 7911 /*Add value to global vector*/ 7912 solution->SetValues(numdof,doflist,values,INS ERT_VALUES);7912 solution->SetValues(numdof,doflist,values,INS_VAL); 7913 7913 7914 7914 /*Free ressources:*/ … … 7943 7943 7944 7944 /*Add value to global vector*/ 7945 solution->SetValues(numdof,doflist,values,INS ERT_VALUES);7945 solution->SetValues(numdof,doflist,values,INS_VAL); 7946 7946 7947 7947 /*Free ressources:*/ … … 7988 7988 7989 7989 /*Add value to global vector*/ 7990 solution->SetValues(numdof,doflist,values,INS ERT_VALUES);7990 solution->SetValues(numdof,doflist,values,INS_VAL); 7991 7991 7992 7992 /*Free ressources:*/ -
issm/trunk-jpl/src/c/objects/Elements/Penta.h
r11679 r11695 79 79 /*}}}*/ 80 80 /*Element virtual functions definitions: {{{1*/ 81 void AverageOntoPartition(Vec partition_contributions,Vecpartition_areas,double* vertex_response,double* qmu_part);81 void AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,double* vertex_response,double* qmu_part); 82 82 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); 85 85 void ComputeStressTensor(); 86 86 void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); … … 93 93 void GetSolutionFromInputs(Vector* solution); 94 94 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); 97 97 98 98 int Sid(); … … 107 107 void InputToResult(int enum_type,int step,double time); 108 108 void MigrateGroundingLine(double* old_floating_ice,double* sheet_ungrounding); 109 void PotentialSheetUngrounding(Vec potential_sheet_ungrounding);109 void PotentialSheetUngrounding(Vector* potential_sheet_ungrounding); 110 110 void RequestedOutput(int output_enum,int step,double time); 111 111 void ListResultsInfo(int** results_enums,int** results_size,double** results_times,int** results_steps,int* num_results); … … 117 117 double SurfaceArea(void); 118 118 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); 120 120 int NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units); 121 121 double TimeAdapt(); 122 122 int* GetHorizontalNeighboorSids(void); 123 123 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); 125 125 126 126 #ifdef _HAVE_RESPONSES_ … … 144 144 double DragCoefficientAbsGradient(bool process_units,int weight_index); 145 145 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); 154 154 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); 156 156 void ControlInputScaleGradient(int enum_type,double scale); 157 157 void ControlInputSetGradient(double* gradient,int enum_type,int control_index); -
issm/trunk-jpl/src/c/objects/Elements/Tria.cpp
r11679 r11695 279 279 /*Other*/ 280 280 /*FUNCTION Tria::AverageOntoPartition {{{1*/ 281 void Tria::AverageOntoPartition(Vec partition_contributions,Vecpartition_areas,double* vertex_response,double* qmu_part){281 void Tria::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,double* vertex_response,double* qmu_part){ 282 282 283 283 bool already=false; … … 312 312 } 313 313 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); 316 316 }; 317 317 } … … 925 925 /*}}}*/ 926 926 /*FUNCTION Tria::ComputeBasalStress {{{1*/ 927 void Tria::ComputeBasalStress(Vec eps){927 void Tria::ComputeBasalStress(Vector* eps){ 928 928 _error_("Not Implemented yet"); 929 929 } 930 930 /*}}}*/ 931 931 /*FUNCTION Tria::ComputeStrainRate {{{1*/ 932 void Tria::ComputeStrainRate(Vec eps){932 void Tria::ComputeStrainRate(Vector* eps){ 933 933 _error_("Not Implemented yet"); 934 934 } … … 1324 1324 /*}}}*/ 1325 1325 /*FUNCTION Tria::GetVectorFromInputs{{{1*/ 1326 void Tria::GetVectorFromInputs(Vec vector,int input_enum){1326 void Tria::GetVectorFromInputs(Vector* vector,int input_enum){ 1327 1327 1328 1328 int doflist1[NUMVERTICES]; … … 1343 1343 /*}}}*/ 1344 1344 /*FUNCTION Tria::GetVectorFromResults{{{1*/ 1345 void Tria::GetVectorFromResults(Vec vector,int offset,int interp){1345 void Tria::GetVectorFromResults(Vector* vector,int offset,int interp){ 1346 1346 1347 1347 /*Get result*/ … … 2206 2206 /*}}}*/ 2207 2207 /*FUNCTION Tria::PotentialSheetUngrounding{{{1*/ 2208 void Tria::PotentialSheetUngrounding(Vec potential_sheet_ungrounding){2208 void Tria::PotentialSheetUngrounding(Vector* potential_sheet_ungrounding){ 2209 2209 2210 2210 int i; … … 2228 2228 if (bed_hydro>ba[i]){ 2229 2229 /*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); 2231 2231 } 2232 2232 } … … 2286 2286 /*}}}1*/ 2287 2287 /*FUNCTION Tria::SmearFunction {{{1*/ 2288 void Tria::SmearFunction(Vec smearedvector,double (*WeightFunction)(double distance,double radius),double radius){2288 void Tria::SmearFunction(Vector* smearedvector,double (*WeightFunction)(double distance,double radius),double radius){ 2289 2289 _error_("not implemented yet"); 2290 2290 … … 2507 2507 /*}}}*/ 2508 2508 /*FUNCTION Tria::UpdatePotentialSheetUngrounding{{{1*/ 2509 int Tria::UpdatePotentialSheetUngrounding(double* vertices_potentially_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf){2509 int Tria::UpdatePotentialSheetUngrounding(double* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,double* nodes_on_iceshelf){ 2510 2510 2511 2511 int i; … … 2515 2515 for(i=0;i<3;i++){ 2516 2516 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); 2518 2518 2519 2519 /*If node was not on ice shelf, we flipped*/ … … 3170 3170 } 3171 3171 3172 solution->SetValues(numdof,doflist,values,INS ERT_VALUES);3172 solution->SetValues(numdof,doflist,values,INS_VAL); 3173 3173 3174 3174 /*Free ressources:*/ … … 3209 3209 } 3210 3210 3211 solution->SetValues(numdof,doflist,values,INS ERT_VALUES);3211 solution->SetValues(numdof,doflist,values,INS_VAL); 3212 3212 3213 3213 /*Free ressources:*/ … … 3377 3377 /*}}}*/ 3378 3378 /*FUNCTION Tria::ControlInputGetGradient{{{1*/ 3379 void Tria::ControlInputGetGradient(Vec gradient,int enum_type,int control_index){3379 void Tria::ControlInputGetGradient(Vector* gradient,int enum_type,int control_index){ 3380 3380 3381 3381 int doflist1[NUMVERTICES]; … … 3436 3436 }/*}}}*/ 3437 3437 /*FUNCTION Tria::Gradj {{{1*/ 3438 void Tria::Gradj(Vec gradient,int control_type,int control_index){3438 void Tria::Gradj(Vector* gradient,int control_type,int control_index){ 3439 3439 /*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/ 3440 3440 … … 3495 3495 /*}}}*/ 3496 3496 /*FUNCTION Tria::GradjBGradient{{{1*/ 3497 void Tria::GradjBGradient(Vec gradient,int weight_index,int control_index){3497 void Tria::GradjBGradient(Vector* gradient,int weight_index,int control_index){ 3498 3498 3499 3499 int i,ig; … … 3528 3528 for (i=0;i<NUMVERTICES;i++) grade_g[i]+=-weight*Jdet*gauss->weight*(dbasis[0][i]*dk[0]+dbasis[1][i]*dk[1]); 3529 3529 } 3530 VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)grade_g,ADD_VALUES);3530 gradient->SetValues(NUMVERTICES,doflist1,grade_g,ADD_VAL); 3531 3531 3532 3532 /*Clean up and return*/ … … 3535 3535 /*}}}*/ 3536 3536 /*FUNCTION Tria::GradjBMacAyeal{{{1*/ 3537 void Tria::GradjBMacAyeal(Vec gradient,int control_index){3537 void Tria::GradjBMacAyeal(Vector* gradient,int control_index){ 3538 3538 3539 3539 /*Intermediaries*/ … … 3585 3585 } 3586 3586 3587 VecSetValues(gradient,NUMVERTICES,doflist,(const double*)grad,ADD_VALUES);3587 gradient->SetValues(NUMVERTICES,doflist,grad,ADD_VAL); 3588 3588 3589 3589 /*clean-up*/ … … 3592 3592 /*}}}*/ 3593 3593 /*FUNCTION Tria::GradjDragMacAyeal {{{1*/ 3594 void Tria::GradjDragMacAyeal(Vec gradient,int control_index){3594 void Tria::GradjDragMacAyeal(Vector* gradient,int control_index){ 3595 3595 3596 3596 int i,ig; … … 3672 3672 /*End Analytical gradient*/ 3673 3673 3674 VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)grade_g,ADD_VALUES);3674 gradient->SetValues(NUMVERTICES,doflist1,grade_g,ADD_VAL); 3675 3675 3676 3676 /*Clean up and return*/ … … 3680 3680 /*}}}*/ 3681 3681 /*FUNCTION Tria::GradjDragGradient{{{1*/ 3682 void Tria::GradjDragGradient(Vec gradient, int weight_index,int control_index){3682 void Tria::GradjDragGradient(Vector* gradient, int weight_index,int control_index){ 3683 3683 3684 3684 int i,ig; … … 3717 3717 } 3718 3718 } 3719 VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)grade_g,ADD_VALUES);3719 gradient->SetValues(NUMVERTICES,doflist1,grade_g,ADD_VAL); 3720 3720 3721 3721 /*Clean up and return*/ … … 3724 3724 /*}}}*/ 3725 3725 /*FUNCTION Tria::GradjDhDtBalancedthickness{{{1*/ 3726 void Tria::GradjDhDtBalancedthickness(Vec gradient,int control_index){3726 void Tria::GradjDhDtBalancedthickness(Vector* gradient,int control_index){ 3727 3727 3728 3728 /*Intermediaries*/ … … 3736 3736 for(int i=0;i<NUMVERTICES;i++) gradient_g[i]=-lambda[i]; 3737 3737 3738 VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)gradient_g,INSERT_VALUES);3738 gradient->SetValues(NUMVERTICES,doflist1,gradient_g,INS_VAL); 3739 3739 } 3740 3740 /*}}}*/ 3741 3741 /*FUNCTION Tria::GradjVxBalancedthickness{{{1*/ 3742 void Tria::GradjVxBalancedthickness(Vec gradient,int control_index){3742 void Tria::GradjVxBalancedthickness(Vector* gradient,int control_index){ 3743 3743 3744 3744 /*Intermediaries*/ … … 3776 3776 } 3777 3777 3778 VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)grade_g,ADD_VALUES);3778 gradient->SetValues(NUMVERTICES,doflist1,grade_g,ADD_VAL); 3779 3779 3780 3780 /*Clean up and return*/ … … 3783 3783 /*}}}*/ 3784 3784 /*FUNCTION Tria::GradjVyBalancedthickness{{{1*/ 3785 void Tria::GradjVyBalancedthickness(Vec gradient,int control_index){3785 void Tria::GradjVyBalancedthickness(Vector* gradient,int control_index){ 3786 3786 3787 3787 /*Intermediaries*/ … … 3818 3818 for(i=0;i<NUMVERTICES;i++) grade_g[i]+=thickness*Dlambda[1]*Jdet*gauss->weight*basis[i]; 3819 3819 } 3820 VecSetValues(gradient,NUMVERTICES,doflist1,(const double*)grade_g,ADD_VALUES);3820 gradient->SetValues(NUMVERTICES,doflist1,grade_g,ADD_VAL); 3821 3821 3822 3822 /*Clean up and return*/ … … 4912 4912 /*}}}*/ 4913 4913 /*FUNCTION Tria::GetVectorFromControlInputs{{{1*/ 4914 void Tria::GetVectorFromControlInputs(Vec vector,int control_enum,int control_index,const char* data){4914 void Tria::GetVectorFromControlInputs(Vector* vector,int control_enum,int control_index,const char* data){ 4915 4915 4916 4916 int doflist1[NUMVERTICES]; … … 5214 5214 } 5215 5215 5216 solution->SetValues(numdof,doflist,values,INS ERT_VALUES);5216 solution->SetValues(numdof,doflist,values,INS_VAL); 5217 5217 5218 5218 /*Free ressources:*/ -
issm/trunk-jpl/src/c/objects/Elements/Tria.h
r11679 r11695 76 76 /*}}}*/ 77 77 /*Element virtual functions definitions: {{{1*/ 78 void AverageOntoPartition(Vec partition_contributions,Vecpartition_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); 81 81 void ComputeStressTensor(); 82 82 void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); … … 93 93 bool IsOnWater(); 94 94 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); 97 97 void InputArtificialNoise(int enum_type,double min, double max); 98 98 bool InputConvergence(double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums); … … 107 107 void MigrateGroundingLine(double* oldfloating,double* sheet_ungrounding); 108 108 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); 110 110 void PositiveDegreeDay(void); 111 111 void RequestedOutput(int output_enum,int step,double time); … … 117 117 double SurfaceArea(void); 118 118 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); 120 120 double TimeAdapt(); 121 121 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); 123 123 124 124 #ifdef _HAVE_RESPONSES_ … … 143 143 double DragCoefficientAbsGradient(bool process_units,int weight_index); 144 144 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); 155 155 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); 157 157 void ControlInputScaleGradient(int enum_type,double scale); 158 158 void ControlInputSetGradient(double* gradient,int enum_type,int control_index); -
issm/trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.cpp
r11205 r11695 27 27 /*}}}*/ 28 28 /*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){29 PetscVecExternalResult::PetscVecExternalResult(int in_id, int in_enum_type,Vector* in_value,int in_step, double in_time){ 30 30 31 31 id=in_id; … … 35 35 36 36 if(in_value){ 37 VecDuplicate(in_value,&value);38 VecCopy(in_value,value);37 value=in_value->Duplicate(); 38 in_value->Copy(value); 39 39 } 40 40 else value=NULL; -
issm/trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.h
r11202 r11695 33 33 int id; 34 34 int enum_type; 35 Vec value;35 Vector* value; 36 36 int step; 37 37 double time; … … 40 40 /*PetscVecExternalResult constructors, destructors: {{{1*/ 41 41 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); 43 43 ~PetscVecExternalResult(); 44 44 /*}}}*/ -
issm/trunk-jpl/src/c/objects/FemModel.cpp
r11130 r11695 144 144 this->loads->SetCurrentConfiguration(elements, loads, nodes,vertices, materials,parameters); 145 145 146 #ifdef _HAVE_PETSC_ 146 147 /*take care of petsc options, that depend on this analysis type (present only after model processor)*/ 147 148 if(this->parameters->Exist(PetscOptionsStringsEnum)){ … … 149 150 _printf_(VerboseSolver()," petsc Options set for analysis type: %s\n",EnumToStringx(analysis_type)); 150 151 } 152 #endif 151 153 152 154 } -
issm/trunk-jpl/src/c/objects/Inputs/BoolInput.cpp
r10431 r11695 233 233 /*}}}*/ 234 234 /*FUNCTION BoolInput::GetVectorFromInputs{{{1*/ 235 void BoolInput::GetVectorFromInputs(Vec vector,int* doflist){235 void BoolInput::GetVectorFromInputs(Vector* vector,int* doflist){ 236 236 237 237 _error_(" not supporte yet!"); -
issm/trunk-jpl/src/c/objects/Inputs/BoolInput.h
r10431 r11695 81 81 void Extrude(void); 82 82 void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");}; 83 void GetVectorFromInputs(Vec vector,int* doflist);83 void GetVectorFromInputs(Vector* vector,int* doflist); 84 84 void GetValuesPtr(double** pvalues,int* pnum_values); 85 85 /*}}}*/ -
issm/trunk-jpl/src/c/objects/Inputs/ControlInput.cpp
r11318 r11695 355 355 }/*}}}*/ 356 356 /*FUNCTION ControlInput::GetGradient{{{1*/ 357 void ControlInput::GetGradient(Vec gradient_vec,int* doflist){357 void ControlInput::GetGradient(Vector* gradient_vec,int* doflist){ 358 358 if(gradient) gradient->GetVectorFromInputs(gradient_vec,doflist); 359 359 }/*}}}*/ … … 406 406 return gradient->SpawnResult(step,time); 407 407 }/*}}}*/ 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*/ 409 void ControlInput::GetVectorFromInputs(Vector* vector,int* doflist){ 410 410 values->GetVectorFromInputs(vector,doflist); 411 411 }/*}}}*/ 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*/ 413 void ControlInput::GetVectorFromInputs(Vector* vector,int* doflist,const char* data){ 414 414 if(strcmp(data,"value")==0){ 415 415 _assert_(values); -
issm/trunk-jpl/src/c/objects/Inputs/ControlInput.h
r11318 r11695 87 87 void Extrude(void); 88 88 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); 91 91 void GetValuesPtr(double** pvalues,int* pnum_values){_error_("not implemented yet");}; 92 92 ElementResult* SpawnGradient(int step, double time); 93 void GetGradient(Vec gradient_vec,int* doflist);93 void GetGradient(Vector* gradient_vec,int* doflist); 94 94 void ScaleGradient(double scale); 95 95 void SetGradient(Input* gradient_in); -
issm/trunk-jpl/src/c/objects/Inputs/DatasetInput.h
r10135 r11695 82 82 void Extrude(void){_error_("not implemented yet");}; 83 83 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");}; 85 85 void GetValuesPtr(double** pvalues,int* pnum_values){_error_("not implemented yet");}; 86 86 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");}; 88 88 void ScaleGradient(double scale){_error_("not implemented yet");}; 89 89 void SetGradient(Input* gradient_in){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/objects/Inputs/DoubleInput.cpp
r11291 r11695 310 310 /*}}}*/ 311 311 /*FUNCTION DoubleInput::GetVectorFromInputs{{{1*/ 312 void DoubleInput::GetVectorFromInputs(Vec vector,int* doflist){312 void DoubleInput::GetVectorFromInputs(Vector* vector,int* doflist){ 313 313 314 314 _error_(" not supporte yet!"); -
issm/trunk-jpl/src/c/objects/Inputs/DoubleInput.h
r10135 r11695 80 80 void Extrude(void){_error_("not supported yet");}; 81 81 void VerticallyIntegrate(Input* thickness_input); 82 void GetVectorFromInputs(Vec vector,int* doflist);82 void GetVectorFromInputs(Vector* vector,int* doflist); 83 83 void GetValuesPtr(double** pvalues,int* pnum_values); 84 84 /*}}}*/ -
issm/trunk-jpl/src/c/objects/Inputs/Input.h
r10135 r11695 56 56 virtual void VerticallyIntegrate(Input* thickness_input)=0; 57 57 virtual void Extrude()=0; 58 virtual void GetVectorFromInputs(Vec vector,int* doflist)=0;58 virtual void GetVectorFromInputs(Vector* vector,int* doflist)=0; 59 59 virtual void GetValuesPtr(double** pvalues,int* pnum_values)=0; 60 60 -
issm/trunk-jpl/src/c/objects/Inputs/IntInput.cpp
r11070 r11695 231 231 /*}}}*/ 232 232 /*FUNCTION IntInput::GetVectorFromInputs{{{1*/ 233 void IntInput::GetVectorFromInputs(Vec vector,int* doflist){233 void IntInput::GetVectorFromInputs(Vector* vector,int* doflist){ 234 234 235 235 _error_(" not supporte yet!"); -
issm/trunk-jpl/src/c/objects/Inputs/IntInput.h
r10135 r11695 81 81 void Extrude(void){_error_("not supported yet");}; 82 82 void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");}; 83 void GetVectorFromInputs(Vec vector,int* doflist);83 void GetVectorFromInputs(Vector* vector,int* doflist); 84 84 void GetValuesPtr(double** pvalues,int* pnum_values); 85 85 /*}}}*/ -
issm/trunk-jpl/src/c/objects/Inputs/PentaP1Input.cpp
r11292 r11695 660 660 /*}}}*/ 661 661 /*FUNCTION PentaP1Input::GetVectorFromInputs{{{1*/ 662 void PentaP1Input::GetVectorFromInputs(Vec vector,int* doflist){662 void PentaP1Input::GetVectorFromInputs(Vector* vector,int* doflist){ 663 663 664 664 const int numvertices=6; 665 VecSetValues(vector,numvertices,doflist,(const double*)this->values,INSERT_VALUES);665 vector->SetValues(numvertices,doflist,this->values,INS_VAL); 666 666 667 667 } /*}}}*/ -
issm/trunk-jpl/src/c/objects/Inputs/PentaP1Input.h
r11292 r11695 82 82 void Extrude(void); 83 83 void VerticallyIntegrate(Input* thickness_input); 84 void GetVectorFromInputs(Vec vector,int* doflist);84 void GetVectorFromInputs(Vector* vector,int* doflist); 85 85 void GetValuesPtr(double** pvalues,int* pnum_values); 86 86 /*}}}*/ -
issm/trunk-jpl/src/c/objects/Inputs/TransientInput.cpp
r11197 r11695 440 440 /*}}}*/ 441 441 /*FUNCTION TransientInput::GetVectorFromInputs{{{1*/ 442 void TransientInput::GetVectorFromInputs(Vec vector,int* doflist){442 void TransientInput::GetVectorFromInputs(Vector* vector,int* doflist){ 443 443 444 444 double time; -
issm/trunk-jpl/src/c/objects/Inputs/TransientInput.h
r10135 r11695 84 84 void Extrude(void){_error_("not supported yet");} 85 85 void VerticallyIntegrate(Input* thickness_forcing){_error_("not supported yet");}; 86 void GetVectorFromInputs(Vec vector,int* doflist);86 void GetVectorFromInputs(Vector* vector,int* doflist); 87 87 void GetValuesPtr(double** pvalues,int* pnum_values){_error_("not supported yet");}; 88 88 void GetTimeValues(double* values,double time){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/objects/Inputs/TriaP1Input.cpp
r11292 r11695 391 391 /*}}}*/ 392 392 /*FUNCTION TriaP1Input::GetVectorFromInputs{{{1*/ 393 void TriaP1Input::GetVectorFromInputs(Vec vector,int* doflist){393 void TriaP1Input::GetVectorFromInputs(Vector* vector,int* doflist){ 394 394 395 395 const int numvertices=3; 396 VecSetValues(vector,numvertices,doflist,(const double*)this->values,INSERT_VALUES);396 vector->SetValues(numvertices,doflist,this->values,INS_VAL); 397 397 398 398 } /*}}}*/ -
issm/trunk-jpl/src/c/objects/Inputs/TriaP1Input.h
r11291 r11695 82 82 void Extrude(void){_error_("not supported yet");}; 83 83 void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");}; 84 void GetVectorFromInputs(Vec vector,int* doflist);84 void GetVectorFromInputs(Vector* vector,int* doflist); 85 85 void GetValuesPtr(double** pvalues,int* pnum_values); 86 86 /*}}}*/ -
issm/trunk-jpl/src/c/objects/Materials/Material.h
r8386 r11695 22 22 virtual void InputDuplicate(int original_enum,int new_enum)=0; 23 23 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; 25 25 26 26 }; -
issm/trunk-jpl/src/c/objects/Materials/Matice.cpp
r11332 r11695 229 229 /*}}}*/ 230 230 /*FUNCTION Matice::GetVectorFromInputs{{{1*/ 231 void Matice::GetVectorFromInputs(Vec vector,int input_enum){231 void Matice::GetVectorFromInputs(Vector* vector,int input_enum){ 232 232 233 233 /*Intermediaries*/ -
issm/trunk-jpl/src/c/objects/Materials/Matice.h
r11332 r11695 60 60 void InputDuplicate(int original_enum,int new_enum); 61 61 void Configure(Elements* elements); 62 void GetVectorFromInputs(Vec vector,int input_enum);62 void GetVectorFromInputs(Vector* vector,int input_enum); 63 63 /*}}}*/ 64 64 /*Matice Numerics: {{{1*/ -
issm/trunk-jpl/src/c/objects/Materials/Matpar.h
r10576 r11695 71 71 void InputDuplicate(int original_enum,int new_enum){_error_("not implemented yet");}; 72 72 void Configure(Elements* elements); 73 void GetVectorFromInputs(Vec vector,int input_enum){return;}73 void GetVectorFromInputs(Vector* vector,int input_enum){return;} 74 74 /*}}}*/ 75 75 /*Numerics: {{{1*/ -
issm/trunk-jpl/src/c/objects/Node.cpp
r11679 r11695 568 568 /*}}}*/ 569 569 /*FUNCTION Node::CreateVecSets {{{1*/ 570 void Node::CreateVecSets(Vec pv_g,Vec pv_f,Vecpv_s){570 void Node::CreateVecSets(Vector* pv_g,Vector* pv_f,Vector* pv_s){ 571 571 572 572 double gvalue=1.0; //all nodes are in the g set; … … 578 578 579 579 /*g set: */ 580 VecSetValues(pv_g,1,&indexing.gdoflist[i],&gvalue,INSERT_VALUES);580 pv_g->SetValue(indexing.gdoflist[i],gvalue,INS_VAL); 581 581 582 582 /*f set: */ 583 583 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); 585 585 586 586 /*s set: */ 587 587 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); 589 589 590 590 } … … 613 613 614 614 /*Add values into constraint vector: */ 615 ys->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS ERT_VALUES);615 ys->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS_VAL); 616 616 } 617 617 … … 897 897 898 898 /*Add values into ug: */ 899 ug->SetValues(this->indexing.fsize,indices,values,INS ERT_VALUES);899 ug->SetValues(this->indexing.fsize,indices,values,INS_VAL); 900 900 } 901 901 } … … 915 915 916 916 /*Add values into ug: */ 917 ug->SetValues(this->indexing.ssize,indices,values,INS ERT_VALUES);917 ug->SetValues(this->indexing.ssize,indices,values,INS_VAL); 918 918 } 919 919 } … … 945 945 946 946 /*Add values into ug: */ 947 vector->SetValues(this->indexing.fsize,this->indexing.fdoflist,values,INS ERT_VALUES);947 vector->SetValues(this->indexing.fsize,this->indexing.fdoflist,values,INS_VAL); 948 948 } 949 949 } … … 961 961 962 962 /*Add values into ug: */ 963 vector->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS ERT_VALUES);963 vector->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS_VAL); 964 964 } 965 965 } -
issm/trunk-jpl/src/c/objects/Node.h
r11679 r11695 87 87 void DofInFSet(int dof); 88 88 int GetDof(int dofindex,int setenum); 89 void CreateVecSets(Vec pv_g,Vec pv_f,Vecpv_s);89 void CreateVecSets(Vector* pv_g,Vector* pv_f,Vector* pv_s); 90 90 int GetConnectivity(); 91 91 void GetDofList(int* poutdoflist,int approximation_enum,int setenum); -
issm/trunk-jpl/src/c/objects/Numerics/Matrix.cpp
r11679 r11695 17 17 #include "../../Container/Container.h" 18 18 #include "../../include/include.h" 19 #include "../../toolkits/toolkits.h" 19 20 #include "./Matrix.h" 21 20 22 /*}}}*/ 21 23 … … 61 63 #ifdef _HAVE_PETSC_ 62 64 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*/ 74 Matrix::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); 63 98 #else 64 99 this->matrix=(double*)xcalloc(pM*pN,sizeof(double)); … … 160 195 /*}}}*/ 161 196 /*FUNCTION Matrix::Norm{{{1*/ 162 double Matrix::Norm( intnorm_type){197 double Matrix::Norm(NormMode norm_type){ 163 198 164 199 double norm=0; 165 200 #ifdef _HAVE_PETSC_ 166 MatNorm(this->matrix, (NormType)norm_type,&norm);201 MatNorm(this->matrix,ISSMToPetscNormMode(norm_type),&norm); 167 202 #else 168 203 _error_("not implemented yet!"); … … 201 236 } 202 237 /*}}}*/ 238 /*FUNCTION Matrix::Duplicate{{{1*/ 239 Matrix* 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*/ 253 double* 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 14 14 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 15 15 #endif 16 #include "../Object.h"17 16 #include "../../toolkits/toolkits.h" 18 17 #include "../../EnumDefinitions/EnumDefinitions.h" … … 48 47 Matrix(int M,int N); 49 48 Matrix(int M,int N,double sparsity); 49 Matrix(double* serial_mat,int M,int N,double sparsity); 50 50 Matrix(int M,int N,int connectivity,int numberofdofspernode); 51 51 ~Matrix(); … … 57 57 #endif 58 58 void Assemble(void); 59 double Norm( intnorm_type);59 double Norm(NormMode norm_type); 60 60 void GetSize(int* pM,int* pN); 61 61 void GetLocalSize(int* pM,int* pN); 62 62 void MatMult(Vector* X,Vector* AX); 63 Matrix* Duplicate(void); 64 double* ToSerial(void); 63 65 /*}}}*/ 64 66 -
issm/trunk-jpl/src/c/objects/Numerics/Vector.cpp
r11690 r11695 17 17 #include "../../Container/Container.h" 18 18 #include "../../include/include.h" 19 #include "../../toolkits/toolkits.h" 19 20 #include "./Vector.h" 20 21 /*}}}*/ … … 49 50 } 50 51 /*}}}*/ 51 /*FUNCTION Vector::~Vector(){{{1*/ 52 /*FUNCTION Vector::Vector(double* serial_vec,int M){{{1*/ 53 Vector::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*/ 52 81 Vector::~Vector(){ 53 82 … … 62 91 } 63 92 /*}}}*/ 93 64 94 65 95 /*Vector specific routines: */ … … 116 146 /*}}}*/ 117 147 /*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 /*}}}*/ 148 void 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*/ 160 void 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*/ 172 void 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 129 184 /*FUNCTION Vector::GetSize{{{1*/ 130 185 void Vector::GetSize(int* pM){ … … 226 281 /*}}}*/ 227 282 /*FUNCTION Vector::Norm{{{1*/ 228 double Vector::Norm( intnorm_type){283 double Vector::Norm(NormMode norm_type){ 229 284 230 285 double norm=0; 231 286 #ifdef _HAVE_PETSC_ 232 VecNorm(this->vector, (NormType)norm_type,&norm);287 VecNorm(this->vector,ISSMToPetscNormMode(norm_type),&norm); 233 288 #else 234 289 _error_("not implemented yet!"); … … 247 302 } 248 303 /*}}}*/ 304 /*FUNCTION Vector::Scale{{{1*/ 305 double 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*/ 317 void 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 14 14 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 15 15 #endif 16 #include "../Object.h"17 16 #include "../../toolkits/toolkits.h" 18 17 #include "../../EnumDefinitions/EnumDefinitions.h" … … 22 21 #endif 23 22 24 25 23 #ifdef _SERIAL_ 26 24 #include "mex.h" … … 47 45 Vector(); 48 46 Vector(int M,bool fromlocalsize=false); 47 Vector(double* serial_vec,int pM); 49 48 ~Vector(); 50 49 /*}}}*/ … … 55 54 #endif 56 55 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); 58 59 void GetSize(int* pM); 59 60 void GetLocalSize(int* pM); … … 64 65 double* ToMPISerial(void); 65 66 void Copy(Vector* to); 66 double Norm( intnorm_type);67 double Norm(NormMode norm_type); 67 68 void Scale(double scale_factor); 69 void PointwiseDivide(Vector* x,Vector* y); 70 double Dot(Vector* vector); 68 71 /*}}}*/ 69 72 }; -
issm/trunk-jpl/src/c/objects/Params/BoolParam.h
r11358 r11695 61 61 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));} 62 62 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));} 65 65 void GetParameterValue(FILE** pfid){_error_("Bool param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));} 66 66 … … 74 74 void SetValue(int* intarray,int M){_error_("Bool param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} 75 75 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));} 78 78 void SetValue(FILE* fid){_error_("Bool param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 79 79 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 64 64 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));} 65 65 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));} 68 68 void GetParameterValue(FILE** pfid){_error_("DoubleMatArray param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));} 69 69 … … 77 77 void SetValue(int* intarray,int M){_error_("DoubleMatArray param of enum %i (%s) cannot hold a int vec array",enum_type,EnumToStringx(enum_type));} 78 78 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));} 81 81 void SetValue(FILE* fid){_error_("Bool param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 82 82 void SetValue(double** array, int M, int* mdim_array, int* ndim_array); -
issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.h
r11358 r11695 63 63 void GetParameterValue(double** pdoublearray,int* pM,int* pN); 64 64 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));} 67 67 void GetParameterValue(FILE** pfid){_error_("DoubleMat param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));} 68 68 … … 76 76 void SetValue(int* intarray,int M){_error_("DoubleMat param of enum %i (%s) cannot hold a int vec array",enum_type,EnumToStringx(enum_type));} 77 77 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));} 80 80 void SetValue(FILE* fid){_error_("DoubleMat param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 81 81 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 62 62 void GetParameterValue(double** pdoublearray,int* pM, int* pN); 63 63 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));} 66 66 void GetParameterValue(FILE** pfid){_error_("Double param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));} 67 67 … … 75 75 void SetValue(int* intarray,int M){_error_("Double param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} 76 76 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));} 79 79 void SetValue(FILE* fid){_error_("Double param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 80 80 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 62 62 void GetParameterValue(double** pdoublearray,int* pM, int* pN); 63 63 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));} 66 66 void GetParameterValue(FILE** pfid){_error_("DoubleVec param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));} 67 67 … … 75 75 void SetValue(int* intarray,int M){_error_("DoubleVec param of enum %i (%s) cannot hold a int mat array",enum_type,EnumToStringx(enum_type));}; 76 76 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));} 79 79 void SetValue(FILE* fid){_error_("DoubleVec param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 80 80 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 61 61 void GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("FileParam of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));} 62 62 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));} 65 65 void GetParameterValue(FILE** pfid){*pfid=value;}; 66 66 … … 74 74 void SetValue(int* intarray,int M){_error_("FileParam of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} 75 75 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));} 78 78 void SetValue(FILE* fid){_error_("File param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 79 79 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 63 63 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));}; 64 64 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));} 67 67 void GetParameterValue(FILE** pfid){_error_("IntMat param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));} 68 68 … … 76 76 void SetValue(int* intarray,int M){_error_("IntMat param of enum %i (%s) cannot hold a int vec array",enum_type,EnumToStringx(enum_type));}; 77 77 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));} 80 80 void SetValue(FILE* fid){_error_("IntMat param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 81 81 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 62 62 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));} 63 63 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));} 66 66 void GetParameterValue(FILE** pfid){_error_("Int param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));} 67 67 … … 75 75 void SetValue(double* doublearray,int M){_error_("Int param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));} 76 76 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));} 79 79 void SetValue(FILE* fid){_error_("Int param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 80 80 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 63 63 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));} 64 64 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));} 67 67 void GetParameterValue(FILE** pfid){_error_("IntVec param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));} 68 68 … … 76 76 void SetValue(int* intarray,int M); 77 77 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));} 80 80 void SetValue(FILE* fid){_error_("IntVec param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 81 81 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 41 41 virtual void GetParameterValue(double** pdoublearray,int* pM,int* pN)=0; 42 42 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; 45 45 virtual void GetParameterValue(FILE** pfid)=0; 46 46 … … 54 54 virtual void SetValue(int* intarray,int M)=0; 55 55 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; 58 58 virtual void SetValue(FILE* fid)=0; 59 59 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 64 64 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));} 65 65 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));} 68 68 void GetParameterValue(FILE** pfid){_error_("StringArray param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));} 69 69 … … 77 77 void SetValue(int* intarray,int M){_error_("StringArray param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} 78 78 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));} 81 81 void SetValue(FILE* fid){_error_("StringArray param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 82 82 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 62 62 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));} 63 63 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));} 66 66 void GetParameterValue(FILE** pfid){_error_("Bool param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));} 67 67 … … 75 75 void SetValue(int* intarray,int M){_error_("String param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} 76 76 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));} 79 79 void SetValue(FILE* fid){_error_("String param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 80 80 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 273 273 /*}}}*/ 274 274 /*FUNCTION Vertex::UpdateVertexPosition {{{1*/ 275 void Vertex::UpdatePosition(Vec vz,Parameters* parameters,double* thickness,double* bed){275 void Vertex::UpdatePosition(Vector* vz,Parameters* parameters,double* thickness,double* bed){ 276 276 277 277 double oldz,newz; … … 288 288 289 289 /*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 10 10 #include "./Object.h" 11 11 class IoModel; 12 class Vector; 13 class Parameters; 12 14 #include "../shared/Exceptions/exceptions.h" 13 15 #include "../toolkits/toolkits.h" … … 63 65 int Sid(void); 64 66 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); 66 68 /*}}}*/ 67 69 }; -
issm/trunk-jpl/src/c/objects/objects.h
r11670 r11695 135 135 #include "./Params/FileParam.h" 136 136 #include "./Params/Param.h" 137 #include "./Params/ PetscMatParam.h"138 #include "./Params/ PetscVecParam.h"137 #include "./Params/MatrixParam.h" 138 #include "./Params/VectorParam.h" 139 139 #include "./Params/StringArrayParam.h" 140 140 #include "./Params/StringParam.h" -
issm/trunk-jpl/src/c/shared/Exp/IsInPoly.cpp
r9320 r11695 15 15 16 16 /*IsInPoly {{{1*/ 17 int IsInPoly(Vec in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){17 int IsInPoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){ 18 18 19 19 int i; … … 37 37 38 38 //Get current value of value[i] -> do not change it if != 0 39 VecGetValues(in,1,&i,&value);39 in->GetValue(&value,i); 40 40 if (value){ 41 41 /*this vertex already is inside one of the contours, continue*/ … … 51 51 value=pnpoly(numvertices,xc,yc,x0,y0,edgevalue); 52 52 } 53 VecSetValues(in,1,&i,&value,INSERT_VALUES);53 in->SetValue(i,value,INS_VAL); 54 54 } 55 55 return 1; 56 56 }/*}}}*/ 57 57 /*IsOutsidePoly {{{1*/ 58 int IsOutsidePoly(Vec in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){58 int IsOutsidePoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){ 59 59 60 60 int i,j; … … 78 78 79 79 //Get current value of value[i] -> do not change it if != 0 80 VecGetValues(in,1,&i,&value);80 in->GetValue(&value,i); 81 81 if (value){ 82 82 /*this vertex already is inside one of the contours, continue*/ … … 92 92 value=1-pnpoly(numvertices,xc,yc,x0,y0,edgevalue); 93 93 } 94 VecSetValues(in,1,&i,&value,INSERT_VALUES);94 in->SetValue(i,value,INS_VAL); 95 95 } 96 96 return 1; -
issm/trunk-jpl/src/c/shared/Exp/exp.h
r9258 r11695 9 9 #include "../../toolkits/toolkits.h" 10 10 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);11 int IsInPoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue); 12 int IsOutsidePoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue); 13 13 int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue); 14 14 int 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 5 5 6 6 #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 7 14 8 15 int my_rank; … … 16 23 17 24 /*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 } 27 47 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); 38 49 } 39 ierr=PetscInitializeNoArguments();CHKERRQ(ierr); 40 ierr=PetscPopSignalHandler();CHKERRQ(ierr); 41 } 50 #endif 51 52 /*Initialize Petsc: */ 53 PetscInitializeNoArguments(); 42 54 #endif 43 44 /*Initialize Petsc: */45 PetscInitializeNoArguments();46 55 47 56 return 1; -
issm/trunk-jpl/src/c/shared/Numerics/PetscOptionsFromAnalysis.cpp
r9826 r11695 15 15 void PetscOptionsFromAnalysis(Parameters* parameters,int analysis_type){ 16 16 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; 24 19 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); 64 22 65 23 /*now, reset the options database with this string. Taken from petsc/install/src/sys/objects/pinit.c. This … … 72 30 //PetscOptionsCheckInitial_Components(); 73 31 PetscOptionsSetFromOptions(); 74 PetscOptionsInsertMultipleString( string); //our patch32 PetscOptionsInsertMultipleString(options); //our patch 75 33 #else 76 34 PetscOptionsSetFromOptions(); 77 35 PetscOptionsClear(); 78 36 //PetscOptionsSetFromOptions(); 79 PetscOptionsInsertMultipleString( string); //our patch37 PetscOptionsInsertMultipleString(options); //our patch 80 38 #endif 81 39 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); 91 42 } -
issm/trunk-jpl/src/c/shared/Numerics/numerics.h
r10367 r11695 27 27 void UnitConversion(double* values, int numvalues,int direction_enum, int type_enum); 28 28 double UnitConversion(double value, int direction_enum, int type_enum); 29 char* OptionsFromAnalysis(Parameters* parameters,int analysis_type); 30 void XZvectorsToCoordinateSystem(double* T,double* xzvectors); 31 #ifdef _HAVE_PETSC_ 29 32 void PetscOptionsFromAnalysis(Parameters* parameters,int analysis_type); 30 void XZvectorsToCoordinateSystem(double* T,double* xzvectors); 33 #endif 31 34 32 35 #endif //ifndef _NUMERICS_H_ -
issm/trunk-jpl/src/c/solutions/convergence.cpp
r11679 r11695 52 52 53 53 //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); 56 56 solver_residue=nKUF/nF; 57 57 _printf_(true,"\n%s%g\n"," solver residue: norm(KU-F)/norm(F)=",solver_residue); … … 67 67 KUold=uf->Duplicate(); Kff->MatMult(old_uf,KUold); 68 68 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); 71 71 res=nKUoldF/nF; 72 72 if (isnan(res)){ … … 94 94 //compute norm(du)/norm(u) 95 95 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); 97 97 98 98 if (isnan(ndu) || isnan(nu)) _error_("convergence criterion is NaN!"); … … 120 120 //compute max(du) 121 121 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); 123 123 if (isnan(ndu) || isnan(nu)) _error_("convergence criterion is NaN!"); 124 124 -
issm/trunk-jpl/src/c/solutions/gradient_core.cpp
r11313 r11695 18 18 double norm_inf; 19 19 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; 23 23 24 24 /*Compute gradient*/ … … 29 29 _printf_(VerboseControl()," orthogonalization\n"); 30 30 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); 32 32 } 33 33 else{ … … 36 36 37 37 /*Check that gradient is clean*/ 38 VecNorm(new_gradient,NORM_INFINITY,&norm_inf);38 norm_inf=new_gradient->Norm(NORM_INF); 39 39 if(norm_inf<=0) _error_("||∂J/∂α||∞ = 0 gradient norm is zero"); 40 40 if(isnan(norm_inf))_error_("||∂J/∂α||∞ = NaN gradient norm is NaN"); … … 42 42 /*plug back into inputs: */ 43 43 ControlInputSetGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,new_gradient); 44 VecFree(&new_gradient);44 xdelete(&new_gradient); 45 45 46 46 /*Scale Gradients*/ -
issm/trunk-jpl/src/c/solutions/issm.cpp
r11275 r11695 37 37 double start_core, finish_core; 38 38 double start_init, finish_init; 39 int ierr; 39 40 40 41 MODULEBOOT(); … … 44 45 #endif 45 46 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,""); 48 50 if(ierr) _error_("Could not initialize Petsc"); 51 #else 52 MPI_Init(&argc,&argv); 53 #endif 54 49 55 MPI_Barrier(MPI_COMM_WORLD); start=MPI_Wtime(); 50 56 … … 130 136 _printf_(true," %-34s %f seconds \n","Core solution elapsed time:",finish_core-start_core); 131 137 _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 132 140 _printf_(true,"closing MPI and Petsc\n"); 141 #ifdef _HAVE_PETSC_ 133 142 PetscFinalize(); 143 #else 144 MPI_Finalize(); 145 #endif 134 146 135 147 /*end module: */ -
issm/trunk-jpl/src/c/toolkits/mpi/patches/MPI_Boundariesfromrange.cpp
r1 r11695 4 4 */ 5 5 6 #include "../../petsc/patches/petscpatches.h"7 6 #include "./mpipatches.h" 8 7 #include "../../../shared/shared.h" -
issm/trunk-jpl/src/c/toolkits/mpi/patches/MPI_Lowerrow.cpp
r365 r11695 7 7 */ 8 8 9 #include "../../petsc/patches/petscpatches.h"10 9 #include "./mpipatches.h" 11 10 … … 19 18 20 19 /*First, figure out our range : */ 21 range= PetscDetermineLocalSize(n);20 range=DetermineLocalSize(n); 22 21 23 22 /*Now determien upper and lower boundaries: */ -
issm/trunk-jpl/src/c/toolkits/mpi/patches/MPI_Upperrow.cpp
r1 r11695 7 7 */ 8 8 9 #include "../../petsc/patches/petscpatches.h"10 9 #include "./mpipatches.h" 11 10 … … 17 16 18 17 /*First, figure out our range : */ 19 range= PetscDetermineLocalSize(n);18 range=DetermineLocalSize(n); 20 19 21 20 /*Now determien upper and lower boundaries: */ -
issm/trunk-jpl/src/c/toolkits/mpi/patches/mpipatches.h
r1 r11695 11 11 int MPI_Lowerrow(int n); 12 12 int MPI_Upperrow(int n); 13 int DetermineLocalSize(int global_size); 13 14 14 15 -
issm/trunk-jpl/src/c/toolkits/petsc/patches/MatPartition.cpp
r11197 r11695 15 15 16 16 #include "../../../shared/shared.h" 17 #include "../../mpi/patches/mpipatches.h" 17 18 18 19 int MatPartition(Mat* poutmatrix,Mat matrixA,double* row_partition_vector,int row_partition_vector_size , … … 97 98 98 99 /*Call MatGetSubMatrix*/ 99 csize= PetscDetermineLocalSize(col_partition_vector_size);100 csize=DetermineLocalSize(col_partition_vector_size); 100 101 if(col_partition_vector_size==row_partition_vector_size){ 101 102 #if _PETSC_MAJOR_ >= 3 -
issm/trunk-jpl/src/c/toolkits/petsc/patches/MatToSerial.cpp
r3332 r11695 2 2 * \brief gather a Petsc Mat matrix onto cpu 0 3 3 */ 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 4 11 5 12 #include "../petscincludes.h" -
issm/trunk-jpl/src/c/toolkits/petsc/patches/NewMat.cpp
r9826 r11695 18 18 #include "../../../shared/shared.h" 19 19 #include "../../../include/include.h" 20 #include "../../mpi/patches/mpipatches.h" 20 21 21 22 /*NewMat(int M,int N){{{1*/ … … 31 32 32 33 /*Determine local sizes: */ 33 m= PetscDetermineLocalSize(M);34 n= PetscDetermineLocalSize(N);34 m=DetermineLocalSize(M); 35 n=DetermineLocalSize(N); 35 36 36 37 nnz=(int)((double)M*(double)N*sparsity); //number of non zeros. … … 55 56 56 57 /*Determine local sizes: */ 57 m= PetscDetermineLocalSize(M);58 n= PetscDetermineLocalSize(N);58 m=DetermineLocalSize(M); 59 n=DetermineLocalSize(N); 59 60 60 61 nnz=(int)((double)M*(double)N*sparsity); //number of non zeros. … … 85 86 86 87 /*Determine local sizes: */ 87 m= PetscDetermineLocalSize(M);88 n= PetscDetermineLocalSize(N);88 m=DetermineLocalSize(M); 89 n=DetermineLocalSize(N); 89 90 90 91 /*Figure out number of non zeros per row: */ -
issm/trunk-jpl/src/c/toolkits/petsc/patches/NewVec.cpp
r9320 r11695 15 15 16 16 #include "./petscpatches.h" 17 #include "../../mpi/patches/mpipatches.h" 17 18 18 19 Vec NewVec(int size,bool fromlocalsize){ … … 29 30 } 30 31 else{ 31 local_size= PetscDetermineLocalSize(size);32 local_size=DetermineLocalSize(size); 32 33 } 33 34 -
issm/trunk-jpl/src/c/toolkits/petsc/patches/VecToMPISerial.cpp
r3595 r11695 2 2 * \brief gather a Petsc Vector spread across the cluster, onto node 0, and then broadcast to all nodes. 3 3 */ 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 4 11 5 12 #include "../petscincludes.h" -
issm/trunk-jpl/src/c/toolkits/petsc/patches/petscpatches.h
r9291 r11695 12 12 13 13 #include "./SolverEnum.h" 14 #include "../../toolkitsenums.h" 14 15 15 16 class Parameters; … … 21 22 int PetscMatrixToMatlabMatrix(mxArray** pdataref,Mat matrix); 22 23 int 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);25 24 #endif 26 25 27 int PetscDetermineLocalSize(int global_size);28 26 Vec NewVec(int size,bool fromlocalsize=false); 29 27 Mat NewMat(int M,int N); … … 49 47 void VecDuplicatePatch(Vec* output, Vec input); 50 48 Vec SerialToVec(double* vector,int vector_size); 49 InsertMode ISSMToPetscInsertMode(InsMode mode); 50 NormType ISSMToPetscNormMode(NormMode mode); 51 51 52 52 #endif -
issm/trunk-jpl/src/c/toolkits/petsc/petscincludes.h
r9320 r11695 5 5 #ifndef _PETSC_INCLUDES_H_ 6 6 #define _PETSC_INCLUDES_H_ 7 8 #ifdef _HAVE_PETSC_ 7 9 8 10 /*Petsc includes: */ … … 16 18 17 19 #endif 20 #endif -
issm/trunk-jpl/src/c/toolkits/plapack/plapackincludes.h
r9320 r11695 6 6 #define _PLA_INCLUDES_H_ 7 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 14 8 15 #include "PLA.h" 9 16 … … 12 19 13 20 /*our own patches: */ 21 #ifdef _HAVE_PETSC_ 14 22 #include "patches/petscpatches.h" 23 #endif 15 24 16 25 -
issm/trunk-jpl/src/c/toolkits/toolkits.h
r8901 r11695 6 6 #define _TOOLKITS_H_ 7 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 14 #ifdef _HAVE_PETSC_ 8 15 #include "./petsc/petscincludes.h" 16 #endif 17 9 18 #include "./mpi/mpiincludes.h" 10 19 #include "./metis/metisincludes.h" 11 20 #include "./triangle/triangleincludes.h" 12 21 #include "./matlab/matlabincludes.h" 22 #include "./double/double.h" 23 #include "./toolkitsenums.h" 13 24 14 25 #endif -
issm/trunk-jpl/src/mex/ComputeBasalStress/ComputeBasalStress.cpp
r8910 r11695 17 17 18 18 /* output datasets: */ 19 Vec sigma_g=NULL;19 Vector* sigma_g=NULL; 20 20 21 21 /*Boot module: */ … … 51 51 delete loads; 52 52 delete parameters; 53 VecFree(&sigma_g);53 xdelete(&sigma_g); 54 54 55 55 /*end module: */ -
issm/trunk-jpl/src/mex/ContourToMesh/ContourToMesh.cpp
r8910 r11695 33 33 34 34 /* output: */ 35 Vec in_nod=NULL;35 Vector* in_nod=NULL; 36 36 int nods; 37 Vec in_elem=NULL;37 Vector* in_elem=NULL; 38 38 int nel; 39 39 -
issm/trunk-jpl/src/mex/ContourToNodes/ContourToNodes.cpp
r8910 r11695 35 35 36 36 /* output: */ 37 Vec flags=NULL;37 Vector* flags=NULL; 38 38 int nods; 39 39 -
issm/trunk-jpl/src/mex/ControlInputGetGradient/ControlInputGetGradient.cpp
r11313 r11695 14 14 Materials *materials = NULL; 15 15 Parameters *parameters = NULL; 16 Vec gradient = NULL;16 Vector* gradient = NULL; 17 17 18 18 /* output datasets: elements and loads*/ -
issm/trunk-jpl/src/mex/GetVectorFromInputs/GetVectorFromInputs.cpp
r8910 r11695 16 16 int name_enum; 17 17 int type_enum; 18 Vec ug=NULL;18 Vector* ug=NULL; 19 19 20 20 /* output datasets: elements and loads*/ -
issm/trunk-jpl/src/mex/Gradj/Gradj.cpp
r11313 r11695 18 18 19 19 /* output datasets: */ 20 Vec gradient = NULL;20 Vector* gradient = NULL; 21 21 22 22 /*Boot module: */ … … 54 54 delete materials; 55 55 delete parameters; 56 VecFree(&gradient);56 xdelete(&gradient); 57 57 58 58 /*end module: */ -
issm/trunk-jpl/src/mex/InterpFromGridToMesh/InterpFromGridToMesh.cpp
r10949 r11695 37 37 38 38 /* output: */ 39 Vec data_mesh=NULL;39 Vector* data_mesh=NULL; 40 40 41 41 /*Boot module: */ -
issm/trunk-jpl/src/mex/InterpFromMesh2d/InterpFromMesh2d.cpp
r8910 r11695 61 61 62 62 /* output: */ 63 Vec data_prime=NULL;63 Vector* data_prime=NULL; 64 64 65 65 /*Boot module: */ -
issm/trunk-jpl/src/mex/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
r10949 r11695 55 55 56 56 /* output: */ 57 Vec data_prime=NULL;57 Vector* data_prime=NULL; 58 58 59 59 /*Boot module: */ -
issm/trunk-jpl/src/mex/Makefile.am
r11435 r11695 76 76 SurfaceArea\ 77 77 SystemMatrices\ 78 Test\79 78 TimeAdapt\ 80 79 TriaSearch\ … … 206 205 GroundinglineMigration/GroundinglineMigration.h 207 206 208 Test_SOURCES = Test/Test.cpp\209 Test/Test.h210 211 207 HoleFiller_SOURCES = HoleFiller/HoleFiller.cpp\ 212 208 HoleFiller/HoleFiller.h -
issm/trunk-jpl/src/mex/Orth/Orth.cpp
r8910 r11695 8 8 9 9 /*input datasets: */ 10 Vec gradj=NULL;11 Vec oldgradj=NULL;10 Vector* gradj=NULL; 11 Vector* oldgradj=NULL; 12 12 13 13 /* output datasets: */ 14 Vec newgradj=NULL;14 Vector* newgradj=NULL; 15 15 16 16 /*Boot module: */ … … 31 31 32 32 /*Free ressources: */ 33 VecFree(&gradj);34 VecFree(&oldgradj);35 VecFree(&newgradj);33 xdelete(&gradj); 34 xdelete(&oldgradj); 35 xdelete(&newgradj); 36 36 37 37 /*end module: */ -
issm/trunk-jpl/src/mex/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp
r8910 r11695 17 17 18 18 /* output: */ 19 Vec flags=NULL;19 Vector* flags=NULL; 20 20 21 21 /*Boot module: */ -
issm/trunk-jpl/src/mex/ResetCoordinateSystem/ResetCoordinateSystem.cpp
r10440 r11695 17 17 18 18 /* output datasets: */ 19 Vec sigma_g=NULL;19 Vector* sigma_g=NULL; 20 20 21 21 /*Boot module: */ -
issm/trunk-jpl/src/mex/Solver/Solver.cpp
r11686 r11695 15 15 Parameters *parameters = NULL; 16 16 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: */ 25 22 mxArray* array[2]; 26 23 24 /*Start module: */ 27 25 MODULEBOOT(); 28 26 … … 34 32 35 33 /*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 #endif40 34 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"); 43 37 44 38 /*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)){ 46 40 47 41 /*Input datasets: */ … … 58 52 } 59 53 else{ 60 /* Matlab solver: */54 /*Call Matlab solver: */ 61 55 if (VerboseModule()) printf(" Solving\n"); 62 56 array[0]=KFF;
Note:
See TracChangeset
for help on using the changeset viewer.