- Timestamp:
- 03/31/10 16:43:20 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/ModelProcessorx/Prognostic2/CreateConstraintsPrognostic2.cpp
r3354 r3359 2 2 * CreateConstraintsPrognostic2.c: 3 3 */ 4 5 4 6 5 #include "../../DataSet/DataSet.h" … … 11 10 #include "../IoModel.h" 12 11 13 14 12 void CreateConstraintsPrognostic2(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 15 16 17 int i;18 int count;19 13 20 14 DataSet* constraints = NULL; 21 Spc* spc = NULL;22 23 /*spc intermediary data: */24 int spc_sid;25 int spc_node;26 int spc_dof;27 double spc_value;28 29 double* spcthickness=NULL;30 15 31 16 /*Create constraints: */ 32 17 constraints = new DataSet(ConstraintsEnum()); 33 34 /*Fetch data: */35 IoModelFetchData(&spcthickness,NULL,NULL,iomodel_handle,"spcthickness");36 37 count=0;38 39 /*Create spcs from x,y,z, as well as the spc values on those spcs: */40 for (i=0;i<iomodel->numberofnodes;i++){41 #ifdef _PARALLEL_42 /*keep only this partition's nodes:*/43 if((iomodel->my_grids[i]==1)){44 #endif45 46 if ((int)spcthickness[2*i]){47 48 /*This grid needs to be spc'd: */49 50 spc_sid=count;51 spc_node=i+1;52 spc_dof=1; //we enforce first translation degree of freedom, for temperature53 spc_value=*(spcthickness+2*i+1);54 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_grids[i]==1))62 #endif63 }64 65 /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these66 * datasets, it will not be redone: */67 constraints->Presort();68 69 /*Free data: */70 xfree((void**)&spcthickness);71 72 cleanup_and_return:73 18 74 19 /*Assign output pointer: */
Note:
See TracChangeset
for help on using the changeset viewer.