Changeset 14822
- Timestamp:
- 04/30/13 15:42:20 (12 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 43 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/Container/Vertices.cpp
r14476 r14822 206 206 int my_rank; 207 207 int num_vertices; 208 208 209 209 /*output: */ 210 210 Matrix<IssmDouble>* xyz = NULL; -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r14807 r14822 39 39 this->comm=incomm; 40 40 this->SetStaticComm(); 41 41 42 42 /*Now, initialize PETSC: */ 43 43 #ifdef _HAVE_PETSC_ … … 129 129 /*Now delete: */ 130 130 delete profiler; 131 131 132 132 /*Finalize PETSC for this model: */ 133 133 #ifdef _HAVE_PETSC_ … … 673 673 /*}}}*/ 674 674 void FemModel::Responsex(IssmDouble* responses,int response_descriptor_enum,bool process_units,int weight_index){/*{{{*/ 675 676 675 677 676 switch (response_descriptor_enum){ … … 719 718 void FemModel::RequestedOutputsx(int* requested_outputs, int numoutputs){/*{{{*/ 720 719 721 722 720 int output_enum; 723 721 int step; … … 763 761 void FemModel::RequestedDependentsx(void){/*{{{*/ 764 762 765 766 763 bool isautodiff = false; 767 764 IssmDouble output_value; … … 1386 1383 void FemModel::ThicknessAbsGradientx( IssmDouble* pJ, bool process_units, int weight_index){/*{{{*/ 1387 1384 1388 1389 1385 /*Intermediary*/ 1390 1386 int i; … … 1414 1410 void FemModel::CostFunctionx(IssmDouble* pJ){/*{{{*/ 1415 1411 1416 1417 1412 /*Intermediary*/ 1418 1413 int num_responses; … … 1442 1437 #ifdef _HAVE_DAKOTA_ 1443 1438 void FemModel::DakotaResponsesx(double* d_responses,char** responses_descriptors,int numresponsedescriptors,int d_numresponses){/*{{{*/ 1444 1445 1439 1446 1440 int i,j; -
issm/trunk-jpl/src/c/classes/IssmComm.cpp
r14292 r14822 36 36 37 37 int my_rank = 0; 38 38 39 39 /*for matlab and python modules*/ 40 40 if(!parallel) return my_rank; -
issm/trunk-jpl/src/c/classes/ToolkitOptions.cpp
r14688 r14822 25 25 toolkitoptions= xNew<char>(strlen(options)+1); 26 26 sprintf(toolkitoptions, "%s",options); 27 28 27 29 28 }/*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Bucket.h
r14787 r14822 31 31 32 32 public: 33 33 34 34 /*constructors, destructors: */ 35 35 Bucket(){ /*{{{*/ … … 37 37 } /*}}}*/ 38 38 Bucket(int min,int* idxmin,int nin,int* idxnin,doubletype* valuesin,InsMode modein){ /*{{{*/ 39 39 40 40 this->Initialize(); 41 41 … … 59 59 Bucket(int min,int* idxmin,doubletype* valuesin,InsMode modein){ /*{{{*/ 60 60 this->Initialize(); 61 61 62 62 this->type=VECTOR_BUCKET; 63 63 this->m=min; … … 66 66 this->idxm=xNew<int>(this->m); 67 67 xMemCpy(this->idxm,idxmin,this->m); 68 68 69 69 this->values=xNew<doubletype>(this->m); 70 70 xMemCpy(this->values,valuesin,this->m); … … 77 77 } /*}}}*/ 78 78 void Initialize(void){ /*{{{*/ 79 79 80 80 this->type=0; 81 81 this->m=0; … … 87 87 88 88 } /*}}}*/ 89 90 89 91 90 /*object virtual functions definitions:*/ … … 130 129 _error_("Not implemented yet (similar to Elements)"); }; 131 130 /*}}}*/ 132 131 133 132 /*specific routines of Bucket: */ 134 133 void SpawnBucketsPerCpu(DataSet* bucketsofcpu_i,int rank_i,int* rowranks){ /*{{{*/ … … 160 159 } 161 160 } 162 161 163 162 }; 164 163 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
r14807 r14822 844 844 /*Recover parameters and values*/ 845 845 GetInputListOnVertices(&gl[0],GLlevelsetEnum); 846 846 847 847 /*Be sure that values are not zero*/ 848 848 if(gl[0]==0) gl[0]=gl[0]+epsilon; -
issm/trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp
r14794 r14822 65 65 } 66 66 67 68 67 this->numanalyses = in_numanalyses; 69 68 this->hnodes = new Hook*[in_numanalyses]; -
issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
r14810 r14822 1154 1154 /*Recover parameters and values*/ 1155 1155 GetInputListOnVertices(&gl[0],GLlevelsetEnum); 1156 1156 1157 1157 /*Be sure that values are not zero*/ 1158 1158 if(gl[0]==0) gl[0]=gl[0]+epsilon; … … 2416 2416 rho_ice=matpar->GetRhoIce(); 2417 2417 rho_water=matpar->GetRhoFreshwater(); 2418 2418 2419 2419 /*Get desertification effect parameters*/ 2420 2420 desfac=matpar->GetDesFac(); … … 3138 3138 if (!thickness_input)_error_("thickness input needed to compute gia deflection!"); 3139 3139 thickness_input->GetInputUpToCurrentTimeAverages(&hes,×,&numtimes,currenttime); 3140 3140 3141 3141 /*recover lithosphere thickness: */ 3142 3142 lithosphere_thickness_input=inputs->GetInput(GiaLithosphereThicknessEnum); … … 3177 3177 xi=x[i]; yi=y[i]; 3178 3178 ri=sqrt(pow(xi-x0,2)+pow(yi-y0,2)); 3179 3179 3180 3180 /*load ri onto arguments for this vertex i: */ 3181 3181 arguments.ri=ri; … … 4526 4526 } 4527 4527 } 4528 4529 4528 4530 4529 gradient->SetValues(NUMVERTICES,vertexpidlist,grade_g,ADD_VAL); … … 5858 5857 /*FUNCTION Tria::CreateKMatrixHydrologyShreve{{{*/ 5859 5858 ElementMatrix* Tria::CreateKMatrixHydrologyShreve(void){ 5860 5859 5861 5860 /*Constants*/ 5862 5861 const int numdof=NDOF1*NUMVERTICES; 5863 5862 5864 5863 /*Intermediaries */ 5865 5864 IssmDouble diffusivity; … … 5877 5876 IssmDouble DLprime[2][2] ={0.0}; 5878 5877 GaussTria *gauss=NULL; 5879 5878 5880 5879 /*Skip if water or ice shelf element*/ 5881 5880 if(IsOnWater() | IsFloating()) return NULL; 5882 5881 5883 5882 /*Initialize Element matrix*/ 5884 5883 ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum); 5885 5884 5886 5885 /*Create water velocity vx and vy from current inputs*/ 5887 5886 CreateHydrologyWaterVelocityInput(); 5888 5887 5889 5888 /*Retrieve all inputs and parameters*/ 5890 5889 GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); … … 5894 5893 Input* vy_input=inputs->GetInput(HydrologyWaterVyEnum); _assert_(vy_input); 5895 5894 h=sqrt(2*this->GetArea()); 5896 5895 5897 5896 /* Start looping on the number of gaussian points: */ 5898 5897 gauss=new GaussTria(2); 5899 5898 for(int ig=gauss->begin();ig<gauss->end();ig++){ 5900 5899 5901 5900 gauss->GaussPoint(ig); 5902 5901 5903 5902 GetJacobianDeterminant(&Jdettria, &xyz_list[0][0],gauss); 5904 5903 GetL(&L[0], &xyz_list[0][0], gauss,NDOF1); 5905 5904 5906 5905 vx_input->GetInputValue(&vx,gauss); 5907 5906 vy_input->GetInputValue(&vy,gauss); 5908 5907 vx_input->GetInputDerivativeValue(&dvx[0],&xyz_list[0][0],gauss); 5909 5908 vy_input->GetInputDerivativeValue(&dvy[0],&xyz_list[0][0],gauss); 5910 5909 5911 5910 DL_scalar=gauss->weight*Jdettria; 5912 5911 5913 5912 TripleMultiply( &L[0],1,numdof,1, 5914 5913 &DL_scalar,1,1,0, 5915 5914 &L[0],1,numdof,0, 5916 5915 &Ke->values[0],1); 5917 5916 5918 5917 GetBPrognostic(&B[0][0], &xyz_list[0][0], gauss); 5919 5918 GetBprimePrognostic(&Bprime[0][0], &xyz_list[0][0], gauss); 5920 5919 5921 5920 dvxdx=dvx[0]; 5922 5921 dvydy=dvy[1]; 5923 5922 DL_scalar=dt*gauss->weight*Jdettria; 5924 5923 5925 5924 DL[0][0]=DL_scalar*dvxdx; 5926 5925 DL[1][1]=DL_scalar*dvydy; 5927 5926 DLprime[0][0]=DL_scalar*vx; 5928 5927 DLprime[1][1]=DL_scalar*vy; 5929 5928 5930 5929 TripleMultiply( &B[0][0],2,numdof,1, 5931 5930 &DL[0][0],2,2,0, 5932 5931 &B[0][0],2,numdof,0, 5933 5932 &Ke->values[0],1); 5934 5933 5935 5934 TripleMultiply( &B[0][0],2,numdof,1, 5936 5935 &DLprime[0][0],2,2,0, 5937 5936 &Bprime[0][0],2,numdof,0, 5938 5937 &Ke->values[0],1); 5939 5938 5940 5939 /*Artificial diffusivity*/ 5941 5940 vel=sqrt(vx*vx+vy*vy); … … 5948 5947 KDL[0][1]=DL_scalar*K[0][1]; 5949 5948 KDL[1][1]=DL_scalar*K[1][1]; 5950 5949 5951 5950 TripleMultiply( &Bprime[0][0],2,numdof,1, 5952 5951 &KDL[0][0],2,2,0, … … 5954 5953 &Ke->values[0],1); 5955 5954 } 5956 5955 5957 5956 /*Clean up and return*/ 5958 5957 delete gauss; … … 6008 6007 GetL(&L[0], &xyz_list[0][0], gauss,NDOF1); 6009 6008 D_scalar=sediment_storing*gauss->weight*Jdet; 6010 6009 6011 6010 TripleMultiply(&L[0],numdof,1,0, 6012 6011 &D_scalar,1,1,0, … … 6069 6068 GetL(&L[0], &xyz_list[0][0], gauss,NDOF1); 6070 6069 D_scalar=epl_storing*gauss->weight*Jdet; 6071 6070 6072 6071 TripleMultiply(&L[0],numdof,1,0, 6073 6072 &D_scalar,1,1,0, … … 6155 6154 Input* water_input=inputs->GetInput(BasalforcingsMeltingRateEnum); _assert_(water_input); 6156 6155 Input* old_wh_input=NULL; 6157 6156 6158 6157 if(reCast<bool,IssmDouble>(dt)){ 6159 6158 old_wh_input=inputs->GetInput(SedimentHeadEnum); _assert_(old_wh_input); 6160 6159 } 6161 6160 6162 6161 /* Start looping on the number of gaussian points: */ 6163 6162 gauss=new GaussTria(2); … … 6212 6211 Input* water_input=inputs->GetInput(BasalforcingsMeltingRateEnum); _assert_(water_input); 6213 6212 Input* old_wh_input=NULL; 6214 6213 6215 6214 if(reCast<bool,IssmDouble>(dt)){ 6216 6215 old_wh_input=inputs->GetInput(EplHeadEnum); _assert_(old_wh_input); 6217 6216 } 6218 6217 6219 6218 /* Start looping on the number of gaussian points: */ 6220 6219 gauss=new GaussTria(2); … … 6364 6363 /*Get the flag to the limitation method*/ 6365 6364 this->parameters->FindParam(&hmax_flag,HydrologydcSedimentlimitFlagEnum); 6366 6365 6367 6366 /*Switch between the different cases*/ 6368 6367 switch(hmax_flag){ -
issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp
r14809 r14822 295 295 296 296 if((iscurrenttime_included==false) && (i==(numsteps-1))){ 297 297 298 298 /*Retrieve interpolated values for current time step: */ 299 299 Input* input=GetTimeInput(currenttime); -
issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp
r14809 r14822 192 192 outvalues=xNew<IssmDouble>(1); 193 193 times=xNew<IssmDouble>(1); 194 194 195 195 outvalues[0]=1./3.*(values[0]+values[1]+values[2]); 196 196 times[0]=0; /*we don't have a time*/ … … 212 212 outvalues=xNew<IssmDouble>(1); 213 213 times=xNew<IssmDouble>(1); 214 214 215 215 outvalues[0]=1./3.*(values[0]+values[1]+values[2]); 216 216 times[0]=currenttime; /*we don't have a time*/ … … 221 221 } 222 222 /*}}}*/ 223 224 223 225 224 /*Intermediary*/ -
issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.cpp
r14796 r14822 65 65 iomodel->Constant(&this->water_compressibility,HydrologydcWaterCompressibilityEnum); 66 66 iomodel->Constant(&isefficientlayer,HydrologydcIsefficientlayerEnum); 67 68 67 69 68 if(isefficientlayer){ … … 77 76 _error_("Hydrology model "<<EnumToStringx(hydrology_model)<<" not supported yet"); 78 77 } 79 78 80 79 /*gia: */ 81 80 iomodel->Constant(&this->lithosphere_shear_modulus,MaterialsLithosphereShearModulusEnum); … … 466 465 /*FUNCTION Matpar::UnitConversion {{{*/ 467 466 void Matpar::UnitConversion(void){ 468 467 469 468 /*convert units of fields that were allocated using the Ext unit system, into the Iu unit system: */ 470 469 ::UnitConversion(&this->lithosphere_density,1,ExtToIuEnum,MaterialsLithosphereDensityEnum); … … 473 472 } 474 473 /*}}}*/ 475 -
issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.h
r14757 r14822 31 31 IssmDouble desfac; 32 32 IssmDouble s0p; 33 33 34 34 /*hydrology Shreve: */ 35 35 IssmDouble hydro_kn; … … 57 57 IssmDouble mantle_viscosity; 58 58 IssmDouble mantle_density; 59 60 59 61 60 public: -
issm/trunk-jpl/src/c/classes/objects/Vertex.cpp
r14763 r14822 214 214 IssmDouble xyz[3]; 215 215 int indices[3]; 216 216 217 217 if (this->clone==true) return; 218 218 -
issm/trunk-jpl/src/c/classes/toolkits/Matrix.h
r14792 r14822 42 42 /*FUNCTION Matrix(int M,int N){{{*/ 43 43 Matrix(int M,int N){ 44 44 45 45 InitCheckAndSetType(); 46 46 … … 74 74 /*FUNCTION Matrix(int M,int N,IssmDouble sparsity){{{*/ 75 75 Matrix(int M,int N,double sparsity){ 76 76 77 77 InitCheckAndSetType(); 78 78 … … 89 89 /*FUNCTION Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity){{{*/ 90 90 Matrix(IssmPDouble* serial_mat,int M,int N,IssmPDouble sparsity){ 91 91 92 92 InitCheckAndSetType(); 93 93 … … 105 105 /*FUNCTION Matrix(int M,int N,int connectivity,int numberofdofspernode){{{*/ 106 106 Matrix(int M,int N,int connectivity,int numberofdofspernode){ 107 107 108 108 InitCheckAndSetType(); 109 109 … … 157 157 } 158 158 else _error_("unknow toolkit type "); 159 159 160 160 /*Free ressources: */ 161 161 xDelete<char>(toolkittype); -
issm/trunk-jpl/src/c/classes/toolkits/Solver.h
r14797 r14822 48 48 } 49 49 /*}}}*/ 50 50 51 51 /*Methods: */ 52 52 Vector<doubletype>* Solve(void){ /*{{{*/ -
issm/trunk-jpl/src/c/classes/toolkits/Vector.h
r14792 r14822 39 39 /*}}}*/ 40 40 Vector(int M,bool fromlocalsize=false){ /*{{{*/ 41 41 42 42 InitCheckAndSetType(); 43 43 … … 64 64 /*}}}*/ 65 65 Vector(doubletype* serial_vec,int M){ /*{{{*/ 66 66 67 67 InitCheckAndSetType(); 68 68 … … 120 120 } 121 121 else _error_("unknow toolkit type "); 122 122 123 123 /*Free ressources: */ 124 124 xDelete<char>(toolkittype); … … 201 201 bool IsEmpty(void){ 202 202 int M; 203 203 204 204 _assert_(this); 205 205 this->GetSize(&M); … … 227 227 228 228 Vector<doubletype>* output=NULL; 229 229 230 230 output=new Vector<doubletype>(); 231 231 … … 280 280 281 281 doubletype* vec_serial=NULL; 282 282 283 283 _assert_(this); 284 284 if(type==PetscVecType){ -
issm/trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStatex.cpp
r14704 r14822 28 28 /*Do we have penalties linked to rifts? In this case, run our special rifts penalty 29 29 * management routine, otherwise, skip : */ 30 30 31 31 /*No constraints management by default!:*/ 32 32 num_unstable_constraints=0; -
issm/trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp
r14791 r14822 24 24 ssize=nodes->NumberOfDofs(configuration_type,SsetEnum); 25 25 slocalsize = nodes->NumberOfDofsLocal(configuration_type,SsetEnum); 26 27 26 28 27 /*allocate:*/ -
issm/trunk-jpl/src/c/modules/EdgeDetectionx/EdgeDetectionx.cpp
r14718 r14822 18 18 19 19 _assert_(contours); 20 20 21 21 /*output: */ 22 22 Contour<IssmPDouble>* contour=NULL; … … 35 35 /*Add contour to our dataset of contours: */ 36 36 contours->AddObject(contour); 37 37 38 38 } -
issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp
r14789 r14822 20 20 /*output: */ 21 21 Vector<IssmDouble>* solution=NULL; 22 22 23 23 if(VerboseModule()) _pprintLine_(" Get solution from inputs"); 24 24 -
issm/trunk-jpl/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp
r14814 r14822 21 21 double pset[7]; 22 22 }; 23 23 24 24 struct blockt{ 25 25 double time[Ntimp]; … … 36 36 double zhload[Ntime]; 37 37 }; 38 38 39 39 struct blockn{ 40 40 int irate; … … 64 64 65 65 /*}}}*/ 66 66 67 67 void GiaDeflectionCorex( IssmDouble* pwi, IssmDouble* pdwidt, GiaDeflectionCoreArgs* arguments){ 68 68 … … 70 70 IssmDouble wi=0; 71 71 IssmDouble dwidt=0; 72 72 73 73 /*inputs: {{{*/ 74 74 /*constant: */ … … 104 104 105 105 /*}}}*/ 106 106 107 107 /*Recover material parameters and loading history: see GiaDeflectionCoreArgs for more details {{{*/ 108 108 ri=arguments->ri; … … 140 140 blockp_.pset[6]=re; 141 141 blocko_.rhoi=rho_ice; 142 142 143 143 /*loading history: */ 144 144 blocky_.zhload[0]=hes[1]; -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
r14808 r14822 139 139 parameters->AddObject(new IntParam(AnalysisTypeEnum,analysis_type)); 140 140 parameters->AddObject(new IntParam(AnalysisCounterEnum,analysis_counter)); 141 141 142 142 iomodel->Constant(&time,TimesteppingStartTimeEnum); 143 143 parameters->AddObject(new DoubleParam(TimeEnum,time)); //start at time 0 by default for all solutions FIXME: to be deleted -
issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp
r14529 r14822 93 93 elements->InputDuplicate(VxEnum,InversionVxObsEnum); 94 94 if(dakota_analysis)elements->InputDuplicate(VxEnum,QmuVxEnum); 95 95 96 96 #ifdef _HAVE_ANDROID_ 97 97 elements->InputDuplicate(FrictionCoefficientEnum,AndroidFrictionCoefficientEnum); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Gia/CreateNodesGia.cpp
r14588 r14822 44 44 } 45 45 } 46 46 47 47 /*Clean fetched data: */ 48 48 iomodel->DeleteData(1,MaskVertexonwaterEnum); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/HydrologyDCEfficient/CreateParametersHydrologyDCEfficient.cpp
r14769 r14822 37 37 } 38 38 39 40 39 /*Nothing for now*/ 41 40 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/HydrologyDCInefficient/CreateParametersHydrologyDCInefficient.cpp
r14796 r14822 34 34 iomodel->FetchData(&isefficientlayer,HydrologydcIsefficientlayerEnum); 35 35 iomodel->FetchData(&sedimentlimit_flag,HydrologydcSedimentlimitFlagEnum); 36 36 37 37 if(sedimentlimit_flag==1){ 38 38 iomodel->FetchData(&sedimentlimit,HydrologydcSedimentlimitEnum); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
r14585 r14822 44 44 45 45 SetVerbosityLevel(verbose); 46 46 47 47 if(VerboseMProcessor()) _pprintLine_(" starting model processor "); 48 48 -
issm/trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp
r14788 r14822 16 16 IssmDouble *ug_serial = NULL; 17 17 bool oldalloc = false; 18 18 19 19 if(VerboseModule()) _pprintLine_(" Reduce vector from g to f set"); 20 20 -
issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp
r14793 r14822 16 16 /*intermediary: */ 17 17 Solver<IssmDouble> *solver=NULL; 18 18 19 19 /*output: */ 20 20 Vector<IssmDouble> *uf=NULL; -
issm/trunk-jpl/src/c/shared/Numerics/ToolkitsOptionsFromAnalysis.cpp
r14633 r14822 19 19 20 20 char* options=NULL; 21 21 22 22 /*Recover first the options string for this analysis: */ 23 23 options=OptionsFromAnalysis(parameters,analysis_type); … … 45 45 46 46 #endif 47 47 48 48 xDelete<char>(options); 49 49 } -
issm/trunk-jpl/src/c/solutions/EnvironmentFinalize.cpp
r13797 r14822 17 17 /*Make sure we are all here*/ 18 18 MPI_Barrier(MPI_COMM_WORLD); 19 19 20 20 /*Print closing statement*/ 21 21 int my_rank; -
issm/trunk-jpl/src/c/solutions/convergence.cpp
r14664 r14822 30 30 IssmDouble eps_abs; 31 31 IssmDouble yts; 32 32 33 33 if(VerboseModule()) _pprintLine_(" checking convergence"); 34 34 -
issm/trunk-jpl/src/c/solutions/gia_core.cpp
r14807 r14822 12 12 13 13 void gia_core(FemModel* femmodel){ 14 14 15 15 int i; 16 16 Vector<IssmDouble>* wg = NULL; … … 27 27 femmodel->parameters->FindParam(&save_results,SaveResultsEnum); 28 28 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum); 29 29 30 30 if(VerboseSolution()) _pprintLine_(" computing GIA"); 31 31 -
issm/trunk-jpl/src/c/solutions/hydrology_core.cpp
r14769 r14822 24 24 IssmDouble starttime,final_time; 25 25 IssmDouble time,dt; 26 26 27 27 /*first recover parameters common to all solutions*/ 28 28 femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum); … … 92 92 } 93 93 94 95 94 } 96 95 } -
issm/trunk-jpl/src/c/toolkits/issm/IssmAbsMat.h
r14671 r14822 38 38 39 39 public: 40 40 41 41 /*IssmAbsMat constructors, destructors*/ 42 42 virtual ~IssmAbsMat(){}; -
issm/trunk-jpl/src/c/toolkits/issm/IssmAbsVec.h
r14671 r14822 37 37 38 38 public: 39 39 40 40 /*IssmAbsVec constructors, destructors*/ 41 41 ~IssmAbsVec(){/*{{{*/ -
issm/trunk-jpl/src/c/toolkits/issm/IssmMat.h
r14684 r14822 38 38 class IssmMat{ 39 39 40 41 40 public: 42 41 43 42 IssmAbsMat<doubletype>* matrix; /*abstract matrix, which implements object orientation*/ 44 43 … … 64 63 /*}}}*/ 65 64 IssmMat(int M,int N){ /*{{{*/ 66 65 67 66 switch(IssmMatTypeFromToolkitOptions()){ 68 67 … … 141 140 /*}}}*/ 142 141 IssmMat(int M,int N, int connectivity, int numberofdofspernode){ /*{{{*/ 143 142 144 143 switch(IssmMatTypeFromToolkitOptions()){ 145 144 … … 203 202 }; 204 203 205 206 204 #endif //#ifndef _ISSMMAT_H_ -
issm/trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h
r14792 r14822 76 76 /*FUNCTION IssmMpiDenseMat(doubletype* serial_mat,int M,int N,doubletype sparsity){{{*/ 77 77 IssmMpiDenseMat(doubletype* serial_mat,int Min,int Nin,doubletype sparsity){ 78 78 79 79 /*Here, we assume that the serial_mat is local to the local cpu, and that it has 80 80 * the correct size (m rows by N colums), n determined by DetermineLocalSize: */ … … 110 110 111 111 this->buckets=new DataSet(); 112 112 113 113 this->M=Min; 114 114 this->N=Nin; 115 115 116 116 /*Figure out local number of rows: */ 117 117 this->m=DetermineLocalSize(this->M,IssmComm::GetComm()); 118 118 119 119 /*Initialize pointer: */ 120 120 this->matrix=NULL; … … 152 152 void Assemble(){ 153 153 154 155 154 int i; 156 155 int j; … … 173 172 int size; 174 173 175 176 177 174 /*some communicator info: */ 178 175 num_procs=IssmComm::GetSize(); … … 218 215 for(j=0;j<num_procs;j++){ 219 216 if(j!=i){//only send the buckets that this cpu does not own. 220 217 221 218 /*Go through the buckets belonging to cpu j, and send them accordingly. */ 222 219 DataSet* buckets=bucketspercpu[j]; … … 230 227 } 231 228 else{ 232 229 233 230 /*Receive buckets from cpu i, and add them to my own my_rank bucket list: */ 234 231 /*First, are we receiving anything from sender_rank? :*/ … … 272 269 /*FUNCTION Norm{{{*/ 273 270 doubletype Norm(NormMode mode){ 274 275 271 276 272 doubletype norm,local_norm; 277 273 doubletype absolute; … … 313 309 void MatMult(IssmAbsVec<doubletype>* Xin,IssmAbsVec<doubletype>* AXin){ 314 310 315 316 311 int i,j; 317 312 doubletype *X_serial = NULL; 318 319 313 320 314 /*A check on the types: */ … … 371 365 /*}}}*/ 372 366 }; 373 374 367 375 368 #endif //#ifndef _ISSM_MPI_DENSE_MAT_H_ -
issm/trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h
r14792 r14822 80 80 81 81 this->buckets=new DataSet(); 82 82 83 83 if(fromlocalsize){ 84 84 this->m=Min; … … 89 89 this->m=DetermineLocalSize(this->M,IssmComm::GetComm()); 90 90 } 91 91 92 92 /*Initialize pointer: */ 93 93 this->vector=NULL; … … 109 109 /*FUNCTION Echo{{{*/ 110 110 void Echo(void){ 111 111 112 112 int i,j; 113 113 … … 126 126 /*FUNCTION Assemble{{{*/ 127 127 void Assemble(){ 128 129 128 130 129 int i; … … 148 147 int size; 149 148 150 151 152 149 /*some communicator info: */ 153 150 num_procs=IssmComm::GetSize(); … … 193 190 for(j=0;j<num_procs;j++){ 194 191 if(j!=i){//only send the buckets that this cpu does not own. 195 192 196 193 /*Go through the buckets belonging to cpu j, and send them accordingly. */ 197 194 DataSet* buckets=bucketspercpu[j]; … … 205 202 } 206 203 else{ 207 204 208 205 /*Receive buckets from cpu i, and add them to my own my_rank bucket list: */ 209 206 /*First, are we receiving anything from sender_rank? :*/ … … 247 244 /*FUNCTION SetValues{{{*/ 248 245 void SetValues(int ssize, int* list, doubletype* values, InsMode mode){ 249 246 250 247 /*we need to store all the values we collect here in order to Assemble later. 251 248 * Indeed, the values we are collecting here most of the time will not belong … … 304 301 /*FUNCTION AXPY{{{*/ 305 302 void AXPY(IssmAbsVec<doubletype>* Xin, doubletype a){ 306 303 307 304 int i; 308 305 … … 314 311 /*y=a*x+y where this->vector is y*/ 315 312 for(i=0;i<this->m;i++)this->vector[i]=a*X->vector[i]+this->vector[i]; 316 317 313 318 314 } … … 343 339 int* recvcounts=NULL; 344 340 int* displs=NULL; 345 341 346 342 /*output: */ 347 343 doubletype* buffer=NULL; … … 358 354 /*recvcounts:*/ 359 355 MPI_Allgather(&this->m,1,MPI_INT,recvcounts,1,MPI_INT,comm); 360 356 361 357 /*get lower_row: */ 362 358 GetOwnershipBoundariesFromRange(&lower_row,&upper_row,this->m,comm); … … 394 390 /*FUNCTION Norm{{{*/ 395 391 doubletype Norm(NormMode mode){ 396 392 397 393 doubletype local_norm; 398 394 doubletype norm; … … 453 449 454 450 int i; 455 451 456 452 /*Assume xin and yin are of the correct type, and downcast: */ 457 453 IssmMpiVec* x=NULL; … … 461 457 y=(IssmMpiVec<doubletype>*)yin; 462 458 463 464 459 /*pointwise w=x/y where this->vector is w: */ 465 460 for(i=0;i<this->m;i++)this->vector[i]=x->vector[i]/y->vector[i]; -
issm/trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h
r14671 r14822 5 5 * and the contructors required by IssmVec (see IssmVec.h) 6 6 */ 7 8 7 9 8 #ifndef _ISSM_SEQ_VEC_H_ … … 182 181 183 182 int i; 184 183 185 184 /*Assume X is of the correct type, and downcast: */ 186 185 IssmSeqVec* X=NULL; 187 186 188 187 X=(IssmSeqVec<doubletype>*)Xin; 189 190 188 191 189 /*y=a*x+y where this->vector is y*/ … … 278 276 input=(IssmSeqVec<doubletype>*)inputin; 279 277 280 281 278 doubletype dot=0; 282 279 for(i=0;i<this->M;i++)dot+=this->vector[i]*input->vector[i]; … … 289 286 290 287 int i; 291 288 292 289 /*Assume xin and yin are of the correct type, and downcast: */ 293 290 IssmSeqVec* x=NULL; … … 297 294 y=(IssmSeqVec<doubletype>*)yin; 298 295 299 300 296 /*pointwise w=x/y where this->vector is w: */ 301 297 for(i=0;i<this->M;i++)this->vector[i]=x->vector[i]/y->vector[i]; -
issm/trunk-jpl/src/c/toolkits/issm/IssmToolkitUtils.cpp
r14688 r14822 24 24 /*Routines: */ 25 25 int IssmMatTypeFromToolkitOptions(void){ /*{{{*/ 26 26 27 27 char *mat_type = NULL; 28 28 int mat_type_enum; … … 33 33 num_procs=IssmComm::GetSize(); 34 34 if(num_procs>1)isparallel=true; 35 35 36 36 /*retrieve matrix type as a string, from the Toolkits Options database, similar to what Petsc does. Actually, 37 37 *we try and stick with the Petsc matrix types: */ … … 43 43 } 44 44 else _error_("matrix type not supported yet!"); 45 45 46 46 /*free ressources: */ 47 47 xDelete<char>(mat_type); 48 48 49 49 /*return: */ 50 50 return mat_type_enum; 51 51 } /*}}}*/ 52 52 int IssmVecTypeFromToolkitOptions(void){ /*{{{*/ 53 53 54 54 char* vec_type=NULL; 55 55 int vec_type_enum; … … 60 60 num_procs=IssmComm::GetSize(); 61 61 if(num_procs>1)isparallel=true; 62 62 63 63 /*retrieve vector type as a string, from the Toolkits Options database, similar to what Petsc does. Actually, 64 64 *we try and stick with the Petsc vector types: */ … … 70 70 } 71 71 else _error_("vector type not supported yet!"); 72 72 73 73 /*free ressources: */ 74 74 xDelete<char>(vec_type); 75 75 76 76 /*return: */ 77 77 return vec_type_enum; -
issm/trunk-jpl/src/c/toolkits/issm/IssmVec.h
r14685 r14822 37 37 38 38 public: 39 39 40 40 IssmAbsVec<doubletype>* vector; /*abstract vector, which implements object orientation*/ 41 41 … … 61 61 /*}}}*/ 62 62 IssmVec(int M){/*{{{*/ 63 63 64 64 switch(IssmVecTypeFromToolkitOptions()){ 65 65 … … 80 80 /*}}}*/ 81 81 IssmVec(int m,int M){/*{{{*/ 82 82 83 83 switch(IssmVecTypeFromToolkitOptions()){ 84 84 … … 99 99 /*}}}*/ 100 100 IssmVec(int M,bool fromlocalsize){/*{{{*/ 101 101 102 102 switch(IssmVecTypeFromToolkitOptions()){ 103 103 … … 118 118 /*}}}*/ 119 119 IssmVec(doubletype* buffer,int M){/*{{{*/ 120 120 121 121 switch(IssmVecTypeFromToolkitOptions()){ 122 122 … … 170 170 /*}}}*/ 171 171 IssmVec<doubletype>* Duplicate(void){/*{{{*/ 172 172 173 173 IssmVec<doubletype>* issmvector=NULL; 174 174 -
issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscSolver.cpp
r14792 r14822 2 2 * \brief Petsc implementation of solver 3 3 */ 4 5 4 6 5 #ifdef HAVE_CONFIG_H
Note:
See TracChangeset
for help on using the changeset viewer.