Changeset 3455
- Timestamp:
- 04/08/10 08:15:47 (15 years ago)
- Location:
- issm/trunk/src/c/ModelProcessorx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp
r3446 r3455 10 10 #include "../IoModel.h" 11 11 12 13 12 void CreateConstraintsDiagnosticHutter(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 13 15 int i ,j;16 int count ;14 int i; 15 int count=0; 17 16 18 17 DataSet* constraints = NULL; 18 Spc* spc = NULL; 19 19 20 Spc* spc = NULL; 21 Rgb* rgb = NULL; 22 23 /*spc intermediary data: */ 24 int spc_sid; 25 int spc_node; 26 int spc_dof; 27 double spc_value; 28 29 /*rgb constructor data: */ 30 int rgb_id; 31 int rgb_dof; 32 int rgb_nodeid1; 33 int rgb_nodeid2; 20 /*Now, is the flag ishutter on? otherwise, do nothing: */ 21 if (!iomodel->ishutter)goto cleanup_and_return; 34 22 35 23 /*Create constraints: */ 36 24 constraints = new DataSet(ConstraintsEnum()); 37 25 38 /*Now, is the flag ishutter on? otherwise, do nothing: */39 if (!iomodel->ishutter)goto cleanup_and_return;40 41 count=0;42 43 26 /*Fetch data: */ 44 27 IoModelFetchData(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter"); 45 28 29 count=1; //matlab indexing 46 30 /*vx and vy are spc'd if we are not on gridonhutter: */ 47 31 for (i=0;i<iomodel->numberofvertices;i++){ 48 #ifdef _PARALLEL_ 49 /*keep only this partition's nodes:*/ 50 if((iomodel->my_vertices[i])){ 51 #endif 32 /*keep only this partition's nodes:*/ 33 if((iomodel->my_vertices[i])){ 34 if (!(int)iomodel->gridonhutter[i]){ 52 35 53 if (!(int)iomodel->gridonhutter[i]){ 54 55 spc_sid=count; 56 spc_node=i+1; 57 spc_dof=1; //we enforce first x translation degree of freedom 58 spc_value=0; 36 constraints->AddObject(new Spc(count,i+1,1,0)); 37 count++; 59 38 60 spc = new Spc(spc_sid,spc_node,spc_dof,spc_value); 61 constraints->AddObject(spc); 62 count++; 63 64 spc_sid=count; 65 spc_node=i+1; 66 spc_dof=2; //we enforce first y translation degree of freedom 67 spc_value=0; 68 69 spc = new Spc(spc_sid,spc_node,spc_dof,spc_value); 70 constraints->AddObject(spc); 71 count++; 72 } 73 74 #ifdef _PARALLEL_ 75 } //if((my_vertices[i])) 76 #endif 39 constraints->AddObject(new Spc(count,i+1,2,0)); 40 count++; 41 } 42 } //if((my_vertices[i])) 77 43 } 78 44 -
issm/trunk/src/c/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp
r3450 r3455 18 18 Spc* spc = NULL; 19 19 20 double* spctemperature=NULL;21 22 20 /*Create constraints: */ 23 21 constraints = new DataSet(ConstraintsEnum()); … … 27 25 28 26 /*Fetch data: */ 29 IoModelFetchData(& spctemperature,NULL,NULL,iomodel_handle,"spctemperature");27 IoModelFetchData(&iomodel->spctemperature,NULL,NULL,iomodel_handle,"spctemperature"); 30 28 31 29 count=1; … … 36 34 if((iomodel->my_vertices[i]==1)){ 37 35 38 if ((int) spctemperature[2*i]){36 if ((int)iomodel->spctemperature[2*i]){ 39 37 40 constraints->AddObject(new Spc(count,i+1,1, spctemperature[2*i+1]));38 constraints->AddObject(new Spc(count,i+1,1,iomodel->spctemperature[2*i+1])); 41 39 count++; 42 40 … … 46 44 } 47 45 46 /*Free data: */ 47 xfree((void**)&iomodel->spctemperature); 48 48 49 /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these 49 50 * datasets, it will not be redone: */ … … 51 52 52 53 cleanup_and_return: 53 /*Free data: */54 xfree((void**)&spctemperature);55 54 56 55 /*Assign output pointer: */
Note:
See TracChangeset
for help on using the changeset viewer.