Changeset 8800
- Timestamp:
- 07/05/11 16:46:08 (14 years ago)
- Location:
- issm/trunk/src/c/objects
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Element.h
r8647 r8800 28 28 virtual void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0; 29 29 virtual void SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0; 30 virtual void CreateKMatrix(Mat K gg,Mat Kff, Mat Kfs,Vec dg,Vec df)=0;31 virtual void CreatePVector(Vec p g, Vec pf)=0;30 virtual void CreateKMatrix(Mat Kff, Mat Kfs,Vec df)=0; 31 virtual void CreatePVector(Vec pf)=0; 32 32 virtual void GetSolutionFromInputs(Vec solution)=0; 33 33 virtual int GetNodeIndex(Node* node)=0; -
issm/trunk/src/c/objects/Elements/Penta.cpp
r8795 r8800 571 571 /*}}}*/ 572 572 /*FUNCTION Penta::CreateKMatrix {{{1*/ 573 void Penta::CreateKMatrix(Mat K gg, Mat Kff, Mat Kfs,Vec dg,Vec df){573 void Penta::CreateKMatrix(Mat Kff, Mat Kfs,Vec df){ 574 574 575 575 /*retrieve parameters: */ … … 624 624 /*Add to global matrix*/ 625 625 if(Ke){ 626 Ke->AddToGlobal(K gg,Kff,Kfs);626 Ke->AddToGlobal(Kff,Kfs); 627 627 delete Ke; 628 628 } 629 629 /*Add to global Vector*/ 630 630 if(De){ 631 De->InsertIntoGlobal(d g,df);631 De->InsertIntoGlobal(df); 632 632 delete De; 633 633 } … … 2342 2342 /*}}}*/ 2343 2343 /*FUNCTION Penta::CreatePVector {{{1*/ 2344 void Penta::CreatePVector(Vec p g, Vec pf){2344 void Penta::CreatePVector(Vec pf){ 2345 2345 2346 2346 /*retrive parameters: */ … … 2397 2397 /*Add to global Vector*/ 2398 2398 if(pe){ 2399 pe->AddToGlobal(p g,pf);2399 pe->AddToGlobal(pf); 2400 2400 delete pe; 2401 2401 } -
issm/trunk/src/c/objects/Elements/Penta.h
r8654 r8800 79 79 void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); 80 80 void SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); 81 void CreateKMatrix(Mat K gg, Mat Kff, Mat Kfs,Vec dg,Vec df);82 void CreatePVector(Vec p g, Vec pf);81 void CreateKMatrix(Mat Kff, Mat Kfs,Vec df); 82 void CreatePVector(Vec pf); 83 83 void DeleteResults(void); 84 84 double DragCoefficientAbsGradient(bool process_units,int weight_index); -
issm/trunk/src/c/objects/Elements/Tria.cpp
r8795 r8800 377 377 /*}}}*/ 378 378 /*FUNCTION Tria::CreateKMatrix {{{1*/ 379 void Tria::CreateKMatrix(Mat K gg, Mat Kff, Mat Kfs,Vec dg,Vec df){379 void Tria::CreateKMatrix(Mat Kff, Mat Kfs,Vec df){ 380 380 381 381 /*retreive parameters: */ … … 423 423 /*Add to global matrix*/ 424 424 if(Ke){ 425 Ke->AddToGlobal(K gg,Kff,Kfs);425 Ke->AddToGlobal(Kff,Kfs); 426 426 delete Ke; 427 427 } … … 1318 1318 /*}}}*/ 1319 1319 /*FUNCTION Tria::CreatePVector {{{1*/ 1320 void Tria::CreatePVector(Vec p g, Vec pf){1320 void Tria::CreatePVector(Vec pf){ 1321 1321 1322 1322 /*retrive parameters: */ … … 1368 1368 /*Add to global Vector*/ 1369 1369 if(pe){ 1370 pe->AddToGlobal(p g,pf);1370 pe->AddToGlobal(pf); 1371 1371 delete pe; 1372 1372 } -
issm/trunk/src/c/objects/Elements/Tria.h
r8649 r8800 76 76 void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); 77 77 void SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); 78 void CreateKMatrix(Mat K gg, Mat Kff, Mat Kfs,Vec dg,Vec df);79 void CreatePVector(Vec p g, Vec pf);78 void CreateKMatrix(Mat Kff, Mat Kfs,Vec df); 79 void CreatePVector(Vec pf); 80 80 double DragCoefficientAbsGradient(bool process_units,int weight_index); 81 81 int GetNodeIndex(Node* node); -
issm/trunk/src/c/objects/FemModel.cpp
r8386 r8800 39 39 /*Dynamically allocate whatever is a list of length nummodels: */ 40 40 analysis_type_list=(int*)xmalloc(nummodels*sizeof(int)); 41 m_nodesets=(NodeSets**)xmalloc(nummodels*sizeof(NodeSets*));42 m_ys=(Vec*)xmalloc(nummodels*sizeof(Vec));43 41 44 42 /*Initialize: */ 45 43 for(i=0;i<nummodels;i++)analysis_type_list[i]=analyses[i]; 46 for(i=0;i<nummodels;i++)m_nodesets[i]=NULL;47 for(i=0;i<nummodels;i++)m_ys[i]=NULL;48 44 49 45 /*create datasets for all analyses*/ … … 68 64 NodesDofx(nodes,parameters,analysis_type); 69 65 70 _printf_(VerboseMProcessor()," create nodal constraints vector\n");71 CreateNodalConstraintsx(&m_ys[i],nodes,analysis_type);72 73 _printf_(VerboseMProcessor()," create node sets\n");74 BuildNodeSetsx(&m_nodesets[i], nodes,analysis_type);75 76 66 _printf_(VerboseMProcessor()," configuring element and loads\n"); 77 67 ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters); … … 105 95 delete parameters; 106 96 delete results; 107 108 for(i=0;i<nummodels;i++){109 NodeSets* temp_nodesets=m_nodesets[i];110 delete temp_nodesets;111 Vec temp_ys=m_ys[i];112 VecFree(&temp_ys);113 }114 115 /*Delete dynamically allocated arrays: */116 xfree((void**)&m_nodesets);117 xfree((void**)&m_ys);118 97 119 98 } … … 153 132 else _error_("Could not find alias for analysis_type %s in list of FemModel analyses",EnumToStringx(configuration_type)); 154 133 155 /*activate matrices/vectors: */156 nodesets=m_nodesets[analysis_counter];157 ys=m_ys[analysis_counter];158 159 134 /*Now, plug analysis_counter and analysis_type inside the parameters: */ 160 135 this->parameters->SetParam(analysis_counter,AnalysisCounterEnum); -
issm/trunk/src/c/objects/FemModel.h
r6372 r8800 36 36 Results* results; //results that cannot be fit into the elements (such as one time constants, arrays, strings, etc ...) 37 37 38 //multiple sets of matrices/vectors for each analysis_type. m stands for multiple39 NodeSets** m_nodesets; //boundary conditions dof sets40 Vec* m_ys; //boundary conditions, in reduced s-set41 42 //pointers to point to sets of matrices/vectors, for a certain analysis type. activated in SetCurrentAnalysis43 NodeSets* nodesets;44 Vec yg;45 Vec ys;46 47 38 /*constructors, destructors: */ 48 39 FemModel(char* inputfilename, char* outputfilename, const int solution_type,const int* analyses,const int nummodels); -
issm/trunk/src/c/objects/IoModel.cpp
r8647 r8800 203 203 IoModelFetchData(&this->shelf_dampening,iomodel_handle,"shelf_dampening"); 204 204 IoModelFetchData(&this->waitonlock,iomodel_handle,"waitonlock"); 205 IoModelFetchData(&this->kff,iomodel_handle,"kff");206 205 IoModelFetchData(&this->gl_migration,iomodel_handle,"gl_migration"); 207 206 IoModelFetchData(&this->isdiagnostic,iomodel_handle,"isdiagnostic"); … … 374 373 this->connectivity=0; 375 374 this->lowmem=0; 376 this->kff=0;377 375 this->optscal=NULL; 378 376 this->yts=0; -
issm/trunk/src/c/objects/IoModel.h
r8647 r8800 161 161 double yts; 162 162 double waitonlock; 163 int kff;164 163 int isdiagnostic; 165 164 int isprognostic; -
issm/trunk/src/c/objects/Loads/Icefront.cpp
r8303 r8800 303 303 /*}}}*/ 304 304 /*FUNCTION Icefront::CreateKMatrix {{{1*/ 305 void Icefront::CreateKMatrix(Mat K gg, Mat Kff, Mat Kfs){305 void Icefront::CreateKMatrix(Mat Kff, Mat Kfs){ 306 306 307 307 /*No stiffness loads applied, do nothing: */ … … 311 311 /*}}}*/ 312 312 /*FUNCTION Icefront::CreatePVector {{{1*/ 313 void Icefront::CreatePVector(Vec p g, Vec pf){313 void Icefront::CreatePVector(Vec pf){ 314 314 315 315 /*Checks in debugging mode*/ … … 339 339 /*Add to global Vector*/ 340 340 if(pe){ 341 pe->AddToGlobal(p g,pf);341 pe->AddToGlobal(pf); 342 342 delete pe; 343 343 } … … 345 345 /*}}}*/ 346 346 /*FUNCTION Icefront::PenaltyCreateKMatrix {{{1*/ 347 void Icefront::PenaltyCreateKMatrix(Mat K gg,Mat Kff, Mat Kfs, double kmax){347 void Icefront::PenaltyCreateKMatrix(Mat Kff, Mat Kfs, double kmax){ 348 348 /*do nothing: */ 349 349 return; … … 351 351 /*}}}*/ 352 352 /*FUNCTION Icefront::PenaltyCreatePVector{{{1*/ 353 void Icefront::PenaltyCreatePVector(Vec p g,Vec pf,double kmax){353 void Icefront::PenaltyCreatePVector(Vec pf,double kmax){ 354 354 /*do nothing: */ 355 355 return; -
issm/trunk/src/c/objects/Loads/Icefront.h
r6412 r8800 71 71 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 72 72 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 73 void CreateKMatrix(Mat K gg, Mat Kff, Mat Kfs);74 void CreatePVector(Vec p g, Vec pf);75 void PenaltyCreateKMatrix(Mat K gg,Mat Kff, Mat kfs, double kmax);76 void PenaltyCreatePVector(Vec p g,Vec pf, double kmax);73 void CreateKMatrix(Mat Kff, Mat Kfs); 74 void CreatePVector(Vec pf); 75 void PenaltyCreateKMatrix(Mat Kff, Mat kfs, double kmax); 76 void PenaltyCreatePVector(Vec pf, double kmax); 77 77 bool InAnalysis(int analysis_type); 78 78 /*}}}*/ -
issm/trunk/src/c/objects/Loads/Load.h
r5772 r8800 26 26 virtual void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0; 27 27 virtual void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0; 28 virtual void CreateKMatrix(Mat K gg,Mat Kff, Mat Kfs)=0;29 virtual void CreatePVector(Vec p g, Vec pf)=0;30 virtual void PenaltyCreateKMatrix(Mat K gg,Mat Kff, Mat Kfs, double kmax)=0;31 virtual void PenaltyCreatePVector(Vec p g, Vec pf, double kmax)=0;28 virtual void CreateKMatrix(Mat Kff, Mat Kfs)=0; 29 virtual void CreatePVector(Vec pf)=0; 30 virtual void PenaltyCreateKMatrix(Mat Kff, Mat Kfs, double kmax)=0; 31 virtual void PenaltyCreatePVector(Vec pf, double kmax)=0; 32 32 virtual bool InAnalysis(int analysis_type)=0; 33 33 /*}}}*/ -
issm/trunk/src/c/objects/Loads/Numericalflux.cpp
r8287 r8800 327 327 /*}}}*/ 328 328 /*FUNCTION Numericalflux::CreateKMatrix {{{1*/ 329 void Numericalflux::CreateKMatrix(Mat K gg,Mat Kff, Mat Kfs){329 void Numericalflux::CreateKMatrix(Mat Kff, Mat Kfs){ 330 330 331 331 /*recover some parameters*/ … … 351 351 /*Add to global matrix*/ 352 352 if(Ke){ 353 Ke->AddToGlobal(K gg,Kff,Kfs);353 Ke->AddToGlobal(Kff,Kfs); 354 354 delete Ke; 355 355 } … … 358 358 /*}}}*/ 359 359 /*FUNCTION Numericalflux::CreatePVector {{{1*/ 360 void Numericalflux::CreatePVector(Vec p g,Vec pf){360 void Numericalflux::CreatePVector(Vec pf){ 361 361 362 362 /*recover some parameters*/ … … 381 381 /*Add to global matrix*/ 382 382 if(pe){ 383 pe->AddToGlobal(p g,pf);383 pe->AddToGlobal(pf); 384 384 delete pe; 385 385 } … … 388 388 /*}}}*/ 389 389 /*FUNCTION Numericalflux::PenaltyCreateKMatrix {{{1*/ 390 void Numericalflux::PenaltyCreateKMatrix(Mat K gg,Mat Kff, Mat Kfs,double kmax){390 void Numericalflux::PenaltyCreateKMatrix(Mat Kff, Mat Kfs,double kmax){ 391 391 392 392 /*No stiffness loads applied, do nothing: */ … … 396 396 /*}}}*/ 397 397 /*FUNCTION Numericalflux::PenaltyCreatePVector{{{1*/ 398 void Numericalflux::PenaltyCreatePVector(Vec p g,Vec pf,double kmax){398 void Numericalflux::PenaltyCreatePVector(Vec pf,double kmax){ 399 399 400 400 /*No penalty loads applied, do nothing: */ -
issm/trunk/src/c/objects/Loads/Numericalflux.h
r8287 r8800 67 67 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 68 68 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 69 void CreateKMatrix(Mat K gg, Mat Kff, Mat Kfs);70 void CreatePVector(Vec p g, Vec pf);71 void PenaltyCreateKMatrix(Mat K gg,Mat Kff, Mat kfs, double kmax);72 void PenaltyCreatePVector(Vec p g,Vec pf, double kmax);69 void CreateKMatrix(Mat Kff, Mat Kfs); 70 void CreatePVector(Vec pf); 71 void PenaltyCreateKMatrix(Mat Kff, Mat kfs, double kmax); 72 void PenaltyCreatePVector(Vec pf, double kmax); 73 73 bool InAnalysis(int analysis_type); 74 74 /*}}}*/ -
issm/trunk/src/c/objects/Loads/Pengrid.cpp
r8490 r8800 286 286 /*}}}1*/ 287 287 /*FUNCTION Pengrid::CreateKMatrix {{{1*/ 288 void Pengrid::CreateKMatrix(Mat K gg,Mat Kff, Mat Kfs){288 void Pengrid::CreateKMatrix(Mat Kff, Mat Kfs){ 289 289 290 290 /*No loads applied, do nothing: */ … … 294 294 /*}}}1*/ 295 295 /*FUNCTION Pengrid::CreatePVector {{{1*/ 296 void Pengrid::CreatePVector(Vec p g,Vec pf){296 void Pengrid::CreatePVector(Vec pf){ 297 297 298 298 /*No loads applied, do nothing: */ … … 302 302 /*}}}1*/ 303 303 /*FUNCTION Pengrid::PenaltyCreateMatrix {{{1*/ 304 void Pengrid::PenaltyCreateKMatrix(Mat K gg,Mat Kff, Mat Kfs,double kmax){304 void Pengrid::PenaltyCreateKMatrix(Mat Kff, Mat Kfs,double kmax){ 305 305 306 306 /*Retrieve parameters: */ … … 325 325 /*Add to global matrix*/ 326 326 if(Ke){ 327 Ke->AddToGlobal(K gg,Kff,Kfs);327 Ke->AddToGlobal(Kff,Kfs); 328 328 delete Ke; 329 329 } … … 331 331 /*}}}1*/ 332 332 /*FUNCTION Pengrid::PenaltyCreatePVector {{{1*/ 333 void Pengrid::PenaltyCreatePVector(Vec p g,Vec pf,double kmax){333 void Pengrid::PenaltyCreatePVector(Vec pf,double kmax){ 334 334 335 335 /*Retrieve parameters: */ … … 353 353 /*Add to global Vector*/ 354 354 if(pe){ 355 pe->AddToGlobal(p g,pf);355 pe->AddToGlobal(pf); 356 356 delete pe; 357 357 } -
issm/trunk/src/c/objects/Loads/Pengrid.h
r8408 r8800 72 72 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 73 73 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 74 void CreateKMatrix(Mat K gg, Mat Kff, Mat Kfs);75 void CreatePVector(Vec p g, Vec pf);76 void PenaltyCreateKMatrix(Mat K gg,Mat Kff, Mat kfs, double kmax);77 void PenaltyCreatePVector(Vec p g,Vec pf, double kmax);74 void CreateKMatrix(Mat Kff, Mat Kfs); 75 void CreatePVector(Vec pf); 76 void PenaltyCreateKMatrix(Mat Kff, Mat kfs, double kmax); 77 void PenaltyCreatePVector(Vec pf, double kmax); 78 78 bool InAnalysis(int analysis_type); 79 79 /*}}}*/ -
issm/trunk/src/c/objects/Loads/Penpair.cpp
r8224 r8800 197 197 /*}}}1*/ 198 198 /*FUNCTION Penpair::CreateKMatrix {{{1*/ 199 void Penpair::CreateKMatrix(Mat K gg,Mat Kff, Mat Kfs){199 void Penpair::CreateKMatrix(Mat Kff, Mat Kfs){ 200 200 /*If you code this piece, don't forget that a penalty will be inactive if it is dealing with clone nodes*/ 201 201 /*No loads applied, do nothing: */ … … 205 205 /*}}}1*/ 206 206 /*FUNCTION Penpair::CreatePVector {{{1*/ 207 void Penpair::CreatePVector(Vec p g,Vec pf){207 void Penpair::CreatePVector(Vec pf){ 208 208 209 209 /*No loads applied, do nothing: */ … … 213 213 /*}}}1*/ 214 214 /*FUNCTION Penpair::PenaltyCreateKMatrix {{{1*/ 215 void Penpair::PenaltyCreateKMatrix(Mat K gg,Mat Kff, Mat Kfs,double kmax){215 void Penpair::PenaltyCreateKMatrix(Mat Kff, Mat Kfs,double kmax){ 216 216 217 217 /*Retrieve parameters: */ … … 233 233 /*Add to global Vector*/ 234 234 if(Ke){ 235 Ke->AddToGlobal(K gg,Kff,Kfs);235 Ke->AddToGlobal(Kff,Kfs); 236 236 delete Ke; 237 237 } … … 239 239 /*}}}1*/ 240 240 /*FUNCTION Penpair::PenaltyCreatePVector {{{1*/ 241 void Penpair::PenaltyCreatePVector(Vec p g,Vec pf,double kmax){241 void Penpair::PenaltyCreatePVector(Vec pf,double kmax){ 242 242 /*No loads applied, do nothing: */ 243 243 return; -
issm/trunk/src/c/objects/Loads/Penpair.h
r7833 r8800 59 59 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 60 60 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 61 void CreateKMatrix(Mat K gg, Mat Kff, Mat Kfs);62 void CreatePVector(Vec p g, Vec pf);63 void PenaltyCreateKMatrix(Mat K gg,Mat Kff, Mat kfs, double kmax);64 void PenaltyCreatePVector(Vec p g,Vec pf, double kmax);61 void CreateKMatrix(Mat Kff, Mat Kfs); 62 void CreatePVector(Vec pf); 63 void PenaltyCreateKMatrix(Mat Kff, Mat kfs, double kmax); 64 void PenaltyCreatePVector(Vec pf, double kmax); 65 65 bool InAnalysis(int analysis_type); 66 66 /*}}}*/ -
issm/trunk/src/c/objects/Loads/Riftfront.cpp
r8303 r8800 420 420 /*}}}*/ 421 421 /*FUNCTION Riftfront::PenaltyCreateKMatrix {{{1*/ 422 void Riftfront::PenaltyCreateKMatrix(Mat K gg,Mat Kff, Mat Kfs,double kmax){422 void Riftfront::PenaltyCreateKMatrix(Mat Kff, Mat Kfs,double kmax){ 423 423 424 424 /*Retrieve parameters: */ … … 440 440 /*Add to global Vector*/ 441 441 if(Ke){ 442 Ke->AddToGlobal(K gg,Kff,Kfs);442 Ke->AddToGlobal(Kff,Kfs); 443 443 delete Ke; 444 444 } … … 446 446 /*}}}1*/ 447 447 /*FUNCTION Riftfront::PenaltyCreatePVector {{{1*/ 448 void Riftfront::PenaltyCreatePVector(Vec p g,Vec pf,double kmax){448 void Riftfront::PenaltyCreatePVector(Vec pf,double kmax){ 449 449 450 450 /*Retrieve parameters: */ … … 466 466 /*Add to global Vector*/ 467 467 if(pe){ 468 pe->AddToGlobal(p g,pf);468 pe->AddToGlobal(pf); 469 469 delete pe; 470 470 } … … 472 472 /*}}}1*/ 473 473 /*FUNCTION Riftfront::CreateKMatrix {{{1*/ 474 void Riftfront::CreateKMatrix(Mat K gg,Mat Kff, Mat Kfs){474 void Riftfront::CreateKMatrix(Mat Kff, Mat Kfs){ 475 475 /*do nothing: */ 476 476 return; … … 478 478 /*}}}1*/ 479 479 /*FUNCTION Riftfront::CreatePVector {{{1*/ 480 void Riftfront::CreatePVector(Vec p g,Vec pf){480 void Riftfront::CreatePVector(Vec pf){ 481 481 /*do nothing: */ 482 482 return; -
issm/trunk/src/c/objects/Loads/Riftfront.h
r6748 r8800 79 79 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 80 80 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 81 void CreateKMatrix(Mat K gg, Mat Kff, Mat Kfs);82 void CreatePVector(Vec p g, Vec pf);83 void PenaltyCreateKMatrix(Mat K gg,Mat Kff, Mat kfs, double kmax);84 void PenaltyCreatePVector(Vec p g,Vec pf, double kmax);81 void CreateKMatrix(Mat Kff, Mat Kfs); 82 void CreatePVector(Vec pf); 83 void PenaltyCreateKMatrix(Mat Kff, Mat kfs, double kmax); 84 void PenaltyCreatePVector(Vec pf, double kmax); 85 85 bool InAnalysis(int analysis_type); 86 86 /*}}}*/ -
issm/trunk/src/c/objects/Node.cpp
r8303 r8800 806 806 } 807 807 /*}}}*/ 808 /*FUNCTION Node::UpdateSpcs {{{1*/ 809 void Node::UpdateSpcs(double* ys){ 810 811 int count=0; 812 int i; 813 814 count=0; 815 for(i=0;i<this->indexing.gsize;i++){ 816 if(this->indexing.s_set[i]){ 817 this->indexing.svalues[i]=ys[this->indexing.sdoflist[count]]; 818 count++; 819 } 820 } 821 } 822 /*}}}*/ 823 /*FUNCTION Node::VecMerge {{{1*/ 824 void Node::VecMerge(Vec ug, double* vector_serial,int setenum){ 825 826 double* values=NULL; 827 int* indices=NULL; 828 int count=0; 829 int i; 830 831 if(setenum==FsetEnum){ 832 if(this->indexing.fsize){ 833 indices=(int*)xmalloc(this->indexing.fsize*sizeof(int)); 834 values=(double*)xmalloc(this->indexing.fsize*sizeof(double)); 835 836 for(i=0;i<this->indexing.gsize;i++){ 837 if(this->indexing.f_set[i]){ 838 values[count]=vector_serial[this->indexing.fdoflist[count]]; 839 indices[count]=this->indexing.gdoflist[i]; 840 count++; 841 } 842 } 843 844 /*Add values into ug: */ 845 VecSetValues(ug,this->indexing.fsize,indices,(const double*)values,INSERT_VALUES); 846 } 847 } 848 else if(setenum==SsetEnum){ 849 if(this->indexing.ssize){ 850 indices=(int*)xmalloc(this->indexing.ssize*sizeof(int)); 851 values=(double*)xmalloc(this->indexing.ssize*sizeof(double)); 852 853 for(i=0;i<this->indexing.gsize;i++){ 854 if(this->indexing.s_set[i]){ 855 values[count]=vector_serial[this->indexing.sdoflist[count]]; 856 indices[count]=this->indexing.gdoflist[i]; 857 count++; 858 } 859 } 860 861 /*Add values into ug: */ 862 VecSetValues(ug,this->indexing.ssize,indices,(const double*)values,INSERT_VALUES); 863 } 864 } 865 else _error_("VecMerge can only merge from the s or f-set onto the g-set!"); 866 867 /*Free ressources:*/ 868 xfree((void**)&values); 869 xfree((void**)&indices); 870 } 871 /*}}}*/ 872 /*FUNCTION Node::VecReduce {{{1*/ 873 void Node::VecReduce(Vec vector, double* ug_serial,int setenum){ 874 875 double* values=NULL; 876 int count=0; 877 int i; 878 879 if(setenum==FsetEnum){ 880 if(this->indexing.fsize){ 881 values=(double*)xmalloc(this->indexing.fsize*sizeof(double)); 882 883 for(i=0;i<this->indexing.gsize;i++){ 884 if(this->indexing.f_set[i]){ 885 values[count]=ug_serial[this->indexing.gdoflist[count]]; 886 count++; 887 } 888 } 889 890 /*Add values into ug: */ 891 VecSetValues(vector,this->indexing.fsize,this->indexing.fdoflist,(const double*)values,INSERT_VALUES); 892 } 893 } 894 else if(setenum==SsetEnum){ 895 if(this->indexing.ssize){ 896 values=(double*)xmalloc(this->indexing.ssize*sizeof(double)); 897 898 for(i=0;i<this->indexing.gsize;i++){ 899 if(this->indexing.s_set[i]){ 900 values[count]=ug_serial[this->indexing.gdoflist[count]]; 901 count++; 902 } 903 } 904 905 /*Add values into ug: */ 906 VecSetValues(vector,this->indexing.ssize,this->indexing.sdoflist,(const double*)values,INSERT_VALUES); 907 } 908 } 909 else _error_("VecReduce can only merge from the s or f-set onto the g-set!"); 910 911 /*Free ressources:*/ 912 xfree((void**)&values); 913 } 914 /*}}}*/ 808 915 809 916 /* DofObject routines:*/ -
issm/trunk/src/c/objects/Node.h
r8260 r8800 92 92 int IsOnShelf(); 93 93 int IsOnSheet(); 94 void UpdateSpcs(double* ys); 95 void VecMerge(Vec ug, double* vector_serial,int setnum); 96 void VecReduce(Vec vector, double* ug_serial,int setnum); 97 94 98 /*}}}*/ 95 99 /*Dof Object routines {{{1*/ -
issm/trunk/src/c/objects/Numerics/ElementMatrix.cpp
r7639 r8800 27 27 this->values=NULL; 28 28 this->dofsymmetrical=false; 29 this->kff=false;30 29 31 30 this->row_fsize=0; … … 99 98 this->ncols=gsize; 100 99 this->dofsymmetrical=true; 101 this->kff=Ke1->kff;102 100 103 101 /*Gset and values*/ … … 201 199 ElementMatrix::ElementMatrix(Node** nodes,int numnodes,Parameters* parameters,int approximation){ 202 200 203 /*retrieve some parameters: */204 parameters->FindParam(&kff,KffEnum);205 206 201 /*get Matrix size and properties*/ 207 202 this->dofsymmetrical=true; … … 216 211 217 212 /*get dof lists for f and s set: */ 218 if(kff){ 219 this->row_fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation); 220 this->row_flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation); 221 this->row_fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation); 222 this->row_ssize=GetNumberOfDofs(nodes,numnodes,SsetEnum,approximation); 223 this->row_slocaldoflist =GetLocalDofList( nodes,numnodes,SsetEnum,approximation); 224 this->row_sglobaldoflist=GetGlobalDofList(nodes,numnodes,SsetEnum,approximation); 225 } 226 else{ 227 this->row_fsize=0; 228 this->row_flocaldoflist=NULL; 229 this->row_fglobaldoflist=NULL; 230 this->row_ssize=0; 231 this->row_slocaldoflist=NULL; 232 this->row_sglobaldoflist=NULL; 233 } 213 this->row_fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation); 214 this->row_flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation); 215 this->row_fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation); 216 this->row_ssize=GetNumberOfDofs(nodes,numnodes,SsetEnum,approximation); 217 this->row_slocaldoflist =GetLocalDofList( nodes,numnodes,SsetEnum,approximation); 218 this->row_sglobaldoflist=GetGlobalDofList(nodes,numnodes,SsetEnum,approximation); 234 219 235 220 /*Because this matrix is "dofsymmetrical" don't do cols, we can pick them up from the rows: */ … … 261 246 /*ElementMatrix specific routines: */ 262 247 /*FUNCTION ElementMatrix::AddToGlobal{{{1*/ 263 void ElementMatrix::AddToGlobal(Mat K gg, Mat Kff, Mat Kfs){248 void ElementMatrix::AddToGlobal(Mat Kff, Mat Kfs){ 264 249 265 250 int i,j; … … 269 254 /*only use row dofs to add values into global matrices: */ 270 255 271 if(!this->kff){ 256 if(this->row_fsize){ 257 /*first, retrieve values that are in the f-set from the g-set values matrix: */ 258 localvalues=(double*)xmalloc(this->row_fsize*this->row_fsize*sizeof(double)); 259 for(i=0;i<this->row_fsize;i++){ 260 for(j=0;j<this->row_fsize;j++){ 261 *(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]); 262 } 263 } 272 264 /*add local values into global matrix, using the fglobaldoflist: */ 273 MatSetValues(Kgg,this->nrows,this->gglobaldoflist,this->nrows,this->gglobaldoflist,(const double*)values,ADD_VALUES); 274 } 275 else{ 276 if(this->row_fsize){ 277 /*first, retrieve values that are in the f-set from the g-set values matrix: */ 278 localvalues=(double*)xmalloc(this->row_fsize*this->row_fsize*sizeof(double)); 279 for(i=0;i<this->row_fsize;i++){ 280 for(j=0;j<this->row_fsize;j++){ 281 *(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]); 282 } 265 MatSetValues(Kff,this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,(const double*)localvalues,ADD_VALUES); 266 267 /*Free ressources:*/ 268 xfree((void**)&localvalues); 269 } 270 271 272 if((this->row_ssize!=0) && (this->row_fsize!=0)){ 273 /*first, retrieve values that are in the f and s-set from the g-set values matrix: */ 274 localvalues=(double*)xmalloc(this->row_fsize*this->row_ssize*sizeof(double)); 275 for(i=0;i<this->row_fsize;i++){ 276 for(j=0;j<this->row_ssize;j++){ 277 *(localvalues+this->row_ssize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_slocaldoflist[j]); 283 278 } 284 /*add local values into global matrix, using the fglobaldoflist: */285 MatSetValues(Kff,this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,(const double*)localvalues,ADD_VALUES);286 287 /*Free ressources:*/288 xfree((void**)&localvalues);289 279 } 290 291 292 if((this->row_ssize!=0) && (this->row_fsize!=0)){ 293 /*first, retrieve values that are in the f and s-set from the g-set values matrix: */ 294 localvalues=(double*)xmalloc(this->row_fsize*this->row_ssize*sizeof(double)); 295 for(i=0;i<this->row_fsize;i++){ 296 for(j=0;j<this->row_ssize;j++){ 297 *(localvalues+this->row_ssize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_slocaldoflist[j]); 298 } 299 } 300 /*add local values into global matrix, using the fglobaldoflist: */ 301 MatSetValues(Kfs,this->row_fsize,this->row_fglobaldoflist,this->row_ssize,this->row_sglobaldoflist,(const double*)localvalues,ADD_VALUES); 302 303 /*Free ressources:*/ 304 xfree((void**)&localvalues); 305 } 280 /*add local values into global matrix, using the fglobaldoflist: */ 281 MatSetValues(Kfs,this->row_fsize,this->row_fglobaldoflist,this->row_ssize,this->row_sglobaldoflist,(const double*)localvalues,ADD_VALUES); 282 283 /*Free ressources:*/ 284 xfree((void**)&localvalues); 306 285 } 307 286 } … … 356 335 printf(" ncols: %i\n",ncols); 357 336 printf(" dofsymmetrical: %s\n",dofsymmetrical?"true":"false"); 358 printf(" kff: %s\n",kff?"true":"false");359 337 360 338 printf(" values: \n"); … … 403 381 this->ncols =Ke->ncols; 404 382 this->dofsymmetrical=Ke->dofsymmetrical; 405 this->kff =Ke->kff;406 383 407 384 this->values=(double*)xmalloc(this->nrows*this->ncols*sizeof(double)); -
issm/trunk/src/c/objects/Numerics/ElementMatrix.h
r7639 r8800 24 24 int ncols; 25 25 bool dofsymmetrical; 26 bool kff;27 26 double* values; 28 27 … … 59 58 /*}}}*/ 60 59 /*ElementMatrix specific routines {{{1*/ 61 void AddToGlobal(Mat K gg, Mat Kff, Mat Kfs);60 void AddToGlobal(Mat Kff, Mat Kfs); 62 61 void Echo(void); 63 62 void CheckConsistency(void); -
issm/trunk/src/c/objects/Numerics/ElementVector.cpp
r7639 r8800 72 72 /*2: Initialize static fields*/ 73 73 this->nrows=gsize; 74 this->pf=pe1->pf;75 74 76 75 /*Gset and values*/ … … 135 134 ElementVector::ElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation){ 136 135 137 /*retrieve some parameters: */138 parameters->FindParam(&this->pf,KffEnum);139 140 136 /*get Vector size and properties*/ 141 137 this->nrows=GetNumberOfDofs(nodes,numnodes,GsetEnum,approximation); … … 148 144 149 145 /*Get fsize*/ 150 if(pf){ 151 this->fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation); 152 this->flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation); 153 this->fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation); 154 } 155 else{ 156 this->fsize=0; 157 this->flocaldoflist =NULL; 158 this->fglobaldoflist=NULL; 159 } 146 this->fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation); 147 this->flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation); 148 this->fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation); 160 149 } 161 150 /*}}}*/ … … 171 160 172 161 /*ElementVector specific routines: */ 173 /*FUNCTION ElementVector::AddToGlobal(Vec p g, Vec pf){{{1*/174 void ElementVector::AddToGlobal(Vec p g, Vec pf){162 /*FUNCTION ElementVector::AddToGlobal(Vec pf){{{1*/ 163 void ElementVector::AddToGlobal(Vec pf){ 175 164 176 165 int i; 177 166 double* localvalues=NULL; 178 167 179 if(!pf){ 168 if(this->fsize){ 169 /*first, retrieve values that are in the f-set from the g-set values vector: */ 170 localvalues=(double*)xmalloc(this->fsize*sizeof(double)); 171 for(i=0;i<this->fsize;i++){ 172 localvalues[i]=this->values[this->flocaldoflist[i]]; 173 } 180 174 /*add local values into global vector, using the fglobaldoflist: */ 181 VecSetValues(pg,this->nrows,this->gglobaldoflist,(const double*)values,ADD_VALUES); 182 } 183 else{ 184 if(this->fsize){ 185 /*first, retrieve values that are in the f-set from the g-set values vector: */ 186 localvalues=(double*)xmalloc(this->fsize*sizeof(double)); 187 for(i=0;i<this->fsize;i++){ 188 localvalues[i]=this->values[this->flocaldoflist[i]]; 189 } 190 /*add local values into global vector, using the fglobaldoflist: */ 191 VecSetValues(pf,this->fsize,this->fglobaldoflist,(const double*)localvalues,ADD_VALUES); 192 193 /*Free ressources:*/ 194 xfree((void**)&localvalues); 195 } 196 } 197 } 198 /*}}}*/ 199 /*FUNCTION ElementVector::InsertIntoGlobal(Vec pg, Vec pf){{{1*/ 200 void ElementVector::InsertIntoGlobal(Vec pg, Vec pf){ 175 VecSetValues(pf,this->fsize,this->fglobaldoflist,(const double*)localvalues,ADD_VALUES); 176 177 /*Free ressources:*/ 178 xfree((void**)&localvalues); 179 } 180 } 181 /*}}}*/ 182 /*FUNCTION ElementVector::InsertIntoGlobal(Vec pf){{{1*/ 183 void ElementVector::InsertIntoGlobal(Vec pf){ 201 184 202 185 int i; 203 186 double* localvalues=NULL; 204 187 205 if(!pf){ 188 if(this->fsize){ 189 /*first, retrieve values that are in the f-set from the g-set values vector: */ 190 localvalues=(double*)xmalloc(this->fsize*sizeof(double)); 191 for(i=0;i<this->fsize;i++){ 192 localvalues[i]=this->values[this->flocaldoflist[i]]; 193 } 206 194 /*add local values into global vector, using the fglobaldoflist: */ 207 VecSetValues(pg,this->nrows,this->gglobaldoflist,(const double*)values,INSERT_VALUES); 208 } 209 else{ 210 if(this->fsize){ 211 /*first, retrieve values that are in the f-set from the g-set values vector: */ 212 localvalues=(double*)xmalloc(this->fsize*sizeof(double)); 213 for(i=0;i<this->fsize;i++){ 214 localvalues[i]=this->values[this->flocaldoflist[i]]; 215 } 216 /*add local values into global vector, using the fglobaldoflist: */ 217 VecSetValues(pf,this->fsize,this->fglobaldoflist,(const double*)localvalues,INSERT_VALUES); 218 219 /*Free ressources:*/ 220 xfree((void**)&localvalues); 221 } 195 VecSetValues(pf,this->fsize,this->fglobaldoflist,(const double*)localvalues,INSERT_VALUES); 196 197 /*Free ressources:*/ 198 xfree((void**)&localvalues); 222 199 } 223 200 } … … 229 206 printf("Element Vector echo: \n"); 230 207 printf(" nrows: %i\n",nrows); 231 printf(" pf: %s\n",pf?"true":"false");232 208 233 209 printf(" values: \n"); … … 252 228 253 229 this->nrows =pe->nrows; 254 this->pf =pe->pf;255 230 256 231 this->values=(double*)xmalloc(this->nrows*sizeof(double)); -
issm/trunk/src/c/objects/Numerics/ElementVector.h
r7639 r8800 23 23 int nrows; 24 24 double* values; 25 bool pf;26 25 27 26 //gset … … 41 40 /*}}}*/ 42 41 /*ElementVector specific routines {{{1*/ 43 void AddToGlobal(Vec p g, Vec pf);44 void InsertIntoGlobal(Vec p g, Vec pf);42 void AddToGlobal(Vec pf); 43 void InsertIntoGlobal(Vec pf); 45 44 void Echo(void); 46 45 void Init(ElementVector* pe); -
issm/trunk/src/c/objects/objects.h
r8798 r8800 15 15 #include "./Node.h" 16 16 #include "./Segment.h" 17 #include "./NodeSets.h"18 17 #include "./IoModel.h" 19 18 #include "./Patch.h"
Note:
See TracChangeset
for help on using the changeset viewer.