Changeset 3453
- Timestamp:
- 04/08/10 08:08:32 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp
r3446 r3453 10 10 #include "../IoModel.h" 11 11 12 13 12 void CreateConstraintsDiagnosticStokes(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 13 … … 18 17 19 18 /*spc intermediary data: */ 20 int spc_sid;21 int spc_node;22 int spc_dof;23 double spc_value;24 int count;25 26 19 double* gridonstokes=NULL; 27 28 20 29 21 /*Create constraints: */ … … 36 28 IoModelFetchData(&gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes"); 37 29 38 count= 0;30 count=1; //matlab indexing 39 31 /*Create spcs from x,y,z, as well as the spc values on those spcs: */ 40 32 for (i=0;i<iomodel->numberofvertices;i++){ 41 #ifdef _PARALLEL_ 42 /*keep only this partition's nodes:*/ 43 if((iomodel->my_vertices[i]==1)){ 44 #endif 33 /*keep only this partition's nodes:*/ 34 if((iomodel->my_vertices[i]==1)){ 45 35 46 if ((int)!gridonstokes[i]){ 47 48 /*This grid will see its vx,vy and vz dofs spc'd to pattyn velocities: */ 49 spc_sid=count; 50 spc_node=i+1; 51 spc_dof=1; //we enforce first x translation degree of freedom 52 spc_value=0; 36 if ((int)!gridonstokes[i]){ 53 37 54 spc = new Spc(spc_sid,spc_node,spc_dof,spc_value);55 constraints->AddObject(spc);56 count++;38 /*This grid will see its vx,vy and vz dofs spc'd to pattyn velocities: */ 39 constraints->AddObject(new Spc(count,i+1,1,0)); 40 count++; 57 41 58 spc_sid=count; 59 spc_node=i+1; 60 spc_dof=2; //we enforce first y translation degree of freedom 61 spc_value=0; 62 63 spc = new Spc(spc_sid,spc_node,spc_dof,spc_value); 64 constraints->AddObject(spc); 65 count++; 66 67 spc_sid=count; 68 spc_node=i+1; 69 spc_dof=3; //we enforce first y translation degree of freedom 70 spc_value=0; 71 72 spc = new Spc(spc_sid,spc_node,spc_dof,spc_value); 73 constraints->AddObject(spc); 74 count++; 42 constraints->AddObject(new Spc(count,i+1,2,0)); 43 count++; 75 44 76 } 77 78 #ifdef _PARALLEL_ 79 } //if((my_vertices[i]==1)) 80 #endif 45 constraints->AddObject(new Spc(count,i+1,3,0)); 46 count++; 47 } 48 } //if((my_vertices[i]==1)) 81 49 } 82 50
Note:
See TracChangeset
for help on using the changeset viewer.