Changeset 3965
- Timestamp:
- 05/27/10 08:39:36 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/DataSet/DataSet.cpp
r3938 r3965 651 651 } 652 652 /*}}}*/ 653 /*FUNCTION DataSet::CreateKMatrix{{{1*/654 void DataSet::CreateKMatrix(Mat Kgg,int analysis_type,int sub_analysis_type){655 656 vector<Object*>::iterator object;657 Element* element=NULL;658 Load* load=NULL;659 660 for ( object=objects.begin() ; object < objects.end(); object++ ){661 662 if(EnumIsElement((*object)->Enum())){663 664 element=(Element*)(*object);665 element->CreateKMatrix(Kgg,analysis_type,sub_analysis_type);666 }667 if(EnumIsLoad((*object)->Enum())){668 669 load=(Load*)(*object);670 load->CreateKMatrix(Kgg,analysis_type,sub_analysis_type);671 }672 }673 674 }675 /*}}}*/676 653 /*FUNCTION DataSet::CreatePartitioningVector{{{1*/ 677 654 void DataSet::CreatePartitioningVector(Vec* ppartition,int numberofobjects){ … … 700 677 /*Assign output pointers: */ 701 678 *ppartition=partition; 702 }703 /*}}}*/704 /*FUNCTION DataSet::CreatePVector{{{1*/705 void DataSet::CreatePVector(Vec pg,int analysis_type,int sub_analysis_type){706 707 vector<Object*>::iterator object;708 Element* element=NULL;709 Load* load=NULL;710 711 for ( object=objects.begin() ; object < objects.end(); object++ ){712 713 if(EnumIsElement((*object)->Enum())){714 715 element=(Element*)(*object);716 element->CreatePVector(pg,analysis_type,sub_analysis_type);717 }718 if(EnumIsLoad((*object)->Enum())){719 720 load=(Load*)(*object);721 load->CreatePVector(pg,analysis_type,sub_analysis_type);722 }723 }724 725 679 } 726 680 /*}}}*/ … … 1240 1194 1241 1195 1242 1243 }1244 /*}}}*/1245 /*FUNCTION DataSet::PenaltyCreateKMatrix{{{1*/1246 void DataSet::PenaltyCreateKMatrix(Mat Kgg,double kmax,int analysis_type,int sub_analysis_type){1247 1248 vector<Object*>::iterator object;1249 Load* load=NULL;1250 1251 for ( object=objects.begin() ; object < objects.end(); object++ ){1252 1253 if(EnumIsLoad((*object)->Enum())){1254 1255 load=(Load*)(*object);1256 load->PenaltyCreateKMatrix(Kgg,kmax,analysis_type,sub_analysis_type);1257 }1258 }1259 1260 }1261 /*}}}*/1262 /*FUNCTION DataSet::PenaltyCreatePVector{{{1*/1263 void DataSet::PenaltyCreatePVector(Vec pg,double kmax,int analysis_type,int sub_analysis_type){1264 1265 vector<Object*>::iterator object;1266 Load* load=NULL;1267 1268 for ( object=objects.begin() ; object < objects.end(); object++ ){1269 1270 if(EnumIsLoad((*object)->Enum())){1271 1272 load=(Load*)(*object);1273 load->PenaltyCreatePVector(pg,kmax,analysis_type,sub_analysis_type);1274 }1275 }1276 1196 1277 1197 } -
issm/trunk/src/c/DataSet/DataSet.h
r3956 r3965 69 69 void SetSorting(int* in_sorted_ids,int* in_id_offsets); 70 70 void Sort(); 71 void CreateKMatrix(Mat Kgg, int analysis_type,int sub_analysis_type);72 void CreatePVector(Vec pg, int analysis_type,int sub_analysis_type);73 71 void UpdateInputsFromConstant(double constant, int name); 74 72 void UpdateInputsFromConstant(int constant, int name); … … 79 77 void UpdateInputsFromSolution(double* solution,int analysis_type,int sub_analysis_type); 80 78 void GetSolutionFromInputs(Vec solution, int analysis_type, int sub_analysis_type); 81 void PenaltyCreateKMatrix(Mat Kgg,double kmax,int analysis_type,int sub_analysis_type);82 void PenaltyCreatePVector(Vec pg,double kmax,int analysis_type,int sub_analysis_type);83 79 int RiftIsPresent(); 84 80 int MeltingIsPresent(); -
issm/trunk/src/c/modules/PenaltySystemMatricesx/PenaltySystemMatricesx.cpp
r3913 r3965 14 14 15 15 int i; 16 17 extern int num_procs;18 extern int my_rank;19 16 double kmax; 17 Load* load=NULL; 20 18 21 19 /*First, get elements and loads configured: */ 22 elements-> Configure(elements,loads, nodes,vertices, materials,parameters);23 nodes-> Configure(elements,loads, nodes,vertices, materials,parameters);24 loads-> Configure(elements, loads, nodes,vertices, materials,parameters);20 elements-> Configure(elements,loads, nodes,vertices, materials,parameters); 21 nodes-> Configure(elements,loads, nodes,vertices, materials,parameters); 22 loads-> Configure(elements, loads, nodes,vertices, materials,parameters); 25 23 parameters->Configure(elements,loads, nodes,vertices, materials,parameters); 26 24 … … 29 27 30 28 /*Add penalties to stiffnesses, from loads: */ 31 if(kflag)loads->PenaltyCreateKMatrix(Kgg,kmax,analysis_type,sub_analysis_type);32 if(pflag)loads->PenaltyCreatePVector(pg,kmax,analysis_type,sub_analysis_type);33 34 /*Assemble matrices: */35 29 if(kflag){ 30 31 /*Fill stiffness matrix from loads: */ 32 for (i=0;i<loads->Size();i++){ 33 load=(Load*)loads->GetObjectByOffset(i); 34 load->PenaltyCreateKMatrix(Kgg,kmax,analysis_type,sub_analysis_type); 35 } 36 37 /*Assemble matrix and compress matrix to save memory: */ 36 38 MatAssemblyBegin(Kgg,MAT_FINAL_ASSEMBLY); 37 39 MatAssemblyEnd(Kgg,MAT_FINAL_ASSEMBLY); 38 40 MatCompress(Kgg); 39 41 } 42 43 /*Add penalties to right hand side, from loads: */ 40 44 if(pflag){ 45 46 /*Fill right hand side vector, from loads: */ 47 for (i=0;i<loads->Size();i++){ 48 load=(Load*)loads->GetObjectByOffset(i); 49 load->PenaltyCreatePVector(pg,kmax,analysis_type,sub_analysis_type); 50 } 51 52 /*Assemble right hand side: */ 41 53 VecAssemblyBegin(pg); 42 54 VecAssemblyEnd(pg); 43 55 } 44 45 /*Assign output pointer s:*/46 if(pkmax) *pkmax=kmax;56 57 /*Assign output pointer:*/ 58 if(pkmax) *pkmax=kmax; 47 59 48 60 } -
issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
r3913 r3965 13 13 int kflag,int pflag,int analysis_type,int sub_analysis_type){ 14 14 15 extern int num_procs;16 extern int my_rank;17 18 15 /*intermediary: */ 19 16 int gsize; 17 int i,j; 20 18 int connectivity; 21 19 int numberofdofspernode; 20 Element* element=NULL; 21 Load* load=NULL; 22 22 23 23 /*output: */ … … 26 26 27 27 /*First, get elements and loads configured: */ 28 elements-> Configure(elements,loads, nodes,vertices, materials,parameters);29 nodes-> Configure(elements,loads, nodes,vertices, materials,parameters);30 loads-> Configure(elements, loads, nodes,vertices, materials,parameters);28 elements-> Configure(elements,loads, nodes,vertices, materials,parameters); 29 nodes-> Configure(elements,loads, nodes,vertices, materials,parameters); 30 loads-> Configure(elements, loads, nodes,vertices, materials,parameters); 31 31 parameters->Configure(elements,loads, nodes,vertices, materials,parameters); 32 32 … … 38 38 gsize=nodes->NumberOfDofs(); 39 39 40 /*Allocate Kgg and pg: */ 41 if(kflag)Kgg=NewMat(gsize,gsize,NULL,&connectivity,&numberofdofspernode); 42 if(pflag)pg=NewVec(gsize); 40 /*Compute stiffness matrix*/ 41 if(kflag){ 43 42 44 /*Fill stiffness matrix and right hand side vector, from elements: */ 45 if(kflag)elements->CreateKMatrix(Kgg,analysis_type,sub_analysis_type); 46 if(pflag)elements->CreatePVector(pg,analysis_type,sub_analysis_type); 47 48 /*Fill stiffness matrix and right hand side vector, from loads: */ 49 if(kflag)loads->CreateKMatrix(Kgg,analysis_type,sub_analysis_type); 50 if(pflag)loads->CreatePVector(pg,analysis_type,sub_analysis_type); 43 /*Allocate Kgg*/ 44 Kgg=NewMat(gsize,gsize,NULL,&connectivity,&numberofdofspernode); 51 45 52 /*Assemble matrices: */ 53 if(kflag){ 46 /*Fill stiffness matrix from elements: */ 47 for (i=0;i<elements->Size();i++){ 48 element=(Element*)elements->GetObjectByOffset(i); 49 element->CreateKMatrix(Kgg,analysis_type,sub_analysis_type); 50 } 51 52 /*Fill stiffness matrix from loads: */ 53 for (i=0;i<loads->Size();i++){ 54 load=(Load*)loads->GetObjectByOffset(i); 55 load->CreateKMatrix(Kgg,analysis_type,sub_analysis_type); 56 } 57 58 /*Assemble matrix and compress matrix to save memory: */ 54 59 MatAssemblyBegin(Kgg,MAT_FINAL_ASSEMBLY); 55 60 MatAssemblyEnd(Kgg,MAT_FINAL_ASSEMBLY); 56 61 MatCompress(Kgg); 57 62 } 63 64 /*Compute Load vector*/ 58 65 if(pflag){ 66 67 /*Allocate pg*/ 68 pg=NewVec(gsize); 69 70 /*Fill right hand side vector, from elements: */ 71 for (i=0;i<elements->Size();i++){ 72 element=(Element*)elements->GetObjectByOffset(i); 73 element->CreatePVector(pg,analysis_type,sub_analysis_type); 74 } 75 76 /*Fill right hand side vector, from loads: */ 77 for (i=0;i<loads->Size();i++){ 78 load=(Load*)loads->GetObjectByOffset(i); 79 load->CreatePVector(pg,analysis_type,sub_analysis_type); 80 } 81 82 /*Assemble right hand side: */ 59 83 VecAssemblyBegin(pg); 60 84 VecAssemblyEnd(pg); … … 64 88 *pKgg=Kgg; 65 89 *ppg=pg; 90 66 91 } -
issm/trunk/src/c/objects/Elements/Tria.cpp
r3956 r3965 4844 4844 } 4845 4845 /*}}}*/ 4846 /*FUNCTION Tria::UpdateInputsFromConstant(double value, int name);{{{1*/ 4847 void Tria::UpdateInputsFromConstant(double constant, int name){ 4848 /*Nothing updated for now*/ 4849 } 4850 /*}}}*/ 4851 /*FUNCTION Tria::UpdateInputsFromConstant(bool value, int name);{{{1*/ 4852 void Tria::UpdateInputsFromConstant(bool constant, int name){ 4853 /*Nothing updated for now*/ 4854 } 4855 /*}}}*/ 4846 4856 /*FUNCTION Tria::DepthAverageInputAtBase {{{1*/ 4847 4857 void Tria::DepthAverageInputAtBase(int enum_type){ -
issm/trunk/src/c/objects/Elements/Tria.h
r3956 r3965 139 139 void UpdateInputsFromVector(int* vector, int name, int type); 140 140 void UpdateInputsFromVector(bool* vector, int name, int type); 141 void UpdateInputsFromConstant(double constant, int name) {ISSMERROR("Not implemented yet!");};141 void UpdateInputsFromConstant(double constant, int name); 142 142 void UpdateInputsFromConstant(int constant, int name); 143 void UpdateInputsFromConstant(bool constant, int name) {ISSMERROR("Not implemented yet!");};143 void UpdateInputsFromConstant(bool constant, int name); 144 144 /*}}}*/ 145 145 -
issm/trunk/src/c/objects/Model.cpp
r3925 r3965 88 88 89 89 _printf_(" reducing single point constraints vector:\n"); 90 Reducevectorgtosx(&ys, &ys0,yg->vector,nodesets);90 Reducevectorgtosx(&ys,yg->vector,nodesets); 91 91 92 92 _printf_(" normalizing rigid body constraints matrix:\n"); … … 166 166 167 167 _printf_(" reducing single point constraints vector:\n"); 168 Reducevectorgtosx(&ys, &ys0,yg->vector,nodesets);168 Reducevectorgtosx(&ys,yg->vector,nodesets); 169 169 170 170 _printf_(" normalizing rigid body constraints matrix:\n");
Note:
See TracChangeset
for help on using the changeset viewer.