Changeset 26468 for issm/trunk-jpl/src
- Timestamp:
- 10/04/21 06:35:33 (3 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 59 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp ¶
r26362 r26468 150 150 }/*}}}*/ 151 151 ElementMatrix* AdjointHorizAnalysis::CreateKMatrixHO(Element* element){/*{{{*/ 152 152 153 153 /* Check if ice in element */ 154 154 if(!element->IsIceInElement()) return NULL; -
TabularUnified issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp ¶
r26223 r26468 70 70 element->SetElementInput(inputs,DamageFEnum,0.); 71 71 } 72 73 72 74 73 /*What input do I need to run my damage evolution model?*/ -
TabularUnified issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp ¶
r26090 r26468 535 535 int iseplthickcomp; 536 536 537 538 537 /*Skip if we don't want to compute thicknesses*/ 539 538 femmodel->parameters->FindParam(&iseplthickcomp,HydrologydcEplThickCompEnum); … … 558 557 femmodel->parameters->FindParam(&gravity,ConstantsGEnum); 559 558 femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum); 560 561 559 562 560 for(Object* & object : femmodel->elements->objects){ -
TabularUnified issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp ¶
r26463 r26468 562 562 /*Skip if water or ice shelf element*/ 563 563 if(element->IsAllFloating()) return; 564 564 565 565 /*Intermediary*/ 566 566 IssmDouble phi_0, phi_m, p_i; -
TabularUnified issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp ¶
r26329 r26468 307 307 /*Add input to the element: */ 308 308 element->AddInput(WatercolumnEnum,watercolumn,element->GetElementType()); 309 309 310 310 /*Also update the hydrological loads for the sealevel core: */ 311 311 IssmDouble* oldwatercolumn = xNew<IssmDouble>(numnodes); -
TabularUnified issm/trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.cpp ¶
r26075 r26468 42 42 iomodel->FetchDataToInput(inputs,elements,"md.initialization.watercolumn",WatercolumnEnum); 43 43 44 45 44 }/*}}}*/ 46 45 void HydrologyTwsAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/ … … 85 84 int numnodes = element->GetNumberOfNodes(); 86 85 IssmDouble* watercolumn = xNew<IssmDouble>(numnodes); 87 86 88 87 /*Use the dof list to index into the solution vector: */ 89 88 for(int i=0;i<numnodes;i++){ -
TabularUnified issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp ¶
r26465 r26468 576 576 IssmDouble dt = femmodel->parameters->FindParam(TimesteppingTimeStepEnum); 577 577 578 579 578 for(Object* & object : femmodel->elements->objects){ 580 579 Element* element = xDynamicCast<Element*>(object); -
TabularUnified issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp ¶
r26090 r26468 234 234 if(grdmodel==IvinsEnum) inputs->SetTransientInput(TransientAccumulatedDeltaIceThicknessEnum,NULL,0); 235 235 236 237 236 }/*}}}*/ 238 237 void MasstransportAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/ … … 816 815 element->FindParam(&count,SealevelchangeRunCountEnum); 817 816 } 818 817 819 818 /*Fetch dof list and allocate solution vector*/ 820 819 int *doflist = NULL; … … 912 911 element->AddBasalInput(SurfaceEnum,newsurface,P1Enum); 913 912 element->AddBasalInput(BaseEnum,newbase,P1Enum); 914 915 913 916 914 /*Free ressources:*/ -
TabularUnified issm/trunk-jpl/src/c/analyses/OceantransportAnalysis.cpp ¶
r26099 r26468 62 62 iomodel->FetchDataToInput(inputs,elements,"md.initialization.str",StrEnum); 63 63 64 65 64 }/*}}}*/ 66 65 void OceantransportAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/ … … 75 74 IssmDouble modelid; 76 75 int nummodels; 77 76 78 77 /*create double param, not int param, because Dakota will be updating it as 79 78 * a double potentially: */ -
TabularUnified issm/trunk-jpl/src/c/analyses/SealevelchangeAnalysis.cpp ¶
r26296 r26468 49 49 iomodel->FetchDataToInput(inputs,elements,"md.solidearth.external.geoid",SolidearthExternalGeoidRateEnum); 50 50 51 52 51 /*Resolve Mmes using the modelid, if necessary:*/ 53 52 if (inputs->GetInputObjectEnum(SolidearthExternalDisplacementEastRateEnum)==DatasetInputEnum){ 54 53 int modelid; 55 54 56 55 /*retrieve model id: */ 57 56 iomodel->FetchData(&modelid,"md.solidearth.external.modelid"); 58 57 59 58 /*replace dataset of forcings with only one, the modelid'th:*/ 60 59 MmeToInputFromIdx(inputs,elements,modelid,SolidearthExternalDisplacementNorthRateEnum, P1Enum); … … 74 73 iomodel->ConstantToInput(inputs,elements,0.,DeltaIceThicknessEnum,P1Enum); 75 74 iomodel->ConstantToInput(inputs,elements,0.,DeltaBottomPressureEnum,P1Enum); 76 77 75 78 76 }/*}}}*/ … … 182 180 xDelete<IssmDouble>(partitionice); 183 181 } 184 182 185 183 iomodel->FetchData(&nparthydro,"md.solidearth.nparthydro"); 186 184 parameters->AddObject(new IntParam(SolidearthNpartHydroEnum,nparthydro)); … … 208 206 BarystaticContributions* barystaticcontributions=new BarystaticContributions(iomodel); 209 207 parameters->AddObject(new GenericParam<BarystaticContributions*>(barystaticcontributions,BarystaticContributionsEnum)); 210 208 211 209 /*Deal with external multi-model ensembles: {{{*/ 212 210 if(isexternal){ … … 425 423 xDelete<int>(displs); 426 424 427 428 429 425 /*Avoid singularity at 0: */ 430 426 G_gravi[0]=G_gravi[1]; … … 436 432 } 437 433 } 438 439 440 434 441 435 /*Reinterpolate viscoelastic green kernels onto a regular gridded time … … 484 478 } 485 479 } 486 480 487 481 } 488 482 else if(elastic){ -
TabularUnified issm/trunk-jpl/src/c/analyses/SmbAnalysis.cpp ¶
r26208 r26468 232 232 parameters->AddObject(new IntParam(SmbStepsPerStepEnum,smbslices)); 233 233 234 235 234 parameters->AddObject(iomodel->CopyConstantObject("md.smb.averaging",SmbAveragingEnum)); 236 235 -
TabularUnified issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp ¶
r26463 r26468 1109 1109 #endif 1110 1110 1111 1112 1111 if(is_schur_cg_solver) 1113 1112 solutionsequence_schurcg(femmodel); … … 2096 2095 /*Use the dof list to index into the solution vector: */ 2097 2096 for(i=0;i<numdof;i++) values[i]=solution[doflist[i]]; 2098 2097 2099 2098 /*Transform solution in Cartesian Space*/ 2100 2099 if(dim==2) basalelement->TransformSolutionCoord(&values[0],XYEnum); … … 2134 2133 } 2135 2134 element->AddBasalInput(VelEnum,vel,element->GetElementType()); 2136 2135 2137 2136 /*Free ressources:*/ 2138 2137 xDelete<IssmDouble>(vel); … … 2754 2753 /*MLHO*/ 2755 2754 ElementMatrix* StressbalanceAnalysis::CreateKMatrixMLHO(Element* element){/*{{{*/ 2756 2755 2757 2756 //_error_("Mono Layer Higher-Order called, not fully tested. If you are sure of using it, comment this line."); 2758 2757 2759 2758 /* Check if ice in element */ 2760 2759 if(!element->IsIceInElement()) return NULL; … … 2818 2817 gauss = element->NewGauss(2); 2819 2818 } 2820 2819 2821 2820 /* Start looping on the number of gaussian points: */ 2822 2821 while(gauss->next()){ … … 2850 2849 xDelete<IssmDouble>(basis); 2851 2850 return Ke; 2852 2853 2851 2854 2852 //itapopo OLD - testing above … … 2873 2871 //ElementMatrix* Ke = basalelement->NewElementMatrix(MLHOApproximationEnum); 2874 2872 ElementMatrix* KeSSA = CreateKMatrixSSAFriction(basalelement); //only to get K11 and K33 2875 2873 2876 2874 /*Fetch number of nodes and dof for this finite element*/ 2877 2875 //int numnodes = basalelement->GetNumberOfNodes(); … … 2969 2967 2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i] 2970 2968 )*(n+1)/(n+2);//K14 2971 2969 2972 2970 Ke->values[(4*i+1)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity[1]*thickness*( 2973 2971 4.*dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i] … … 2985 2983 2.*dbasis[1*numnodes+j]*dbasis[0*numnodes+i] + dbasis[0*numnodes+j]*dbasis[1*numnodes+i] 2986 2984 )*2*pow(n+1,2)/((2*n+3)*(n+2));//K24 2987 2985 2988 2986 Ke->values[(4*i+2)*2*2*numnodes+4*j+0] += gauss->weight*Jdet*viscosity[0]*thickness*( 2989 2987 2.*dbasis[0*numnodes+j]*dbasis[1*numnodes+i] + dbasis[1*numnodes+j]*dbasis[0*numnodes+i] … … 3017 3015 } 3018 3016 } 3019 3017 3020 3018 /*Transform Coordinate System*/ 3021 3019 //basalelement->TransformStiffnessMatrixCoord(Ke,XYMLHOEnum); … … 3051 3049 default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet"); 3052 3050 } 3053 3051 3054 3052 /*compute all load vectors for this element*/ 3055 3053 ElementVector* pe1=CreatePVectorMLHODrivingStress(basalelement); … … 3092 3090 surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss); 3093 3091 n_input->GetInputValue(&n,gauss); 3094 3092 3095 3093 for(int i=0;i<numnodes;i++){// per node: vx (basal vx), vshx, vy (basal vy), vshy 3096 3094 pe->values[i*4+0]+=-rhog*thickness*slope[0]*Jdet*gauss->weight*basis[i]; //F1 … … 3150 3148 element->JacobianDeterminantSurface(&Jdet,xyz_list_front,gauss); 3151 3149 element->NodalFunctions(basis,gauss); 3152 3150 3153 3151 b = base-sealevel; // ice base shifted by the sea level 3154 3152 s = thickness+b; // ice surface shifted by the sea level … … 3249 3247 IssmDouble* vel = xNew<IssmDouble>(numnodes); 3250 3248 IssmDouble* n = xNew<IssmDouble>(numnodes); 3251 3249 3252 3250 /*Use the dof list to index into the solution vector: */ 3253 3251 for(i=0;i<numdof;i++) values[i]=solution[doflist[i]]; … … 3283 3281 element->AddBasalInput(VxShearEnum,vshx,element->GetElementType()); 3284 3282 element->AddBasalInput(VyShearEnum,vshy,element->GetElementType()); 3285 3283 3286 3284 /*Add vx and vy as inputs to the tria element (base velocities): */ 3287 3285 element->AddBasalInput(VxBaseEnum,vbx,element->GetElementType()); 3288 3286 element->AddBasalInput(VyBaseEnum,vby,element->GetElementType()); 3289 3287 3290 3288 /*Add vx and vy as inputs to the tria element (surface velocities): */ 3291 3289 element->AddBasalInput(VxSurfaceEnum,vsx,element->GetElementType()); … … 3298 3296 vy[i]=vby[i]+vshy[i]*(n[i]+1)/(n[i]+2); 3299 3297 } 3300 3298 3301 3299 /*Get Vz and compute vel (vertically averaged vel)*/ 3302 3300 basalelement->GetInputListOnNodes(&vz[0],VzEnum,0.); … … 3372 3370 3373 3371 solution->SetValues(numdof,doflist,values,INS_VAL); 3374 3372 3375 3373 /*Free ressources:*/ 3376 3374 delete gauss; … … 4406 4404 if(dim==3){vz_input=element->GetInput(VzEnum); _assert_(vz_input);} 4407 4405 4408 4409 4406 /* Start looping on the number of gaussian points: */ 4410 4407 Gauss* gauss = element->NewGauss(5); … … 4414 4411 element->NodalFunctionsPressure(pbasis,gauss); 4415 4412 element->material->ViscosityFS(&viscosity,dim,xyz_list,gauss,vx_input,vy_input,vz_input); 4416 4417 4413 4418 4414 if(dim==3 || dim==2){ … … 5485 5481 element->NodalFunctionsPressure(pbasis,gauss); 5486 5482 element->material->ViscosityFS(&viscosity,dim,xyz_list,gauss,vx_input,vy_input,vz_input); 5487 5483 5488 5484 for(int i=0;i<vnumnodes;i++){ 5489 5485 for(int j=0;j<vnumnodes;j++){ -
TabularUnified issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp ¶
r26047 r26468 117 117 iomodel->FetchDataToInput(inputs,elements,"md.smb.mass_balance",SmbMassBalanceEnum); 118 118 #endif 119 120 119 121 120 /*Add basal forcings to compute melt rate*/ … … 583 582 } 584 583 585 586 584 #ifdef INWOOVZ 587 585 IssmDouble* thickness = xNew<IssmDouble>(numnodes); … … 624 622 xDelete<IssmDouble>(thickness); 625 623 #endif 626 627 624 628 625 /*Now Compute vel*/ -
TabularUnified issm/trunk-jpl/src/c/classes/AmrBamg.cpp ¶
r23501 r26468 86 86 /*Methods*/ 87 87 void AmrBamg::SetMesh(int** elementslist_in,IssmDouble** x_in,IssmDouble** y_in,int* numberofvertices_in,int* numberofelements_in){/*{{{*/ 88 88 89 89 /*Delete previous mesh and keep the entire mesh*/ 90 90 if(this->elementslist) xDelete<int>(this->elementslist); … … 99 99 }/*}}}*/ 100 100 void AmrBamg::GetMesh(int** elementslist_out,IssmDouble** x_out,IssmDouble** y_out,int* numberofvertices_out,int* numberofelements_out){/*{{{*/ 101 101 102 102 /*Get the entire mesh*/ 103 103 *elementslist_out = this->elementslist; … … 128 128 }/*}}}*/ 129 129 void AmrBamg::ExecuteRefinementBamg(IssmDouble* field,IssmDouble* hmaxVertices,int** pdatalist,IssmDouble** pxylist,int** pelementslist){/*{{{*/ 130 130 131 131 /*Intermediaries*/ 132 132 BamgGeom* geomout=new BamgGeom(); … … 142 142 this->options->field = field; 143 143 this->options->hmaxVertices = hmaxVertices; 144 144 145 145 /*remesh*/ 146 146 if(this->previousmesh){ -
TabularUnified issm/trunk-jpl/src/c/classes/AmrNeopz.cpp ¶
r25454 r26468 137 137 /*Mesh refinement methods*/ 138 138 void AmrNeopz::SetMesh(int** elementslist_in,IssmDouble** x_in,IssmDouble** y_in,int* numberofvertices_in,int* numberofelements_in){/*{{{*/ 139 139 140 140 /*Delete previous mesh and keep the entire mesh*/ 141 141 if(this->elementslist) xDelete<int>(this->elementslist); … … 150 150 }/*}}}*/ 151 151 void AmrNeopz::GetMesh(int** elementslist_out,IssmDouble** x_out,IssmDouble** y_out,int* numberofvertices_out,int* numberofelements_out){/*{{{*/ 152 152 153 153 /*Get the entire mesh*/ 154 154 *elementslist_out = this->elementslist; … … 394 394 if(type>1) break; 395 395 } 396 396 397 397 /*Verify and return*/ 398 398 if(type>1) type=2; … … 416 416 417 417 count=1; 418 418 419 419 while(count>0){ 420 420 count=0; … … 438 438 } 439 439 } 440 440 441 441 /*refine the element if requested*/ 442 442 if(type==2){gmesh->Element(i)->Divide(sons); count++;} … … 926 926 this->fathermesh = dynamic_cast<TPZGeoMesh *>(TPZPersistenceManager::ReadFromFile()); 927 927 TPZPersistenceManager::CloseRead(); 928 928 929 929 TPZPersistenceManager::OpenRead(previousmeshfile); 930 930 this->previousmesh = dynamic_cast<TPZGeoMesh *>(TPZPersistenceManager::ReadFromFile()); … … 933 933 if(!amrifstream.is_open()) _error_("amr ifstream is not open!"); 934 934 amrifstream.seekg(0); 935 935 936 936 this->sid2index.clear(); 937 937 this->index2sid.clear(); 938 938 this->specialelementsindex.clear(); 939 939 940 940 amrifstream>>size; 941 941 for(int i=0;i<size;i++){ … … 943 943 this->sid2index.push_back(value); 944 944 } 945 945 946 946 amrifstream>>size; 947 947 for(int i=0;i<size;i++){ … … 949 949 this->index2sid.push_back(value); 950 950 } 951 951 952 952 amrifstream>>size; 953 953 for(int i=0;i<size;i++){ … … 982 982 } 983 983 } 984 984 985 985 if(this->index2sid.size()>0){ 986 986 amrofstream << this->index2sid.size() << std::endl; -
TabularUnified issm/trunk-jpl/src/c/classes/BarystaticContributions.cpp ¶
r26287 r26468 66 66 67 67 IssmDouble sumice,sumhydro,sumocean; 68 68 69 69 ice->Assemble(); 70 70 hydro->Assemble(); … … 90 90 cumocean->Sum(&sumocean); 91 91 92 93 92 return sumice+sumhydro+sumocean; 94 93 … … 100 99 cumhydro->AXPY(hydro,1); 101 100 102 103 101 } /*}}}*/ 104 102 void BarystaticContributions::Set(int eid, IssmDouble icevalue, IssmDouble hydrovalue, IssmDouble oceanvalue){ /*{{{*/ 105 103 106 104 int id; 107 105 if(nice){ … … 128 126 ocean->SetValue(0,oceanvalue,ADD_VAL); 129 127 } 130 131 128 132 129 } /*}}}*/ 133 130 void BarystaticContributions::Reset(){ /*{{{*/ 134 131 135 136 132 ice->Set(0.); 137 133 hydro->Set(0.); 138 134 ocean->Set(0.); 139 135 140 136 } /*}}}*/ 141 137 void BarystaticContributions::Save(Results* results, Parameters* parameters, IssmDouble oceanarea){ /*{{{*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Cfsurfacelogvel.cpp ¶
r26090 r26468 96 96 IssmDouble Cfsurfacelogvel::Response(FemModel* femmodel){/*{{{*/ 97 97 98 99 98 /*recover time parameters: */ 100 99 IssmDouble time; -
TabularUnified issm/trunk-jpl/src/c/classes/Dakota/IssmParallelDirectApplicInterface.cpp ¶
r26222 r26468 124 124 if(VerboseQmu()) _printf0_("compute dakota responses:\n"); 125 125 femmodel->DakotaResponsesx(responses,responses_descriptors,numresponsedescriptors,numFns); 126 126 127 127 /*Output results for this iteration: */ 128 128 if(VerboseQmu()) _printf0_("output results for this iteration: \n"); -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Element.cpp ¶
r26329 r26468 1286 1286 /*}}}*/ 1287 1287 void Element::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum,int type){/*{{{*/ 1288 1289 1288 1290 1289 switch(type){ … … 1680 1679 if(M==1)times[0]=0; 1681 1680 if(M==2)for(int t=0;t<N;t++) times[t] = vector[(M-1)*N+t]; 1682 1681 1683 1682 inputs->SetTransientInput(vector_enum,times,N); 1684 1683 TransientInput* transientinput = inputs->GetTransientInput(vector_enum); 1685 1684 1686 1685 for(int t=0;t<N;t++){ 1687 1686 value=vector[t]; //values are on the first line, times are on the second line … … 3262 3261 } 3263 3262 3264 3265 3263 /*Assign output pointer*/ 3266 3264 … … 3323 3321 case P1Enum:{ 3324 3322 const int NUM_VERTICES = this->GetNumberOfVertices(); 3325 3326 3327 3323 3328 3324 this->GetVerticesSidList(&sidlist[0]); -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.cpp ¶
r26362 r26468 1940 1940 } 1941 1941 1942 1943 1942 /*Some checks in debugging mode*/ 1944 1943 _assert_(s1>=0 && s1<=1.); … … 2055 2054 _error_("case not possible"); 2056 2055 } 2057 2058 2056 2059 2057 /*Some checks in debugging mode*/ … … 2377 2375 if(start==+1 && !IsOnSurface()) return; 2378 2376 2379 2380 2377 /*Get original input*/ 2381 2378 Input* input = this->GetInput(enum_type); … … 2738 2735 IssmDouble movingfrontvy[NUMVERTICES]; 2739 2736 IssmDouble vel; 2740 2737 2741 2738 /* Get node coordinates and dof list: */ 2742 2739 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); … … 4033 4030 } 4034 4031 4035 4036 4032 /*Some checks in debugging mode*/ 4037 4033 _assert_(s1>=0 && s1<=1.); … … 4147 4143 _error_("case not possible"); 4148 4144 } 4149 4150 4145 4151 4146 /*Some checks in debugging mode*/ … … 4899 4894 else if(type==TransientInputEnum){ 4900 4895 4901 4902 4896 IssmDouble* steps=NULL; 4903 4897 int nsteps; -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.cpp ¶
r26464 r26468 323 323 IssmDouble epse_2,groundedice,bed,sealevel; // added sealevel 324 324 325 326 325 /* Get node coordinates and dof list: */ 327 326 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); … … 337 336 Input* n_input = this->GetInput(MaterialsRheologyNEnum); _assert_(n_input); 338 337 Input* sl_input = this->GetInput(SealevelEnum); _assert_(sl_input); 339 340 341 338 342 339 /* Start looping on the number of vertices: */ … … 413 410 int crevasse_opening_stress; 414 411 415 416 412 /*reset if no ice in element*/ 417 413 if(!this->IsIceInElement()){ … … 426 422 return; 427 423 } 428 429 424 430 425 /*retrieve the type of crevasse_opening_stress*/ … … 1321 1316 area=this->GetAreaSpherical(); 1322 1317 vareae->SetValue(this->sid,area,INS_VAL); 1323 1318 1324 1319 /*in addition, put in in the inputs:*/ 1325 1320 this->inputs->SetDoubleInput(AreaEnum,this->lid,area); … … 1350 1345 vlate->SetValue(this->sid,late,INS_VAL); 1351 1346 vareae->SetValue(this->sid,area,INS_VAL); 1352 1347 1353 1348 return; 1354 1349 } … … 1766 1761 /*}}}*/ 1767 1762 void Tria::GetFractionGeometry(IssmDouble* weights, IssmDouble* pphi, int* ppoint1,IssmDouble* pfraction1,IssmDouble* pfraction2, bool* ptrapezeisnegative, IssmDouble* gl){/*{{{*/ 1768 1763 1769 1764 /*Computeportion of the element that is grounded*/ 1770 1765 bool trapezeisnegative=true; //default value … … 1777 1772 IssmDouble loadweights_g[NUMVERTICES]; 1778 1773 IssmDouble total_weight=0; 1779 1774 1780 1775 _assert_(!xIsNan<IssmDouble>(gl[0])); 1781 1776 _assert_(!xIsNan<IssmDouble>(gl[1])); … … 1820 1815 if(trapezeisnegative) phi=1-f1*f2; 1821 1816 else phi=f1*f2; 1822 1823 1817 1824 1818 /*Compute weights:*/ 1825 1819 gauss = this->NewGauss(point,f1,f2,trapezeisnegative,2); 1826 1820 1827 1821 total_weight=0; 1828 1822 for(int i=0;i<NUMVERTICES;i++)weights[i]=0; … … 1848 1842 /*}}}*/ 1849 1843 IssmDouble Tria::GetTriangleAreaSpherical(IssmDouble xyz_list[3][3]){/*{{{*/ 1850 1844 1851 1845 IssmDouble x1,y1,z1,x2,y2,z2,x3,y3,z3; 1852 1846 IssmDouble arc12,arc23,arc31,semi_peri,excess; … … 1929 1923 IssmDouble levelset[NUMVERTICES]; 1930 1924 IssmDouble planetradius; 1931 1925 1932 1926 this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum); 1933 1927 … … 1940 1934 Element::GetInputListOnVertices(&levelset[0],levelsetenum); 1941 1935 if(flip1)for(int i=0;i<NUMVERTICES;i++)levelset[i]=-levelset[i]; 1942 1936 1943 1937 //compute sea level load weights 1944 1938 this->GetFractionGeometry(loadweights,&phi,&point1,&fraction1,&fraction2,&istrapeze1,levelset); … … 1951 1945 } /*}}}*/ 1952 1946 void Tria::GetNodalWeightsAndAreaAndCentroidsFromLeveset(IssmDouble* loadweights, IssmDouble* ploadarea, IssmDouble* platbar, IssmDouble* plongbar, IssmDouble late, IssmDouble longe, IssmDouble area, int levelset1enum, int levelset2enum){ /*{{{*/ 1953 1954 1947 1955 1948 bool istrapeze1, istrapeze2; … … 2019 2012 } 2020 2013 2021 2022 2014 //If everyone is negative, no need to calculate any fraction 2023 2015 if (levelset1[0]<=0 && levelset1[1]<=0 && levelset1[2]<=0 && levelset2[0]<=0 && levelset2[1]<=0 && levelset2[2]<=0) { … … 2028 2020 return; 2029 2021 } 2030 2022 2031 2023 /*recover planet radius:*/ 2032 2024 this->parameters->FindParam(&planetradius,SolidearthPlanetRadiusEnum); 2033 2034 2025 2035 2026 //If just one levelset is all negative, just take the partitioning of the other, no interaction between them … … 2047 2038 } 2048 2039 2049 2050 2040 this->GetFractionGeometry(&weights1[0],&phi1,&point1,&d,&e,&istrapeze1,levelset1); 2051 2041 this->GetFractionGeometry(&weights2[0],&phi2,&point2,&f,&g,&istrapeze2,levelset2); 2052 2053 2042 2054 2043 //Early return if levelsets are not independent … … 2069 2058 } 2070 2059 2071 2072 2060 ::GetVerticesCoordinates(&xyz0[0][0],vertices,NUMVERTICES); // initial triangle 2073 2061 … … 2117 2105 h2= (d*(f+e-1))/(g*(e-d) +f*d); 2118 2106 } 2119 2120 2107 2121 2108 //interpolant weights of each point. Any field F[0,1,2] provided at the original vertices [0,1,2] will be equal on point k to sum_i (F[i] * w[k][i]) … … 2227 2214 } /*}}}*/ 2228 2215 } 2229 2216 2230 2217 }/*}}}*/ 2231 2218 else{ /*{{{*/ … … 2498 2485 }/*}}}*/ 2499 2486 Input* Tria::GetInput(int inputenum){/*{{{*/ 2500 2487 2501 2488 /*Get Input from dataset*/ 2502 2489 if(this->iscollapsed){ … … 4081 4068 IssmDouble movingfrontvy[NUMVERTICES]; 4082 4069 IssmDouble vel; 4083 4070 4084 4071 /* Get node coordinates and dof list: */ 4085 4072 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); … … 4332 4319 } 4333 4320 for(i=0;i<dim;i++) w[i]=v[i]-c[i]-m[i]; 4334 4321 4335 4322 movingfrontvx[iv] = w[0]; 4336 4323 movingfrontvy[iv] = w[1]; … … 6147 6134 this->parameters->FindParam(&gsize,MeshNumberofverticesEnum); 6148 6135 this->parameters->FindParam(&yts,ConstantsYtsEnum); 6149 6136 6150 6137 /*recover gia solution parameters: */ 6151 6138 int cross_section_shape; … … 6158 6145 /*recover material parameters: */ 6159 6146 IssmDouble rho_ice = FindParam(MaterialsRhoIceEnum); 6160 6147 6161 6148 /*recover mantle and lithosphere material properties:*/ 6162 6149 int numlayers=litho->numlayers; … … 6179 6166 int numtimes; 6180 6167 this->GetInputAveragesUpToCurrentTime(TransientAccumulatedDeltaIceThicknessEnum,&hes,×,&numtimes,currenttime); 6181 6182 6168 6183 6169 /*pull area of this Tria: */ … … 6274 6260 IssmDouble* H_viscoelastic_precomputed=NULL; 6275 6261 #endif 6276 6262 6277 6263 /*viscoelastic green function:*/ 6278 6264 int index; … … 6342 6328 parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeGViscoElasticEnum)); _assert_(parameter); 6343 6329 parameter->GetParameterValueByPointer((IssmDouble**)&G_viscoelastic_precomputed,NULL); 6344 6330 6345 6331 parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelchangeUViscoElasticEnum)); _assert_(parameter); 6346 6332 parameter->GetParameterValueByPointer((IssmDouble**)&U_viscoelastic_precomputed,NULL); … … 6373 6359 } 6374 6360 6375 6376 6361 constant=3/rho_earth/planetarea; 6377 6362 … … 6393 6378 IssmDouble late= asin(zze[e]/sqrt( pow(xxe[e],2.0)+ pow(yye[e],2.0)+ pow(zze[e],2.0))); 6394 6379 IssmDouble longe= atan2(yye[e],xxe[e]); 6395 6380 6396 6381 lati=latitude[i]; 6397 6382 longi=longitude[i]; … … 6404 6389 _assert_(index>=0 && index<M); 6405 6390 6406 6407 6391 lincoef=doubleindex-index; //where between index and index+1 is alpha 6408 6392 if (index==M-1){ //avoids out of bound case … … 6410 6394 lincoef=1; 6411 6395 } 6412 6413 6396 6414 6397 if(horiz){ … … 6591 6574 /* Classic buildup of load weights, centroids and areas *for elements which are fully inside a mask. 6592 6575 * At the same time, we'll tag the elements that are fractionally only inside a mask*/ 6593 6576 6594 6577 IssmDouble loadweights[3]={0}; 6595 6578 IssmDouble area; … … 6610 6593 /*constants:*/ 6611 6594 IssmDouble constant=0; 6612 6595 6613 6596 /*recover parameters:*/ 6614 6597 this->parameters->FindParam(&computeice,TransientIsmasstransportEnum); … … 6671 6654 slgeom->nsubel[SLGEOM_OCEAN]++; 6672 6655 } 6673 6656 6674 6657 /*early return if we are not on an ice sheet , and we are not requesting 6675 6658 *hydrology or bottom pressure loads :*/ … … 6748 6731 } 6749 6732 } 6750 6733 6751 6734 /*Deal with ice loads if we are on grounded ice:*/ 6752 6735 if(isice && !isoceanonly && computeice){ … … 6791 6774 } 6792 6775 } 6793 6776 6794 6777 } 6795 6778 /*}}}*/ … … 6798 6781 /* Classic buildup of load weights, centroids and areas *for elements which are fully inside a mask. 6799 6782 * At the same time, we'll tag the elements that are fractionally only inside a mask*/ 6800 6783 6801 6784 IssmDouble loadweights[3]={0}; 6802 6785 IssmDouble area,loadarea; … … 6808 6791 IssmDouble constant; 6809 6792 IssmDouble nanconstant=NAN; 6810 6793 6811 6794 /*get vertex and area information:*/ 6812 6795 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); … … 6821 6804 this->AddInput(SealevelBarystaticOceanLongbarEnum,&longbar,P0Enum); 6822 6805 #endif 6823 6806 6824 6807 if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){ 6825 6808 int intj=slgeom->subelementmapping[SLGEOM_OCEAN][this->lid]; 6826 6809 6827 6810 this->GetNodalWeightsAndAreaAndCentroidsFromLeveset(&loadweightsocean[0],&loadareaocean,&latbar, &longbar, slgeom->late[this->lid], slgeom->longe[this->lid], area, MaskOceanLevelsetEnum); 6828 6811 slgeom->LoadArea[SLGEOM_OCEAN][this->lid]=loadareaocean; … … 6885 6868 this->AddInput(SealevelBarystaticHydroWeightsEnum,loadweights,P1DGEnum); 6886 6869 this->AddInput(SealevelBarystaticHydroAreaEnum,&loadarea,P0Enum); 6887 6870 6888 6871 this->AddInput(SealevelBarystaticHydroLatbarEnum,&latbar,P0Enum); 6889 6872 this->AddInput(SealevelBarystaticHydroLongbarEnum,&longbar,P0Enum); … … 6891 6874 #endif 6892 6875 } 6893 6876 6894 6877 } 6895 6878 /*}}}*/ … … 6927 6910 IssmDouble** GEsubel=NULL; 6928 6911 #endif 6929 6912 6930 6913 /*viscoelastic green function:*/ 6931 6914 int index; … … 7010 6993 } 7011 6994 } 7012 6995 7013 6996 //Allocate: 7014 6997 for(int l=0;l<SLGEOM_NUMLOADS;l++){ … … 7133 7116 /*}}}*/ 7134 7117 void Tria::SealevelchangeUpdateViscousFields(){ /*{{{*/ 7135 7118 7136 7119 /*Inputs:*/ 7137 7120 IssmDouble* viscousRSL=NULL; … … 7148 7131 IssmDouble lincoeff=0; 7149 7132 int horiz; 7150 7133 7151 7134 this->parameters->FindParam(&viscous,SolidearthSettingsViscousEnum); 7152 7135 7153 7136 if(viscous){ 7154 7137 this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum); 7155 7138 7156 7139 this->parameters->FindParam(&viscousnumsteps,SealevelchangeViscousNumStepsEnum); 7157 7140 this->parameters->FindParam(&viscoustimes,NULL,SealevelchangeViscousTimesEnum); … … 7165 7148 this->inputs->GetArrayPtr(SealevelchangeViscousEEnum,this->lid,&viscousE,&dummy); 7166 7149 } 7167 7168 7150 7169 7151 bool foundtime=false; … … 7194 7176 viscousindex=newindex+offset; 7195 7177 7196 7197 7178 this->parameters->SetParam(viscousindex,SealevelchangeViscousIndexEnum); 7198 7179 this->parameters->SetParam(viscoustimes,viscousnumsteps,SealevelchangeViscousTimesEnum); … … 7201 7182 xDelete<IssmDouble>(viscoustimes); 7202 7183 } 7203 7204 7184 7205 7185 } … … 7254 7234 bslchydro = -slgeom->LoadArea[SLGEOM_WATER][this->lid]*Wavg; 7255 7235 bslcbp = -slgeom->LoadArea[SLGEOM_OCEAN][this->lid]*BPavg; 7256 7236 7257 7237 _assert_(!xIsNan<IssmDouble>(bslcice)); 7258 7238 _assert_(!xIsNan<IssmDouble>(bslchydro)); 7259 7239 _assert_(!xIsNan<IssmDouble>(bslcbp)); 7260 7240 7261 7241 /*Plug values into subelement load vector:*/ 7262 7242 if(slgeom->issubelement[SLGEOM_ICE][this->lid]){ … … 7289 7269 IssmDouble* Gsub[SLGEOM_NUMLOADS]; 7290 7270 bool computefuture=false; 7291 7271 7292 7272 bool sal = false; 7293 7273 bool viscous = false; … … 7299 7279 IssmDouble Grotm2[3]; 7300 7280 IssmDouble Grotm3[3]; 7301 7281 7302 7282 this->parameters->FindParam(&sal,SolidearthSettingsSelfAttractionEnum); 7303 7283 this->parameters->FindParam(&viscous,SolidearthSettingsViscousEnum); … … 7318 7298 Element::GetInputListOnVertices(&Grotm2[0],SealevelGrotm2Enum); 7319 7299 Element::GetInputListOnVertices(&Grotm3[0],SealevelGrotm3Enum); 7320 7300 7321 7301 for(int i=0;i<NUMVERTICES;i++){ 7322 7302 if(slgeom->lids[this->vertices[i]->lid]==this->lid){ … … 7333 7313 IssmDouble oceanarea=0; 7334 7314 IssmDouble rho_water; 7335 7315 7336 7316 this->parameters->FindParam(&rho_water,MaterialsRhoSeawaterEnum); 7337 7317 … … 7352 7332 } 7353 7333 else loads->vsealevelloads->SetValue(this->sid,oceanaverage*rho_water,INS_VAL); 7354 7355 7334 7356 7335 /*add ocean area into a global oceanareas vector:*/ … … 7362 7341 } 7363 7342 } 7364 7343 7365 7344 return; 7366 7345 } /*}}}*/ … … 7409 7388 this->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum); 7410 7389 this->parameters->FindParam(&planethasocean,SolidearthSettingsGrdOceanEnum); 7411 7412 7390 7413 7391 if(sal){ 7414 7392 … … 7450 7428 Element::GetInputListOnVertices(&Grotm2[0],SealevelGrotm2Enum); 7451 7429 Element::GetInputListOnVertices(&Grotm3[0],SealevelGrotm3Enum); 7452 7430 7453 7431 for(int i=0;i<NUMVERTICES;i++){ 7454 7432 if(slgeom->lids[this->vertices[i]->lid]==this->lid){ … … 7461 7439 Element::GetInputListOnVertices(&GUrotm2[0],SealevelGUrotm2Enum); 7462 7440 Element::GetInputListOnVertices(&GUrotm3[0],SealevelGUrotm3Enum); 7463 7441 7464 7442 for(int i=0;i<NUMVERTICES;i++){ 7465 7443 if(slgeom->lids[this->vertices[i]->lid]==this->lid){ … … 7474 7452 Element::GetInputListOnVertices(&GErotm2[0],SealevelGErotm2Enum); 7475 7453 Element::GetInputListOnVertices(&GErotm3[0],SealevelGErotm3Enum); 7476 7454 7477 7455 for(int i=0;i<NUMVERTICES;i++){ 7478 7456 if(slgeom->lids[this->vertices[i]->lid]==this->lid){ … … 7495 7473 /*Create geoid: */ 7496 7474 for(int i=0;i<NUMVERTICES;i++)SealevelGrd[i]=UGrd[i]+RSLGrd[i]; 7497 7475 7498 7476 /*Create inputs*/ 7499 7477 this->AddInput(SealevelGRDEnum,SealevelGrd,P1Enum); … … 7503 7481 this->AddInput(BedEastGRDEnum,EGrd,P1Enum); 7504 7482 } 7505 7506 7483 7507 7484 } /*}}}*/ … … 7577 7554 } 7578 7555 } 7579 7556 7580 7557 if(computeviscous){ 7581 7558 IssmDouble* grdfieldinterp=NULL; … … 7646 7623 } 7647 7624 7648 7649 7625 } /*}}}*/ 7650 7626 void Tria::SealevelchangeMomentOfInertiaCentroid(IssmDouble* dI_list, GrdLoads* loads, SealevelGeometry* slgeom){/*{{{*/ 7651 7627 7652 7628 IssmDouble S=0; 7653 7629 … … 7663 7639 longe=slgeom->longe[this->lid]/180*M_PI; 7664 7640 7665 7666 7641 /*recover total load: */ 7667 7642 if(loads->loads) S+=loads->loads[this->Sid()]; 7668 7643 if(loads->sealevelloads) S+=loads->sealevelloads[this->Sid()]; 7669 7644 7670 7645 /* Perturbation terms for moment of inertia (moi_list): 7671 7646 * computed analytically (see Wu & Peltier, eqs 10 & 32) … … 7679 7654 }/*}}}*/ 7680 7655 void Tria::SealevelchangeMomentOfInertiaSubElement(IssmDouble* dI_list, GrdLoads* grdloads, SealevelGeometry* slgeom){/*{{{*/ 7681 7656 7682 7657 IssmDouble SA=0; 7683 7658 IssmDouble* loads=NULL; … … 7691 7666 this->parameters->FindParam(&planetarea,SolidearthPlanetAreaEnum); 7692 7667 this->parameters->FindParam(&re,SolidearthPlanetRadiusEnum); 7693 7668 7694 7669 /*Initalize:*/ 7695 7670 for(int i=0;i<3;i++)dI_list[i]=0; … … 7723 7698 }/*}}}*/ 7724 7699 void Tria::SealevelchangeShift(GrdLoads* loads, IssmDouble offset, SealevelGeometry* slgeom){ /*{{{*/ 7725 7700 7726 7701 if(slgeom->isoceanin[this->lid]){ 7727 7702 if(slgeom->issubelement[SLGEOM_OCEAN][this->lid]){ … … 7732 7707 } 7733 7708 7734 7735 7709 } /*}}}*/ 7736 7710 #endif … … 7741 7715 int interp; 7742 7716 int type; 7743 7717 7744 7718 /*Branch according to whether we have a transient or not input: */ 7745 7719 type=this->inputs->GetInputObjectEnum(name); … … 7750 7724 this->InputServe(triainput); 7751 7725 interp=triainput->GetInterpolation(); 7752 7726 7753 7727 if (interp==P0Enum){ 7754 7728 /*Update the value if this element belongs to the partition: */ -
TabularUnified issm/trunk-jpl/src/c/classes/FemModel.cpp ¶
r26432 r26468 243 243 /*If you reach this point, analysis has not been found*/ 244 244 _error_("Could not find index of analysis " << EnumToStringx(analysis_enum) << " in list of FemModel analyses"); 245 246 245 247 246 }/*}}}*/ … … 2355 2354 if(numonnodes) parameters->FindParam(&resultsonnodes,&numonnodes,SettingsResultsOnNodesEnum); 2356 2355 2357 2358 2356 /*Go through all requested output*/ 2359 2357 for(int i=0;i<numoutputs;i++){ … … 2361 2359 output_enum = StringToEnumx(output_string,false); 2362 2360 isvec = false; 2363 2364 2361 2365 2362 /*If string is not an enum, it is defined in output definitions*/ … … 2481 2478 } 2482 2479 break; 2483 2484 2480 2485 2481 /*Default is always Vector */ … … 3658 3654 } 3659 3655 3660 3661 3656 /*Cleanup*/ 3662 3657 xDelete<IssmDouble>(P0inputs); … … 4812 4807 serial_active=active->ToMPISerial(); 4813 4808 delete active; 4814 4815 4809 4816 4810 /*Update node activation accordingly*/ … … 5447 5441 bool refine; 5448 5442 5449 5450 5443 /*Fill variables*/ 5451 5444 switch(errorestimator_type){ … … 5535 5528 5536 5529 //itapopo esse metodo pode ser deletado 5537 5538 5530 5539 5531 /*Here, "zero level set" means grounding line or ice front, depending on the level set type*/ -
TabularUnified issm/trunk-jpl/src/c/classes/GrdLoads.cpp ¶
r26227 r26468 19 19 GrdLoads::GrdLoads(int nel,SealevelGeometry* slgeom){ /*{{{*/ 20 20 21 22 21 vloads=new Vector<IssmDouble>(nel); 23 22 for (int i=0;i<SLGEOM_NUMLOADS;i++) vsubloads[i]=new Vector<IssmDouble>(slgeom->nbar[i]); … … 27 26 28 27 vsubsealevelloads=new Vector<IssmDouble>(slgeom->nbar[SLGEOM_OCEAN]); 29 30 28 31 29 }; /*}}}*/ … … 51 49 vsubloads[i]->Assemble(); 52 50 } 53 51 54 52 loads=vloads->ToMPISerial(); 55 53 for (int i=0;i<SLGEOM_NUMLOADS;i++){ … … 65 63 } /*}}}*/ 66 64 void GrdLoads::BroadcastSealevelLoads(void){ /*{{{*/ 67 65 68 66 sealevelloads=vsealevelloads->ToMPISerial(); 69 67 subsealevelloads=vsubsealevelloads->ToMPISerial(); -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/ControlInput.cpp ¶
r26160 r26468 223 223 //} 224 224 225 226 225 //NEW?? 227 226 //this->gradient->SetInput(interp,numindices,indices,values_in); -
TabularUnified issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp ¶
r26323 r26468 390 390 /*}}}*/ 391 391 PentaInput* TransientInput::GetPentaInput(int offset){/*{{{*/ 392 393 392 394 393 /*Check offset*/ -
TabularUnified issm/trunk-jpl/src/c/classes/IoModel.cpp ¶
r26432 r26468 612 612 record_name=xNew<char>(record_name_size+1); 613 613 record_name[record_name_size]='\0'; 614 614 615 615 /*Read record_name: */ 616 616 if(fread(record_name,record_name_size*sizeof(char),1,fid)!=0){}; 617 617 618 618 _error_("error while looking in binary file. String \"" << record_name << "\" is a string of size "<<record_name_size); 619 619 } … … 1838 1838 matrix=array[i]; 1839 1839 1840 1841 1840 //initialize transient input dataset: 1842 1841 TransientInput* transientinput=inputs->SetDatasetTransientInput(input_enum,i, times,N); … … 1850 1849 int *vertexlids = xNew<int>(numvertices); 1851 1850 int *vertexsids = xNew<int>(numvertices); 1852 1853 1851 1854 1852 /*Recover vertices ids needed to initialize inputs*/ … … 1918 1916 } 1919 1917 else _error_("FetchDataToInput error message: row size of MatArray elements should be either numberofelements (+1) or numberofvertices (+1)"); 1920 1918 1921 1919 xDelete<int>(vertexlids); 1922 1920 xDelete<int>(vertexsids); -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Friction.cpp ¶
r26466 r26468 34 34 element_in->FindParam(&this->law,FrictionLawEnum); 35 35 element_in->FindParam(&this->domaintype,DomainTypeEnum); 36 36 37 37 /* Load VxBase and VyBase for this special case */ 38 38 switch(this->domaintype){ … … 67 67 element_in->FindParam(&this->law,FrictionLawEnum); 68 68 element_in->FindParam(&this->domaintype,DomainTypeEnum); 69 69 70 70 /* Load VxBase and VyBase for this special case */ 71 71 switch(this->domaintype){ … … 120 120 _error_("not supported"); 121 121 } 122 123 122 124 123 /*Checks*/ … … 278 277 if(vmag==0. && (1./m-1.)<0.) alpha_complement=0.; 279 278 else alpha_complement= pow(vmag, 1.0/m-1.); 280 279 281 280 /*Assign output pointers:*/ 282 281 *palpha_complement=alpha_complement; … … 522 521 Tpmp = element->TMeltingPoint(pressure); 523 522 deltaT = T-Tpmp; 524 525 523 526 524 /*Compute gamma*/ … … 921 919 if ((this->vz_input == NULL) || (this->apply_dim<3.)) vz = 0.0; 922 920 else this->vz_input->GetInputValue(&vz, gauss); 923 921 924 922 if (this->apply_dim<2.) vy = 0.0; 925 923 -
TabularUnified issm/trunk-jpl/src/c/classes/Materials/Matice.cpp ¶
r26294 r26468 752 752 //IssmDouble eps_eff_averaged=0; 753 753 while(gauss_seg->next()){ 754 754 755 755 /*Compute zeta for gauss_seg point (0=surface, 1=base)*/ 756 756 zeta=0.5*(gauss_seg->coord1+1); … … 773 773 f[2]=(1-pow(zeta,n+1))*(1-pow(zeta,n+1)); 774 774 f[3]=((n+1)/H)*pow(zeta,n) * ((n+1)/H)*pow(zeta,n); 775 775 776 776 F[0]=H; 777 777 F[1]=H*(n+1)/(n+2); -
TabularUnified issm/trunk-jpl/src/c/classes/Node.cpp ¶
r26245 r26468 654 654 } 655 655 ug->SetValues(ssize,indices,values,INS_VAL); 656 656 657 657 xDelete<IssmDouble>(values); 658 658 xDelete<int>(indices); … … 661 661 /*}}}*/ 662 662 void Node::VecReduce(Vector<IssmDouble>* uf, IssmDouble* local_ug,int* indices_ug){/*{{{*/ 663 664 663 665 664 /*Only perform operation if not clone*/ -
TabularUnified issm/trunk-jpl/src/c/classes/SealevelGeometry.cpp ¶
r26247 r26468 69 69 int lower_row; 70 70 71 72 71 for (int i=0;i<SLGEOM_NUMLOADS;i++){ 73 72 subelementmapping[i]=xNew<int>(localnel); … … 107 106 /*Also, we'll need the barycentre associated areas:*/ 108 107 109 110 108 } /*}}}*/ 111 109 int SealevelGeometry::GEnum(int l){ /*{{{*/ 112 110 113 111 int output = -1; 114 112 switch(l){ … … 122 120 } /*}}}*/ 123 121 int SealevelGeometry::GUEnum(int l){ /*{{{*/ 124 122 125 123 int output = -1; 126 124 switch(l){ … … 134 132 } /*}}}*/ 135 133 int SealevelGeometry::GNEnum(int l){ /*{{{*/ 136 134 137 135 int output = -1; 138 136 switch(l){ … … 146 144 } /*}}}*/ 147 145 int SealevelGeometry::GEEnum(int l){ /*{{{*/ 148 146 149 147 int output = -1; 150 148 switch(l){ -
TabularUnified issm/trunk-jpl/src/c/cores/WrapperPreCorePointerFromSolutionEnum.cpp ¶
r26222 r26468 28 28 break; 29 29 } 30 30 31 31 /*Assign output pointer:*/ 32 32 *psolutioncore=solutioncore; -
TabularUnified issm/trunk-jpl/src/c/cores/adjointstressbalance_core.cpp ¶
r23822 r26468 28 28 if(VerboseSolution()) _printf0_(" computing velocities\n"); 29 29 femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum); 30 30 31 31 bool is_schur_cg_solver = false; 32 32 #ifdef _HAVE_PETSC_ -
TabularUnified issm/trunk-jpl/src/c/cores/balancethickness_core.cpp ¶
r25680 r26468 11 11 12 12 void balancethickness_core(FemModel* femmodel){ 13 14 13 15 14 /*recover parameters: */ -
TabularUnified issm/trunk-jpl/src/c/cores/control_core.cpp ¶
r26363 r26468 143 143 /*Update control input*/ 144 144 SetControlInputsFromVectorx(femmodel,X); 145 145 146 146 /*solve forward: */ 147 147 switch(solution_type){ … … 152 152 case StressbalanceSolutionEnum:{ 153 153 femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum); 154 154 155 155 bool is_schur_cg_solver = false; 156 156 #ifdef _HAVE_PETSC_ … … 159 159 if(solver_type==FSSolverEnum) is_schur_cg_solver = true; 160 160 #endif 161 161 162 162 if(is_schur_cg_solver){ 163 163 solutionsequence_schurcg(femmodel); -
TabularUnified issm/trunk-jpl/src/c/cores/dakota_core.cpp ¶
r24981 r26468 227 227 if(VerboseQmu()) _printf0_("outputing results for this core:\n"); 228 228 OutputResultsx(femmodel); 229 229 230 230 /*Free ressources:*/ 231 231 DakotaFree(&d_variables,&d_variables_descriptors,&responses_descriptors, d_numvariables, numresponsedescriptors); -
TabularUnified issm/trunk-jpl/src/c/cores/esa_core.cpp ¶
r26055 r26468 114 114 if(numoutputs){for(int i=0;i<numoutputs;i++){xDelete<char>(requested_outputs[i]);} xDelete<char*>(requested_outputs);} 115 115 } 116 116 117 117 /*End profiler*/ 118 118 femmodel->profiler->Stop(ESACORE); -
TabularUnified issm/trunk-jpl/src/c/cores/hydrology_core.cpp ¶
r26121 r26468 47 47 SolidEarthWaterUpdates(femmodel); 48 48 49 50 49 } 51 50 /*Using the Tws based Model*/ 52 51 if (hydrology_model==HydrologyTwsEnum){ 53 52 if(VerboseSolution()) _printf0_(" computing water column\n"); 54 53 55 54 femmodel->SetCurrentConfiguration(HydrologyTwsAnalysisEnum); 56 55 57 56 /*save current tws before updating:*/ 58 57 InputDuplicatex(femmodel,WatercolumnEnum,WaterColumnOldEnum); 59 58 60 59 /*grab tws from the hydrology.spcwatercolumn field input and update 61 60 * the solution with it:*/ … … 68 67 69 68 delete ug; 70 69 71 70 } 72 71 … … 241 240 femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum); 242 241 femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum); 243 242 244 243 /*early return?:*/ 245 244 if(!isgrd)return; -
TabularUnified issm/trunk-jpl/src/c/cores/love_core.cpp ¶
r26272 r26468 20 20 int nyi; 21 21 int starting_layer; 22 22 23 23 LoveVariables(){ /*{{{*/ 24 24 g0=0; … … 245 245 femmodel->parameters->FindParam(&GG,LoveGravitationalConstantEnum); 246 246 femmodel->parameters->FindParam(&nstep,LoveIntStepsPerLayerEnum); 247 247 248 248 g0=vars->g0; 249 249 r0=vars->r0; … … 392 392 fn=(deg*(deg+1.0)); 393 393 394 395 394 if(issolid==1){ 396 395 ny = 6; … … 652 651 xmax=(matlitho->radius[i+1])/ra; 653 652 654 655 653 if (matlitho->issolid[i]){ 656 654 ny = 6; … … 662 660 one= -1.0; 663 661 } 664 665 662 666 663 for (int j = 0;j<ny;j++){ … … 679 676 } 680 677 } 681 682 678 683 679 // Boundary Condition matrix - solid regions … … 712 708 } 713 709 714 715 710 //-- Internal sphere: integration starts here rather than r=0 for numerical reasons 716 711 Innersphere_boundaryconditions<doubletype>(yi, starting_layer, deg, omega, femmodel, matlitho,vars); … … 856 851 857 852 allgesv<doubletype>(&nyi, &nrhs, yilocal, &lda, ipiv, rhslocal, &ldb, &info); 858 853 859 854 xDelete<int>(ipiv); 860 855 861 856 if(VerboseModule() && info!=0){ 862 857 _printf0_("love core warning in DGESV : LAPACK linear equation solver couldn't resolve the system"); … … 973 968 IssmDouble* r = matlitho->radius; 974 969 IssmDouble r1,r2,ro, GG; 975 970 976 971 /*outputs:*/ 977 972 IssmDouble* EarthMass=NULL; … … 997 992 nyi=6*(numlayers+1); 998 993 starting_layer=0; 999 994 1000 995 return new LoveVariables(EarthMass,g0,r0,nyi,starting_layer); 1001 996 … … 1019 1014 doubletype* LoveHf = NULL; 1020 1015 doubletype* LoveLf = NULL; 1021 1016 1022 1017 doubletype* LoveKernels= NULL; 1023 1018 LoveVariables* vars=NULL; … … 1052 1047 femmodel->parameters->FindParam(&complex_computation,LoveComplexComputationEnum); 1053 1048 1054 1055 1049 /*Initialize three love matrices: geoid, vertical and horizontal displacement (real and imaginary parts) */ 1056 1050 LoveKf = xNewZeroInit<doubletype>(nfreq*(sh_nmax+1)); … … 1098 1092 } 1099 1093 1100 1101 1094 xDelete<doubletype>(yi); 1102 1095 xDelete<doubletype>(yi_righthandside); 1103 1104 1096 1105 1097 //Temporal love numbers … … 1145 1137 xDelete<IssmDouble>(LoveKtDouble); 1146 1138 xDelete<IssmDouble>(LoveLtDouble); 1147 1139 1148 1140 /*Add into external results, no need to downcast, we can handle complexes/quad precision: */ 1149 1141 femmodel->results->AddObject(new GenericExternalResult<doubletype*>(femmodel->results->Size()+1,LoveKrEnum,LoveKt,sh_nmax+1,nt,0,0)); … … 1226 1218 // ); 1227 1219 1228 1229 1220 /*Only when love_kernels is on*/ 1230 1221 //if (love_kernels==1) { … … 1232 1223 //femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveKernelsImagEnum,LoveKernelsImag,(sh_nmax+1)*(matlitho->numlayers+1)*6,nfreq,0,0)); 1233 1224 //} 1234 1235 1225 1236 1226 /*Add love matrices to results:*/ … … 1241 1231 //femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveHiEnum,LoveHi,sh_nmax+1,nfreq,0,0)); 1242 1232 //femmodel->results->AddObject(new GenericExternalResult<IssmDouble*>(femmodel->results->Size()+1,LoveLiEnum,LoveLi,sh_nmax+1,nfreq,0,0)); 1243 1244 1245 1233 1246 1234 //xDelete<IssmDouble>(LoveKr); -
TabularUnified issm/trunk-jpl/src/c/cores/masstransport_core.cpp ¶
r26121 r26468 77 77 } 78 78 SolidEarthIceUpdates(femmodel); 79 79 80 80 femmodel->parameters->SetParam(ThicknessEnum,InputToExtrudeEnum); 81 81 extrudefrombase_core(femmodel); … … 84 84 femmodel->parameters->SetParam(SurfaceEnum,InputToExtrudeEnum); 85 85 extrudefrombase_core(femmodel); 86 86 87 87 } 88 88 … … 112 112 femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum); 113 113 femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum); 114 114 115 115 /*early return?:*/ 116 116 if(!isgrd)return; -
TabularUnified issm/trunk-jpl/src/c/cores/movingfront_core.cpp ¶
r25883 r26468 11 11 12 12 void movingfront_core(FemModel* femmodel){ 13 13 14 14 /*Start profiler*/ 15 15 femmodel->profiler->Start(MOVINGFRONTCORE); … … 47 47 } 48 48 } 49 50 49 51 50 /* start the work from here */ -
TabularUnified issm/trunk-jpl/src/c/cores/oceantransport_core.cpp ¶
r26121 r26468 51 51 /*profiler*/ 52 52 femmodel->profiler->Stop(OCEANTRANSPORTCORE); 53 53 54 54 /*free ressources:*/ 55 55 delete ug; … … 69 69 femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum); 70 70 femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum); 71 71 72 72 /*early return?:*/ 73 73 if(!isgrd)return; -
TabularUnified issm/trunk-jpl/src/c/cores/sealevelchange_core.cpp ¶
r26296 r26468 8 8 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 9 9 #endif 10 11 10 12 11 #include "./cores.h" … … 44 43 /*Retrieve parameters:*/ 45 44 femmodel->parameters->FindParam(&save_results,SaveResultsEnum); 46 45 47 46 /*Verbose: */ 48 47 if(VerboseSolution()) _printf0_(" computing sea level change\n"); … … 53 52 /*run geometry core: */ 54 53 slgeom=sealevelchange_geometry(femmodel); 55 54 56 55 /*any external forcings?:*/ 57 56 solidearthexternal_core(femmodel); … … 97 96 int modelid=-1; 98 97 int isexternal=0; 99 98 100 99 /*parameters: */ 101 100 IssmDouble dt; … … 105 104 femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum); 106 105 femmodel->parameters->FindParam(&isexternal,SolidearthIsExternalEnum); 107 106 108 107 /*Early return:*/ 109 108 if (!isexternal)return; … … 119 118 GetVectorFromInputsx(&bedrocknorth,femmodel,BedNorthEnum,VertexSIdEnum); 120 119 } 121 120 122 121 GetVectorFromInputsx(&geoid_rate,femmodel,SolidearthExternalGeoidRateEnum,VertexSIdEnum); 123 122 GetVectorFromInputsx(&bedrock_rate,femmodel,SolidearthExternalDisplacementUpRateEnum,VertexSIdEnum); … … 156 155 /*Be very careful here, everything is well thought through, do not remove 157 156 * without taking big risks:*/ 158 157 159 158 /*parameters:*/ 160 159 int iscoupling; … … 199 198 /*transer loads from basins to Earth for grd core computations. :*/ 200 199 if(iscoupling){ 201 200 202 201 /*transfer ice thickness change load from basins to earth: */ 203 202 TransferForcing(femmodel,DeltaIceThicknessEnum); … … 213 212 } 214 213 } 215 214 216 215 }; /*}}}*/ 217 216 void grd_core(FemModel* femmodel, SealevelGeometry* slgeom) { /*{{{*/ … … 222 221 GenericParam<BarystaticContributions*>* barycontribparam=NULL; 223 222 IssmDouble polarmotionvector[3]={0}; 224 223 225 224 GrdLoads* loads=NULL; 226 225 Vector<IssmDouble>* oldsealevelloads=NULL; … … 304 303 305 304 if(VerboseSolution()) _printf0_(" starting GRD convolutions\n"); 306 305 307 306 /*update viscous RSL:*/ 308 307 for(Object* & object : femmodel->elements->objects){ … … 341 340 element->SealevelchangeConvolution(sealevelpercpu, loads , polarmotionvector,slgeom); 342 341 } 343 342 344 343 /*retrieve sea level average and ocean area:*/ 345 344 for(Object* & object : femmodel->elements->objects){ … … 349 348 350 349 loads->AssembleSealevelLoads(); 351 350 352 351 /*compute ocean areas:*/ 353 352 if(!loads->sealevelloads){ //first time in the loop … … 357 356 if(scaleoceanarea) totaloceanarea=3.619e+14; // use true ocean area, m^2 358 357 } 359 358 360 359 //Conserve ocean mass: 361 360 oceanaverage=SealevelloadsOceanAverage(loads, oceanareas,subelementoceanareas, totaloceanarea); … … 377 376 378 377 deformation: 379 378 380 379 if(VerboseSolution()) _printf0_(" deformation GRD convolutions\n"); 381 380 … … 403 402 oceanareas->Sum(&totaloceanarea); _assert_(totaloceanarea>0.); 404 403 if(scaleoceanarea) totaloceanarea=3.619e+14; // use true ocean area, m^2 405 404 406 405 //Conserve ocean mass 407 406 //Note that here we create sea-level loads but they will not generate GRD as we have already run all the convolutions … … 454 453 femmodel->parameters->FindParam(&isocean,TransientIsoceantransportEnum); 455 454 if(!isocean)return; 456 455 457 456 /*Verbose: */ 458 457 if(VerboseSolution()) _printf0_(" computing steric and dynamic sea level change\n"); … … 477 476 femmodel->parameters->SetParam(cumgmtslc,CumGmtslcEnum); 478 477 femmodel->parameters->SetParam(cumgmslc,CumGmslcEnum); 479 478 480 479 /*Outputs some metrics:*/ 481 480 femmodel->parameters->FindParam(&step,StepEnum); … … 496 495 /*}}}*/ 497 496 void coupleroutput_core(FemModel* femmodel){ /*{{{*/ 498 497 499 498 /*parameters:*/ 500 499 int iscoupling; … … 504 503 femmodel->parameters->FindParam(&iscoupling,IsSlcCouplingEnum); 505 504 femmodel->parameters->FindParam(&horiz,SolidearthSettingsHorizEnum); 506 505 507 506 if(iscoupling){ 508 507 /*transfer sea level back to ice caps:*/ … … 522 521 IssmDouble *xx = NULL; 523 522 IssmDouble *yy = NULL; 524 523 525 524 if(VerboseSolution()) _printf0_(" computing vertical deformation using Ivins model. \n"); 526 525 … … 541 540 bedup = new Vector<IssmDouble>(gsize); 542 541 beduprate = new Vector<IssmDouble>(gsize); 543 542 544 543 /*retrieve geometric information: */ 545 544 VertexCoordinatesx(&xx,&yy,NULL,femmodel->vertices); … … 581 580 femmodel->parameters->FindParam(&grdmodel,GrdModelEnum); 582 581 nel=femmodel->elements->NumberOfElements(); 583 582 584 583 /*early return?:*/ 585 584 if(grdmodel==IvinsEnum) return; … … 601 600 femmodel->parameters->AddObject(new DoubleVecParam(ZzeEnum,zze,nel)); 602 601 femmodel->parameters->AddObject(new DoubleVecParam(AreaeEnum,areae,nel)); 603 604 602 605 603 #ifdef _ISSM_DEBUG_ … … 612 610 return; 613 611 614 615 612 }/*}}}*/ 616 613 SealevelGeometry* sealevelchange_geometry(FemModel* femmodel) { /*{{{*/ … … 638 635 femmodel->parameters->FindParam(&zze,&nel,ZzeEnum); 639 636 femmodel->parameters->FindParam(&areae,&nel,AreaeEnum); 640 637 641 638 /*initialize SealevelloadMasks structure: */ 642 639 slgeom=new SealevelGeometry(femmodel->elements->Size(),femmodel->vertices->Size()); 643 640 644 641 /*Verbose: */ 645 642 if(VerboseSolution()) _printf0_(" computing sea level geometrical kernel and weight updates.\n"); 646 647 643 648 644 /*Run sealevel geometry routine for elements with full loading:*/ 649 645 for(Object* & object : femmodel->elements->objects){ … … 651 647 element->SealevelchangeGeometryCentroidLoads(slgeom,xxe,yye,zze,areae); 652 648 } 653 649 654 650 /*Initialize fractional loading mapping: */ 655 651 slgeom->InitializeMappingsAndBarycentres(); 656 652 657 658 653 /*Run sealevel geometry routine for elements with fractional loading:*/ 659 654 for(Object* & object : femmodel->elements->objects){ … … 671 666 } 672 667 673 674 668 femmodel->parameters->AddObject(new DoubleVecParam(XxeEnum,xxe,nel)); 675 669 femmodel->parameters->AddObject(new DoubleVecParam(YyeEnum,yye,nel)); … … 738 732 vsealevelloadsvolume->PointwiseMult(loads->vsealevelloads,oceanareas); 739 733 vsubsealevelloadsvolume->PointwiseMult(loads->vsubsealevelloads,suboceanareas); 740 734 741 735 vsealevelloadsvolume->Sum(&sealevelloadsaverage); 742 736 vsubsealevelloadsvolume->Sum(&subsealevelloadsaverage); 743 737 delete vsealevelloadsvolume; 744 738 delete vsubsealevelloadsvolume; 745 739 746 740 return (sealevelloadsaverage+subsealevelloadsaverage)/totaloceanarea; 747 741 } /*}}}*/ … … 758 752 IssmDouble m1, m2, m3; 759 753 bool rotation=false; 760 754 761 755 /*early return?:*/ 762 756 femmodel->parameters->FindParam(&rotation,SolidearthSettingsRotationEnum); … … 786 780 ISSM_MPI_Reduce (&moi_list_cpu[0],&moi_list[0],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() ); 787 781 ISSM_MPI_Bcast(&moi_list[0],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); 788 782 789 783 ISSM_MPI_Reduce (&moi_list_cpu[1],&moi_list[1],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() ); 790 784 ISSM_MPI_Bcast(&moi_list[1],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); 791 785 792 786 ISSM_MPI_Reduce (&moi_list_cpu[2],&moi_list[2],1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() ); 793 787 ISSM_MPI_Bcast(&moi_list[2],1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); … … 817 811 int* indices=xNew<int>(nel); 818 812 for(int i=0;i<nel;i++)indices[i]=i; 819 813 820 814 Vector<IssmDouble>* vloadcopy=new Vector<IssmDouble>(nel); 821 815 IssmDouble* loadcopy=xNew<IssmDouble>(nel); 822 816 823 817 vloadcopy->SetValues(nel,indices,load,INS_VAL); 824 818 vloadcopy->Assemble(); 825 826 819 827 820 if(subload){ -
TabularUnified issm/trunk-jpl/src/c/main/esmfbinders.cpp ¶
r26057 r26468 115 115 Input* surface_input = element->GetInput(SurfaceEnum); _assert_(surface_input); 116 116 surface_input->GetInputAverage(&surface); 117 117 118 118 *(issmoutputs+f*numberofelements+i) = surface; 119 119 -
TabularUnified issm/trunk-jpl/src/c/main/issm.cpp ¶
r26047 r26468 15 15 /*Initialize femmodel from arguments provided command line: */ 16 16 FemModel *femmodel = new FemModel(argc,argv,comm_init); 17 17 18 18 /*Need to know we are firing up from ISSM main, not a coupler driver like issm_slcp or issm_ocean:*/ 19 19 femmodel->parameters->AddObject(new IntParam(IsSlcCouplingEnum,0)); -
TabularUnified issm/trunk-jpl/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp ¶
r23657 r26468 12 12 int melt_parameterization; 13 13 femmodel->parameters->FindParam(&melt_parameterization,FrontalForcingsParamEnum); 14 14 15 15 /*Calculate melting rate*/ 16 16 switch(melt_parameterization){ -
TabularUnified issm/trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp ¶
r26073 r26468 27 27 } 28 28 } 29 30 31 29 32 30 void InputUpdateFromConstantx(FemModel* femmodel,IssmDouble constant, int name){ … … 84 82 else _error_("InputUpdateFromConstantx error message: type not supported yet!"); 85 83 86 87 84 } 88 85 void InputUpdateFromConstantx(Inputs* inputs,Elements* elements,bool constant, int name){ -
TabularUnified issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp ¶
r26282 r26468 49 49 descriptor=variables_descriptors[i]; 50 50 51 52 51 /*From descriptor, figure out if the variable is scaled, indexed, distributed or just a simple variable: */ 53 52 if (strncmp(descriptor,"scaled_",7)==0){ … … 166 165 _printf0_("\n"); 167 166 } 168 169 167 170 168 if (femmodel->inputs->GetInputObjectEnum(MasstransportSpcthicknessEnum)==DatasetInputEnum) … … 286 284 } 287 285 288 289 286 } /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp ¶
r26048 r26468 7 7 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 8 8 #endif 9 10 9 11 10 #include "../../shared/shared.h" -
TabularUnified issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp ¶
r25539 r26468 289 289 N_all[i] = N; 290 290 291 292 291 for(Object* & object : elements->objects){ 293 292 Element* element=xDynamicCast<Element*>(object); -
TabularUnified issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp ¶
r26252 r26468 717 717 xDelete<int>(cost_functions_weights_N); 718 718 xDelete<IssmDouble*>(cost_functions_weights); 719 719 720 720 /*}}}*/ 721 721 } -
TabularUnified issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp ¶
r26222 r26468 90 90 parameters->AddObject(iomodel->CopyConstantObject("md.transient.amr_frequency",TransientAmrFrequencyEnum)); 91 91 parameters->AddObject(iomodel->CopyConstantObject("md.transient.issampling",TransientIssamplingEnum)); 92 92 93 93 /*For stress balance only*/ 94 94 parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.isFS",FlowequationIsFSEnum)); -
TabularUnified issm/trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp ¶
r25627 r26468 24 24 int solutiontype; 25 25 char* solutiontypestring = NULL; 26 27 26 28 27 /*recover my_rank:*/ … … 71 70 char* root=NULL; 72 71 char* modelname=NULL; 73 72 74 73 femmodel->parameters->FindParam(&currEvalId,QmuCurrEvalIdEnum); 75 74 femmodel->parameters->FindParam(&statistics,QmuStatisticsEnum); -
TabularUnified issm/trunk-jpl/src/c/modules/QmuStatisticsx/QmuStatisticsx.cpp ¶
r25711 r26468 20 20 IssmDouble* dmatfield = NULL; 21 21 int* imatfield = NULL; 22 22 23 23 //type of the returned field: 24 24 int type; … … 109 109 int range,lower_row,upper_row; 110 110 int nfilesperdirectory; 111 111 112 112 /*intermediary:*/ 113 113 IssmDouble* doublemat=NULL; … … 237 237 char* field=fields[f]; 238 238 meanxtype[f]=readdata(&doublemat, &doublematsize, &scalar, fid,field,steps[0]); 239 239 240 240 if(meanxtype[f]==1){ 241 241 meanxsize[f]=1; … … 246 246 timemean+=scalar/nsteps; 247 247 } 248 248 249 249 /*Figure out max and min of time means: */ 250 250 if(i==(lower_row+1)){ … … 334 334 IssmDouble* allmax=xNew<IssmDouble>(size); 335 335 IssmDouble* allmin=xNew<IssmDouble>(size); 336 336 337 337 ISSM_MPI_Allreduce(maxx,allmax,size,ISSM_MPI_PDOUBLE,ISSM_MPI_MAX,IssmComm::GetComm()); 338 338 ISSM_MPI_Allreduce(minx,allmin,size,ISSM_MPI_PDOUBLE,ISSM_MPI_MIN,IssmComm::GetComm()); … … 344 344 } /*}}}*/ 345 345 } 346 346 347 347 /*Now do the same for the time mean fields:*/ 348 348 for (int f=0;f<nfields;f++){ … … 377 377 ISSM_MPI_Allreduce(minx,allmin,size,ISSM_MPI_PDOUBLE,ISSM_MPI_MIN,IssmComm::GetComm()); 378 378 379 380 379 /*Store for later use in histogram computation:*/ 381 380 maxmeans[f]=allmax; … … 488 487 char* field=fields[f]; 489 488 meanxtype[f]=readdata(&doublemat, &doublematsize, &scalar, fid,field,steps[0]); 490 489 491 490 if(meanxtype[f]==1){ 492 491 IssmDouble timemean=0; … … 496 495 timemean+=scalar/nsteps; 497 496 } 498 497 499 498 /*Figure out max and min of time means: */ 500 499 if(i==(lower_row+1)){ … … 531 530 IssmDouble* ma=maxmeans[f]; 532 531 IssmDouble* mi=minmeans[f]; 533 532 534 533 for (int k=0;k<doublematsize;k++){ 535 534 IssmDouble scalar=timemean[k]; … … 541 540 } 542 541 else{ 543 542 544 543 IssmDouble* localhistogram=timehistogram[f]; 545 544 IssmDouble* ma=maxmeans[f]; 546 545 IssmDouble* mi=minmeans[f]; 547 546 548 547 for (int k=0;k<doublematsize;k++){ 549 548 IssmDouble scalar=timemean[k]; … … 600 599 IssmDouble* histo=histogram[counter]; 601 600 IssmDouble* allhisto=xNew<IssmDouble>(size*nbins); 602 601 603 602 ISSM_MPI_Allreduce(histo,allhisto,size*nbins,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,IssmComm::GetComm()); 604 603 xDelete<IssmDouble>(histo); … … 620 619 } 621 620 _printf0_("Start aggregating time mean histogram:\n"); 622 621 623 622 /*Now do the same for the time mean fields:*/ 624 623 for (int f=0;f<nfields;f++){ … … 684 683 int range,lower_row,upper_row; 685 684 int nfilesperdirectory; 686 685 687 686 /*intermediary:*/ 688 687 IssmDouble* doublemat=NULL; … … 806 805 } 807 806 } 808 807 809 808 /*Deal with time mean: */ 810 809 for (int f=0;f<nfields;f++){ … … 917 916 IssmDouble* sumx=xNew<IssmDouble>(size); 918 917 IssmDouble* sumx2=xNew<IssmDouble>(size); 919 918 920 919 ISSM_MPI_Reduce(x,sumx,size,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm()); 921 920 ISSM_MPI_Reduce(x2,sumx2,size,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm()); … … 980 979 IssmDouble* sumx=xNew<IssmDouble>(size); 981 980 IssmDouble* sumx2=xNew<IssmDouble>(size); 982 981 983 982 ISSM_MPI_Reduce(x,sumx,size,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm()); 984 983 ISSM_MPI_Reduce(x2,sumx2,size,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm()); … … 1021 1020 int* indices=NULL; 1022 1021 int nindices; 1023 1022 1024 1023 /*intermediary:*/ 1025 1024 IssmDouble* doublemat=NULL; … … 1143 1142 if(my_rank==0){ 1144 1143 char fieldname[1000]; 1145 1144 1146 1145 sprintf(fieldname,"%s%s",fields[f],"Samples"); 1147 1146 results->AddResult(new GenericExternalResult<IssmPDouble*>(results->Size()+1,fieldname,allx,nsamples,1,j+1,0)); … … 1152 1151 x=xs[counter]; 1153 1152 allx=xNew<IssmDouble>(nsamples*nindices); 1154 1153 1155 1154 MPI_Gather(x, range*nindices, ISSM_MPI_PDOUBLE,allx, range*nindices, ISSM_MPI_PDOUBLE, 0, IssmComm::GetComm()); 1156 1155 1157 1156 /*add to results:*/ 1158 1157 if(my_rank==0){ … … 1183 1182 1184 1183 FemModel* femmodel=new FemModel(); 1185 1184 1186 1185 /*Some parameters that will allow us to use the OutputResultsx module:*/ 1187 1186 parameters->AddObject(new BoolParam(QmuIsdakotaEnum,false)); … … 1327 1326 results = new Results(); 1328 1327 parameters=new Parameters(); 1329 1328 1330 1329 //solution type: 1331 1330 parameters->AddObject(new IntParam(SolutionTypeEnum,StatisticsSolutionEnum)); 1332 1331 1333 1332 //root directory 1334 1333 directory=xNew<char>(strlen(argv[2])+1); … … 1359 1358 ISSM_MPI_Comm_split(ISSM_MPI_COMM_WORLD,color, my_rank, &statcomm); 1360 1359 1361 1362 1360 iomodel->FindConstant(&numstatistics,"md.qmu.statistics.numstatistics"); 1363 1361 for (int i=1;i<=numstatistics;i++){ … … 1367 1365 int nsamples; 1368 1366 _printf0_("Dealing with qmu statistical computation #" << i << "\n"); 1369 1367 1370 1368 sprintf(string,"md.qmu.statistics.method(%i).name",i); 1371 1369 iomodel->FindConstant(&name,string); … … 1391 1389 iomodel->FetchData(&indices,&dummy,&nindices,string); 1392 1390 parameters->AddObject(new IntVecParam(IndicesEnum,indices,nindices)); 1393 1391 1394 1392 ComputeSampleSeries(parameters,results,color,statcomm); 1395 1393 } … … 1410 1408 /*output results:*/ 1411 1409 OutputStatistics(parameters,results,color,statcomm); 1412 1410 1413 1411 /*all meet here: */ 1414 1412 ISSM_MPI_Barrier(ISSM_MPI_COMM_WORLD); _printf0_("Output file.\n"); -
TabularUnified issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp ¶
r26271 r26468 1618 1618 1619 1619 //// MELT, PERCOLATION AND REFREEZE 1620 1620 1621 1621 // initialize refreeze, runoff, flxDn and dW vectors [kg] 1622 1622 IssmDouble* F = xNewZeroInit<IssmDouble>(n); … … 1707 1707 for(int l=i;(l<n && d[l]>=dPHC-Dtol);l++) depthice=depthice+dz[l]; 1708 1708 } 1709 1709 1710 1710 // break loop if there is no meltwater and if depth is > mw_depth 1711 1711 if (fabs(inM) < Wtol && i > X){ -
TabularUnified issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp ¶
r23400 r26468 32 32 IssmDouble Pmax = 0.6; 33 33 IssmDouble inv_twelve=1./12.; 34 34 35 35 sconv=(rho_water/rho_ice); //rhow_rain/rhoi 36 36 … … 91 91 IssmDouble coeff5=3.8e-05; // polynomial 92 92 IssmDouble coeff6=6.0e-07; // fit 93 93 94 94 if(tstar>=temp_rain) 95 95 frac_solid = 0.0; … … 100 100 +tstar*(coeff3+tstar*(coeff4+tstar*(coeff5+tstar*coeff6)))); 101 101 } 102 102 103 103 snowfall=snowfall+precip_star*frac_solid*inv_twelve; 104 104 } … … 108 108 if(snowfall<0.0) snowfall=0.0; // correction of 109 109 if(rainfall<0.0) rainfall=0.0; // negative values 110 110 111 111 if(rainfall<=(Pmax*snowfall)){ 112 112 if((rainfall+beta1*pdd)<=(Pmax*snowfall)) { … … 126 126 runoff = smelt+rainfall-Pmax*snowfall; 127 127 } 128 128 129 129 saccu = precip; 130 130 -
TabularUnified issm/trunk-jpl/src/c/solutionsequences/solutionsequence_nonlinear.cpp ¶
r25549 r26468 76 76 Solverx(&uf, Kff, pf, old_uf, df, femmodel->parameters); 77 77 femmodel->profiler->Stop(SOLVER); 78 78 79 79 Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters);delete ys; 80 80 … … 98 98 } 99 99 } 100 100 101 101 /*Increase count: */ 102 102 count++; -
TabularUnified issm/trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp ¶
r25710 r26468 33 33 IssmPDouble t1,t2; /* Time measurement for bottleneck analysis */ 34 34 35 36 35 double tmp1,tmp2,tmp3; 37 36 int tmpi; … … 39 38 40 39 int noIt; 41 42 43 40 44 41 int precond = 0; … … 49 46 PetscBool flag,flg; 50 47 #endif 51 52 48 53 49 char ksp_type[50]; … … 71 67 #endif 72 68 73 74 69 if(precond){ 75 70 _printf0_("Running WITH preconditioner\n"); … … 78 73 } 79 74 80 81 75 /*Initialize output*/ 82 76 Vector<IssmDouble>* out_uf=new Vector<IssmDouble>(uf0); 83 77 84 78 /* Extract block matrices from the saddle point matrix */ 85 79 /* [ A B ] = Kff … … 97 91 MatGetSubMatrix(Kff,isp,isv,MAT_INITIAL_MATRIX,&BT); 98 92 #endif 99 93 100 94 /* Extract preconditioner matrix on the pressure space*/ 101 95 #if PETSC_VERSION_GT(3,8,0) … … 105 99 #endif 106 100 107 108 101 /* Get number of velocity / pressure nodes */ 109 102 MatGetSize(B,&nu,&np); … … 117 110 VecGetSubVector(out_uf->pvector->vector,isv,&uold); 118 111 VecGetSubVector(out_uf->pvector->vector,isp,&p); 119 120 112 121 113 /* Set up intermediaries */ … … 133 125 VecDuplicate(p,&wnew);VecSet(wnew,0.0); 134 126 VecDuplicate(uold,&chi);VecSet(chi,0.0); 135 127 136 128 /* Get global RHS (for each block sub-problem respectively)*/ 137 129 VecGetSubVector(pf,isv,&f1); … … 143 135 /* a(u0,v) = f1(v)-b(p0,v) i.e. Au0 = F1-Bp0 */ 144 136 /* u0 = u_DIR on \Gamma_DIR */ 145 137 146 138 /* Create KSP context */ 147 139 KSPCreate(IssmComm::GetComm(),&kspu); … … 174 166 _error_("Suggested KSP method not implemented yet!\n"); 175 167 } 176 168 177 169 KSPSetInitialGuessNonzero(kspu,PETSC_TRUE); 178 170 179 171 /*Strong rel. residual tolerance needed when solving for the velocity update. 180 172 * This is because ISSM uses the dimensional equations, so the initial guess chi = 0 181 173 * results in a very high initial residual (~ 1e19)*/ 182 174 KSPSetTolerances(kspu,ELLTOL,PETSC_DEFAULT,PETSC_DEFAULT,maxiter); //maxiter 183 184 185 175 186 176 KSPGetPC(kspu,&pcu); … … 210 200 KSPSetUp(kspu); 211 201 212 213 202 /* Create RHS */ 214 203 /* RHS = F1-B * pold */ … … 227 216 VecNorm(resu,NORM_2,&tmp5); 228 217 229 230 } 231 218 } 232 219 233 220 /* Go solve Au0 = F1-Bp0*/ … … 235 222 KSPGetIterationNumber(kspu,&noIt); 236 223 237 238 239 224 if (VerboseConvergence()) 240 225 { 241 226 242 227 KSPGetIterationNumber(kspu,&tmpi); 243 228 VecScale(rhsu,-1.);MatMultAdd(A,uold,rhsu,tmpu);VecScale(rhsu,-1.); … … 249 234 } 250 235 251 252 253 236 /* Set up u_new */ 254 237 VecDuplicate(uold,&unew);VecCopy(uold,unew); 255 238 VecAssemblyBegin(unew);VecAssemblyEnd(unew); 256 239 257 258 259 240 /* ------------------------------------------------------------- */ 260 241 261 242 /*Get initial residual*/ 262 243 /*(1/mu(x) * g0, q) = b(q,u0) - (f2,q) i.e. IP * g0 = BT * u0 - F2*/ 263 244 264 245 /* Create KSP context */ 265 246 KSPCreate(IssmComm::GetComm(),&kspip); … … 269 250 KSPSetOperators(kspip,IP,IP,DIFFERENT_NONZERO_PATTERN); 270 251 #endif 271 252 272 253 /* Create RHS */ 273 254 /* RHS = BT * uold - F2 */ 274 255 VecScale(uold,-1.);MatMultAdd(BT,uold,f2,rhsp);VecScale(uold,-1.); 275 256 276 277 257 /* Set KSP & PC options */ 278 258 KSPSetType(kspip,KSPGMRES); 279 259 KSPSetInitialGuessNonzero(kspip,PETSC_TRUE); 280 281 260 282 261 KSPGetPC(kspip,&pcp); 283 262 PCSetType(pcp,PCJACOBI); … … 294 273 } 295 274 296 297 298 275 /* Go solve */ 299 276 KSPSolve(kspip,rhsp,gold); 300 277 301 302 303 278 if (VerboseConvergence()) 304 279 { 305 280 306 281 KSPGetResidualNorm(kspip,&tmp1); 307 282 VecScale(rhsp,-1.);MatMultAdd(IP,gold,rhsp,tmpp);VecScale(rhsp,-1.); … … 311 286 _printf0_("||IP*g00 - rhsp||_euc: " << tmp4 <<"\n||Jac(-1)*(IP*g00-rhsp)||_euc: " << tmp5 << "\n||IP*gn0-rhsp||_euc: " << tmp2<< "\n||Jac(-1)*(IP*gn0-rhsp)||_euc: " << tmp1 << "\nIteration number: "<<tmpi<<"\n"); 312 287 } 313 314 288 315 289 /*Initial residual*/ … … 318 292 _printf0_("inner product norm g0: "<<initRnorm<<"\n"); 319 293 320 321 294 /*Iterate only if inital residual large enough*/ 322 295 if(initRnorm > 1e-5) … … 326 299 VecDuplicate(gold,&gnew);VecCopy(gold,gnew); 327 300 VecAssemblyBegin(gnew);VecAssemblyEnd(gnew); 328 329 301 330 302 /* ------------------------------------------------------------ */ … … 334 306 VecDuplicate(gold,&wold);VecCopy(gold,wold); 335 307 VecAssemblyBegin(wold);VecAssemblyEnd(wold); 336 337 308 338 309 /* Count number of iterations */ … … 351 322 VecScale(wold,1.);MatMult(B,wold,rhsu);VecScale(wold,1.); 352 323 VecSet(chi,0.0); 353 354 324 355 325 if(VerboseConvergence()) 356 326 { 357 327 VecScale(rhsu,-1.);MatMultAdd(A,chi,rhsu,tmpu);VecScale(rhsu,-1.); 358 328 VecNorm(tmpu,NORM_2,&tmp4); 359 329 360 330 KSPInitialResidual(kspu,chi,tmpu,tmpu2,resu,rhsu); 361 331 VecNorm(resu,NORM_2,&tmp5); … … 363 333 } 364 334 365 366 335 KSPSolve(kspu,rhsu,chi); 367 368 369 370 336 371 337 if (VerboseConvergence()) 372 338 { 373 339 VecNorm(chi,NORM_2,&tmp1); 374 340 KSPGetResidualNorm(kspu,&tmp2); 375 341 376 342 VecScale(rhsu,-1.);MatMultAdd(A,chi,rhsu,tmpu);VecScale(rhsu,-1.); 377 343 VecNorm(tmpu,NORM_2,&tmp3); 378 379 344 380 345 KSPGetIterationNumber(kspu,&tmpi); 381 346 _printf0_("||chi_nk||_euc: "<< tmp1 << "\n||A*chi_0k - rhsu||_euc: "<<tmp4<< "\n||P(-1)*(A*chi_0k-rhsu)||_euc: " << tmp5 << "\n||A*chi_nk - rhsu||_euc: "<< tmp3 <<"\n||P(-1)*(A*chi_nk - rhsu)||_euc: " << tmp2 <<"\nIteration Number: " << tmpi <<"\n"); 382 347 } 383 348 384 385 349 /* ---------------------------------------------------------- */ 386 387 350 388 351 /*Set step size*/ … … 390 353 MatMult(IP,gold,tmpp); 391 354 VecDot(tmpp,wold,&rho); 392 355 393 356 MatMult(BT,chi,tmpp); 394 357 VecDot(tmpp,wold,&tmpScalar); 395 358 rho = rho/tmpScalar; 396 359 397 398 360 /* ---------------------------------------------------------- */ 399 400 361 401 362 /*Pressure update*/ 402 363 /*p(m+1) = pm + rhom * wm*/ 403 364 VecAXPY(p,-1.*rho,wold); 404 405 365 406 366 /*Velocity update*/ … … 408 368 VecWAXPY(unew,rho,chi,uold); 409 369 VecNorm(unew,NORM_2,&tmpScalar); 410 411 370 412 371 if (VerboseConvergence()) … … 421 380 _printf0_("Incompressibility norm: " << tmp7 <<"\n"); 422 381 } 423 424 425 382 426 383 /* ---------------------------------------------------------- */ … … 432 389 VecWAXPY(rhsp,-1.*rho,tmpp,tmpp2); 433 390 KSPSolve(kspip,rhsp,gnew); 434 435 436 391 437 392 /* ---------------------------------------------------------- */ 438 393 439 394 MatMult(IP,gnew,tmpp); 440 395 441 396 VecDot(tmpp,gnew,&gamma); 442 397 rnorm = sqrt(gamma); … … 454 409 _printf0_("L2-Norm g: "<< rnorm << "\n"); 455 410 } 456 411 457 412 /*Break prematurely if solver doesn't reach desired tolerance in reasonable time frame*/ 458 413 if(count > 10./TOL) … … 461 416 break; 462 417 } 463 464 418 465 419 /* ---------------------------------------------------------- */ 466 467 420 468 421 /*Directional update*/ … … 475 428 /* Assign new to old iterates */ 476 429 VecCopy(wnew,wold);VecCopy(gnew,gold);VecCopy(unew,uold); 477 430 478 431 count++; 479 432 } … … 487 440 *puf=out_uf; 488 441 489 490 442 /* Cleanup */ 491 443 KSPDestroy(&kspu);KSPDestroy(&kspip); 492 444 493 445 MatDestroy(&A);MatDestroy(&B);MatDestroy(&BT);MatDestroy(&IP); 494 446 495 447 VecDestroy(&p);VecDestroy(&uold);VecDestroy(&unew);VecDestroy(&rhsu);VecDestroy(&rhsp); 496 448 VecDestroy(&gold);VecDestroy(&gnew);VecDestroy(&wold);VecDestroy(&wnew);VecDestroy(&chi); … … 522 474 double rnorm1, rnorm2; 523 475 524 525 476 if(VerboseModule()) _printf0_(" checking convergence\n"); 526 477 … … 548 499 MatGetSubMatrix(Kff->pmatrix->matrix,isp,isv,MAT_INITIAL_MATRIX,&BT); 549 500 #endif 550 501 551 502 /*no. of free nodes in velocity/pressure space*/ 552 503 MatGetSize(B,&n_u,&n_p); … … 560 511 VecGetSubVector(uf->pvector->vector,isv,&u); 561 512 VecGetSubVector(uf->pvector->vector,isp,&p); 562 563 513 564 514 /*Extract values of the RHS corresponding to the first/second block*/ … … 573 523 VecDuplicate(p,&res2);VecSet(res2,1.0); 574 524 575 576 525 /*Display solver caracteristics*/ 577 526 if (VerboseConvergence()){ 578 527 579 528 /*Calculate res1 = A*u + B*p - f1*/ 580 529 VecScale(f1,-1.);MatMultAdd(A,u,f1,tmp);MatMultAdd(B,p,tmp,res1);VecScale(f1,-1.); 581 530 /*Calculate res2 = B^T * u - f2*/ 582 531 VecScale(f2,-1.);MatMultAdd(BT,u,f2,res2);VecScale(f2,-1.); 583 584 532 585 533 /*compute norm(res1), norm(res2), norm(F) and residue*/ … … 597 545 VecRestoreSubVector(uf->pvector->vector,isv,&u); 598 546 VecRestoreSubVector(uf->pvector->vector,isp,&p); 599 547 600 548 /*Extract values corresponding to velocity/pressure on the old solution*/ 601 549 VecGetSubVector(old_uf->pvector->vector,isv,&uold); 602 550 VecGetSubVector(old_uf->pvector->vector,isp,&pold); 603 604 551 605 552 /*Force equilibrium (Mandatory)*/ … … 609 556 /*Calculate res2 = B^T * uold - f2*/ 610 557 VecScale(f2,-1.);MatMultAdd(BT,uold,f2,res2);VecScale(f2,-1.); 611 558 612 559 /*compute norm(res1), norm(res2), norm(F) and residue*/ 613 560 VecNorm(res1,NORM_2,&rnorm1);VecNorm(res2,NORM_2,&rnorm2); … … 626 573 VecRestoreSubVector(old_uf->pvector->vector,isv,&uold); 627 574 VecRestoreSubVector(old_uf->pvector->vector,isp,&pold); 628 629 630 575 631 576 //print … … 721 666 int count=0; 722 667 bool converged=false; 723 668 724 669 /*Start non-linear iteration using input velocity: */ 725 670 GetSolutionFromInputsx(&ug,femmodel); … … 729 674 InputUpdateFromConstantx(femmodel,converged,ConvergedEnum); 730 675 InputUpdateFromSolutionx(femmodel,ug); 731 676 732 677 for(;;){ 733 678 … … 747 692 PetscOptionsGetInt(NULL,PETSC_NULL,"-schur_pc",&precond,NULL); 748 693 #endif 749 694 750 695 StressbalanceAnalysis* analysis = new StressbalanceAnalysis(); 751 696 752 697 /* Construct Schur preconditioner matrix or mass matrix depending on input */ 753 698 if(precond) … … 760 705 } 761 706 }else{ 762 707 763 708 for(Object* & object : femmodel->elements->objects){ 764 709 Element* element2=xDynamicCast<Element*>(object); … … 769 714 } 770 715 771 772 716 delete analysis; 773 717 774 718 /*Obtain index sets for velocity and pressure components */ 775 719 IS isv = NULL; … … 785 729 Kff->Assemble(); 786 730 787 788 731 /*Solve*/ 789 732 femmodel->profiler->Start(SOLVER); 790 733 _assert_(Kff->type==PetscMatType); 791 792 734 793 735 SchurCGSolver(&uf, -
TabularUnified issm/trunk-jpl/src/c/toolkits/codipack/ampi_interface.cpp ¶
r23350 r26468 12 12 #error "Cannot compile without MeDiPack and AdjointMpi" 13 13 #endif 14 -
TabularUnified issm/trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp ¶
r26433 r26468 318 318 xDelete(valueX); 319 319 xDelete(indexX); 320 320 321 321 delete data; 322 322 }
Note:
See TracChangeset
for help on using the changeset viewer.