Changeset 13915
- Timestamp:
- 11/08/12 15:11:19 (13 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/objects/Loads
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp
r13813 r13915 271 271 } 272 272 /*}}}*/ 273 /*FUNCTION Icefront::GetNodesSidList{{{*/ 274 void Icefront::GetNodesSidList(int* sidlist){ 275 276 int type; 277 inputs->GetInputValue(&type,TypeEnum); 278 _assert_(sidlist); 279 _assert_(nodes); 280 281 switch(type){ 282 case MacAyeal2dIceFrontEnum: 283 case MacAyeal3dIceFrontEnum: 284 for(int i=0;i<NUMVERTICESSEG;i++) sidlist[i]=nodes[i]->Sid(); 285 return; 286 #ifdef _HAVE_3D_ 287 case PattynIceFrontEnum: 288 case StokesIceFrontEnum: 289 for(int i=0;i<NUMVERTICESQUA;i++) sidlist[i]=nodes[i]->Sid(); 290 return; 291 #endif 292 default: 293 _error_("Icefront type " << EnumToStringx(type) << " not supported yet"); 294 } 295 } 296 /*}}}*/ 297 /*FUNCTION Icefront::GetNumberOfNodes{{{*/ 298 int Icefront::GetNumberOfNodes(void){ 299 300 int type; 301 inputs->GetInputValue(&type,TypeEnum); 302 303 switch(type){ 304 case MacAyeal2dIceFrontEnum: 305 return NUMVERTICESSEG; 306 #ifdef _HAVE_3D_ 307 case MacAyeal3dIceFrontEnum: 308 return NUMVERTICESSEG; 309 case PattynIceFrontEnum: 310 return NUMVERTICESQUA; 311 case StokesIceFrontEnum: 312 return NUMVERTICESQUA; 313 #endif 314 default: 315 _error_("Icefront type " << EnumToStringx(type) << " not supported yet"); 316 } 317 318 } 319 /*}}}*/ 273 320 /*FUNCTION Icefront::PenaltyCreateKMatrix {{{*/ 274 321 void Icefront::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs, IssmDouble kmax){ … … 286 333 void Icefront::PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){ 287 334 this->PenaltyCreateKMatrix(Jff,NULL,kmax); 335 } 336 /*}}}*/ 337 /*FUNCTION Icefront::SetwiseNodeConnectivity{{{*/ 338 void Icefront::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int set1_enum,int set2_enum){ 339 340 /*Output */ 341 int d_nz = 0; 342 int o_nz = 0; 343 344 /*Loop over all nodes*/ 345 for(int i=0;i<this->GetNumberOfNodes();i++){ 346 347 if(!flags[this->nodes[i]->Sid()]){ 348 349 /*flag current node so that no other element processes it*/ 350 flags[this->nodes[i]->Sid()]=true; 351 352 /*if node is clone, we have an off-diagonal non-zero, else it is a diagonal non-zero*/ 353 switch(set2_enum){ 354 case FsetEnum: 355 if(nodes[i]->indexing.fsize){ 356 if(this->nodes[i]->IsClone()) 357 o_nz += 1; 358 else 359 d_nz += 1; 360 } 361 break; 362 case GsetEnum: 363 if(nodes[i]->indexing.gsize){ 364 if(this->nodes[i]->IsClone()) 365 o_nz += 1; 366 else 367 d_nz += 1; 368 } 369 break; 370 case SsetEnum: 371 if(nodes[i]->indexing.ssize){ 372 if(this->nodes[i]->IsClone()) 373 o_nz += 1; 374 else 375 d_nz += 1; 376 } 377 break; 378 default: _error_("not supported"); 379 } 380 } 381 } 382 383 /*Assign output pointers: */ 384 *pd_nz=d_nz; 385 *po_nz=o_nz; 288 386 } 289 387 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.h
r13414 r13915 71 71 void CreatePVector(Vector<IssmDouble>* pf); 72 72 void CreateJacobianMatrix(Matrix<IssmDouble>* Jff); 73 int GetNumberOfNodes(void); 74 void GetNodesSidList(int* sidlist); 73 75 void PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax); 74 76 void PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax); 75 77 void PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax); 78 void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum); 76 79 bool InAnalysis(int analysis_type); 77 80 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Load.h
r13414 r13915 25 25 virtual ~Load(){}; 26 26 virtual void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0; 27 virtual int GetNumberOfNodes(void)=0; 28 virtual void GetNodesSidList(int* sidlist)=0; 27 29 virtual void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0; 28 30 virtual void CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs)=0; … … 33 35 virtual void PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax)=0; 34 36 virtual bool InAnalysis(int analysis_type)=0; 37 virtual void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum)=0; 35 38 }; 36 39 #endif -
issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp
r13761 r13915 34 34 } 35 35 /*}}}*/ 36 /* }}}*//*FUNCTION Numericalflux::Numericalflux(int id, int i, IoModel* iomodel, int analysis_type) {{{*/36 /*FUNCTION Numericalflux::Numericalflux(int id, int i, IoModel* iomodel, int analysis_type) {{{*/ 37 37 Numericalflux::Numericalflux(int numericalflux_id,int i, IoModel* iomodel, int in_analysis_type){ 38 38 … … 305 305 } 306 306 /*}}}*/ 307 /*FUNCTION Numericalflux::GetNodesSidList{{{*/ 308 void Numericalflux::GetNodesSidList(int* sidlist){ 309 310 int type; 311 inputs->GetInputValue(&type,TypeEnum); 312 _assert_(sidlist); 313 _assert_(nodes); 314 315 switch(type){ 316 case InternalEnum: 317 for(int i=0;i<NUMVERTICES_INTERNAL;i++) sidlist[i]=nodes[i]->Sid(); 318 return; 319 case BoundaryEnum: 320 for(int i=0;i<NUMVERTICES_BOUNDARY;i++) sidlist[i]=nodes[i]->Sid(); 321 return; 322 default: 323 _error_("Numericalflux type " << EnumToStringx(type) << " not supported yet"); 324 } 325 } 326 /*}}}*/ 327 /*FUNCTION Numericalflux::GetNumberOfNodes{{{*/ 328 int Numericalflux::GetNumberOfNodes(void){ 329 330 int type; 331 inputs->GetInputValue(&type,TypeEnum); 332 333 switch(type){ 334 case InternalEnum: 335 return NUMVERTICES_INTERNAL; 336 case BoundaryEnum: 337 return NUMVERTICES_BOUNDARY; 338 default: 339 _error_("Numericalflux type " << EnumToStringx(type) << " not supported yet"); 340 } 341 342 } 343 /*}}}*/ 307 344 /*FUNCTION Numericalflux::PenaltyCreateKMatrix {{{*/ 308 345 void Numericalflux::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){ … … 325 362 if (in_analysis_type==this->analysis_type) return true; 326 363 else return false; 364 } 365 /*}}}*/ 366 /*FUNCTION Numericalflux::SetwiseNodeConnectivity{{{*/ 367 void Numericalflux::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int set1_enum,int set2_enum){ 368 369 /*Output */ 370 int d_nz = 0; 371 int o_nz = 0; 372 373 /*Loop over all nodes*/ 374 for(int i=0;i<this->GetNumberOfNodes();i++){ 375 376 if(!flags[this->nodes[i]->Sid()]){ 377 378 /*flag current node so that no other element processes it*/ 379 flags[this->nodes[i]->Sid()]=true; 380 381 /*if node is clone, we have an off-diagonal non-zero, else it is a diagonal non-zero*/ 382 switch(set2_enum){ 383 case FsetEnum: 384 if(nodes[i]->indexing.fsize){ 385 if(this->nodes[i]->IsClone()) 386 o_nz += 1; 387 else 388 d_nz += 1; 389 } 390 break; 391 case GsetEnum: 392 if(nodes[i]->indexing.gsize){ 393 if(this->nodes[i]->IsClone()) 394 o_nz += 1; 395 else 396 d_nz += 1; 397 } 398 break; 399 case SsetEnum: 400 if(nodes[i]->indexing.ssize){ 401 if(this->nodes[i]->IsClone()) 402 o_nz += 1; 403 else 404 d_nz += 1; 405 } 406 break; 407 default: _error_("not supported"); 408 } 409 } 410 } 411 412 /*Assign output pointers: */ 413 *pd_nz=d_nz; 414 *po_nz=o_nz; 327 415 } 328 416 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h
r13414 r13915 64 64 void CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs); 65 65 void CreatePVector(Vector<IssmDouble>* pf); 66 void GetNodesSidList(int* sidlist); 67 int GetNumberOfNodes(void); 66 68 void CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");}; 67 69 void PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");}; 68 70 void PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax); 69 71 void PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax); 72 void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum); 70 73 bool InAnalysis(int analysis_type); 71 74 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp
r13761 r13915 207 207 return; 208 208 209 } 210 /*}}}*/ 211 /*FUNCTION Pengrid::GetNodesSidList{{{*/ 212 void Pengrid::GetNodesSidList(int* sidlist){ 213 214 _assert_(sidlist); 215 _assert_(node); 216 217 sidlist[0]=node->Sid(); 218 } 219 /*}}}*/ 220 /*FUNCTION Pengrid::GetNumberOfNodes{{{*/ 221 int Pengrid::GetNumberOfNodes(void){ 222 223 return NUMVERTICES; 209 224 } 210 225 /*}}}*/ … … 280 295 } 281 296 /*}}}*/ 297 /*FUNCTION Pengrid::SetwiseNodeConnectivity{{{*/ 298 void Pengrid::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int set1_enum,int set2_enum){ 299 300 /*Output */ 301 int d_nz = 0; 302 int o_nz = 0; 303 304 if(!flags[this->node->Sid()]){ 305 306 /*flag current node so that no other element processes it*/ 307 flags[this->node->Sid()]=true; 308 309 /*if node is clone, we have an off-diagonal non-zero, else it is a diagonal non-zero*/ 310 switch(set2_enum){ 311 case FsetEnum: 312 if(node->indexing.fsize){ 313 if(this->node->IsClone()) 314 o_nz += 1; 315 else 316 d_nz += 1; 317 } 318 break; 319 case GsetEnum: 320 if(node->indexing.gsize){ 321 if(this->node->IsClone()) 322 o_nz += 1; 323 else 324 d_nz += 1; 325 } 326 break; 327 case SsetEnum: 328 if(node->indexing.ssize){ 329 if(this->node->IsClone()) 330 o_nz += 1; 331 else 332 d_nz += 1; 333 } 334 break; 335 default: _error_("not supported"); 336 } 337 } 338 339 /*Assign output pointers: */ 340 *pd_nz=d_nz; 341 *po_nz=o_nz; 342 } 343 /*}}}*/ 282 344 283 345 /*Update virtual functions definitions:*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Pengrid.h
r13623 r13915 72 72 void CreatePVector(Vector<IssmDouble>* pf); 73 73 void CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");}; 74 void GetNodesSidList(int* sidlist); 75 int GetNumberOfNodes(void); 74 76 void PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");}; 75 77 void PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax); 76 78 void PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax); 79 void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum); 77 80 bool InAnalysis(int analysis_type); 78 81 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp
r13761 r13915 146 146 void Penpair::CreateJacobianMatrix(Matrix<IssmDouble>* Jff){ 147 147 this->CreateKMatrix(Jff,NULL); 148 } 149 /*}}}*/ 150 /*FUNCTION Penpair::GetNodesSidList{{{*/ 151 void Penpair::GetNodesSidList(int* sidlist){ 152 153 _assert_(sidlist); 154 _assert_(nodes); 155 156 for(int i=0;i<NUMVERTICES;i++) sidlist[i]=nodes[i]->Sid(); 157 } 158 /*}}}*/ 159 /*FUNCTION Penpair::GetNumberOfNodes{{{*/ 160 int Penpair::GetNumberOfNodes(void){ 161 162 return NUMVERTICES; 148 163 } 149 164 /*}}}*/ … … 189 204 if (in_analysis_type==this->analysis_type)return true; 190 205 else return false; 206 } 207 /*}}}*/ 208 /*FUNCTION Penpair::SetwiseNodeConnectivity{{{*/ 209 void Penpair::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int set1_enum,int set2_enum){ 210 211 /*Output */ 212 int d_nz = 0; 213 int o_nz = 0; 214 215 /*Loop over all nodes*/ 216 for(int i=0;i<NUMVERTICES;i++){ 217 218 if(!flags[this->nodes[i]->Sid()]){ 219 220 /*flag current node so that no other element processes it*/ 221 flags[this->nodes[i]->Sid()]=true; 222 223 /*if node is clone, we have an off-diagonal non-zero, else it is a diagonal non-zero*/ 224 switch(set2_enum){ 225 case FsetEnum: 226 if(nodes[i]->indexing.fsize){ 227 if(this->nodes[i]->IsClone()) 228 o_nz += 1; 229 else 230 d_nz += 1; 231 } 232 break; 233 case GsetEnum: 234 if(nodes[i]->indexing.gsize){ 235 if(this->nodes[i]->IsClone()) 236 o_nz += 1; 237 else 238 d_nz += 1; 239 } 240 break; 241 case SsetEnum: 242 if(nodes[i]->indexing.ssize){ 243 if(this->nodes[i]->IsClone()) 244 o_nz += 1; 245 else 246 d_nz += 1; 247 } 248 break; 249 default: _error_("not supported"); 250 } 251 } 252 } 253 254 /*Assign output pointers: */ 255 *pd_nz=d_nz; 256 *po_nz=o_nz; 191 257 } 192 258 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Penpair.h
r13623 r13915 57 57 void CreatePVector(Vector<IssmDouble>* pf); 58 58 void CreateJacobianMatrix(Matrix<IssmDouble>* Jff); 59 void GetNodesSidList(int* sidlist); 60 int GetNumberOfNodes(void); 59 61 void PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff,Matrix<IssmDouble>* Kfs,IssmDouble kmax); 60 62 void PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax); 61 63 void PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax); 64 void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum); 62 65 bool InAnalysis(int analysis_type); 63 66 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp
r13787 r13915 364 364 } 365 365 /*}}}*/ 366 /*FUNCTION Riftfront::GetNodesSidList{{{*/ 367 void Riftfront::GetNodesSidList(int* sidlist){ 368 369 _assert_(sidlist); 370 _assert_(nodes); 371 372 for(int i=0;i<NUMVERTICES;i++) sidlist[i]=nodes[i]->Sid(); 373 } 374 /*}}}*/ 375 /*FUNCTION Riftfront::GetNumberOfNodes{{{*/ 376 int Riftfront::GetNumberOfNodes(void){ 377 378 return NUMVERTICES; 379 } 380 /*}}}*/ 366 381 /*FUNCTION Riftfront::InAnalysis{{{*/ 367 382 bool Riftfront::InAnalysis(int in_analysis_type){ 368 383 if (in_analysis_type==this->analysis_type) return true; 369 384 else return false; 385 } 386 /*}}}*/ 387 /*FUNCTION Riftfront::SetwiseNodeConnectivity{{{*/ 388 void Riftfront::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int set1_enum,int set2_enum){ 389 390 /*Output */ 391 int d_nz = 0; 392 int o_nz = 0; 393 394 /*Loop over all nodes*/ 395 for(int i=0;i<NUMVERTICES;i++){ 396 397 if(!flags[this->nodes[i]->Sid()]){ 398 399 /*flag current node so that no other element processes it*/ 400 flags[this->nodes[i]->Sid()]=true; 401 402 /*if node is clone, we have an off-diagonal non-zero, else it is a diagonal non-zero*/ 403 switch(set2_enum){ 404 case FsetEnum: 405 if(nodes[i]->indexing.fsize){ 406 if(this->nodes[i]->IsClone()) 407 o_nz += 1; 408 else 409 d_nz += 1; 410 } 411 break; 412 case GsetEnum: 413 if(nodes[i]->indexing.gsize){ 414 if(this->nodes[i]->IsClone()) 415 o_nz += 1; 416 else 417 d_nz += 1; 418 } 419 break; 420 case SsetEnum: 421 if(nodes[i]->indexing.ssize){ 422 if(this->nodes[i]->IsClone()) 423 o_nz += 1; 424 else 425 d_nz += 1; 426 } 427 break; 428 default: _error_("not supported"); 429 } 430 } 431 } 432 433 /*Assign output pointers: */ 434 *pd_nz=d_nz; 435 *po_nz=o_nz; 370 436 } 371 437 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Riftfront.h
r13623 r13915 78 78 void CreatePVector(Vector<IssmDouble>* pf); 79 79 void CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");}; 80 void GetNodesSidList(int* sidlist); 81 int GetNumberOfNodes(void); 80 82 void PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");}; 81 83 void PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax); 82 84 void PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax); 85 void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum); 83 86 bool InAnalysis(int analysis_type); 84 87 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.