Changeset 4008
- Timestamp:
- 06/03/10 08:18:26 (15 years ago)
- Location:
- issm/trunk/src/c/modules/ModelProcessorx
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness/CreateConstraintsBalancedthickness.cpp
r3913 r4008 13 13 void CreateConstraintsBalancedthickness(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 /*Intermediary*/ 15 16 int i; 16 int count=0; 17 int count; 18 19 /*Output*/ 17 20 DataSet* constraints = NULL; 18 21 19 /*Create constraints: */ 20 constraints = new DataSet(ConstraintsEnum); 22 /*Recover pointer: */ 23 constraints=*pconstraints; 24 25 /*Create constraints if they do not exist yet*/ 26 if(!constraints) constraints = new DataSet(ConstraintsEnum); 21 27 22 28 /*Fetch data: */ 23 29 IoModelFetchData(&iomodel->spcthickness,NULL,NULL,iomodel_handle,"spcthickness"); 24 30 25 count=1; //matlab indexing 31 /*Initialize counter*/ 32 count=0; 33 26 34 /*Create spcs from x,y,z, as well as the spc values on those spcs: */ 27 35 for (i=0;i<iomodel->numberofvertices;i++){ … … 30 38 if ((int)iomodel->spcthickness[2*i]){ 31 39 32 constraints->AddObject(new Spc(count,i+1,1,*(iomodel->spcthickness+2*i+1)));//we enforce first translation degree of freedom, for temperature 40 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1, 41 *(iomodel->spcthickness+2*i+1),BalancedthicknessAnalysisEnum));//we enforce first translation degree of freedom, for temperature 33 42 count++; 34 43 } … … 39 48 xfree((void**)&iomodel->spcthickness); 40 49 41 /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these42 * datasets, it will not be redone: */43 constraints->Presort();44 45 cleanup_and_return:46 47 50 /*Assign output pointer: */ 48 51 *pconstraints=constraints; -
issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness2/CreateConstraintsBalancedthickness2.cpp
r3913 r4008 13 13 void CreateConstraintsBalancedthickness2(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 /*Output*/ 15 16 DataSet* constraints = NULL; 16 17 17 /*Create constraints: */ 18 constraints = new DataSet(ConstraintsEnum); 18 /*Recover pointer: */ 19 constraints=*pconstraints; 20 21 /*Create constraints if they do not exist yet*/ 22 if(!constraints) constraints = new DataSet(ConstraintsEnum); 19 23 20 24 /*Assign output pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/Balancedvelocities/CreateConstraintsBalancedvelocities.cpp
r3913 r4008 13 13 void CreateConstraintsBalancedvelocities(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 /*Intermediary*/ 15 16 int i; 16 int count= 1;17 int count=0; 17 18 19 /*Output*/ 18 20 DataSet* constraints = NULL; 19 21 Spc* spc = NULL; 20 22 21 /*Create constraints: */ 22 constraints = new DataSet(ConstraintsEnum); 23 /*Recover pointer: */ 24 constraints=*pconstraints; 25 26 /*Create constraints if they do not exist yet*/ 27 if(!constraints) constraints = new DataSet(ConstraintsEnum); 23 28 24 29 /*Fetch data: */ … … 34 39 35 40 /*This grid needs to be spc'd: */ 36 constraints->AddObject(new Spc(count,i+1,1,pow( pow(*(iomodel->spcvelocity+6*i+4),2.0) + pow(*(iomodel->spcvelocity+6*i+5),2.0) ,0.5))); 41 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1, 42 pow( pow(*(iomodel->spcvelocity+6*i+4),2.0) + pow(*(iomodel->spcvelocity+6*i+5),2.0) ,0.5),BalancedvelocitiesAnalysisEnum)); 37 43 count++; 38 44 } 39 40 45 } //if((my_vertices[i]==1)) 41 46 } … … 44 49 xfree((void**)&iomodel->spcvelocity); 45 50 46 /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these47 * datasets, it will not be redone: */48 constraints->Presort();49 50 cleanup_and_return:51 52 51 /*Assign output pointer: */ 53 52 *pconstraints=constraints; -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
r4003 r4008 11 11 #include "../ModelProcessorx.h" 12 12 13 14 13 void CreateConstraintsDiagnosticHoriz(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 15 14 16 15 /*Intermediary*/ 17 16 int i,j; 18 int count =0;17 int count; 19 18 19 /*Output*/ 20 20 DataSet* constraints = NULL; 21 21 Spc* spc = NULL; … … 62 62 IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties"); 63 63 64 count=1; //matlab indexing 64 /*Initilize counter*/ 65 count=0; 66 65 67 if(iomodel->numpenalties){ 66 68 -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp
r3913 r4008 13 13 void CreateConstraintsDiagnosticHutter(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 /*Intermediary*/ 15 16 int i; 16 int count =0;17 int count; 17 18 19 /*Output*/ 18 20 DataSet* constraints = NULL; 19 21 Spc* spc = NULL; 20 22 21 /*Create constraints: */ 22 constraints = new DataSet(ConstraintsEnum); 23 /*Recover pointer: */ 24 constraints=*pconstraints; 25 26 /*Create constraints if they do not exist yet*/ 27 if(!constraints) constraints = new DataSet(ConstraintsEnum); 23 28 24 29 /*Now, is the flag ishutter on? otherwise, do nothing: */ … … 28 33 IoModelFetchData(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter"); 29 34 30 count=1; //matlab indexing 35 /*Initialize conunter*/ 36 count=0; 37 31 38 /*vx and vy are spc'd if we are not on gridonhutter: */ 32 39 for (i=0;i<iomodel->numberofvertices;i++){ … … 35 42 if (!(int)iomodel->gridonhutter[i]){ 36 43 37 constraints->AddObject(new Spc( count,i+1,1,0));44 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticHutterAnalysisEnum)); 38 45 count++; 39 46 40 constraints->AddObject(new Spc( count,i+1,2,0));47 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,0,DiagnosticHutterAnalysisEnum)); 41 48 count++; 42 49 } … … 47 54 xfree((void**)&iomodel->gridonhutter); 48 55 49 /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these50 * datasets, it will not be redone: */51 constraints->Presort();52 53 56 cleanup_and_return: 54 57 -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp
r3913 r4008 13 13 void CreateConstraintsDiagnosticStokes(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 /*Intermediary*/ 15 16 int i; 17 Spc* spc = NULL; 18 int count; 19 20 /*Intermediary*/ 16 21 DataSet* constraints = NULL; 17 Spc* spc = NULL;18 int count=0;19 22 20 /*Create constraints: */ 21 constraints = new DataSet(ConstraintsEnum); 23 /*Recover pointer: */ 24 constraints=*pconstraints; 25 26 /*Create constraints if they do not exist yet*/ 27 if(!constraints) constraints = new DataSet(ConstraintsEnum); 22 28 23 29 /*Now, is the flag ishutter on? otherwise, do nothing: */ … … 27 33 IoModelFetchData(&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes"); 28 34 29 count=1; //matlab indexing 35 /*Initialize counter*/ 36 count=0; 37 30 38 /*Create spcs from x,y,z, as well as the spc values on those spcs: */ 31 39 for (i=0;i<iomodel->numberofvertices;i++){ … … 36 44 37 45 /*This grid will see its vx,vy and vz dofs spc'd to pattyn velocities: */ 38 constraints->AddObject(new Spc( count,i+1,1,0));46 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticStokesAnalysisEnum)); 39 47 count++; 40 48 41 constraints->AddObject(new Spc( count,i+1,2,0));49 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,0,DiagnosticStokesAnalysisEnum)); 42 50 count++; 43 51 44 constraints->AddObject(new Spc( count,i+1,3,0));52 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0,DiagnosticStokesAnalysisEnum)); 45 53 count++; 46 54 } … … 51 59 xfree((void**)&iomodel->gridonstokes); 52 60 53 /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these54 * datasets, it will not be redone: */55 constraints->Presort();56 57 61 cleanup_and_return: 58 62 -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp
r3984 r4008 13 13 void CreateConstraintsDiagnosticVert(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 /*Intermediary*/ 15 16 int i; 17 int count; 18 19 /*Output*/ 16 20 DataSet* constraints = NULL; 17 int count=0;18 21 19 /*Create constraints: */ 20 constraints = new DataSet(ConstraintsEnum); 22 /*Recover pointer: */ 23 constraints=*pconstraints; 24 25 /*Create constraints if they do not exist yet*/ 26 if(!constraints) constraints = new DataSet(ConstraintsEnum); 21 27 22 28 /*return if 2d mesh*/ 23 if (iomodel->dim==2) goto cleanup_and_return;29 if (iomodel->dim==2) goto cleanup_and_return; 24 30 25 31 /*Fetch data: */ 26 32 IoModelFetchData(&iomodel->spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity"); 27 33 34 /*Initialize counter*/ 35 count=0; 36 28 37 /*Create spcs from x,y,z, as well as the spc values on those spcs: */ 29 count=1;30 38 for (i=0;i<iomodel->numberofvertices;i++){ 31 39 … … 34 42 35 43 if ((int)iomodel->spcvelocity[6*i+2]){ 36 constraints->AddObject(new Spc(count,i+1,1,*(iomodel->spcvelocity+6*i+5)/iomodel->yts)); //add count'th spc, on node i+1, setting dof 1 to vx. 44 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1, 45 *(iomodel->spcvelocity+6*i+5)/iomodel->yts,DiagnosticVertAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 37 46 count++; 38 47 … … 41 50 } 42 51 43 /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these 44 * datasets, it will not be redone: */ 45 constraints->Presort(); 52 /*Free data: */ 53 xfree((void**)&iomodel->spcvelocity); 46 54 47 55 cleanup_and_return: 48 /*Free data: */49 xfree((void**)&iomodel->spcvelocity);50 56 51 57 /*Assign output pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateConstraintsMelting.cpp
r3913 r4008 13 13 void CreateConstraintsMelting(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 /*Intermediary*/ 15 16 int i; 16 17 int count; 17 18 19 /*Intermediary*/ 18 20 DataSet* constraints = NULL; 19 21 20 /* Create constraints: */21 constraints = new DataSet(ConstraintsEnum);22 /*Recover pointer: */ 23 constraints=*pconstraints; 22 24 23 /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these 24 * datasets, it will not be redone: */ 25 constraints->Presort(); 25 /*Create constraints if they do not exist yet*/ 26 if(!constraints) constraints = new DataSet(ConstraintsEnum); 26 27 27 28 /*Assign output pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp
r3913 r4008 13 13 void CreateConstraintsPrognostic(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 /*Intermediary*/ 15 16 int i; 16 int count =0;17 int count; 17 18 19 /*Output*/ 18 20 DataSet* constraints = NULL; 19 21 Spc* spc = NULL; 20 22 21 /*Create constraints: */ 22 constraints = new DataSet(ConstraintsEnum); 23 /*Recover pointer: */ 24 constraints=*pconstraints; 25 26 /*Create constraints if they do not exist yet*/ 27 if(!constraints) constraints = new DataSet(ConstraintsEnum); 23 28 24 29 /*Fetch data: */ 25 30 IoModelFetchData(&iomodel->spcthickness,NULL,NULL,iomodel_handle,"spcthickness"); 26 31 27 count=1;//matlab indexing 32 /*Initialize counter*/ 33 count=0; 34 28 35 /*Create spcs from x,y,z, as well as the spc values on those spcs: */ 29 36 for (i=0;i<iomodel->numberofvertices;i++){ … … 33 40 if ((int)iomodel->spcthickness[2*i]){ 34 41 35 constraints->AddObject(new Spc( count,i+1,1,*(iomodel->spcthickness+2*i+1)));42 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,*(iomodel->spcthickness+2*i+1),PrognosticAnalysisEnum)); 36 43 count++; 37 44 } … … 42 49 xfree((void**)&iomodel->spcthickness); 43 50 44 /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these45 * datasets, it will not be redone: */46 constraints->Presort();47 48 cleanup_and_return:49 50 51 /*Assign output pointer: */ 51 52 *pconstraints=constraints; -
issm/trunk/src/c/modules/ModelProcessorx/Prognostic2/CreateConstraintsPrognostic2.cpp
r3913 r4008 13 13 void CreateConstraintsPrognostic2(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 /*Output*/ 15 16 DataSet* constraints = NULL; 16 17 17 /*Create constraints: */ 18 constraints = new DataSet(ConstraintsEnum); 18 /*Recover pointer: */ 19 constraints=*pconstraints; 20 21 /*Create constraints if they do not exist yet*/ 22 if(!constraints) constraints = new DataSet(ConstraintsEnum); 19 23 20 24 /*Assign output pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/SlopeCompute/CreateConstraintsSlopeCompute.cpp
r3913 r4008 13 13 void CreateConstraintsSlopeCompute(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 /*Output*/ 15 16 DataSet* constraints = NULL; 17 18 /*Recover pointer: */ 19 constraints=*pconstraints; 16 20 17 /*Create constraints :*/18 constraints = new DataSet(ConstraintsEnum);19 21 /*Create constraints if they do not exist yet*/ 22 if(!constraints) constraints = new DataSet(ConstraintsEnum); 23 20 24 /*Assign output pointer: */ 21 25 *pconstraints=constraints; -
issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp
r3984 r4008 13 13 void CreateConstraintsThermal(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 /*Intermediary*/ 15 16 int i; 16 int count =0;17 int count; 17 18 19 /*Output*/ 18 20 DataSet* constraints = NULL; 19 21 Spc* spc = NULL; 20 22 21 /*Create constraints: */ 22 constraints = new DataSet(ConstraintsEnum); 23 /*Recover pointer: */ 24 constraints=*pconstraints; 25 26 /*Create constraints if they do not exist yet*/ 27 if(!constraints) constraints = new DataSet(ConstraintsEnum); 23 28 24 29 /*return if 2d mesh*/ 25 if (iomodel->dim==2) goto cleanup_and_return;30 if (iomodel->dim==2) goto cleanup_and_return; 26 31 27 32 /*Fetch data: */ 28 33 IoModelFetchData(&iomodel->spctemperature,NULL,NULL,iomodel_handle,"spctemperature"); 29 34 30 count=1; 35 /*Initialize counter*/ 36 count=0; 31 37 32 38 /*Create spcs from x,y,z, as well as the spc values on those spcs: */ … … 37 43 if ((int)iomodel->spctemperature[2*i]){ 38 44 39 constraints->AddObject(new Spc( count,i+1,1,iomodel->spctemperature[2*i+1]));45 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->spctemperature[2*i+1],ThermalAnalysisEnum)); 40 46 count++; 41 47 … … 48 54 xfree((void**)&iomodel->spctemperature); 49 55 50 /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these51 * datasets, it will not be redone: */52 constraints->Presort();53 54 56 cleanup_and_return: 55 57
Note:
See TracChangeset
for help on using the changeset viewer.