Changeset 3452
- Timestamp:
- 04/08/10 08:05:09 (15 years ago)
- Location:
- issm/trunk/src/c/ModelProcessorx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/ModelProcessorx/Balancedthickness/CreateConstraintsBalancedthickness.cpp
r3442 r3452 10 10 #include "../IoModel.h" 11 11 12 13 12 void CreateConstraintsBalancedthickness(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 15 13 16 14 int i; … … 24 22 IoModelFetchData(&iomodel->spcthickness,NULL,NULL,iomodel_handle,"spcthickness"); 25 23 26 count=1; 24 count=1; //matlab indexing 27 25 /*Create spcs from x,y,z, as well as the spc values on those spcs: */ 28 26 for (i=0;i<iomodel->numberofvertices;i++){ -
issm/trunk/src/c/ModelProcessorx/Balancedvelocities/CreateConstraintsBalancedvelocities.cpp
r3446 r3452 10 10 #include "../IoModel.h" 11 11 12 13 12 void CreateConstraintsBalancedvelocities(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 13 15 16 14 int i; 17 int count ;15 int count=1; 18 16 19 17 DataSet* constraints = NULL; … … 21 19 22 20 /*spc intermediary data: */ 23 int spc_sid;24 int spc_node;25 int spc_dof;26 double spc_value;27 28 21 double* spcvelocity=NULL; 29 22 … … 34 27 IoModelFetchData(&spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity"); 35 28 36 count=0; 37 29 count=1; //matlab indexing 38 30 /*Create spcs from x,y,z, as well as the spc values on those spcs: */ 39 31 for (i=0;i<iomodel->numberofvertices;i++){ 40 #ifdef _PARALLEL_ 41 /*keep only this partition's nodes:*/ 42 if((iomodel->my_vertices[i]==1)){ 43 #endif 32 /*keep only this partition's nodes:*/ 33 if((iomodel->my_vertices[i]==1)){ 44 34 45 if ((int)spcvelocity[6*i+0] && (int)spcvelocity[6*i+1]){ //spc if vx and vy are constrained 46 47 /*This grid needs to be spc'd: */ 48 spc_sid=count; 49 spc_node=i+1; 50 spc_dof=1; //we enforce first translation degree of freedom, for temperature 51 spc_value=pow( pow(*(spcvelocity+6*i+4),2.0) + pow(*(spcvelocity+6*i+5),2.0) ,0.5); 35 if ((int)spcvelocity[6*i+0] && (int)spcvelocity[6*i+1]){ //spc if vx and vy are constrained 52 36 53 spc = new Spc(spc_sid,spc_node,spc_dof,spc_value);54 constraints->AddObject(spc);55 count++;56 }37 /*This grid needs to be spc'd: */ 38 constraints->AddObject(new Spc(count,i+1,1,pow( pow(*(spcvelocity+6*i+4),2.0) + pow(*(spcvelocity+6*i+5),2.0) ,0.5))); 39 count++; 40 } 57 41 58 #ifdef _PARALLEL_ 59 } //if((my_vertices[i]==1)) 60 #endif 42 } //if((my_vertices[i]==1)) 61 43 } 62 44 -
issm/trunk/src/c/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp
r3446 r3452 2 2 * CreateConstraintsPrognostic.c: 3 3 */ 4 5 4 6 5 #include "../../DataSet/DataSet.h" … … 11 10 #include "../IoModel.h" 12 11 13 14 12 void CreateConstraintsPrognostic(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 15 13 16 17 14 int i; 18 int count ;15 int count=0; 19 16 20 17 DataSet* constraints = NULL; … … 22 19 23 20 /*spc intermediary data: */ 24 int spc_sid;25 int spc_node;26 int spc_dof;27 double spc_value;28 29 21 double* spcthickness=NULL; 30 22 … … 35 27 IoModelFetchData(&spcthickness,NULL,NULL,iomodel_handle,"spcthickness"); 36 28 37 count=0; 38 29 count=1;//matlab indexing 39 30 /*Create spcs from x,y,z, as well as the spc values on those spcs: */ 40 31 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 32 /*keep only this partition's nodes:*/ 33 if((iomodel->my_vertices[i]==1)){ 45 34 46 if ((int)spcthickness[2*i]){ 47 48 /*This grid needs to be spc'd: */ 35 if ((int)spcthickness[2*i]){ 49 36 50 spc_sid=count; 51 spc_node=i+1; 52 spc_dof=1; //we enforce first translation degree of freedom, for temperature 53 spc_value=*(spcthickness+2*i+1); 37 constraints->AddObject(new Spc(count,i+1,1,*(spcthickness+2*i+1))); 38 count++; 39 } 54 40 55 spc = new Spc(spc_sid,spc_node,spc_dof,spc_value); 56 constraints->AddObject(spc); 57 count++; 58 } 59 60 #ifdef _PARALLEL_ 61 } //if((my_vertices[i]==1)) 62 #endif 41 } //if((my_vertices[i]==1)) 63 42 } 64 43
Note:
See TracChangeset
for help on using the changeset viewer.