Changeset 23587
- Timestamp:
- 01/02/19 20:33:39 (6 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
r23585 r23587 792 792 void DamageEvolutionAnalysis::LumpedMassMatrix(Vector<IssmDouble>** pMlff,FemModel* femmodel){/*{{{*/ 793 793 794 /*Intermediaries*/795 int configuration_type;796 797 794 /*Initialize Lumped mass matrix (actually we just save its diagonal)*/ 798 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum); 799 int fsize = femmodel->nodes->NumberOfDofs(configuration_type,FsetEnum); 800 int flocalsize = femmodel->nodes->NumberOfDofsLocal(configuration_type,FsetEnum); 795 int fsize = femmodel->nodes->NumberOfDofs(FsetEnum); 796 int flocalsize = femmodel->nodes->NumberOfDofsLocal(FsetEnum); 801 797 Vector<IssmDouble>* Mlff = new Vector<IssmDouble>(flocalsize,fsize); 802 798 -
issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
r23585 r23587 1636 1636 IssmDouble* serial_spc = NULL; 1637 1637 1638 spc=new Vector<IssmDouble>(femmodel->nodes->NumberOfNodes( EnthalpyAnalysisEnum));1638 spc=new Vector<IssmDouble>(femmodel->nodes->NumberOfNodes()); 1639 1639 /*First create a vector to figure out what elements should be constrained*/ 1640 1640 for(int i=0;i<femmodel->elements->Size();i++){ -
issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
r23585 r23587 760 760 761 761 /*Vector of size number of nodes*/ 762 vec_constraint_nodes=new Vector<IssmDouble>(femmodel->nodes->NumberOfNodes( LevelsetAnalysisEnum));762 vec_constraint_nodes=new Vector<IssmDouble>(femmodel->nodes->NumberOfNodes()); 763 763 764 764 for(int i=0;i<femmodel->elements->Size();i++){ -
issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
r23585 r23587 930 930 void MasstransportAnalysis::LumpedMassMatrix(Vector<IssmDouble>** pMlff,FemModel* femmodel){/*{{{*/ 931 931 932 /*Intermediaries*/933 int configuration_type;934 935 932 /*Initialize Lumped mass matrix (actually we just save its diagonal)*/ 936 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum); 937 int fsize = femmodel->nodes->NumberOfDofs(configuration_type,FsetEnum); 938 int flocalsize = femmodel->nodes->NumberOfDofsLocal(configuration_type,FsetEnum); 933 int fsize = femmodel->nodes->NumberOfDofs(FsetEnum); 934 int flocalsize = femmodel->nodes->NumberOfDofsLocal(FsetEnum); 939 935 Vector<IssmDouble>* Mlff = new Vector<IssmDouble>(flocalsize,fsize); 940 936 -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r23586 r23587 352 352 analysis_type=output->analysis_type_list[i]; 353 353 output->SetCurrentConfiguration(analysis_type); 354 SpcNodesx(output->nodes_list[i],output->constraints_list[i],output->parameters ,analysis_type);355 NodesDofx(output->nodes_list[i],output->parameters ,analysis_type);354 SpcNodesx(output->nodes_list[i],output->constraints_list[i],output->parameters); 355 NodesDofx(output->nodes_list[i],output->parameters); 356 356 ConfigureObjectsx(output->elements,output->loads_list[i],output->nodes_list[i],output->vertices,output->materials,output->parameters); 357 357 } … … 445 445 446 446 if(VerboseMProcessor()) _printf0_(" resolving node constraints\n"); 447 SpcNodesx(nodes,this->constraints,parameters ,analysis_type_list[i]);447 SpcNodesx(nodes,this->constraints,parameters); 448 448 449 449 if(VerboseMProcessor()) _printf0_(" creating nodal degrees of freedom\n"); 450 NodesDofx(nodes,parameters ,analysis_type_list[i]);450 NodesDofx(nodes,parameters); 451 451 } 452 452 … … 525 525 analysis_type=this->analysis_type_list[i]; 526 526 SetCurrentConfiguration(analysis_type); 527 SpcNodesx(this->nodes_list[i],this->constraints_list[i],this->parameters ,analysis_type);528 NodesDofx(this->nodes_list[i],this->parameters ,analysis_type);527 SpcNodesx(this->nodes_list[i],this->constraints_list[i],this->parameters); 528 NodesDofx(this->nodes_list[i],this->parameters); 529 529 ConfigureObjectsx(this->elements,this->loads_list[i],this->nodes_list[i],this->vertices,this->materials,this->parameters); 530 530 } … … 1279 1279 void FemModel::GetInputLocalMinMaxOnNodesx(IssmDouble** pmin,IssmDouble** pmax,IssmDouble* ug){/*{{{*/ 1280 1280 1281 /*Get vector sizes for current configuration*/1282 int configuration_type;1283 this->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);1284 int numnodes = this->nodes->NumberOfNodes(configuration_type);1285 1286 1281 /*Initialize output vectors*/ 1282 int numnodes = this->nodes->NumberOfNodes(); 1287 1283 IssmDouble* uLmin_local = xNew<IssmDouble>(numnodes); 1288 1284 IssmDouble* uLmax_local = xNew<IssmDouble>(numnodes); … … 2543 2539 2544 2540 /*Second, constraints might be time dependent: */ 2545 SpcNodesx(nodes,constraints,parameters ,config_type);2541 SpcNodesx(nodes,constraints,parameters); 2546 2542 2547 2543 /*Now, update degrees of freedoms: */ 2548 NodesDofx(nodes,parameters ,config_type);2544 NodesDofx(nodes,parameters); 2549 2545 2550 2546 } … … 2725 2721 2726 2722 ConfigureObjectsx(new_elements,this->loads,new_nodes_list[i],new_vertices,new_materials,this->parameters); 2727 SpcNodesx(new_nodes_list[i],new_constraints_list[i],this->parameters ,analysis_type);2728 NodesDofx(new_nodes_list[i],this->parameters ,analysis_type);2723 SpcNodesx(new_nodes_list[i],new_constraints_list[i],this->parameters); 2724 NodesDofx(new_nodes_list[i],this->parameters); 2729 2725 } 2730 2726 … … 4480 4476 void FemModel::HydrologyEPLupdateDomainx(IssmDouble* pEplcount){ /*{{{*/ 4481 4477 4482 Vector<IssmDouble> * mask= NULL;4483 Vector<IssmDouble> * recurence= NULL;4484 Vector<IssmDouble> * active= NULL;4485 IssmDouble * serial_mask= NULL;4486 IssmDouble * serial_rec= NULL;4487 IssmDouble * serial_active= NULL;4488 IssmDouble *old_active = NULL;4489 int * eplzigzag_counter =NULL;4478 Vector<IssmDouble> *mask = NULL; 4479 Vector<IssmDouble> *recurence = NULL; 4480 Vector<IssmDouble> *active = NULL; 4481 IssmDouble *serial_mask = NULL; 4482 IssmDouble *serial_rec = NULL; 4483 IssmDouble *serial_active = NULL; 4484 IssmDouble *old_active = NULL; 4485 int *eplzigzag_counter = NULL; 4490 4486 int eplflip_lock; 4491 4487 4492 HydrologyDCEfficientAnalysis * effanalysis =new HydrologyDCEfficientAnalysis();4493 HydrologyDCInefficientAnalysis * inefanalysis =new HydrologyDCInefficientAnalysis();4488 HydrologyDCEfficientAnalysis *effanalysis = new HydrologyDCEfficientAnalysis(); 4489 HydrologyDCInefficientAnalysis *inefanalysis = new HydrologyDCInefficientAnalysis(); 4494 4490 4495 4491 /*Step 1: update mask, the mask might be extended by residual and/or using downstream sediment head*/ 4496 mask=new Vector<IssmDouble>(this->nodes->NumberOfNodes(HydrologyDCEfficientAnalysisEnum)); 4497 recurence=new Vector<IssmDouble>(this->nodes->NumberOfNodes(HydrologyDCEfficientAnalysisEnum)); 4492 int numnodes = this->nodes->NumberOfNodes(); 4493 mask=new Vector<IssmDouble>(numnodes); 4494 recurence=new Vector<IssmDouble>(numnodes); 4498 4495 this->parameters->FindParam(&eplzigzag_counter,NULL,EplZigZagCounterEnum); 4499 4496 this->parameters->FindParam(&eplflip_lock,HydrologydcEplflipLockEnum); … … 4504 4501 effanalysis->HydrologyEPLGetMask(mask,recurence,element); 4505 4502 } 4503 4506 4504 /*check for changes and increment zigzag counter, change the mask if necessary*/ 4507 4505 recurence->Assemble(); … … 4530 4528 inefanalysis->ElementizeEplMask(this); 4531 4529 /*Step 2: update node activity. If one element is connected to mask=1, all nodes are active*/ 4532 active=new Vector<IssmDouble>(nodes->NumberOfNodes( HydrologyDCEfficientAnalysisEnum));4530 active=new Vector<IssmDouble>(nodes->NumberOfNodes()); 4533 4531 for (int i=0;i<elements->Size();i++){ 4534 4532 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); … … 4566 4564 /*Update dof indexings*/ 4567 4565 this->UpdateConstraintsx(); 4568 4569 4566 } 4570 4567 /*}}}*/ … … 4583 4580 if(isthermal){ 4584 4581 /*Step 1: update mask, the mask correspond to thawed nodes (that have a meltingrate)*/ 4585 mask=new Vector<IssmDouble>(this->nodes->NumberOfNodes( HydrologyDCInefficientAnalysisEnum));4582 mask=new Vector<IssmDouble>(this->nodes->NumberOfNodes()); 4586 4583 4587 4584 for (int i=0;i<elements->Size();i++){ … … 4604 4601 4605 4602 /*get node mask coherent with element mask*/ 4606 active=new Vector<IssmDouble>(nodes->NumberOfNodes( HydrologyDCInefficientAnalysisEnum));4603 active=new Vector<IssmDouble>(nodes->NumberOfNodes()); 4607 4604 for (int i=0;i<elements->Size();i++){ 4608 4605 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); … … 4651 4648 /*update node activity. If one element is connected to mask=1, all nodes are active*/ 4652 4649 this->SetCurrentConfiguration(HydrologyDCEfficientAnalysisEnum); 4653 active=new Vector<IssmDouble>(nodes->NumberOfNodes( HydrologyDCEfficientAnalysisEnum));4650 active=new Vector<IssmDouble>(nodes->NumberOfNodes()); 4654 4651 for (int i=0;i<elements->Size();i++){ 4655 4652 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); -
issm/trunk-jpl/src/c/classes/Loads/Loads.cpp
r23524 r23587 51 51 } 52 52 /*}}}*/ 53 bool Loads::IsPenalty( int analysis_type){/*{{{*/53 bool Loads::IsPenalty(){/*{{{*/ 54 54 55 55 int ispenalty=0; … … 59 59 for(int i=0;i<this->Size();i++){ 60 60 Load* load=xDynamicCast<Load*>(this->GetObjectByOffset(i)); 61 _assert_(load->InAnalysis(analysis_type));62 61 if(load->IsPenalty()) ispenalty++; 63 62 } … … 73 72 } 74 73 /*}}}*/ 75 int Loads::MaxNumNodes( int analysis_type){/*{{{*/74 int Loads::MaxNumNodes(){/*{{{*/ 76 75 77 76 int max=0; 78 77 int allmax; 79 int numnodes=0;80 78 81 79 /*Now go through all loads, and get how many nodes they own, unless they are clone nodes: */ 82 80 for(int i=0;i<this->Size();i++){ 83 84 81 Load* load=xDynamicCast<Load*>(this->GetObjectByOffset(i)); 85 _assert_(load->InAnalysis(analysis_type)); 86 numnodes=load->GetNumberOfNodes(); 82 int numnodes=load->GetNumberOfNodes(); 87 83 if(numnodes>max)max=numnodes; 88 84 } … … 90 86 /*Grab max of all cpus: */ 91 87 ISSM_MPI_Allreduce((void*)&max,(void*)&allmax,1,ISSM_MPI_INT,ISSM_MPI_MAX,IssmComm::GetComm()); 92 max=allmax; 93 94 return max; 88 return allmax; 95 89 } 96 90 /*}}}*/ … … 102 96 /*Get number of local loads*/ 103 97 localloads=this->Size(); 104 105 /*figure out total number of loads combining all the cpus (no clones here)*/106 ISSM_MPI_Reduce(&localloads,&numberofloads,1,ISSM_MPI_INT,ISSM_MPI_SUM,0,IssmComm::GetComm() );107 ISSM_MPI_Bcast(&numberofloads,1,ISSM_MPI_INT,0,IssmComm::GetComm());108 109 return numberofloads;110 }111 /*}}}*/112 int Loads::NumberOfLoads(int analysis_type){/*{{{*/113 114 int localloads = 0;115 int numberofloads;116 117 /*Get number of local loads*/118 for(int i=0;i<this->Size();i++){119 120 Load* load=xDynamicCast<Load*>(this->GetObjectByOffset(i));121 122 /*Check that this load corresponds to our analysis currently being carried out: */123 _assert_(load->InAnalysis(analysis_type));124 localloads++;125 }126 98 127 99 /*figure out total number of loads combining all the cpus (no clones here)*/ … … 152 124 153 125 for ( object=objects.begin() ; object < objects.end(); object++ ){ 154 155 126 load=xDynamicCast<Load*>(*object); 156 127 load->SetCurrentConfiguration(elements,loads,nodes,vertices,materials,parameters); 157 158 128 } 159 160 129 } 161 130 /*}}}*/ 162 int Loads::Size(void){/*{{{*/163 164 return this->DataSet::Size();165 }166 /*}}}*/167 int Loads::Size(int analysis_type){/*{{{*/168 169 int localloads = 0;170 171 /*Get number of local loads*/172 for(int i=0;i<this->Size();i++){173 174 Load* load=xDynamicCast<Load*>(this->GetObjectByOffset(i));175 176 /*Check that this load corresponds to our analysis currently being carried out: */177 _assert_(load->InAnalysis(analysis_type));178 localloads++;179 }180 181 return localloads;182 }183 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Loads/Loads.h
r18926 r23587 24 24 /*numerics*/ 25 25 void Configure(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters); 26 bool IsPenalty(int analysis); 27 int MaxNumNodes(int analysis); 28 int NumberOfLoads(void); 29 int NumberOfLoads(int analysis); 26 bool IsPenalty(); 27 int MaxNumNodes(); 28 int NumberOfLoads(); 30 29 void ResetHooks(); 31 30 void SetCurrentConfiguration(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters); 32 int Size(int analysis);33 int Size(void);34 35 31 }; 36 32 -
issm/trunk-jpl/src/c/classes/Nodes.cpp
r23586 r23587 123 123 } 124 124 /*}}}*/ 125 void Nodes::DistributeDofs(int analysis_type,intsetenum){/*{{{*/125 void Nodes::DistributeDofs(int setenum){/*{{{*/ 126 126 127 127 int i; … … 143 143 for(i=0;i<this->Size();i++){ 144 144 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i)); 145 146 /*Check that this node corresponds to our analysis currently being carried out: */147 _assert_(node->InAnalysis(analysis_type));148 145 node->DistributeDofs(&dofcount,setenum); 149 146 } … … 165 162 /*Check that this node corresponds to our analysis currently being carried out: */ 166 163 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i)); 167 _assert_(node->InAnalysis(analysis_type));168 164 node->OffsetDofs(dofcount,setenum); 169 165 } … … 172 168 * object that is not a clone, tell them to show their dofs, so that later on, they can get picked 173 169 * up by their clones: */ 174 maxdofspernode=this->MaxNumDofs( analysis_type,setenum);175 numnodes=this->NumberOfNodes( analysis_type);170 maxdofspernode=this->MaxNumDofs(setenum); 171 numnodes=this->NumberOfNodes(); 176 172 if(numnodes*maxdofspernode){ 177 173 truedofs= xNewZeroInit<int>(numnodes*maxdofspernode); //initialize to 0, so that we can pick up the max … … 181 177 for(i=0;i<this->Size();i++){ 182 178 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i)); 183 _assert_(node->InAnalysis(analysis_type));184 179 node->ShowTrueDofs(truedofs,maxdofspernode,setenum);//give maxdofspernode, column size, so that nodes can index into truedofs 185 180 } … … 190 185 for(i=0;i<this->Size();i++){ 191 186 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i)); 192 _assert_(node->InAnalysis(analysis_type));193 187 node->UpdateCloneDofs(alltruedofs,maxdofspernode,setenum); 194 188 } … … 197 191 for(i=0;i<this->Size();i++){ 198 192 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i)); 199 _assert_(node->InAnalysis(analysis_type));200 193 node->ReindexingDone(); 201 194 } … … 207 200 } 208 201 /*}}}*/ 209 int Nodes::MaximumId(){/*{{{*/ 210 211 int max=-1; 212 int id,allmax; 213 214 /*Now go through all nodes, and get how many dofs they own, unless they are clone nodes: */ 215 if(!sorted){ 216 for(int i=0;i<this->Size();i++){ 217 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i)); 218 id=node->Id(); 219 if(id>max)max=id; 220 } 221 } 222 else{ 223 if(this->Size()==0){ 224 max = 0; 225 } 226 else{ 227 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(this->Size()-1)); 228 max = node->Id(); 229 } 202 int Nodes::MaxNumDofs(int setenum){/*{{{*/ 203 204 int max=0; 205 int allmax; 206 207 /*Now go through all nodes, and get how many dofs they own, unless they are clone nodes: */ 208 for(int i=0;i<this->Size();i++){ 209 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i)); 210 211 int numdofs=node->GetNumberOfDofs(NoneApproximationEnum,setenum); 212 if(numdofs>max) max=numdofs; 230 213 } 231 214 … … 237 220 } 238 221 /*}}}*/ 239 int Nodes::MaxNumDofs(int analysis_type,int setenum){/*{{{*/ 240 241 int max=0; 242 int allmax,numdofs; 243 244 /*Now go through all nodes, and get how many dofs they own, unless they are clone nodes: */ 245 for(int i=0;i<this->Size();i++){ 246 247 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i)); 248 _assert_(node->InAnalysis(analysis_type)); 249 250 numdofs=node->GetNumberOfDofs(NoneApproximationEnum,setenum); 251 if(numdofs>max)max=numdofs; 252 } 253 254 /*Grab max of all cpus: */ 255 ISSM_MPI_Allreduce((void*)&max,(void*)&allmax,1,ISSM_MPI_INT,ISSM_MPI_MAX,IssmComm::GetComm()); 256 max=allmax; 257 258 return max; 259 } 260 /*}}}*/ 261 int Nodes::NumberOfDofs(int analysis_type,int setenum){/*{{{*/ 222 int Nodes::NumberOfDofs(int setenum){/*{{{*/ 262 223 263 224 int allnumdofs; 264 225 265 226 /*Get number of dofs on current cpu (excluding clones)*/ 266 int numdofs=this->NumberOfDofsLocal( analysis_type,setenum);227 int numdofs=this->NumberOfDofsLocal(setenum); 267 228 268 229 /*Gather from all cpus: */ … … 271 232 } 272 233 /*}}}*/ 273 int Nodes::NumberOfDofsLocal(int analysis_type,intsetenum){/*{{{*/234 int Nodes::NumberOfDofsLocal(int setenum){/*{{{*/ 274 235 275 236 int numdofs=0; … … 277 238 /*Now go through all nodes, and get how many dofs they own, unless they are clone nodes: */ 278 239 for(int i=0;i<this->Size();i++){ 279 280 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i)); 281 _assert_(node->InAnalysis(analysis_type)); 240 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i)); 282 241 283 242 /*Ok, this object is a node, ask it to plug values into partition: */ … … 311 270 } 312 271 /*}}}*/ 313 int Nodes::NumberOfNodes(int analysis_type){/*{{{*/ 314 315 int i; 316 317 int max_sid=-1; 318 int sid; 319 int node_max_sid; 320 321 for(i=0;i<this->Size();i++){ 322 323 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i)); 324 _assert_(node->InAnalysis(analysis_type)); 325 326 sid=node->Sid(); 327 if(sid>max_sid)max_sid=sid; 328 } 329 330 ISSM_MPI_Reduce (&max_sid,&node_max_sid,1,ISSM_MPI_INT,ISSM_MPI_MAX,0,IssmComm::GetComm() ); 331 ISSM_MPI_Bcast(&node_max_sid,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 332 max_sid=node_max_sid; 333 334 /*sid starts at 0*/ 335 max_sid++; 336 337 /*return*/ 338 return max_sid; 339 } 340 /*}}}*/ 341 void Nodes::Ranks(int* ranks,int analysis_type){/*{{{*/ 342 343 int my_rank; 344 int sid; 345 346 /*recover my_rank:*/ 347 my_rank=IssmComm::GetRank(); 348 349 /*Go through nodes, and for each object, report it cpu: */ 350 for(int i=0;i<this->Size();i++){ 351 352 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i)); 353 _assert_(node->InAnalysis(analysis_type)); 354 355 /*Plug rank into ranks, according to sid: */ 356 sid=node->Sid(); 357 ranks[sid]=my_rank; 358 } 359 } 360 /*}}}*/ 361 bool Nodes::RequiresDofReindexing(int analysis_type){/*{{{*/ 272 bool Nodes::RequiresDofReindexing(void){/*{{{*/ 362 273 363 274 int flag = 0; … … 366 277 /*Now go through all nodes, and get how many dofs they own, unless they are clone nodes: */ 367 278 for(int i=0;i<this->Size();i++){ 368 369 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i)); 370 _assert_(node->InAnalysis(analysis_type)); 371 279 Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i)); 372 280 if(node->RequiresDofReindexing()){ 373 281 flag = 1; -
issm/trunk-jpl/src/c/classes/Nodes.h
r23586 r23587 33 33 34 34 /*numerics*/ 35 void DistributeDofs(int analysis_type,int SETENUM); 36 int MaximumId(void); 37 int MaxNumDofs(int analysis_type,int setenum); 38 int NumberOfDofs(int analysis_type,int setenum); 39 int NumberOfDofsLocal(int analysis_type,int setenum); 40 int NumberOfNodes(int analysis_type); 35 void DistributeDofs(int SETENUM); 36 int MaxNumDofs(int setenum); 37 int NumberOfDofs(int setenum); 38 int NumberOfDofsLocal(int setenum); 41 39 int NumberOfNodes(void); 42 void Ranks(int* ranks,int analysis_type); 43 bool RequiresDofReindexing(int analysis_type); 44 40 bool RequiresDofReindexing(void); 45 41 }; 46 42 -
issm/trunk-jpl/src/c/cores/esa_core.cpp
r23232 r23587 21 21 Vector<IssmDouble> *U_y = NULL; 22 22 bool save_results,isesa,iscoupler; 23 int configuration_type;24 23 int domaintype; 25 24 int solution_type; … … 39 38 /*Recover some parameters: */ 40 39 femmodel->parameters->FindParam(&domaintype,DomainTypeEnum); 41 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);42 40 femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum); 43 41 femmodel->parameters->FindParam(&save_results,SaveResultsEnum); … … 50 48 51 49 /*Figure out size of g-set deflection vector and allocate solution vector: */ 52 gsize = femmodel->nodes->NumberOfDofs( configuration_type,GsetEnum);50 gsize = femmodel->nodes->NumberOfDofs(GsetEnum); 53 51 54 52 /*several cases here, depending on value of iscoupler and isesa: -
issm/trunk-jpl/src/c/cores/sealevelrise_core.cpp
r23232 r23587 82 82 bool iscoupler; 83 83 int solution_type; 84 int configuration_type;85 84 int modelid,earthid; 86 85 bool istransientmasstransport; … … 100 99 femmodel->parameters->FindParam(&frequency,SealevelriseGeodeticRunFrequencyEnum); 101 100 femmodel->parameters->FindParam(&count,SealevelriseRunCountEnum); 102 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);103 101 femmodel->parameters->FindParam(&horiz,SealevelriseHorizEnum); 104 102 femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum); … … 301 299 302 300 /*parameters: */ 303 int configuration_type;304 301 int gsize; 305 302 bool spherical=true; … … 313 310 314 311 /*recover parameters:*/ 315 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);316 312 femmodel->parameters->FindParam(&loop,SealevelriseLoopIncrementEnum); 317 313 … … 320 316 321 317 /*Figure out size of g-set deflection vector and allocate solution vector: */ 322 gsize = femmodel->nodes->NumberOfDofs( configuration_type,GsetEnum);318 gsize = femmodel->nodes->NumberOfDofs(GsetEnum); 323 319 324 320 /*Initialize:*/ … … 360 356 bool save_results; 361 357 int gsize; 362 int configuration_type;363 358 bool spherical=true; 364 359 bool converged=true; … … 379 374 femmodel->parameters->FindParam(&eps_rel,SealevelriseReltolEnum); 380 375 femmodel->parameters->FindParam(&eps_abs,SealevelriseAbstolEnum); 381 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);382 376 femmodel->parameters->FindParam(&loop,SealevelriseLoopIncrementEnum); 383 377 … … 389 383 390 384 /*Figure out size of g-set deflection vector and allocate solution vector: */ 391 gsize = femmodel->nodes->NumberOfDofs( configuration_type,GsetEnum);385 gsize = femmodel->nodes->NumberOfDofs(GsetEnum); 392 386 393 387 /*Initialize:*/ … … 477 471 478 472 /*parameters: */ 479 int configuration_type;480 473 int gsize; 481 474 bool spherical=true; … … 491 484 492 485 /*retrieve some parameters:*/ 493 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);494 486 femmodel->parameters->FindParam(&loop,SealevelriseLoopIncrementEnum); 495 487 femmodel->parameters->FindParam(&horiz,SealevelriseHorizEnum); 496 488 497 489 /*find size of vectors:*/ 498 gsize = femmodel->nodes->NumberOfDofs( configuration_type,GsetEnum);490 gsize = femmodel->nodes->NumberOfDofs(GsetEnum); 499 491 500 492 /*intialize vectors:*/ -
issm/trunk-jpl/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp
r23499 r23587 12 12 int fsize,ssize,flocalsize,slocalsize; 13 13 int connectivity, numberofdofspernode; 14 int configuration_type;15 14 int m,n,M,N; 16 15 int *d_nnz = NULL; … … 27 26 28 27 /*retrieve parameters: */ 29 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);30 28 femmodel->parameters->FindParam(&connectivity,MeshAverageVertexConnectivityEnum); 31 29 32 30 /*retrieve node info*/ 33 fsize = femmodel->nodes->NumberOfDofs( configuration_type,FsetEnum);34 ssize = femmodel->nodes->NumberOfDofs( configuration_type,SsetEnum);35 flocalsize = femmodel->nodes->NumberOfDofsLocal( configuration_type,FsetEnum);36 slocalsize = femmodel->nodes->NumberOfDofsLocal( configuration_type,SsetEnum);37 38 numberofdofspernode=femmodel->nodes->MaxNumDofs( configuration_type,GsetEnum);31 fsize = femmodel->nodes->NumberOfDofs(FsetEnum); 32 ssize = femmodel->nodes->NumberOfDofs(SsetEnum); 33 flocalsize = femmodel->nodes->NumberOfDofsLocal(FsetEnum); 34 slocalsize = femmodel->nodes->NumberOfDofsLocal(SsetEnum); 35 36 numberofdofspernode=femmodel->nodes->MaxNumDofs(GsetEnum); 39 37 40 38 /*if our matrices are coming from issm, we don't do dynamic allocation like Petsc … … 93 91 /*Intermediary*/ 94 92 int i,j,k,index,offset,count; 95 int configuration_type;96 93 int d_nz,o_nz; 97 94 Element *element = NULL; … … 109 106 int *o_nnz = NULL; 110 107 111 /*retrive parameters: */112 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);113 114 108 /*Get vector size and number of nodes*/ 115 int numnodes = femmodel->nodes->NumberOfNodes( configuration_type);109 int numnodes = femmodel->nodes->NumberOfNodes(); 116 110 int localnumnodes = femmodel->nodes->Size(); 117 int numberofdofspernode = femmodel->nodes->MaxNumDofs( configuration_type,GsetEnum);118 int M = femmodel->nodes->NumberOfDofs( configuration_type,set1enum);119 int N = femmodel->nodes->NumberOfDofs( configuration_type,set2enum);120 int m = femmodel->nodes->NumberOfDofsLocal( configuration_type,set1enum);121 int n = femmodel->nodes->NumberOfDofsLocal( configuration_type,set2enum);111 int numberofdofspernode = femmodel->nodes->MaxNumDofs(GsetEnum); 112 int M = femmodel->nodes->NumberOfDofs(set1enum); 113 int N = femmodel->nodes->NumberOfDofs(set2enum); 114 int m = femmodel->nodes->NumberOfDofsLocal(set1enum); 115 int n = femmodel->nodes->NumberOfDofsLocal(set2enum); 122 116 int numnodesperelement = femmodel->elements->MaxNumNodes(); 123 int numnodesperload = femmodel->loads->MaxNumNodes( configuration_type);117 int numnodesperload = femmodel->loads->MaxNumNodes(); 124 118 125 119 /*First, we are building chaining vectors so that we know what nodes are … … 153 147 /*Chain for loads*/ 154 148 head_l = xNew<int>(localnumnodes); for(i=0;i<localnumnodes;i++) head_l[i]=-1; 155 next_l = xNew<int>(femmodel->loads->Size( configuration_type)*numnodesperload);156 count2offset_l = xNew<int>(femmodel->loads->Size( configuration_type)*numnodesperload);149 next_l = xNew<int>(femmodel->loads->Size()*numnodesperload); 150 count2offset_l = xNew<int>(femmodel->loads->Size()*numnodesperload); 157 151 k=0; 158 152 for(i=0;i<femmodel->loads->Size();i++){ 159 153 load = xDynamicCast<Load*>(femmodel->loads->GetObjectByOffset(i)); 160 _assert_(load->InAnalysis(configuration_type));161 154 lidlist = xNew<int>(load->GetNumberOfNodes()); 162 155 load->GetNodesLidList(lidlist); … … 191 184 for(i=0;i<femmodel->nodes->Size();i++){ 192 185 Node* node=xDynamicCast<Node*>(femmodel->nodes->GetObjectByOffset(i)); 193 _assert_(node->InAnalysis(configuration_type));194 186 195 187 /*Reinitialize flags to false*/ … … 257 249 Node* node=xDynamicCast<Node*>(femmodel->nodes->GetObjectByOffset(i)); 258 250 if(!node->IsClone()){ 259 _assert_(node->InAnalysis(configuration_type));260 251 for(j=0;j<node->indexing.fsize;j++){ 261 252 _assert_(count<m); -
issm/trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp
r23499 r23587 8 8 #include "../../toolkits/toolkits.h" 9 9 10 void CreateNodalConstraintsx( Vector<IssmDouble>** pys, Nodes* nodes ,int configuration_type){10 void CreateNodalConstraintsx( Vector<IssmDouble>** pys, Nodes* nodes){ 11 11 12 12 bool oldalloc = false; … … 20 20 21 21 /*figure out how many dofs we have: */ 22 ssize=nodes->NumberOfDofs( configuration_type,SsetEnum);23 slocalsize = nodes->NumberOfDofsLocal( configuration_type,SsetEnum);22 ssize=nodes->NumberOfDofs(SsetEnum); 23 slocalsize = nodes->NumberOfDofsLocal(SsetEnum); 24 24 25 25 /*allocate:*/ … … 33 33 for(int i=0;i<nodes->Size();i++){ 34 34 Node* node=(Node*)nodes->GetObjectByOffset(i); 35 _assert_(node->InAnalysis(configuration_type));36 35 node->CreateNodalConstraints(ys); 37 36 } -
issm/trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h
r15000 r23587 8 8 9 9 /* local prototypes: */ 10 void CreateNodalConstraintsx( Vector<IssmDouble>** pys, Nodes* nodes ,int configuration_type);10 void CreateNodalConstraintsx( Vector<IssmDouble>** pys, Nodes* nodes); 11 11 12 12 #endif /* _CREATENODALCONSTRAINTSX_H */ -
issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp
r18521 r23587 10 10 11 11 /*intermediary: */ 12 int 13 int configuration,analysisenum;12 int gsize; 13 int analysisenum; 14 14 15 15 /*output: */ … … 19 19 20 20 /*retrive parameters: */ 21 femmodel->parameters->FindParam(&configuration,ConfigurationTypeEnum);22 21 femmodel->parameters->FindParam(&analysisenum,AnalysisTypeEnum); 23 22 24 23 /*Get size of vector: */ 25 gsize=femmodel->nodes->NumberOfDofs( configuration,GsetEnum);26 if(gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 for configuration "<<EnumToStringx(configuration));24 gsize=femmodel->nodes->NumberOfDofs(GsetEnum); 25 if(gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 "); 27 26 28 27 /*Initialize solution: */ -
issm/trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
r15104 r23587 13 13 14 14 /*intermediary: */ 15 int configuration_type;16 15 int gsize,fsize,ssize; 17 16 … … 20 19 21 20 /*first, get gsize, fsize and ssize: */ 22 parameters->FindParam(&configuration_type,ConfigurationTypeEnum); 23 gsize=nodes->NumberOfDofs(configuration_type,GsetEnum); 24 fsize=nodes->NumberOfDofs(configuration_type,FsetEnum); 25 ssize=nodes->NumberOfDofs(configuration_type,SsetEnum); 21 gsize=nodes->NumberOfDofs(GsetEnum); 22 fsize=nodes->NumberOfDofs(FsetEnum); 23 ssize=nodes->NumberOfDofs(SsetEnum); 26 24 27 25 /*serialize uf and ys: those two vectors will be indexed by the nodes, who are the only ones -
issm/trunk-jpl/src/c/modules/NodesDofx/NodesDofx.cpp
r23586 r23587 8 8 #include "../../toolkits/toolkits.h" 9 9 10 void NodesDofx(Nodes* nodes, Parameters* parameters ,int configuration_type){10 void NodesDofx(Nodes* nodes, Parameters* parameters){ 11 11 12 12 /*Do we have any nodes for this analysis type? :*/ 13 if(!nodes->NumberOfNodes( configuration_type)) return;13 if(!nodes->NumberOfNodes()) return; 14 14 15 15 /*Do we really need to update dof indexings*/ 16 if(!nodes->RequiresDofReindexing( configuration_type)) return;16 if(!nodes->RequiresDofReindexing()) return; 17 17 18 18 if(VerboseModule()) _printf0_(" Renumbering degrees of freedom\n"); … … 21 21 *a node has already been distributed dofs on one cpu, all other cpus with the same node cannot distribute it 22 22 *anymore. Use clone field to be sure of that: */ 23 nodes->DistributeDofs( configuration_type,GsetEnum);24 nodes->DistributeDofs( configuration_type,FsetEnum);25 nodes->DistributeDofs( configuration_type,SsetEnum);23 nodes->DistributeDofs(GsetEnum); 24 nodes->DistributeDofs(FsetEnum); 25 nodes->DistributeDofs(SsetEnum); 26 26 27 27 } -
issm/trunk-jpl/src/c/modules/NodesDofx/NodesDofx.h
r15000 r23587 9 9 10 10 /* local prototypes: */ 11 void NodesDofx(Nodes* nodes, Parameters* parameters ,int analysis_type);11 void NodesDofx(Nodes* nodes, Parameters* parameters); 12 12 13 13 #endif /* _NODESDOFX_H */ -
issm/trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp
r23499 r23587 12 12 13 13 /*variables: */ 14 int configuration_type;15 int fsize;16 14 IssmDouble *ug_serial = NULL; 17 15 bool oldalloc = false; … … 20 18 21 19 /*first figure out fsize: */ 22 parameters->FindParam(&configuration_type,ConfigurationTypeEnum); 23 fsize=nodes->NumberOfDofs(configuration_type,FsetEnum); 24 25 int analysis_type; 26 parameters->FindParam(&analysis_type,AnalysisTypeEnum); 27 int flocalsize = nodes->NumberOfDofsLocal(analysis_type,FsetEnum); 20 int fsize=nodes->NumberOfDofs(FsetEnum); 21 int flocalsize = nodes->NumberOfDofsLocal(FsetEnum); 28 22 29 23 if(fsize==0){ … … 37 31 uf=new Vector<IssmDouble>(flocalsize,fsize); 38 32 39 if(nodes->NumberOfNodes( configuration_type)){33 if(nodes->NumberOfNodes()){ 40 34 41 35 /*serialize ug, so nodes can index into it: */ … … 45 39 for(int i=0;i<nodes->Size();i++){ 46 40 Node* node=(Node*)nodes->GetObjectByOffset(i); 47 _assert_(node->InAnalysis(configuration_type));48 41 49 42 /*For this object, reduce values for enum set Fset: */ -
issm/trunk-jpl/src/c/modules/SetActiveNodesLSMx/SetActiveNodesLSMx.cpp
r23524 r23587 85 85 86 86 /*Create vector on gset*/ 87 int configuration_type; 88 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum); 89 int gsize=femmodel->nodes->NumberOfDofs(configuration_type,GsetEnum); 87 int gsize=femmodel->nodes->NumberOfDofs(GsetEnum); 90 88 if(gsize==0) return; 91 89 Vector<IssmDouble>* vec_mask_ice=new Vector<IssmDouble>(gsize); -
issm/trunk-jpl/src/c/modules/SpcNodesx/SpcNodesx.cpp
r23583 r23587 8 8 #include "../../toolkits/toolkits.h" 9 9 10 void SpcNodesx(Nodes* nodes,Constraints* constraints,Parameters* parameters , int analysis_type){10 void SpcNodesx(Nodes* nodes,Constraints* constraints,Parameters* parameters){ 11 11 12 12 for(int i=0;i<constraints->Size();i++){ 13 14 13 Constraint* constraint=(Constraint*)constraints->GetObjectByOffset(i); 15 16 _assert_(constraint->InAnalysis(analysis_type));17 14 constraint->ConstrainNode(nodes,parameters); 18 15 } -
issm/trunk-jpl/src/c/modules/SpcNodesx/SpcNodesx.h
r15000 r23587 10 10 11 11 /* local prototypes: */ 12 void SpcNodesx(Nodes* nodes, Constraints* constraints,Parameters* parameters ,int analysis_type);12 void SpcNodesx(Nodes* nodes, Constraints* constraints,Parameters* parameters); 13 13 14 14 #endif /* _SPCNODESX_H */ -
issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
r23490 r23587 12 12 /*intermediary: */ 13 13 int i,M,N; 14 int configuration_type,analysisenum;14 int analysisenum; 15 15 Element *element = NULL; 16 16 Load *load = NULL; … … 27 27 28 28 /*retrieve parameters: */ 29 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);30 29 femmodel->parameters->FindParam(&analysisenum,AnalysisTypeEnum); 31 30 Analysis* analysis = EnumToAnalysis(analysisenum); 32 31 33 32 /*Check if there are penalties*/ 34 bool ispenalty = femmodel->loads->IsPenalty( configuration_type);33 bool ispenalty = femmodel->loads->IsPenalty(); 35 34 36 35 /*First, we might need to do a dry run to get kmax if penalties are employed*/ … … 54 53 for (i=0;i<femmodel->loads->Size();i++){ 55 54 load=xDynamicCast<Load*>(femmodel->loads->GetObjectByOffset(i)); 56 _assert_(load->InAnalysis(configuration_type));57 55 load->CreateKMatrix(Kff_temp,NULL); 58 56 } … … 90 88 for(i=0;i<femmodel->loads->Size();i++){ 91 89 load=xDynamicCast<Load*>(femmodel->loads->GetObjectByOffset(i)); 92 _assert_(load->InAnalysis(configuration_type));93 90 load->CreateKMatrix(Kff,Kfs); 94 91 load->CreatePVector(pf); … … 99 96 for (i=0;i<femmodel->loads->Size();i++){ 100 97 load=xDynamicCast<Load*>(femmodel->loads->GetObjectByOffset(i)); 101 _assert_(load->InAnalysis(configuration_type));102 98 load->PenaltyCreateKMatrix(Kff,Kfs,kmax); 103 99 load->PenaltyCreatePVector(pf,kmax); -
issm/trunk-jpl/src/c/modules/VecMergex/VecMergex.cpp
r23499 r23587 9 9 void VecMergex(Vector<IssmDouble>* ug, Vector<IssmDouble>* uf, Nodes* nodes, Parameters* parameters, int SetEnum){ 10 10 11 /*variables: */12 int i;13 int configuration_type;14 IssmDouble* uf_serial=NULL;15 16 /*retrieve parameters: */17 parameters->FindParam(&configuration_type,ConfigurationTypeEnum);18 19 11 /*serialize uf: */ 20 uf_serial=uf->ToMPISerial();12 IssmDouble* uf_serial=uf->ToMPISerial(); 21 13 22 14 /*Do we have any nodes for this configuration? :*/ 23 if(nodes->NumberOfNodes( configuration_type)){15 if(nodes->NumberOfNodes()){ 24 16 25 17 /*yes. Go through all nodes, and ask them to retrieve values from uf, and plug them into ug: */ 26 for(i=0;i<nodes->Size();i++){ 27 18 for(int i=0;i<nodes->Size();i++){ 28 19 Node* node=(Node*)nodes->GetObjectByOffset(i); 29 _assert_(node->InAnalysis(configuration_type));30 20 31 21 /*For this object, merge values for enum set SetEnum: */ … … 33 23 } 34 24 } 25 35 26 /*Free ressources:*/ 36 27 xDelete<IssmDouble>(uf_serial); -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_adjoint_linear.cpp
r22551 r23587 20 20 Vector<IssmDouble>* df = NULL; 21 21 Vector<IssmDouble>* ys = NULL; 22 int configuration_type;23 22 24 23 /*Recover parameters: */ 25 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);26 24 femmodel->UpdateConstraintsx(); 27 25 28 26 SystemMatricesx(&Kff, &Kfs, &pf, &df, NULL,femmodel); 29 CreateNodalConstraintsx(&ys,femmodel->nodes ,configuration_type);27 CreateNodalConstraintsx(&ys,femmodel->nodes); 30 28 Reduceloadx(pf, Kfs, ys,true); delete Kfs; //true means spc = 0 31 29 -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_hydro_nonlinear.cpp
r23524 r23587 101 101 if(VerboseSolution()) _printf0_("Building Sediment Matrix...\n"); 102 102 SystemMatricesx(&Kff,&Kfs,&pf,&df,&sediment_kmax,femmodel); 103 CreateNodalConstraintsx(&ys,femmodel->nodes ,HydrologyDCInefficientAnalysisEnum);103 CreateNodalConstraintsx(&ys,femmodel->nodes); 104 104 Reduceloadx(pf,Kfs,ys); delete Kfs; 105 105 delete uf_sed; … … 187 187 if(VerboseSolution()) _printf0_("Building EPL Matrix...\n"); 188 188 SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel); 189 CreateNodalConstraintsx(&ys,femmodel->nodes ,HydrologyDCEfficientAnalysisEnum);189 CreateNodalConstraintsx(&ys,femmodel->nodes); 190 190 Reduceloadx(pf,Kfs,ys); delete Kfs; 191 191 delete uf_epl; -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_la.cpp
r22551 r23587 21 21 Vector<IssmDouble>* pug_old = NULL; 22 22 IssmDouble eps_rel,r,theta; // 0<theta<.5 -> .15<theta<.45 23 int configuration_type,max_nonlinear_iterations;23 int max_nonlinear_iterations; 24 24 bool vel_converged = false; 25 25 bool pressure_converged = false; … … 31 31 32 32 /*Recover parameters: */ 33 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);34 33 femmodel->parameters->FindParam(&eps_rel,StressbalanceReltolEnum); 35 34 femmodel->parameters->FindParam(&max_nonlinear_iterations,StressbalanceMaxiterEnum); … … 60 59 /*Solve KU=F*/ 61 60 femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum); 62 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);63 61 SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel); 64 CreateNodalConstraintsx(&ys,femmodel->nodes ,configuration_type);62 CreateNodalConstraintsx(&ys,femmodel->nodes); 65 63 Reduceloadx(pf, Kfs, ys); delete Kfs; 66 64 … … 95 93 96 94 femmodel->SetCurrentConfiguration(UzawaPressureAnalysisEnum); 97 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);98 95 SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel); 99 CreateNodalConstraintsx(&ys,femmodel->nodes ,configuration_type);96 CreateNodalConstraintsx(&ys,femmodel->nodes); 100 97 Reduceloadx(pf, Kfs, ys); delete Kfs; 101 98 -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_la_theta.cpp
r22551 r23587 20 20 Vector<IssmDouble>* ys = NULL; 21 21 IssmDouble eps_rel,r,theta; // 0<theta<.5 -> .15<theta<.45 22 int configuration_type,max_nonlinear_iterations;22 int max_nonlinear_iterations; 23 23 24 24 /*Create analysis*/ … … 26 26 27 27 /*Recover parameters: */ 28 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);29 28 femmodel->parameters->FindParam(&eps_rel,StressbalanceReltolEnum); 30 29 femmodel->parameters->FindParam(&max_nonlinear_iterations,StressbalanceMaxiterEnum); … … 57 56 /*Solve KU=F*/ 58 57 SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel); 59 CreateNodalConstraintsx(&ys,femmodel->nodes ,configuration_type);58 CreateNodalConstraintsx(&ys,femmodel->nodes); 60 59 Reduceloadx(pf, Kfs, ys); delete Kfs; 61 60 -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_linear.cpp
r23066 r23587 18 18 Vector<IssmDouble>* df = NULL; 19 19 Vector<IssmDouble>* ys = NULL; 20 int configuration_type;21 20 IssmDouble solver_residue_threshold; 22 21 … … 29 28 30 29 /*Recover parameters: */ 31 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);32 30 femmodel->parameters->FindParam(&solver_residue_threshold,SettingsSolverResidueThresholdEnum); 33 31 femmodel->UpdateConstraintsx(); 34 32 SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel); 35 CreateNodalConstraintsx(&ys,femmodel->nodes ,configuration_type);33 CreateNodalConstraintsx(&ys,femmodel->nodes); 36 34 Reduceloadx(pf, Kfs, ys); delete Kfs; 37 35 -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_newton.cpp
r22551 r23587 30 30 /*parameters:*/ 31 31 int max_nonlinear_iterations; 32 int configuration_type;33 32 IssmDouble eps_res,eps_rel,eps_abs; 34 33 35 34 /*Recover parameters: */ 36 35 femmodel->parameters->FindParam(&max_nonlinear_iterations,StressbalanceMaxiterEnum); 37 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);38 36 femmodel->parameters->FindParam(&newton,StressbalanceIsnewtonEnum); 39 37 femmodel->parameters->FindParam(&eps_res,StressbalanceRestolEnum); … … 61 59 if(count==1 || newton==2){ 62 60 SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel); 63 CreateNodalConstraintsx(&ys,femmodel->nodes ,configuration_type);61 CreateNodalConstraintsx(&ys,femmodel->nodes); 64 62 Reduceloadx(pf,Kfs,ys);delete Kfs; 65 63 femmodel->profiler->Start(SOLVER); … … 75 73 /*Prepare next iteration using Newton's method*/ 76 74 SystemMatricesx(&Kff,&Kfs,&pf,&df,&kmax,femmodel);delete df; 77 CreateNodalConstraintsx(&ys,femmodel->nodes ,configuration_type);75 CreateNodalConstraintsx(&ys,femmodel->nodes); 78 76 Reduceloadx(pf,Kfs,ys);delete Kfs; 79 77 -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_nonlinear.cpp
r23488 r23587 65 65 66 66 SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel); 67 CreateNodalConstraintsx(&ys,femmodel->nodes ,configuration_type);67 CreateNodalConstraintsx(&ys,femmodel->nodes); 68 68 Reduceloadx(pf, Kfs, ys); delete Kfs; 69 69 femmodel->profiler->Start(SOLVER); -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp
r23220 r23587 495 495 /*parameters:*/ 496 496 int max_nonlinear_iterations; 497 int configuration_type;498 497 IssmDouble eps_res,eps_rel,eps_abs; 499 498 … … 503 502 femmodel->parameters->FindParam(&eps_rel,StressbalanceReltolEnum); 504 503 femmodel->parameters->FindParam(&eps_abs,StressbalanceAbstolEnum); 505 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);506 504 femmodel->UpdateConstraintsx(); 507 505 int size; … … 525 523 /*Get stiffness matrix and Load vector*/ 526 524 SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel); 527 CreateNodalConstraintsx(&ys,femmodel->nodes ,configuration_type);525 CreateNodalConstraintsx(&ys,femmodel->nodes); 528 526 Reduceloadx(pf, Kfs, ys); delete Kfs; 529 527 -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_shakti_nonlinear.cpp
r22551 r23587 23 23 /*parameters:*/ 24 24 int max_nonlinear_iterations; 25 int configuration_type;26 25 IssmDouble eps_res,eps_rel,eps_abs; 27 26 … … 31 30 femmodel->parameters->FindParam(&eps_rel,StressbalanceReltolEnum); 32 31 femmodel->parameters->FindParam(&eps_abs,StressbalanceAbstolEnum); 33 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);34 32 femmodel->UpdateConstraintsx(); 35 33 … … 50 48 51 49 SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel); 52 CreateNodalConstraintsx(&ys,femmodel->nodes ,configuration_type);50 CreateNodalConstraintsx(&ys,femmodel->nodes); 53 51 Reduceloadx(pf, Kfs, ys); delete Kfs; 54 52 femmodel->profiler->Start(SOLVER); -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_stokescoupling_nonlinear.cpp
r22551 r23587 32 32 int min_mechanical_constraints; 33 33 int max_nonlinear_iterations; 34 int configuration_type;35 34 IssmDouble eps_res,eps_rel,eps_abs; 36 35 … … 55 54 /*First stressbalance horiz:*/ 56 55 femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum); 57 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);58 56 59 57 //Update once again the solution to make sure that vx and vxold are similar (for next step in transient or steadystate) … … 66 64 /*solve: */ 67 65 SystemMatricesx(&Kff_horiz, &Kfs_horiz, &pf_horiz, &df_horiz, NULL,femmodel); 68 CreateNodalConstraintsx(&ys,femmodel->nodes ,configuration_type);66 CreateNodalConstraintsx(&ys,femmodel->nodes); 69 67 Reduceloadx(pf_horiz, Kfs_horiz, ys); delete Kfs_horiz; 70 68 femmodel->profiler->Start(SOLVER); … … 78 76 /*Second compute vertical velocity: */ 79 77 femmodel->SetCurrentConfiguration(StressbalanceVerticalAnalysisEnum); 80 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);81 78 82 79 /*solve: */ 83 80 SystemMatricesx(&Kff_vert, &Kfs_vert, &pf_vert, &df_vert,NULL,femmodel); 84 CreateNodalConstraintsx(&ys,femmodel->nodes ,configuration_type);81 CreateNodalConstraintsx(&ys,femmodel->nodes); 85 82 Reduceloadx(pf_vert, Kfs_vert, ys); delete Kfs_vert; 86 83 femmodel->profiler->Start(SOLVER); -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_thermal_nonlinear.cpp
r23524 r23587 33 33 34 34 /*parameters:*/ 35 int configuration_type;36 35 IssmDouble eps_rel; 37 36 38 37 /*Recover parameters: */ 39 38 femmodel->parameters->FindParam(&isenthalpy,ThermalIsenthalpyEnum); 40 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);41 39 femmodel->parameters->FindParam(&thermal_maxiter,ThermalMaxiterEnum); 42 40 … … 75 73 else SystemMatricesx(&Kff, &Kfs, &pf,&df, &melting_offset,femmodel); 76 74 delete tg; 77 CreateNodalConstraintsx(&ys,femmodel->nodes ,configuration_type);75 CreateNodalConstraintsx(&ys,femmodel->nodes); 78 76 Reduceloadx(pf, Kfs, ys); delete Kfs; 79 77 femmodel->profiler->Start(SOLVER);
Note:
See TracChangeset
for help on using the changeset viewer.