Changeset 9362
- Timestamp:
- 08/19/11 20:01:40 (14 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 59 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
r9356 r9362 33 33 34 34 /*Fetch parameters: */ 35 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);35 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 36 36 37 37 /*First of, find the record for the enum, and get code of data type: */ -
issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp
r9356 r9362 13 13 14 14 /*Fetch parameters: */ 15 iomodel-> parameters->FindParam(&prognostic_DG,PrognosticDGEnum);15 iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum); 16 16 17 17 /*Output*/ -
issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp
r9356 r9362 20 20 21 21 /*Fetch parameters: */ 22 iomodel-> parameters->FindParam(&prognostic_DG,PrognosticDGEnum);22 iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum); 23 23 24 24 /*Output*/ -
issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp
r9356 r9362 30 30 31 31 /*Fetch parameters: */ 32 iomodel-> parameters->FindParam(&dim,DimEnum);33 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);34 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);35 iomodel-> parameters->FindParam(&prognostic_DG,PrognosticDGEnum);32 iomodel->constants->FindParam(&dim,DimEnum); 33 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 34 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 35 iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum); 36 36 37 37 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp
r9356 r9362 20 20 21 21 /*Fetch data needed: */ 22 iomodel-> parameters->FindParam(&dim,DimEnum);22 iomodel->constants->FindParam(&dim,DimEnum); 23 23 iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum); 24 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);24 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 25 25 26 26 /*Update elements: */ -
issm/trunk/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp
r9356 r9362 24 24 25 25 /*Fetch parameters: */ 26 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);26 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 27 27 28 28 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp
r9356 r9362 20 20 21 21 /*Fetch data needed: */ 22 iomodel-> parameters->FindParam(&dim,DimEnum);22 iomodel->constants->FindParam(&dim,DimEnum); 23 23 iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum); 24 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);24 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 25 25 26 26 /*Update elements: */ -
issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
r9356 r9362 27 27 28 28 /*Fetch parameters: */ 29 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);30 iomodel-> parameters->FindParam(&control_analysis,ControlAnalysisEnum);31 iomodel-> parameters->FindParam(&num_control_type,NumControlTypeEnum);29 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 30 iomodel->constants->FindParam(&control_analysis,ControlAnalysisEnum); 31 iomodel->constants->FindParam(&num_control_type,NumControlTypeEnum); 32 32 33 33 /*Now, return if no control*/ -
issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
r9356 r9362 27 27 28 28 /*Fetch parameters: */ 29 iomodel-> parameters->FindParam(&dim,DimEnum);30 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);31 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);29 iomodel->constants->FindParam(&dim,DimEnum); 30 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 31 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 32 32 33 33 /*Did we already create the elements? : */ … … 43 43 44 44 /*Fetch data needed: */ 45 iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum); 46 iomodel->FetchData(&iomodel->elementconnectivity,NULL,NULL,ElementconnectivityEnum); 47 iomodel->FetchData(&iomodel->upperelements,NULL,NULL,UpperelementsEnum); 48 iomodel->FetchData(&iomodel->lowerelements,NULL,NULL,LowerelementsEnum); 49 iomodel->FetchData(&iomodel->rheology_B,NULL,NULL,RheologyBEnum); 50 iomodel->FetchData(&iomodel->rheology_n,NULL,NULL,RheologyNEnum); 51 iomodel->FetchData(&iomodel->control_type,NULL,NULL,ControlTypeEnum); 52 iomodel->FetchData(&iomodel->cm_min,NULL,NULL,CmMinEnum); 53 iomodel->FetchData(&iomodel->cm_max,NULL,NULL,CmMaxEnum); 45 iomodel->FetchData(9,ElementsEnum,ElementconnectivityEnum,UpperelementsEnum,LowerelementsEnum,RheologyBEnum,RheologyNEnum,ControlTypeEnum,CmMinEnum,CmMaxEnum); 54 46 55 47 /*Create elements and materials: */ … … 59 51 60 52 /*Create and add tria element to elements dataset: */ 61 if(dim==2) 62 elements->AddObject(new Tria(i+1,i,i,iomodel,nummodels)); 63 else 64 elements->AddObject(new Penta(i+1,i,i,iomodel,nummodels)); 53 if(dim==2) elements->AddObject(new Tria(i+1,i,i,iomodel,nummodels)); 54 else elements->AddObject(new Penta(i+1,i,i,iomodel,nummodels)); 65 55 66 56 /*Create and add material property to materials dataset: */ … … 70 60 71 61 /*Free data: */ 72 xfree((void**)&iomodel->elements); 73 xfree((void**)&iomodel->elementconnectivity); 74 xfree((void**)&iomodel->upperelements); 75 xfree((void**)&iomodel->lowerelements); 76 xfree((void**)&iomodel->rheology_B); 77 xfree((void**)&iomodel->rheology_n); 78 xfree((void**)&iomodel->control_type); 79 xfree((void**)&iomodel->cm_min); 80 xfree((void**)&iomodel->cm_max); 62 iomodel->DeleteData(9,ElementsEnum,ElementconnectivityEnum,UpperelementsEnum,LowerelementsEnum,RheologyBEnum,RheologyNEnum,ControlTypeEnum,CmMinEnum,CmMaxEnum); 81 63 82 64 /*Add new constrant material property tgo materials, at the end: */ … … 84 66 85 67 /*Create vertices: */ 86 iomodel->FetchData(&iomodel->x,NULL,NULL,XEnum); 87 iomodel->FetchData(&iomodel->y,NULL,NULL,YEnum); 88 iomodel->FetchData(&iomodel->z,NULL,NULL,ZEnum); 89 iomodel->FetchData(&iomodel->bed,NULL,NULL,BedEnum); 90 iomodel->FetchData(&iomodel->thickness,NULL,NULL,ThicknessEnum); 68 69 /*Fetch data:*/ 70 iomodel->FetchData(5,XEnum,YEnum,ZEnum,BedEnum,ThicknessEnum); 91 71 92 72 for (i=0;i<numberofvertices;i++){ … … 100 80 } 101 81 102 /*Clean fetched data: */ 103 xfree((void**)&iomodel->x); 104 xfree((void**)&iomodel->y); 105 xfree((void**)&iomodel->z); 106 xfree((void**)&iomodel->bed); 107 xfree((void**)&iomodel->thickness); 82 /*Free data: */ 83 iomodel->DeleteData(5,XEnum,YEnum,ZEnum,BedEnum,ThicknessEnum); 108 84 109 cleanup_and_return:110 111 85 /*Assign output pointer: */ 112 86 *pelements=elements; -
issm/trunk/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp
r9356 r9362 23 23 int numberofelements; 24 24 int numberofvertices; 25 double* elements=NULL; 25 26 26 27 /*output*/ … … 28 29 29 30 /*Fetch parameters: */ 30 iomodel->parameters->FindParam(&dim,DimEnum); 31 iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum); 32 iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum); 31 iomodel->constants->FindParam(&dim,DimEnum); 32 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 33 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 34 elements=iomodel->f(ElementsEnum); 33 35 34 36 /*Some checks if debugging*/ 35 37 _assert_(numberofvertices); 36 38 _assert_(numberofelements); 37 _assert_( iomodel->elements);39 _assert_(elements); 38 40 39 41 /*Allocate ouput*/ … … 51 53 for (i=0;i<numberofelements;i++){ 52 54 for (j=0;j<elementswidth;j++){ 53 vertexid=(int) iomodel->elements[elementswidth*i+j];55 vertexid=(int)elements[elementswidth*i+j]; 54 56 _assert_(vertexid>0 && vertexid-1<numberofvertices); 55 57 connectivity[vertexid-1]+=1; -
issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp
r9356 r9362 24 24 25 25 /*Initialize dataset: */ 26 parameters = (Parameters*)iomodel-> parameters->Copy();26 parameters = (Parameters*)iomodel->constants->Copy(); 27 27 28 28 /*some parameters that did not come with the iomodel: */ -
issm/trunk/src/c/modules/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp
r9356 r9362 23 23 int numberofelements; 24 24 int numberofvertices; 25 double* elements=NULL; 25 26 26 27 /*output*/ … … 28 29 29 30 /*Fetch parameters: */ 30 iomodel->parameters->FindParam(&dim,DimEnum); 31 iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum); 32 iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum); 31 iomodel->constants->FindParam(&dim,DimEnum); 32 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 33 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 34 elements=iomodel->f(ElementsEnum); 33 35 34 36 /*Some checks if debugging*/ … … 36 38 _assert_(numberofelements); 37 39 _assert_(iomodel->my_elements); 38 _assert_( iomodel->elements);40 _assert_(elements); 39 41 40 42 /*Allocate ouput*/ … … 54 56 if(iomodel->my_elements[i]){ 55 57 for (j=0;j<elementswidth;j++){ 56 vertexid=(int) iomodel->elements[elementswidth*i+j];58 vertexid=(int)elements[elementswidth*i+j]; 57 59 _assert_(vertexid>0 && vertexid-1<numberofvertices); 58 60 connectivity[vertexid-1]=i+1; -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
r9356 r9362 30 30 31 31 /*Fetch parameters: */ 32 iomodel-> parameters->FindParam(&dim,DimEnum);33 iomodel-> parameters->FindParam(&yts,YtsEnum);34 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);35 iomodel-> parameters->FindParam(&g,GEnum);36 iomodel-> parameters->FindParam(&rho_ice,RhoIceEnum);37 iomodel-> parameters->FindParam(&stokesreconditioning,StokesreconditioningEnum);38 iomodel-> parameters->FindParam(&isstokes,IsstokesEnum);39 iomodel-> parameters->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);32 iomodel->constants->FindParam(&dim,DimEnum); 33 iomodel->constants->FindParam(&yts,YtsEnum); 34 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 35 iomodel->constants->FindParam(&g,GEnum); 36 iomodel->constants->FindParam(&rho_ice,RhoIceEnum); 37 iomodel->constants->FindParam(&stokesreconditioning,StokesreconditioningEnum); 38 iomodel->constants->FindParam(&isstokes,IsstokesEnum); 39 iomodel->constants->FindParam(&ismacayealpattyn,IsmacayealpattynEnum); 40 40 41 41 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
r9356 r9362 31 31 32 32 /*Fetch parameters: */ 33 iomodel-> parameters->FindParam(&dim,DimEnum);34 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);35 iomodel-> parameters->FindParam(&isstokes,IsstokesEnum);36 iomodel-> parameters->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);33 iomodel->constants->FindParam(&dim,DimEnum); 34 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 35 iomodel->constants->FindParam(&isstokes,IsstokesEnum); 36 iomodel->constants->FindParam(&ismacayealpattyn,IsmacayealpattynEnum); 37 37 38 38 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp
r9356 r9362 25 25 26 26 /*Fetch parameters: */ 27 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);28 iomodel-> parameters->FindParam(&isstokes,IsstokesEnum);29 iomodel-> parameters->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);27 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 28 iomodel->constants->FindParam(&isstokes,IsstokesEnum); 29 iomodel->constants->FindParam(&ismacayealpattyn,IsmacayealpattynEnum); 30 30 31 31 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp
r9356 r9362 27 27 iomodel->FetchData(&iomodel->elements_type,NULL,NULL,ElementsTypeEnum); 28 28 29 iomodel-> parameters->FindParam(&isstokes,IsstokesEnum);30 iomodel-> parameters->FindParam(&ismacayealpattyn,IsmacayealpattynEnum);31 iomodel-> parameters->FindParam(&dim,DimEnum);32 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);33 iomodel-> parameters->FindParam(&control_analysis,ControlAnalysisEnum);34 iomodel-> parameters->FindParam(&qmu_analysis,QmuAnalysisEnum);29 iomodel->constants->FindParam(&isstokes,IsstokesEnum); 30 iomodel->constants->FindParam(&ismacayealpattyn,IsmacayealpattynEnum); 31 iomodel->constants->FindParam(&dim,DimEnum); 32 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 33 iomodel->constants->FindParam(&control_analysis,ControlAnalysisEnum); 34 iomodel->constants->FindParam(&qmu_analysis,QmuAnalysisEnum); 35 35 36 36 -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp
r9356 r9362 28 28 29 29 /*Fetch parameters: */ 30 iomodel-> parameters->FindParam(&yts,YtsEnum);31 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);32 iomodel-> parameters->FindParam(&ishutter,IshutterEnum);30 iomodel->constants->FindParam(&yts,YtsEnum); 31 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 32 iomodel->constants->FindParam(&ishutter,IshutterEnum); 33 33 34 34 /*Create constraints if they do not exist yet*/ -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp
r9356 r9362 25 25 26 26 /*Fetch parameters: */ 27 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);28 iomodel-> parameters->FindParam(&ishutter,IshutterEnum);27 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 28 iomodel->constants->FindParam(&ishutter,IshutterEnum); 29 29 30 30 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp
r9356 r9362 23 23 iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum); 24 24 iomodel->FetchData(&iomodel->elements_type,NULL,NULL,ElementsTypeEnum); 25 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);26 iomodel-> parameters->FindParam(&ishutter,IshutterEnum);25 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 26 iomodel->constants->FindParam(&ishutter,IshutterEnum); 27 27 28 28 /*Now, is the flag hutter on? otherwise, do nothing: */ -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp
r9356 r9362 24 24 25 25 /*Fetch parameters: */ 26 iomodel-> parameters->FindParam(&dim,DimEnum);27 iomodel-> parameters->FindParam(&yts,YtsEnum);26 iomodel->constants->FindParam(&dim,DimEnum); 27 iomodel->constants->FindParam(&yts,YtsEnum); 28 28 29 29 /*Recover pointer: */ … … 39 39 iomodel->FetchData(&iomodel->spcvz,NULL,NULL,SpcvzEnum); 40 40 iomodel->FetchData(&iomodel->nodeonstokes,NULL,NULL,NodeOnStokesEnum); 41 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);41 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 42 42 43 43 /*Initialize counter*/ -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp
r9356 r9362 25 25 26 26 /*Fetch parameters: */ 27 iomodel-> parameters->FindParam(&dim,DimEnum);28 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);27 iomodel->constants->FindParam(&dim,DimEnum); 28 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 29 29 30 30 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp
r9356 r9362 20 20 21 21 /*Fetch parameters: */ 22 iomodel-> parameters->FindParam(&dim,DimEnum);23 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);22 iomodel->constants->FindParam(&dim,DimEnum); 23 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 24 24 25 25 /*Now, is the model 3d? otherwise, do nothing: */ -
issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
r9356 r9362 42 42 int el1,el2; 43 43 int dim; 44 double* elements=NULL; 45 double* elements2d=NULL; 46 double* riftinfo=NULL; 47 double* penalties=NULL; 44 48 45 49 /*Fetch parameters: */ 46 iomodel-> parameters->FindParam(&dim,DimEnum);47 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);48 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);49 iomodel-> parameters->FindParam(&numberofelements2d,NumberOfElements2DEnum);50 iomodel-> parameters->FindParam(&numberofvertices2d,NumberOfNodes2DEnum);51 iomodel-> parameters->FindParam(&numlayers,NumlayersEnum);52 iomodel-> parameters->FindParam(&numrifts,NumRiftsEnum);50 iomodel->constants->FindParam(&dim,DimEnum); 51 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 52 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 53 iomodel->constants->FindParam(&numberofelements2d,NumberOfElements2DEnum); 54 iomodel->constants->FindParam(&numberofvertices2d,NumberOfNodes2DEnum); 55 iomodel->constants->FindParam(&numlayers,NumlayersEnum); 56 iomodel->constants->FindParam(&numrifts,NumRiftsEnum); 53 57 54 58 /*First, check that partitioning has not yet been carryed out. Just check whether my_elements pointers is not already assigned a value: */ … … 63 67 if(dim==2){ 64 68 /*load elements: */ 65 iomodel->FetchData(& iomodel->elements,NULL,NULL,ElementsEnum);69 iomodel->FetchData(&elements,NULL,NULL,ElementsEnum); 66 70 } 67 71 else{ 68 72 /*load elements2d: */ 69 iomodel->FetchData(& iomodel->elements2d,NULL,NULL,Elements2DEnum);73 iomodel->FetchData(&elements2d,NULL,NULL,Elements2DEnum); 70 74 } 71 75 72 MeshPartitionx(&epart, &npart,numberofelements,numberofvertices, iomodel->elements, numberofelements2d,numberofvertices2d,iomodel->elements2d,numlayers,elements_width, dim,num_procs);76 MeshPartitionx(&epart, &npart,numberofelements,numberofvertices,elements, numberofelements2d,numberofvertices2d,elements2d,numlayers,elements_width, dim,num_procs); 73 77 74 78 /*Free elements and elements2d: */ 75 xfree((void**)& iomodel->elements);76 xfree((void**)& iomodel->elements2d);79 xfree((void**)&elements); 80 xfree((void**)&elements2d); 77 81 78 82 #else … … 82 86 83 87 /*Deal with rifts, they have to be included into one partition only, not several: */ 84 iomodel->FetchData(& iomodel->riftinfo,&numrifts,NULL,RiftinfoEnum);88 iomodel->FetchData(&riftinfo,&numrifts,NULL,RiftinfoEnum); 85 89 86 90 for(i=0;i<numrifts;i++){ 87 el1=(int)*( iomodel->riftinfo+RIFTINFOSIZE*i+2)-1; //matlab indexing to c indexing88 el2=(int)*( iomodel->riftinfo+RIFTINFOSIZE*i+3)-1; //matlab indexing to c indexing91 el1=(int)*(riftinfo+RIFTINFOSIZE*i+2)-1; //matlab indexing to c indexing 92 el2=(int)*(riftinfo+RIFTINFOSIZE*i+3)-1; //matlab indexing to c indexing 89 93 epart[el2]=epart[el1]; //ensures that this pair of elements will be in the same partition, as well as the corresponding vertices; 90 94 } 91 95 92 96 /*Free rifts: */ 93 xfree((void**)& iomodel->riftinfo);97 xfree((void**)&riftinfo); 94 98 95 99 /*Used later on: */ … … 98 102 99 103 /*Start figuring out, out of the partition, which elements belong to this cpu: */ 100 iomodel->FetchData(& iomodel->elements,NULL,NULL,ElementsEnum);104 iomodel->FetchData(&elements,NULL,NULL,ElementsEnum); 101 105 for (i=0;i<numberofelements;i++){ 102 106 … … 110 114 into the vertices coordinates. If we start plugging 1 into my_vertices for each index[n][i] (i=0:2), then my_vertices 111 115 will hold which vertices belong to this partition*/ 112 my_vertices[(int)*( iomodel->elements+elements_width*i+0)-1]=1;113 my_vertices[(int)*( iomodel->elements+elements_width*i+1)-1]=1;114 my_vertices[(int)*( iomodel->elements+elements_width*i+2)-1]=1;116 my_vertices[(int)*(elements+elements_width*i+0)-1]=1; 117 my_vertices[(int)*(elements+elements_width*i+1)-1]=1; 118 my_vertices[(int)*(elements+elements_width*i+2)-1]=1; 115 119 116 120 if(elements_width==6){ 117 my_vertices[(int)*( iomodel->elements+elements_width*i+3)-1]=1;118 my_vertices[(int)*( iomodel->elements+elements_width*i+4)-1]=1;119 my_vertices[(int)*( iomodel->elements+elements_width*i+5)-1]=1;121 my_vertices[(int)*(elements+elements_width*i+3)-1]=1; 122 my_vertices[(int)*(elements+elements_width*i+4)-1]=1; 123 my_vertices[(int)*(elements+elements_width*i+5)-1]=1; 120 124 } 121 125 } 122 126 }//for (i=0;i<numberofelements;i++) 123 127 /*Free data : */ 124 xfree((void**)& iomodel->elements);128 xfree((void**)&elements); 125 129 126 130 /*We might have penalties in which case, some vertices have to be cloned: 127 131 * penpair has 2 nodes that are poointing toward 2 vertices. 128 132 * The 2 vertices must be in the same cpu as the penpair*/ 129 iomodel->FetchData(& iomodel->penalties,&numpenalties,NULL,PenaltiesEnum);133 iomodel->FetchData(&penalties,&numpenalties,NULL,PenaltiesEnum); 130 134 for(i=0;i<numpenalties;i++){ 131 if(my_vertices[(int) iomodel->penalties[2*i+0]-1] && !my_vertices[(int)iomodel->penalties[2*i+1]-1]){132 my_vertices[(int) iomodel->penalties[2*i+1]-1]=2; //to know that these elements are not on the partition135 if(my_vertices[(int)penalties[2*i+0]-1] && !my_vertices[(int)penalties[2*i+1]-1]){ 136 my_vertices[(int)penalties[2*i+1]-1]=2; //to know that these elements are not on the partition 133 137 } 134 138 } 135 xfree((void**)& iomodel->penalties);139 xfree((void**)&penalties); 136 140 137 141 /*Free ressources:*/ -
issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp
r9356 r9362 26 26 27 27 /*Fetch parameters: */ 28 iomodel-> parameters->FindParam(&dim,DimEnum);29 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);30 iomodel-> parameters->FindParam(&heatcapacity,HeatcapacityEnum);31 iomodel-> parameters->FindParam(&referencetemperature,ReferencetemperatureEnum);28 iomodel->constants->FindParam(&dim,DimEnum); 29 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 30 iomodel->constants->FindParam(&heatcapacity,HeatcapacityEnum); 31 iomodel->constants->FindParam(&referencetemperature,ReferencetemperatureEnum); 32 32 33 33 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp
r9356 r9362 24 24 25 25 /*Fetch parameters: */ 26 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);26 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 27 27 28 28 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp
r9356 r9362 20 20 21 21 /*Fetch parameters: */ 22 iomodel-> parameters->FindParam(&dim,DimEnum);23 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);22 iomodel->constants->FindParam(&dim,DimEnum); 23 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 24 24 25 25 /*Now, is the model 3d? otherwise, do nothing: */ -
issm/trunk/src/c/modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp
r9356 r9362 24 24 25 25 /*Fetch parameters: */ 26 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);26 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 27 27 28 28 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp
r9356 r9362 20 20 /*Fetch data needed: */ 21 21 iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum); 22 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);22 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 23 23 24 24 /*Update elements: */ -
issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp
r9356 r9362 22 22 23 23 /*Fetch parameters: */ 24 iomodel-> parameters->FindParam(&dim,DimEnum);25 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);24 iomodel->constants->FindParam(&dim,DimEnum); 25 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 26 26 27 27 /*if 2d: Error*/ -
issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp
r9356 r9362 24 24 25 25 /*Fetch parameters: */ 26 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);26 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 27 27 28 28 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp
r9356 r9362 20 20 21 21 /*Fetch parameters: */ 22 iomodel-> parameters->FindParam(&dim,DimEnum);23 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);22 iomodel->constants->FindParam(&dim,DimEnum); 23 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 24 24 25 25 /*Now, is the model 3d? otherwise, do nothing: */ -
issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
r9356 r9362 37 37 38 38 /*Fetch parameters: */ 39 iomodel-> parameters->FindParam(&dim,DimEnum);40 iomodel-> parameters->FindParam(&verbose,VerboseEnum);39 iomodel->constants->FindParam(&dim,DimEnum); 40 iomodel->constants->FindParam(&verbose,VerboseEnum); 41 41 42 42 SetVerbosityLevel(verbose); -
issm/trunk/src/c/modules/ModelProcessorx/NodesPartitioning.cpp
r9356 r9362 42 42 43 43 /*Fetch parameters: */ 44 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);44 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 45 45 46 46 my_nodes=(bool*)xmalloc(numberofvertices*sizeof(bool)); … … 57 57 58 58 /*Fetch parameters: */ 59 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);59 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 60 60 61 61 /*each element has it own nodes (as many as vertices) + additional nodes from neighbouring elements for each edge. This yields to a very different partition for … … 74 74 int pos; 75 75 int numberofedges; 76 double* edges=NULL; 77 double* elements=NULL; 76 78 77 79 /*Fetch parameters: */ 78 iomodel-> parameters->FindParam(&dim,DimEnum);80 iomodel->constants->FindParam(&dim,DimEnum); 79 81 80 82 /*Build discontinuous node partitioning … … 107 109 108 110 /*Get edges and elements*/ 109 iomodel->FetchData(& iomodel->edges,&numberofedges,&cols,EdgesEnum);110 iomodel->FetchData(& iomodel->elements,NULL,NULL,ElementsEnum);111 iomodel->FetchData(&edges,&numberofedges,&cols,EdgesEnum); 112 iomodel->FetchData(&elements,NULL,NULL,ElementsEnum); 111 113 if (cols!=4) _error_("field edges should have 4 columns"); 112 114 … … 115 117 116 118 /*Get left and right elements*/ 117 e1= iomodel->edges[4*i+2]-1; //edges are [node1 node2 elem1 elem2]118 e2= iomodel->edges[4*i+3]-1; //edges are [node1 node2 elem1 elem2]119 e1=edges[4*i+2]-1; //edges are [node1 node2 elem1 elem2] 120 e2=edges[4*i+3]-1; //edges are [node1 node2 elem1 elem2] 119 121 120 122 /* 1) If the element e1 is in the current partition … … 126 128 127 129 /*1: Get vertices ids*/ 128 i1=(int) iomodel->edges[4*i+0];129 i2=(int) iomodel->edges[4*i+1];130 i1=(int)edges[4*i+0]; 131 i2=(int)edges[4*i+1]; 130 132 131 133 /*2: Get the column where these ids are located in the index*/ 132 134 pos=UNDEF; 133 135 for(j=0;j<3;j++){ 134 if ((int) iomodel->elements[3*(int)e2+j]==i1) pos=j;136 if ((int)elements[3*(int)e2+j]==i1) pos=j; 135 137 } 136 138 … … 156 158 157 159 /*Free data: */ 158 xfree((void**)& iomodel->elements);159 xfree((void**)& iomodel->edges);160 xfree((void**)&elements); 161 xfree((void**)&edges); 160 162 161 163 /*Assign output pointers:*/ -
issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp
r9356 r9362 13 13 14 14 /*Fetch parameters: */ 15 iomodel-> parameters->FindParam(&prognostic_DG,PrognosticDGEnum);15 iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum); 16 16 17 17 /*Output*/ -
issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp
r9356 r9362 26 26 27 27 /*Fetch parameters: */ 28 iomodel-> parameters->FindParam(&prognostic_DG,PrognosticDGEnum);28 iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum); 29 29 30 30 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp
r9356 r9362 30 30 31 31 /*Fetch parameters: */ 32 iomodel-> parameters->FindParam(&dim,DimEnum);33 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);34 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);35 iomodel-> parameters->FindParam(&prognostic_DG,PrognosticDGEnum);32 iomodel->constants->FindParam(&dim,DimEnum); 33 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 34 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 35 iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum); 36 36 37 37 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp
r9356 r9362 21 21 22 22 /*Fetch data needed: */ 23 iomodel-> parameters->FindParam(&dim,DimEnum);23 iomodel->constants->FindParam(&dim,DimEnum); 24 24 iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum); 25 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);26 iomodel-> parameters->FindParam(&prognostic_DG,PrognosticDGEnum);25 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 26 iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum); 27 27 28 28 /*Update elements: */ -
issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp
r9356 r9362 24 24 25 25 /*Fetch parameters: */ 26 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);26 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 27 27 28 28 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp
r9356 r9362 20 20 21 21 /*Fetch data needed: */ 22 iomodel-> parameters->FindParam(&dim,DimEnum);22 iomodel->constants->FindParam(&dim,DimEnum); 23 23 iomodel->FetchData(&iomodel->elements,NULL,NULL,ElementsEnum); 24 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);24 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 25 25 26 26 /*Update elements: */ -
issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp
r9356 r9362 23 23 24 24 /*Fetch parameters: */ 25 iomodel-> parameters->FindParam(&dim,DimEnum);25 iomodel->constants->FindParam(&dim,DimEnum); 26 26 27 27 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
r9356 r9362 26 26 27 27 /*Fetch parameters: */ 28 iomodel-> parameters->FindParam(&dim,DimEnum);29 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);28 iomodel->constants->FindParam(&dim,DimEnum); 29 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 30 30 31 31 /*Create loads if they do not exist yet*/ -
issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp
r9356 r9362 24 24 25 25 /*Fetch parameters: */ 26 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);26 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 27 27 28 28 /*Recover pointer: */ -
issm/trunk/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp
r9356 r9362 21 21 22 22 /*Fetch parameters: */ 23 iomodel-> parameters->FindParam(&dim,DimEnum);24 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);25 iomodel-> parameters->FindParam(&qmu_analysis,QmuAnalysisEnum);23 iomodel->constants->FindParam(&dim,DimEnum); 24 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 25 iomodel->constants->FindParam(&qmu_analysis,QmuAnalysisEnum); 26 26 27 27 /*Now, is the model 3d? otherwise, do nothing: */ -
issm/trunk/src/c/objects/Elements/Penta.cpp
r9356 r9362 57 57 /*Checks in debugging mode*/ 58 58 /*{{{2*/ 59 _assert_(iomodel-> upperelements);60 _assert_(iomodel-> lowerelements);59 _assert_(iomodel->f(UpperelementsEnum)); 60 _assert_(iomodel->f(LowerelementsEnum)); 61 61 /*}}}*/ 62 62 … … 66 66 67 67 /*Build neighbors list*/ 68 if (isnan(iomodel-> upperelements[index])) penta_elements_ids[1]=this->id; //upper penta is the same penta69 else penta_elements_ids[1]=(int)(iomodel-> upperelements[index]);70 if (isnan(iomodel-> lowerelements[index])) penta_elements_ids[0]=this->id; //lower penta is the same penta71 else penta_elements_ids[0]=(int)(iomodel-> lowerelements[index]);68 if (isnan(iomodel->f(UpperelementsEnum)[index])) penta_elements_ids[1]=this->id; //upper penta is the same penta 69 else penta_elements_ids[1]=(int)(iomodel->f(UpperelementsEnum)[index]); 70 if (isnan(iomodel->f(LowerelementsEnum)[index])) penta_elements_ids[0]=this->id; //lower penta is the same penta 71 else penta_elements_ids[0]=(int)(iomodel->f(LowerelementsEnum)[index]); 72 72 this->InitHookNeighbors(penta_elements_ids); 73 73 74 74 /*Build horizontalneighborsids list: */ 75 _assert_(iomodel-> elementconnectivity);76 for(i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel-> elementconnectivity[3*index+i]-1;75 _assert_(iomodel->f(ElementconnectivityEnum)); 76 for(i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel->f(ElementconnectivityEnum)[3*index+i]-1; 77 77 78 78 //this->parameters: we still can't point to it, it may not even exist. Configure will handle this. … … 4859 4859 4860 4860 /*Fetch parameters: */ 4861 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);4862 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);4863 iomodel-> parameters->FindParam(&yts,YtsEnum);4861 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 4862 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 4863 iomodel->constants->FindParam(&yts,YtsEnum); 4864 4864 4865 4865 /*Branch on type of vector: nodal or elementary: */ … … 4868 4868 /*Recover vertices ids needed to initialize inputs*/ 4869 4869 for(i=0;i<6;i++){ 4870 penta_vertex_ids[i]=(int)iomodel-> elements[6*index+i]; //ids for vertices are in the elements array from Matlab4870 penta_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab 4871 4871 } 4872 4872 … … 5168 5168 5169 5169 /*Fetch parameters: */ 5170 iomodel-> parameters->FindParam(&yts,YtsEnum);5171 iomodel-> parameters->FindParam(&control_analysis,ControlAnalysisEnum);5172 iomodel-> parameters->FindParam(&num_control_type,NumControlTypeEnum);5173 iomodel-> parameters->FindParam(&num_cm_responses,NumCmResponsesEnum);5170 iomodel->constants->FindParam(&yts,YtsEnum); 5171 iomodel->constants->FindParam(&control_analysis,ControlAnalysisEnum); 5172 iomodel->constants->FindParam(&num_control_type,NumControlTypeEnum); 5173 iomodel->constants->FindParam(&num_cm_responses,NumCmResponsesEnum); 5174 5174 5175 5175 /*Checks if debuging*/ 5176 5176 /*{{{2*/ 5177 _assert_(iomodel-> elements);5177 _assert_(iomodel->f(ElementEnum)); 5178 5178 /*}}}*/ 5179 5179 5180 5180 /*Recover vertices ids needed to initialize inputs*/ 5181 5181 for(i=0;i<6;i++){ 5182 penta_vertex_ids[i]=(int)iomodel-> elements[6*index+i]; //ids for vertices are in the elements array from Matlab5182 penta_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab 5183 5183 } 5184 5184 5185 5185 5186 5186 /*Control Inputs*/ 5187 if (control_analysis && iomodel-> control_type){5187 if (control_analysis && iomodel->f(ControlTypeEnum)){ 5188 5188 for(i=0;i<num_control_type;i++){ 5189 switch((int)iomodel-> control_type[i]){5189 switch((int)iomodel->f(ControlTypeEnum)[i]){ 5190 5190 case DhdtEnum: 5191 if (iomodel-> dhdt){5192 for(j=0;j<6;j++)nodeinputs[j]=iomodel-> dhdt[penta_vertex_ids[j]-1]/yts;5193 for(j=0;j<6;j++)cmmininputs[j]=iomodel-> cm_min[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;5194 for(j=0;j<6;j++)cmmaxinputs[j]=iomodel-> cm_max[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;5191 if (iomodel->f(DhdtEnum)){ 5192 for(j=0;j<6;j++)nodeinputs[j]=iomodel->f(DhdtEnum)[penta_vertex_ids[j]-1]/yts; 5193 for(j=0;j<6;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts; 5194 for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts; 5195 5195 this->inputs->AddInput(new ControlInput(DhdtEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 5196 5196 } 5197 5197 break; 5198 5198 case VxEnum: 5199 if (iomodel-> vx){5200 for(j=0;j<6;j++)nodeinputs[j]=iomodel-> vx[penta_vertex_ids[j]-1]/yts;5201 for(j=0;j<6;j++)cmmininputs[j]=iomodel-> cm_min[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;5202 for(j=0;j<6;j++)cmmaxinputs[j]=iomodel-> cm_max[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;5199 if (iomodel->f(VxEnum)){ 5200 for(j=0;j<6;j++)nodeinputs[j]=iomodel->f(VxEnum)[penta_vertex_ids[j]-1]/yts; 5201 for(j=0;j<6;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts; 5202 for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts; 5203 5203 this->inputs->AddInput(new ControlInput(VxEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 5204 5204 } 5205 5205 break; 5206 5206 case VyEnum: 5207 if (iomodel-> vy){5208 for(j=0;j<6;j++)nodeinputs[j]=iomodel-> vy[penta_vertex_ids[j]-1]/yts;5209 for(j=0;j<6;j++)cmmininputs[j]=iomodel-> cm_min[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;5210 for(j=0;j<6;j++)cmmaxinputs[j]=iomodel-> cm_max[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;5207 if (iomodel->f(VyEnum)){ 5208 for(j=0;j<6;j++)nodeinputs[j]=iomodel->f(VyEnum)[penta_vertex_ids[j]-1]/yts; 5209 for(j=0;j<6;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts; 5210 for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts; 5211 5211 this->inputs->AddInput(new ControlInput(VyEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 5212 5212 } 5213 5213 break; 5214 5214 case DragCoefficientEnum: 5215 if (iomodel-> drag_coefficient){5216 for(j=0;j<6;j++)nodeinputs[j]=iomodel-> drag_coefficient[penta_vertex_ids[j]-1];5217 for(j=0;j<6;j++)cmmininputs[j]=iomodel-> cm_min[(penta_vertex_ids[j]-1)*num_control_type+i];5218 for(j=0;j<6;j++)cmmaxinputs[j]=iomodel-> cm_max[(penta_vertex_ids[j]-1)*num_control_type+i];5215 if (iomodel->f(DragCoefficientEnum)){ 5216 for(j=0;j<6;j++)nodeinputs[j]=iomodel->f(DragCoefficientEnum)[penta_vertex_ids[j]-1]; 5217 for(j=0;j<6;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]; 5218 for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]; 5219 5219 this->inputs->AddInput(new ControlInput(DragCoefficientEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 5220 5220 } … … 5223 5223 /*Matice will take care of it*/ break; 5224 5224 default: 5225 _error_("Control %s not implemented yet",EnumToStringx((int)iomodel-> control_type[i]));5225 _error_("Control %s not implemented yet",EnumToStringx((int)iomodel->f(ControlTypeEnum)[i])); 5226 5226 } 5227 5227 } … … 5229 5229 5230 5230 //Need to know the type of approximation for this element 5231 if(iomodel-> elements_type){5232 if (*(iomodel-> elements_type+index)==MacAyealApproximationEnum){5231 if(iomodel->f(ElementsTypeEnum)){ 5232 if (*(iomodel->f(ElementsTypeEnum)+index)==MacAyealApproximationEnum){ 5233 5233 this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealApproximationEnum)); 5234 5234 } 5235 else if (*(iomodel-> elements_type+index)==PattynApproximationEnum){5235 else if (*(iomodel->f(ElementsTypeEnum)+index)==PattynApproximationEnum){ 5236 5236 this->inputs->AddInput(new IntInput(ApproximationEnum,PattynApproximationEnum)); 5237 5237 } 5238 else if (*(iomodel-> elements_type+index)==MacAyealPattynApproximationEnum){5238 else if (*(iomodel->f(ElementsTypeEnum)+index)==MacAyealPattynApproximationEnum){ 5239 5239 this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealPattynApproximationEnum)); 5240 5240 } 5241 else if (*(iomodel-> elements_type+index)==HutterApproximationEnum){5241 else if (*(iomodel->f(ElementsTypeEnum)+index)==HutterApproximationEnum){ 5242 5242 this->inputs->AddInput(new IntInput(ApproximationEnum,HutterApproximationEnum)); 5243 5243 } 5244 else if (*(iomodel-> elements_type+index)==StokesApproximationEnum){5244 else if (*(iomodel->f(ElementsTypeEnum)+index)==StokesApproximationEnum){ 5245 5245 this->inputs->AddInput(new IntInput(ApproximationEnum,StokesApproximationEnum)); 5246 5246 } 5247 else if (*(iomodel-> elements_type+index)==MacAyealStokesApproximationEnum){5247 else if (*(iomodel->f(ElementsTypeEnum)+index)==MacAyealStokesApproximationEnum){ 5248 5248 this->inputs->AddInput(new IntInput(ApproximationEnum,MacAyealStokesApproximationEnum)); 5249 5249 } 5250 else if (*(iomodel-> elements_type+index)==PattynStokesApproximationEnum){5250 else if (*(iomodel->f(ElementsTypeEnum)+index)==PattynStokesApproximationEnum){ 5251 5251 this->inputs->AddInput(new IntInput(ApproximationEnum,PattynStokesApproximationEnum)); 5252 5252 } 5253 else if (*(iomodel-> elements_type+index)==NoneApproximationEnum){5253 else if (*(iomodel->f(ElementsTypeEnum)+index)==NoneApproximationEnum){ 5254 5254 this->inputs->AddInput(new IntInput(ApproximationEnum,NoneApproximationEnum)); 5255 5255 } 5256 5256 else{ 5257 _error_("Approximation type %s not supported yet",EnumToStringx((int)*(iomodel-> elements_type+index)));5257 _error_("Approximation type %s not supported yet",EnumToStringx((int)*(iomodel->f(ElementsTypeEnum)+index))); 5258 5258 } 5259 5259 } 5260 5260 5261 5261 /*DatasetInputs*/ 5262 if (iomodel-> weights) {5262 if (iomodel->f(WeightsEnum)) { 5263 5263 5264 5264 /*Create inputs and add to DataSetInput*/ 5265 5265 DatasetInput* datasetinput=new DatasetInput(WeightsEnum); 5266 5266 for(i=0;i<num_cm_responses;i++){ 5267 for(j=0;j<6;j++)nodeinputs[j]=iomodel-> weights[(penta_vertex_ids[j]-1)*num_cm_responses+i];5267 for(j=0;j<6;j++)nodeinputs[j]=iomodel->f(WeightsEnum)[(penta_vertex_ids[j]-1)*num_cm_responses+i]; 5268 5268 datasetinput->inputs->AddObject(new PentaVertexInput(WeightsEnum,nodeinputs)); 5269 5269 } … … 7520 7520 7521 7521 /*Fetch parameters: */ 7522 iomodel-> parameters->FindParam(&yts,YtsEnum);7523 iomodel-> parameters->FindParam(&prognostic_DG,PrognosticDGEnum);7524 iomodel-> parameters->FindParam(&qmu_analysis,QmuAnalysisEnum);7525 iomodel-> parameters->FindParam(&isstokes,IsstokesEnum);7526 iomodel-> parameters->FindParam(&beta,BetaEnum);7527 iomodel-> parameters->FindParam(&heatcapacity,HeatcapacityEnum);7528 iomodel-> parameters->FindParam(&referencetemperature,ReferencetemperatureEnum);7529 iomodel-> parameters->FindParam(&meltingpoint,MeltingpointEnum);7530 iomodel-> parameters->FindParam(&latentheat,LatentheatEnum);7522 iomodel->constants->FindParam(&yts,YtsEnum); 7523 iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum); 7524 iomodel->constants->FindParam(&qmu_analysis,QmuAnalysisEnum); 7525 iomodel->constants->FindParam(&isstokes,IsstokesEnum); 7526 iomodel->constants->FindParam(&beta,BetaEnum); 7527 iomodel->constants->FindParam(&heatcapacity,HeatcapacityEnum); 7528 iomodel->constants->FindParam(&referencetemperature,ReferencetemperatureEnum); 7529 iomodel->constants->FindParam(&meltingpoint,MeltingpointEnum); 7530 iomodel->constants->FindParam(&latentheat,LatentheatEnum); 7531 7531 7532 7532 7533 7533 /*Checks if debuging*/ 7534 7534 /*{{{2*/ 7535 _assert_(iomodel-> elements);7535 _assert_(iomodel->f(ElementsEnum)); 7536 7536 /*}}}*/ 7537 7537 … … 7548 7548 7549 7549 /*Recover vertices ids needed to initialize inputs*/ 7550 for(i=0;i<6;i++) penta_vertex_ids[i]=(int)iomodel-> elements[6*index+i]; //ids for vertices are in the elements array from Matlab7550 for(i=0;i<6;i++) penta_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab 7551 7551 7552 7552 /*Recover nodes ids needed to initialize the node hook.*/ … … 7554 7554 //go recover node ids, needed to initialize the node hook. 7555 7555 //WARNING: We assume P1 elements here!!!!! 7556 penta_node_ids[i]=iomodel->nodecounter+(int)iomodel-> elements[6*index+i]; //ids for vertices are in the elements array from Matlab7556 penta_node_ids[i]=iomodel->nodecounter+(int)iomodel->f(ElementsEnum)[6*index+i]; //ids for vertices are in the elements array from Matlab 7557 7557 } 7558 7558 … … 7569 7569 7570 7570 /*default vx,vy and vz: either observation or 0 */ 7571 if(!iomodel-> vx){7572 if (iomodel-> vx_obs) for(i=0;i<6;i++)nodeinputs[i]=iomodel->vx_obs[penta_vertex_ids[i]-1]/yts;7571 if(!iomodel->f(VxEnum)){ 7572 if (iomodel->f(VxObsEnum)) for(i=0;i<6;i++)nodeinputs[i]=iomodel->f(VxObsEnum)[penta_vertex_ids[i]-1]/yts; 7573 7573 else for(i=0;i<6;i++)nodeinputs[i]=0; 7574 7574 this->inputs->AddInput(new PentaVertexInput(VxEnum,nodeinputs)); … … 7576 7576 if(qmu_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVxEnum,nodeinputs)); 7577 7577 } 7578 if(!iomodel-> vy){7579 if (iomodel-> vy_obs) for(i=0;i<6;i++)nodeinputs[i]=iomodel->vy_obs[penta_vertex_ids[i]-1]/yts;7578 if(!iomodel->f(VyEnum)){ 7579 if (iomodel->f(VyObsEnum)) for(i=0;i<6;i++)nodeinputs[i]=iomodel->f(VyObsEnum)[penta_vertex_ids[i]-1]/yts; 7580 7580 else for(i=0;i<6;i++)nodeinputs[i]=0; 7581 7581 this->inputs->AddInput(new PentaVertexInput(VyEnum,nodeinputs)); … … 7583 7583 if(qmu_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVyEnum,nodeinputs)); 7584 7584 } 7585 if(!iomodel-> vz){7586 if (iomodel-> vz_obs) for(i=0;i<6;i++)nodeinputs[i]=iomodel->vz_obs[penta_vertex_ids[i]-1]/yts;7585 if(!iomodel->f(VzEnum)){ 7586 if (iomodel->f(VzObsEnum)) for(i=0;i<6;i++)nodeinputs[i]=iomodel->f(VzObsEnum)[penta_vertex_ids[i]-1]/yts; 7587 7587 else for(i=0;i<6;i++)nodeinputs[i]=0; 7588 7588 this->inputs->AddInput(new PentaVertexInput(VzEnum,nodeinputs)); … … 7590 7590 if(qmu_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVzEnum,nodeinputs)); 7591 7591 } 7592 if(!iomodel-> pressure){7592 if(!iomodel->f(PressureEnum)){ 7593 7593 for(i=0;i<6;i++)nodeinputs[i]=0; 7594 7594 if(qmu_analysis){ … … 7601 7601 } 7602 7602 } 7603 if(*(iomodel-> elements_type+index)==PattynStokesApproximationEnum){7603 if(*(iomodel->f(ElementsTypeEnum)+index)==PattynStokesApproximationEnum){ 7604 7604 /*Create VzPattyn and VzStokes Enums*/ 7605 if(iomodel-> vz && iomodel->nodeonstokes){7606 for(i=0;i<6;i++) nodeinputs[i]=iomodel-> vz[penta_vertex_ids[i]-1]/yts*iomodel->nodeonstokes[penta_vertex_ids[i]-1];7605 if(iomodel->f(VzEnum) && iomodel->f(NodeOnStokesEnum)){ 7606 for(i=0;i<6;i++) nodeinputs[i]=iomodel->f(VzEnum)[penta_vertex_ids[i]-1]/yts*iomodel->f(NodeOnStokesEnum)[penta_vertex_ids[i]-1]; 7607 7607 this->inputs->AddInput(new PentaVertexInput(VzStokesEnum,nodeinputs)); 7608 for(i=0;i<6;i++) nodeinputs[i]=iomodel-> vz[penta_vertex_ids[i]-1]/yts*(1-iomodel->nodeonstokes[penta_vertex_ids[i]-1]);7608 for(i=0;i<6;i++) nodeinputs[i]=iomodel->f(VzEnum)[penta_vertex_ids[i]-1]/yts*(1-iomodel->f(NodeOnStokesEnum)[penta_vertex_ids[i]-1]); 7609 7609 this->inputs->AddInput(new PentaVertexInput(VzPattynEnum,nodeinputs)); 7610 7610 } … … 7615 7615 } 7616 7616 } 7617 if(*(iomodel-> elements_type+index)==MacAyealStokesApproximationEnum){7617 if(*(iomodel->f(ElementsTypeEnum)+index)==MacAyealStokesApproximationEnum){ 7618 7618 /*Create VzMacAyeal and VzStokes Enums*/ 7619 if(iomodel-> vz && iomodel->nodeonstokes){7620 for(i=0;i<6;i++) nodeinputs[i]=iomodel-> vz[penta_vertex_ids[i]-1]/yts*iomodel->nodeonstokes[penta_vertex_ids[i]-1];7619 if(iomodel->f(VzEnum) && iomodel->f(NodeOnStokesEnum)){ 7620 for(i=0;i<6;i++) nodeinputs[i]=iomodel->f(VzEnum)[penta_vertex_ids[i]-1]/yts*iomodel->f(NodeOnStokesEnum)[penta_vertex_ids[i]-1]; 7621 7621 this->inputs->AddInput(new PentaVertexInput(VzStokesEnum,nodeinputs)); 7622 for(i=0;i<6;i++) nodeinputs[i]=iomodel-> vz[penta_vertex_ids[i]-1]/yts*(1-iomodel->nodeonstokes[penta_vertex_ids[i]-1]);7622 for(i=0;i<6;i++) nodeinputs[i]=iomodel->f(VzEnum)[penta_vertex_ids[i]-1]/yts*(1-iomodel->f(NodeOnStokesEnum)[penta_vertex_ids[i]-1]); 7623 7623 this->inputs->AddInput(new PentaVertexInput(VzMacAyealEnum,nodeinputs)); 7624 7624 } … … 7645 7645 this->inputs->AddInput(new PentaVertexInput(VyMeshEnum,nodeinputs)); 7646 7646 this->inputs->AddInput(new PentaVertexInput(VzMeshEnum,nodeinputs)); 7647 if (iomodel-> temperature && iomodel->waterfraction) {7647 if (iomodel->f(TemperatureEnum) && iomodel->f(WaterfractionEnum)) { 7648 7648 for(i=0;i<6;i++){ 7649 if(iomodel-> temperature[penta_vertex_ids[i]-1] < meltingpoint-beta*iomodel->pressure[penta_vertex_ids[i]-1]){7650 nodeinputs[i]=heatcapacity*(iomodel-> temperature[penta_vertex_ids[i]-1]-referencetemperature);7649 if(iomodel->f(TemperatureEnum)[penta_vertex_ids[i]-1] < meltingpoint-beta*iomodel->f(PressureEnum)[penta_vertex_ids[i]-1]){ 7650 nodeinputs[i]=heatcapacity*(iomodel->f(TemperatureEnum)[penta_vertex_ids[i]-1]-referencetemperature); 7651 7651 } 7652 7652 else nodeinputs[i]=heatcapacity* 7653 (meltingpoint-beta*iomodel-> pressure[penta_vertex_ids[i]-1]-referencetemperature)7654 +latentheat*iomodel-> waterfraction[penta_vertex_ids[i]-1];7653 (meltingpoint-beta*iomodel->f(PressureEnum)[penta_vertex_ids[i]-1]-referencetemperature) 7654 +latentheat*iomodel->f(WaterfractionEnum)[penta_vertex_ids[i]-1]; 7655 7655 } 7656 7656 this->inputs->AddInput(new PentaVertexInput(EnthalpyEnum,nodeinputs)); -
issm/trunk/src/c/objects/Elements/PentaHook.cpp
r9356 r9362 51 51 52 52 /*retrieve parameters: */ 53 iomodel-> parameters->FindParam(&matpar_id,NumberOfElementsEnum); matpar_id++;53 iomodel->constants->FindParam(&matpar_id,NumberOfElementsEnum); matpar_id++; 54 54 55 55 this->numanalyses=in_numanalyses; -
issm/trunk/src/c/objects/Elements/Tria.cpp
r9356 r9362 52 52 53 53 /*Build horizontalneighborsids list: */ 54 _assert_(iomodel-> elementconnectivity);54 _assert_(iomodel->f(ElementconnectivityEnum)); 55 55 //for (i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel->elementconnectivity[3*index+i]-1; 56 56 … … 3279 3279 /*Checks if debuging*/ 3280 3280 /*{{{2*/ 3281 _assert_(iomodel-> elements);3281 _assert_(iomodel->f(ElementEnum)); 3282 3282 /*}}}*/ 3283 3283 3284 3284 /*Get parameters: */ 3285 iomodel-> parameters->FindParam(&control_analysis,ControlAnalysisEnum);3286 iomodel-> parameters->FindParam(&num_control_type,NumControlTypeEnum);3287 iomodel-> parameters->FindParam(&yts,YtsEnum);3288 iomodel-> parameters->FindParam(&num_cm_responses,NumCmResponsesEnum);3285 iomodel->constants->FindParam(&control_analysis,ControlAnalysisEnum); 3286 iomodel->constants->FindParam(&num_control_type,NumControlTypeEnum); 3287 iomodel->constants->FindParam(&yts,YtsEnum); 3288 iomodel->constants->FindParam(&num_cm_responses,NumCmResponsesEnum); 3289 3289 3290 3290 /*Recover vertices ids needed to initialize inputs*/ 3291 3291 for(i=0;i<3;i++){ 3292 tria_vertex_ids[i]=(int)iomodel-> elements[3*index+i]; //ids for vertices are in the elements array from Matlab3292 tria_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab 3293 3293 } 3294 3294 3295 3295 /*Control Inputs*/ 3296 if (control_analysis && iomodel-> control_type){3296 if (control_analysis && iomodel->f(ControlTypeEnum)){ 3297 3297 for(i=0;i<num_control_type;i++){ 3298 switch((int)iomodel-> control_type[i]){3298 switch((int)iomodel->f(ControlTypeEnum)[i]){ 3299 3299 case DhdtEnum: 3300 if (iomodel-> dhdt){3301 for(j=0;j<3;j++)nodeinputs[j]=iomodel-> dhdt[tria_vertex_ids[j]-1]/yts;3302 for(j=0;j<3;j++)cmmininputs[j]=iomodel-> cm_min[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;3303 for(j=0;j<3;j++)cmmaxinputs[j]=iomodel-> cm_max[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;3300 if (iomodel->f(DhdtEnum)){ 3301 for(j=0;j<3;j++)nodeinputs[j]=iomodel->f(DhdtEnum)[tria_vertex_ids[j]-1]/yts; 3302 for(j=0;j<3;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts; 3303 for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts; 3304 3304 this->inputs->AddInput(new ControlInput(DhdtEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 3305 3305 } 3306 3306 break; 3307 3307 case VxEnum: 3308 if (iomodel-> vx){3309 for(j=0;j<3;j++)nodeinputs[j]=iomodel-> vx[tria_vertex_ids[j]-1]/yts;3310 for(j=0;j<3;j++)cmmininputs[j]=iomodel-> cm_min[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;3311 for(j=0;j<3;j++)cmmaxinputs[j]=iomodel-> cm_max[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;3308 if (iomodel->f(VxEnum)){ 3309 for(j=0;j<3;j++)nodeinputs[j]=iomodel->f(VxEnum)[tria_vertex_ids[j]-1]/yts; 3310 for(j=0;j<3;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts; 3311 for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts; 3312 3312 this->inputs->AddInput(new ControlInput(VxEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 3313 3313 } 3314 3314 break; 3315 3315 case VyEnum: 3316 if (iomodel-> vy){3317 for(j=0;j<3;j++)nodeinputs[j]=iomodel-> vy[tria_vertex_ids[j]-1]/yts;3318 for(j=0;j<3;j++)cmmininputs[j]=iomodel-> cm_min[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;3319 for(j=0;j<3;j++)cmmaxinputs[j]=iomodel-> cm_max[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;3316 if (iomodel->f(VyEnum)){ 3317 for(j=0;j<3;j++)nodeinputs[j]=iomodel->f(VyEnum)[tria_vertex_ids[j]-1]/yts; 3318 for(j=0;j<3;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts; 3319 for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts; 3320 3320 this->inputs->AddInput(new ControlInput(VyEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 3321 3321 } 3322 3322 break; 3323 3323 case DragCoefficientEnum: 3324 if (iomodel-> drag_coefficient){3325 for(j=0;j<3;j++)nodeinputs[j]=iomodel-> drag_coefficient[tria_vertex_ids[j]-1];3326 for(j=0;j<3;j++)cmmininputs[j]=iomodel-> cm_min[(tria_vertex_ids[j]-1)*num_control_type+i];3327 for(j=0;j<3;j++)cmmaxinputs[j]=iomodel-> cm_max[(tria_vertex_ids[j]-1)*num_control_type+i];3324 if (iomodel->f(DragCoefficientEnum)){ 3325 for(j=0;j<3;j++)nodeinputs[j]=iomodel->f(DragCoefficientEnum)[tria_vertex_ids[j]-1]; 3326 for(j=0;j<3;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]; 3327 for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]; 3328 3328 this->inputs->AddInput(new ControlInput(DragCoefficientEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 3329 3329 } … … 3332 3332 /*Matice will take care of it*/ break; 3333 3333 default: 3334 _error_("Control %s not implemented yet",EnumToStringx((int)iomodel-> control_type[i]));3334 _error_("Control %s not implemented yet",EnumToStringx((int)iomodel->f(ControlTypeEnum)[i])); 3335 3335 } 3336 3336 } … … 3338 3338 3339 3339 /*DatasetInputs*/ 3340 if (iomodel-> weights) {3340 if (iomodel->f(WeightsEnum)) { 3341 3341 3342 3342 /*Create inputs and add to DataSetInput*/ 3343 3343 DatasetInput* datasetinput=new DatasetInput(WeightsEnum); 3344 3344 for(i=0;i<num_cm_responses;i++){ 3345 for(j=0;j<3;j++)nodeinputs[j]=iomodel-> weights[(tria_vertex_ids[j]-1)*num_cm_responses+i];3345 for(j=0;j<3;j++)nodeinputs[j]=iomodel->f(WeightsEnum)[(tria_vertex_ids[j]-1)*num_cm_responses+i]; 3346 3346 datasetinput->inputs->AddObject(new TriaVertexInput(WeightsEnum,nodeinputs)); 3347 3347 } … … 3910 3910 3911 3911 /*Fetch parameters: */ 3912 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);3913 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);3914 iomodel-> parameters->FindParam(&yts,YtsEnum);3912 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 3913 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 3914 iomodel->constants->FindParam(&yts,YtsEnum); 3915 3915 3916 3916 /*Branch on type of vector: nodal or elementary: */ … … 3919 3919 /*Recover vertices ids needed to initialize inputs*/ 3920 3920 for(i=0;i<3;i++){ 3921 tria_vertex_ids[i]=(int)iomodel-> elements[3*index+i]; //ids for vertices are in the elements array from Matlab3921 tria_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab 3922 3922 } 3923 3923 … … 5227 5227 /*Checks if debuging*/ 5228 5228 /*{{{2*/ 5229 _assert_(iomodel-> elements);5229 _assert_(iomodel->f(ElementsEnum)); 5230 5230 /*}}}*/ 5231 5231 5232 5232 /*Fetch parameters: */ 5233 iomodel-> parameters->FindParam(&yts,YtsEnum);5234 iomodel-> parameters->FindParam(&prognostic_DG,PrognosticDGEnum);5235 iomodel-> parameters->FindParam(&qmu_analysis,QmuAnalysisEnum);5233 iomodel->constants->FindParam(&yts,YtsEnum); 5234 iomodel->constants->FindParam(&prognostic_DG,PrognosticDGEnum); 5235 iomodel->constants->FindParam(&qmu_analysis,QmuAnalysisEnum); 5236 5236 5237 5237 /*Recover element type*/ … … 5248 5248 /*Recover vertices ids needed to initialize inputs*/ 5249 5249 for(i=0;i<3;i++){ 5250 tria_vertex_ids[i]=(int)iomodel-> elements[3*index+i]; //ids for vertices are in the elements array from Matlab5250 tria_vertex_ids[i]=(int)iomodel->f(ElementsEnum)[3*index+i]; //ids for vertices are in the elements array from Matlab 5251 5251 } 5252 5252 … … 5261 5261 /*Continuous Galerkin*/ 5262 5262 for(i=0;i<3;i++){ 5263 tria_node_ids[i]=iomodel->nodecounter+(int)*(iomodel-> elements+3*index+i); //ids for vertices are in the elements array from Matlab5263 tria_node_ids[i]=iomodel->nodecounter+(int)*(iomodel->f(ElementsEnum)+3*index+i); //ids for vertices are in the elements array from Matlab 5264 5264 } 5265 5265 } … … 5277 5277 5278 5278 /*default vx,vy and vz: either observation or 0 */ 5279 if(!iomodel-> vx){5280 if (iomodel-> vx_obs) for(i=0;i<3;i++)nodeinputs[i]=iomodel->vx_obs[tria_vertex_ids[i]-1]/yts;5279 if(!iomodel->f(VxEnum)){ 5280 if (iomodel->f(VxObsEnum)) for(i=0;i<3;i++)nodeinputs[i]=iomodel->f(VxObsEnum)[tria_vertex_ids[i]-1]/yts; 5281 5281 else for(i=0;i<3;i++)nodeinputs[i]=0; 5282 5282 this->inputs->AddInput(new TriaVertexInput(VxEnum,nodeinputs)); … … 5284 5284 if(qmu_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVxEnum,nodeinputs)); 5285 5285 } 5286 if(!iomodel-> vy){5287 if (iomodel-> vy_obs) for(i=0;i<3;i++)nodeinputs[i]=iomodel->vy_obs[tria_vertex_ids[i]-1]/yts;5286 if(!iomodel->f(VyEnum)){ 5287 if (iomodel->f(VyObsEnum)) for(i=0;i<3;i++)nodeinputs[i]=iomodel->f(VyObsEnum)[tria_vertex_ids[i]-1]/yts; 5288 5288 else for(i=0;i<3;i++)nodeinputs[i]=0; 5289 5289 this->inputs->AddInput(new TriaVertexInput(VyEnum,nodeinputs)); … … 5291 5291 if(qmu_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVyEnum,nodeinputs)); 5292 5292 } 5293 if(!iomodel-> vz){5294 if (iomodel-> vz_obs) for(i=0;i<3;i++)nodeinputs[i]=iomodel->vz_obs[tria_vertex_ids[i]-1]/yts;5293 if(!iomodel->f(VzEnum)){ 5294 if (iomodel->f(VzObsEnum)) for(i=0;i<3;i++)nodeinputs[i]=iomodel->f(VzObsEnum)[tria_vertex_ids[i]-1]/yts; 5295 5295 else for(i=0;i<3;i++)nodeinputs[i]=0; 5296 5296 this->inputs->AddInput(new TriaVertexInput(VzEnum,nodeinputs)); … … 5298 5298 if(qmu_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVzEnum,nodeinputs)); 5299 5299 } 5300 if(!iomodel-> pressure){5300 if(!iomodel->f(PressureEnum)){ 5301 5301 for(i=0;i<3;i++)nodeinputs[i]=0; 5302 5302 if(qmu_analysis){ -
issm/trunk/src/c/objects/Elements/TriaHook.cpp
r9356 r9362 49 49 50 50 /*retrieve parameters: */ 51 iomodel-> parameters->FindParam(&matpar_id,NumberOfElementsEnum); matpar_id++;51 iomodel->constants->FindParam(&matpar_id,NumberOfElementsEnum); matpar_id++; 52 52 53 53 this->numanalyses=in_numanalyses; -
issm/trunk/src/c/objects/IoModel.cpp
r9356 r9362 12 12 #include <string.h> 13 13 #include <stdio.h> 14 #include <stdlib.h> 15 #include <stdarg.h> 16 14 17 #include "./objects.h" 15 18 #include "./Container/Parameters.h" … … 21 24 IoModel::IoModel(){ 22 25 this->fid=NULL; 23 this->parameters=NULL; 24 } 25 /*}}}*/ 26 /*FUNCTION IoModel::IoModel(FILE* iomodel_handle){{{1*/ 27 IoModel::IoModel(FILE* iomodel_handle){ 28 29 int i,j; 30 31 /*First, keep track of the file handle: */ 32 this->fid=iomodel_handle; 33 34 /*Initialize and read parameters:*/ 35 this->parameters=new Parameters(); 36 this->FetchParameters(this->parameters); /*this routine goes through the input file, and fetches bools, ints, doubles and strings only, nothing memory intensive*/ 37 38 /*Initialize the structure: */ 39 this->IoModelInit(); 40 41 } 42 /*}}}*/ 43 /*FUNCTION IoModel::~IoModel(){{{1*/ 44 IoModel::~IoModel(){ 45 46 int i; 47 48 /*!Two cases here: 49 * - serial mode: matlab's memory manager will take care of delete iomodel when returning from Imp. Do nothing here, so as not to confuse 50 * the memory manager. 51 * - in parallel, anything the io layer does (FetchData) did needs to be erased explicitely in the iomodel. 52 */ 53 54 #ifdef _PARALLEL_ 55 xfree((void**)&this->x); 56 xfree((void**)&this->y); 57 xfree((void**)&this->z); 58 xfree((void**)&this->elements); 59 xfree((void**)&this->elementconnectivity); 60 xfree((void**)&this->elements_type); 61 xfree((void**)&this->vertices_type); 62 xfree((void**)&this->nodeonhutter); 63 xfree((void**)&this->nodeonmacayeal); 64 xfree((void**)&this->elements2d); 65 xfree((void**)&this->upperelements); 66 xfree((void**)&this->lowerelements); 67 xfree((void**)&this->nodeonpattyn); 68 xfree((void**)&this->elementonbed); 69 xfree((void**)&this->elementonsurface); 70 xfree((void**)&this->nodeonbed); 71 xfree((void**)&this->nodeonsurface); 72 xfree((void**)&this->nodeonstokes); 73 xfree((void**)&this->borderstokes); 74 xfree((void**)&this->thickness_obs); 75 xfree((void**)&this->thickness_coeff); 76 xfree((void**)&this->thickness); 77 xfree((void**)&this->surface); 78 xfree((void**)&this->bed); 79 xfree((void**)&this->bathymetry); 80 xfree((void**)&this->vx_obs); 81 xfree((void**)&this->vy_obs); 82 xfree((void**)&this->vz_obs); 83 xfree((void**)&this->vx); 84 xfree((void**)&this->vy); 85 xfree((void**)&this->vz); 86 xfree((void**)&this->pressure); 87 xfree((void**)&this->temperature); 88 xfree((void**)&this->waterfraction); 89 xfree((void**)&this->drag_coefficient); 90 xfree((void**)&this->drag_p); 91 xfree((void**)&this->drag_q); 92 xfree((void**)&this->elementoniceshelf); 93 xfree((void**)&this->elementonwater); 94 xfree((void**)&this->nodeonicesheet); 95 xfree((void**)&this->nodeoniceshelf); 96 xfree((void**)&this->nodeonwater); 97 xfree((void**)&this->pressureload); 98 xfree((void**)&this->spcvx); 99 xfree((void**)&this->spcvy); 100 xfree((void**)&this->spcvz); 101 xfree((void**)&this->spcthickness); 102 xfree((void**)&this->spcwatercolumn); 103 xfree((void**)&this->spctemperature); 104 xfree((void**)&this->diagnostic_ref); 105 xfree((void**)&this->edges); 106 xfree((void**)&this->geothermalflux); 107 xfree((void**)&this->basal_melting_rate); 108 xfree((void**)&this->watercolumn); 109 xfree((void**)&this->basal_melting_rate_correction); 110 xfree((void**)&this->surface_accumulation_rate); 111 xfree((void**)&this->surface_ablation_rate); 112 xfree((void**)&this->surface_mass_balance); 113 xfree((void**)&this->dhdt); 114 xfree((void**)&this->rheology_B); 115 xfree((void**)&this->rheology_n); 116 xfree((void**)&this->control_type); 117 xfree((void**)&this->cm_responses); 118 xfree((void**)&this->weights); 119 xfree((void**)&this->cm_jump); 120 xfree((void**)&this->cm_min); 121 xfree((void**)&this->cm_max); 122 xfree((void**)&this->optscal); 123 xfree((void**)&this->maxiter); 124 125 126 /*!Delete structure fields: */ 127 xfree((void**)&this->riftinfo); 128 xfree((void**)&this->penalties); 129 130 /*exterior data: */ 131 xfree((void**)&this->my_elements); 132 xfree((void**)&this->my_vertices); 133 xfree((void**)&this->my_nodes); 134 xfree((void**)&this->singlenodetoelementconnectivity); 135 xfree((void**)&this->numbernodetoelementconnectivity); 136 #endif 137 } 138 /*}}}*/ 139 /*FUNCTION IoModel::IoModelInit{{{1*/ 140 void IoModel::IoModelInit(void){ 141 142 /*exterior data: */ 26 this->constants=NULL; 27 28 this->my_elements=NULL; 29 this->my_nodes=NULL; 30 this->my_vertices=NULL; 31 this->singlenodetoelementconnectivity=NULL; 32 this->numbernodetoelementconnectivity=NULL; 33 143 34 this->nodecounter=0; 144 35 this->loadcounter=0; 145 36 this->constraintcounter=0; 146 147 /*!initialize all pointers to 0: */ 148 this->x=NULL; 149 this->y=NULL; 150 this->z=NULL; 151 this->elements=NULL; 152 this->elementconnectivity=NULL; 153 this->elements_type=NULL; 154 this->vertices_type=NULL; 155 this->elements2d=NULL; 156 this->upperelements=NULL; 157 this->lowerelements=NULL; 158 this->nodeonhutter=NULL; 159 this->nodeonmacayeal=NULL; 160 this->nodeonpattyn=NULL; 161 162 this->vx_obs=NULL; 163 this->vy_obs=NULL; 164 this->vz_obs=NULL; 165 this->vx=NULL; 166 this->vy=NULL; 167 this->vz=NULL; 168 this->pressure=NULL; 169 this->temperature=NULL; 170 this->waterfraction=NULL; 171 this->basal_melting_rate=NULL; 172 this->watercolumn=NULL; 173 this->basal_melting_rate_correction=NULL; 174 this->geothermalflux=NULL; 175 this->elementonbed=NULL; 176 this->elementonsurface=NULL; 177 this->nodeonbed=NULL; 178 this->nodeonsurface=NULL; 179 this->nodeonstokes=NULL; 180 this->borderstokes=NULL; 181 this->thickness_obs=NULL; 182 this->thickness_coeff=NULL; 183 this->thickness=NULL; 184 this->surface=NULL; 185 this->bed=NULL; 186 this->bathymetry=NULL; 187 this->elementoniceshelf=NULL; 188 this->elementonwater=NULL; 189 this->nodeonicesheet=NULL; 190 this->nodeoniceshelf=NULL; 191 this->nodeonwater=NULL; 192 193 this->drag_coefficient=NULL; 194 this->drag_p=NULL; 195 this->drag_q=NULL; 196 197 198 this->pressureload=NULL; 199 this-> spcvx=NULL; 200 this-> spcvy=NULL; 201 this-> spcvz=NULL; 202 this-> spctemperature=NULL; 203 this-> spcthickness=NULL; 204 this-> spcwatercolumn=NULL; 205 this-> diagnostic_ref=NULL; 206 this->edges=NULL; 207 208 /*!materials: */ 209 this->rheology_n=NULL; 210 this->rheology_B=NULL; 211 212 /*!solution parameters: */ 213 this->control_type=NULL; 214 this->cm_responses=NULL; 215 this->weights=NULL; 216 this->cm_jump=NULL; 217 this->maxiter=NULL; 218 this->cm_min=NULL; 219 this->cm_max=NULL; 220 this->optscal=NULL; 221 222 this->riftinfo=NULL; 223 224 /*!penalties: */ 225 this->penalties=NULL; 226 227 /*!surface: */ 228 this->surface_mass_balance=NULL; 229 this->surface_accumulation_rate=NULL; 230 this->surface_ablation_rate=NULL; 231 this->dhdt=NULL; 232 233 /*exterior data: */ 37 38 } 39 /*}}}*/ 40 /*FUNCTION IoModel::IoModel(FILE* iomodel_handle){{{1*/ 41 IoModel::IoModel(FILE* iomodel_handle){ 42 43 /*First, keep track of the file handle: */ 44 this->fid=iomodel_handle; 45 46 /*Initialize and read constants:*/ 47 this->constants=new Parameters(); 48 this->FetchParameters(this->constants); /*this routine goes through the input file, and fetches bools, ints, doubles and strings only, nothing memory intensive*/ 49 50 /*Initialize data: */ 51 this->data=new Parameters(); 52 53 /*Initialize permanent data: */ 234 54 this->my_elements=NULL; 55 this->my_nodes=NULL; 235 56 this->my_vertices=NULL; 236 this->my_nodes=NULL;237 57 this->singlenodetoelementconnectivity=NULL; 238 58 this->numbernodetoelementconnectivity=NULL; 59 60 this->nodecounter=0; 61 this->loadcounter=0; 62 this->constraintcounter=0; 63 64 65 } 66 /*}}}*/ 67 /*FUNCTION IoModel::~IoModel(){{{1*/ 68 IoModel::~IoModel(){ 69 70 delete this->constants; 71 delete this->data; 72 73 xfree((void**)&this->my_elements); 74 xfree((void**)&this->my_nodes); 75 xfree((void**)&this->my_vertices); 76 xfree((void**)&this->singlenodetoelementconnectivity); 77 xfree((void**)&this->numbernodetoelementconnectivity); 239 78 } 240 79 /*}}}*/ … … 638 477 *pndims=ndims; 639 478 *pnumrecords=numrecords; 479 } 480 /*}}}*/ 481 /*FUNCTION IoModel::FetchData(int num,...){{{1*/ 482 void IoModel::FetchData(int num,...){ 483 484 485 va_list ap; 486 int dataenum; 487 double* matrix=NULL; 488 int M,N; 489 int i; 490 491 /*Go through the entire list of enums and fetch the corresponding data. Add it to the iomodel->data dataset. Everything 492 *we fetch is a double* : */ 493 494 va_start(ap,num); 495 496 for(i = 0; i <num; i++){ 497 498 dataenum=va_arg(ap, int); 499 this->FetchData(&matrix,&M,&N,dataenum); 500 501 /*Add to this->data: */ 502 this->data->AddObject(new DoubleMatParam(dataenum,matrix,M,N)); 503 504 /*Free ressources:*/ 505 xfree((void**)&matrix); 506 } 507 va_end(ap); 508 509 } 510 /*}}}*/ 511 /*FUNCTION IoModel::DeleteData(int num,...){{{1*/ 512 void IoModel::DeleteData(int num,...){ 513 514 515 va_list ap; 516 int dataenum; 517 int i; 518 DoubleMatParam* parameter=NULL; 519 520 /*Go through the entire list of enums and delete the corresponding data from the iomodel-data dataset: */ 521 522 va_start(ap,num); 523 524 for(i = 0; i <num; i++){ 525 526 dataenum=va_arg(ap, int); 527 528 parameter=(DoubleMatParam*)this->data->FindParamObject(dataenum); 529 if(parameter){ 530 this->data->DeleteObject((Object*)parameter); 531 } 532 else{ 533 /*do nothing, we did not find the data, but this is no reason to error out: */ 534 } 535 } 536 va_end(ap); 537 538 } 539 /*}}}*/ 540 /*FUNCTION IoModel::get(int dataenum){{{1*/ 541 double* IoModel::f(int dataenum){ 542 543 DoubleMatParam* parameter=NULL; 544 545 parameter=(DoubleMatParam*)this->data->FindParamObject(dataenum); 546 547 if (parameter==NULL)return NULL; //might be legitimate 548 else{ 549 return parameter->GetPointer(); 550 } 640 551 } 641 552 /*}}}*/ … … 935 846 936 847 /*Fetch parameters: */ 937 this-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);848 this->constants->FindParam(&numberofelements,NumberOfElementsEnum); 938 849 939 850 /*First of, find the record for the enum, and get code of data type: */ -
issm/trunk/src/c/objects/IoModel.h
r9356 r9362 12 12 13 13 class Elements; 14 15 14 16 class IoModel { 15 17 … … 18 20 19 21 public: 20 Parameters* parameters; //this dataset holds all double, int, bool and char* parameters read in from the input file.*21 /*Data: {{{1*/22 Parameters* constants; //this dataset holds all double, int, bool and char* parameters read in from the input file.* 23 Parameters* data; //this dataset holds temporary data, memory intensive. 22 24 23 int nodecounter; //keep track of how many nodes are being created in each analysis type 24 int loadcounter; //keep track of how many loads are being created in each analysis type 25 int constraintcounter; //keep track of how many constraints are being created in each analysis type 26 27 /*2d mesh: */ 28 double* x; 29 double* y; 30 double* z; 31 double* elements; 32 double* elements_type; 33 double* vertices_type; 34 double* elementconnectivity; 35 36 /*3d mesh: */ 37 double* elements2d; 38 double* upperelements; 39 double* lowerelements; 40 41 /*elements type: */ 42 double* nodeonhutter; 43 double* nodeonmacayeal; 44 double* nodeonpattyn; 45 46 /*results: */ 47 double* vx; 48 double* vy; 49 double* vz; 50 double* pressure; 51 double* temperature; 52 double* waterfraction; 53 54 /*observations: */ 55 double* thickness_obs; 56 double* vx_obs; 57 double* vy_obs; 58 double* vz_obs; 59 60 /*geometry: */ 61 double* elementonbed; 62 double* elementonsurface; 63 double* nodeonbed; 64 double* nodeonsurface; 65 double* nodeonstokes; 66 double* borderstokes; 67 double* thickness; 68 double* thickness_coeff; 69 double* surface; 70 double* bed; 71 double* bathymetry; 72 double* elementoniceshelf; 73 double* elementonwater; 74 double* nodeonicesheet; 75 double* nodeoniceshelf; 76 double* nodeonwater; 77 78 /*friction: */ 79 double* drag_coefficient; 80 double* drag_p; 81 double* drag_q; 82 83 /*boundary conditions: */ 84 double* pressureload; 85 double* spcvx; 86 double* spcvy; 87 double* spcvz; 88 double* spctemperature; 89 double* spcthickness; 90 double* spcwatercolumn; 91 double* diagnostic_ref; 92 double* geothermalflux; 93 double* edges; 94 95 /*materials: */ 96 double* rheology_B; 97 double* rheology_n; 98 99 /*numerical parameters: */ 100 double* cm_min; 101 double* cm_max; 102 103 /*control methods: */ 104 double* control_type; 105 106 /*solution parameters: */ 107 double* cm_responses; 108 double* weights; 109 double* cm_jump; 110 double* maxiter; 111 double* optscal; 112 113 /*rifts: */ 114 double* riftinfo; 115 116 /*penalties: */ 117 double* penalties; 118 119 /*basal: */ 120 double* basal_melting_rate; 121 double* watercolumn; 122 double* basal_melting_rate_correction; 123 double* surface_mass_balance; 124 double* surface_accumulation_rate; 125 double* surface_ablation_rate; 126 127 double* dhdt; 128 129 /*exterior partitioning data, to be carried around: */ 25 /*This data needs to stay memory resident at all time, even if it's memory intensive: */ 130 26 bool* my_elements; 131 27 bool* my_nodes; … … 134 30 int* numbernodetoelementconnectivity; 135 31 136 /*}}}*/ 32 /*Data to synchronize through low level object drivers: */ 33 int nodecounter; //keep track of how many nodes are being created in each analysis type 34 int loadcounter; //keep track of how many loads are being created in each analysis type 35 int constraintcounter; //keep track of how many constraints are being created in each analysis type 36 137 37 /*Methods: {{{1*/ 138 38 ~IoModel(); 139 39 IoModel(); 140 40 IoModel(FILE* iomodel_handle); 141 void IoModelInit(void);142 41 /*}}}*/ 143 42 /*Input/Output:{{{1*/ … … 153 52 FILE* SetFilePointerToData(int* pcode,int* pvector_type, int data_enum); 154 53 void FetchDataToInput(Elements* elements,int vector_enum,int default_vector_enum=NoneEnum,double default_value=0); 54 void FetchData(int num,...); 55 double* f(int dataenum); 56 void DeleteData(int num,...); 155 57 /*}}}*/ 156 58 -
issm/trunk/src/c/objects/Loads/Icefront.cpp
r9356 r9362 54 54 55 55 /*find parameters: */ 56 iomodel-> parameters->FindParam(&dim,DimEnum);57 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);56 iomodel->constants->FindParam(&dim,DimEnum); 57 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 58 58 59 59 /*First, retrieve element index and element type: */ … … 64 64 segment_width=6; 65 65 } 66 element=(int)(*(iomodel-> pressureload+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill)66 element=(int)(*(iomodel->f(PressureloadEnum)+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill) 67 67 68 68 /*Build ids for hook constructors: */ 69 icefront_eid=(int) *(iomodel-> pressureload+segment_width*i+segment_width-2); //matlab indexing69 icefront_eid=(int) *(iomodel->f(PressureloadEnum)+segment_width*i+segment_width-2); //matlab indexing 70 70 icefront_mparid=numberofelements+1; //matlab indexing 71 71 72 72 if (in_icefront_type==MacAyeal2dIceFrontEnum || in_icefront_type==MacAyeal3dIceFrontEnum){ 73 icefront_node_ids[0]=iomodel->nodecounter+(int)*(iomodel-> pressureload+segment_width*i+0);74 icefront_node_ids[1]=iomodel->nodecounter+(int)*(iomodel-> pressureload+segment_width*i+1);73 icefront_node_ids[0]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+0); 74 icefront_node_ids[1]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+1); 75 75 } 76 76 else if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum){ 77 icefront_node_ids[0]=iomodel->nodecounter+(int)*(iomodel-> pressureload+segment_width*i+0);78 icefront_node_ids[1]=iomodel->nodecounter+(int)*(iomodel-> pressureload+segment_width*i+1);79 icefront_node_ids[2]=iomodel->nodecounter+(int)*(iomodel-> pressureload+segment_width*i+2);80 icefront_node_ids[3]=iomodel->nodecounter+(int)*(iomodel-> pressureload+segment_width*i+3);77 icefront_node_ids[0]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+0); 78 icefront_node_ids[1]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+1); 79 icefront_node_ids[2]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+2); 80 icefront_node_ids[3]=iomodel->nodecounter+(int)*(iomodel->f(PressureloadEnum)+segment_width*i+3); 81 81 } 82 82 else _error_("in_icefront_type %s not supported yet!",EnumToStringx(in_icefront_type)); … … 84 84 if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum) num_nodes=4; 85 85 else num_nodes=2; 86 icefront_fill=(int)*(iomodel-> pressureload+segment_width*i+segment_width-1);86 icefront_fill=(int)*(iomodel->f(PressureloadEnum)+segment_width*i+segment_width-1); 87 87 88 88 /*Ok, we have everything to build the object: */ -
issm/trunk/src/c/objects/Loads/Numericalflux.cpp
r9356 r9362 54 54 55 55 /*Fetch parameters: */ 56 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);56 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 57 57 58 58 /* Get MatPar id */ … … 60 60 61 61 /*First, see wether this is an internal or boundary edge (if e2=NaN)*/ 62 if (isnan((double)iomodel-> edges[4*i+3])){ //edges are [node1 node2 elem1 elem2]62 if (isnan((double)iomodel->f(EdgesEnum)[4*i+3])){ //edges are [node1 node2 elem1 elem2] 63 63 /* Boundary edge, only one element */ 64 e1=(int)iomodel-> edges[4*i+2];64 e1=(int)iomodel->f(EdgesEnum)[4*i+2]; 65 65 e2=(int)UNDEF; 66 66 num_elems=1; … … 71 71 else{ 72 72 /* internal edge: connected to 2 elements */ 73 e1=(int)iomodel-> edges[4*i+2];74 e2=(int)iomodel-> edges[4*i+3];73 e1=(int)iomodel->f(EdgesEnum)[4*i+2]; 74 e2=(int)iomodel->f(EdgesEnum)[4*i+3]; 75 75 num_elems=2; 76 76 num_nodes=4; … … 81 81 82 82 /*1: Get vertices ids*/ 83 i1=(int)iomodel-> edges[4*i+0];84 i2=(int)iomodel-> edges[4*i+1];83 i1=(int)iomodel->f(EdgesEnum)[4*i+0]; 84 i2=(int)iomodel->f(EdgesEnum)[4*i+1]; 85 85 86 86 if (numericalflux_type==InternalEnum){ … … 91 91 pos1=pos2=pos3=pos4=UNDEF; 92 92 for(j=0;j<3;j++){ 93 if (iomodel-> elements[3*(e1-1)+j]==i1) pos1=j+1;94 if (iomodel-> elements[3*(e1-1)+j]==i2) pos2=j+1;95 if (iomodel-> elements[3*(e2-1)+j]==i1) pos3=j+1;96 if (iomodel-> elements[3*(e2-1)+j]==i2) pos4=j+1;93 if (iomodel->f(ElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1; 94 if (iomodel->f(ElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1; 95 if (iomodel->f(ElementsEnum)[3*(e2-1)+j]==i1) pos3=j+1; 96 if (iomodel->f(ElementsEnum)[3*(e2-1)+j]==i2) pos4=j+1; 97 97 } 98 98 _assert_(pos1!=UNDEF && pos2!=UNDEF && pos3!=UNDEF && pos4!=UNDEF); … … 110 110 pos1=pos2=UNDEF; 111 111 for(j=0;j<3;j++){ 112 if (iomodel-> elements[3*(e1-1)+j]==i1) pos1=j+1;113 if (iomodel-> elements[3*(e1-1)+j]==i2) pos2=j+1;112 if (iomodel->f(ElementsEnum)[3*(e1-1)+j]==i1) pos1=j+1; 113 if (iomodel->f(ElementsEnum)[3*(e1-1)+j]==i2) pos2=j+1; 114 114 } 115 115 _assert_(pos1!=UNDEF && pos2!=UNDEF); -
issm/trunk/src/c/objects/Loads/Pengrid.cpp
r9356 r9362 53 53 54 54 /*Fetch parameters: */ 55 iomodel-> parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);56 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);55 iomodel->constants->FindParam(&numberofvertices,NumberOfVerticesEnum); 56 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 57 57 58 58 /*Some checks if debugging activated*/ -
issm/trunk/src/c/objects/Loads/Riftfront.cpp
r9356 r9362 56 56 57 57 /*Fetch parameters: */ 58 iomodel-> parameters->FindParam(&numberofelements,NumberOfElementsEnum);59 iomodel-> parameters->FindParam(&penalty_lock,PenaltyLockEnum);58 iomodel->constants->FindParam(&numberofelements,NumberOfElementsEnum); 59 iomodel->constants->FindParam(&penalty_lock,PenaltyLockEnum); 60 60 61 61 /*Ok, retrieve all the data needed to add a penalty between the two nodes: */ 62 el1=(int)*(iomodel-> riftinfo+RIFTINFOSIZE*i+2);63 el2=(int)*(iomodel-> riftinfo+RIFTINFOSIZE*i+3);64 65 node1=(int)*(iomodel-> riftinfo+RIFTINFOSIZE*i+0);66 node2=(int)*(iomodel-> riftinfo+RIFTINFOSIZE*i+1);62 el1=(int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+2); 63 el2=(int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+3); 64 65 node1=(int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+0); 66 node2=(int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+1); 67 67 68 68 /*id: */ … … 89 89 this->penalty_lock=penalty_lock; 90 90 this->material_converged=0; 91 this->normal[0]=*(iomodel-> riftinfo+RIFTINFOSIZE*i+4);92 this->normal[1]=*(iomodel-> riftinfo+RIFTINFOSIZE*i+5);93 this->length=*(iomodel-> riftinfo+RIFTINFOSIZE*i+6);94 this->fraction=*(iomodel-> riftinfo+RIFTINFOSIZE*i+9);95 this->state=(int)*(iomodel-> riftinfo+RIFTINFOSIZE*i+11);91 this->normal[0]=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+4); 92 this->normal[1]=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+5); 93 this->length=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+6); 94 this->fraction=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+9); 95 this->state=(int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+11); 96 96 97 97 //intialize inputs, and add as many inputs per element as requested: … … 99 99 100 100 riftfront_type=SegmentRiftfrontEnum; 101 riftfront_fill = (int)*(iomodel-> riftinfo+RIFTINFOSIZE*i+7);102 riftfront_friction=*(iomodel-> riftinfo+RIFTINFOSIZE*i+8);103 riftfront_fractionincrement=*(iomodel-> riftinfo+RIFTINFOSIZE*i+10);104 riftfront_shelf=(bool)iomodel-> nodeoniceshelf[node1-1];101 riftfront_fill = (int)*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+7); 102 riftfront_friction=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+8); 103 riftfront_fractionincrement=*(iomodel->f(RiftinfoEnum)+RIFTINFOSIZE*i+10); 104 riftfront_shelf=(bool)iomodel->f(NodeOnIceShelfEnum)[node1-1]; 105 105 106 106 this->inputs->AddInput(new IntInput(TypeEnum,riftfront_type)); -
issm/trunk/src/c/objects/Materials/Matice.cpp
r9356 r9362 660 660 661 661 /*Fetch parameters: */ 662 iomodel-> parameters->FindParam(&dim,DimEnum);663 iomodel-> parameters->FindParam(&control_analysis,ControlAnalysisEnum);664 iomodel-> parameters->FindParam(&num_control_type,NumControlTypeEnum);662 iomodel->constants->FindParam(&dim,DimEnum); 663 iomodel->constants->FindParam(&control_analysis,ControlAnalysisEnum); 664 iomodel->constants->FindParam(&num_control_type,NumControlTypeEnum); 665 665 666 666 … … 675 675 676 676 /*Get B*/ 677 if (iomodel-> rheology_B) {678 for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel-> rheology_B[int(iomodel->elements[num_vertices*index+i]-1)];677 if (iomodel->f(RheologyBEnum)) { 678 for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->f(RheologyBEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+i]-1)]; 679 679 this->inputs->AddInput(new TriaVertexInput(RheologyBbarEnum,nodeinputs)); 680 680 } 681 681 682 682 /*Get n*/ 683 if (iomodel-> rheology_n) {684 for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel-> rheology_n[index];683 if (iomodel->f(RheologyNEnum)) { 684 for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->f(RheologyNEnum)[index]; 685 685 this->inputs->AddInput(new TriaVertexInput(RheologyNEnum,nodeinputs)); 686 686 } 687 687 688 688 /*Control Inputs*/ 689 if (control_analysis && iomodel-> control_type){689 if (control_analysis && iomodel->f(ControlTypeEnum)){ 690 690 for(i=0;i<num_control_type;i++){ 691 switch((int)iomodel-> control_type[i]){691 switch((int)iomodel->f(ControlTypeEnum)[i]){ 692 692 case RheologyBbarEnum: 693 if (iomodel-> rheology_B){694 _assert_(iomodel-> rheology_B);_assert_(iomodel->cm_min); _assert_(iomodel->cm_max);695 for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel-> rheology_B[int(iomodel->elements[num_vertices*index+j]-1)];696 for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel-> cm_min[int(iomodel->elements[num_vertices*index+j]-1)*num_control_type+i];697 for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel-> cm_max[int(iomodel->elements[num_vertices*index+j]-1)*num_control_type+i];693 if (iomodel->f(RheologyBEnum)){ 694 _assert_(iomodel->f(RheologyBEnum));_assert_(iomodel->f(CmMinEnum)); _assert_(iomodel->f(CmMaxEnum)); 695 for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->f(RheologyBEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)]; 696 for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)*num_control_type+i]; 697 for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)*num_control_type+i]; 698 698 this->inputs->AddInput(new ControlInput(RheologyBbarEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 699 699 } … … 714 714 715 715 /*Get B*/ 716 if (iomodel-> rheology_B) {717 for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel-> rheology_B[int(iomodel->elements[num_vertices*index+i]-1)];716 if (iomodel->f(RheologyBEnum)) { 717 for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->f(RheologyBEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+i]-1)]; 718 718 this->inputs->AddInput(new PentaVertexInput(RheologyBEnum,nodeinputs)); 719 719 } 720 720 721 721 /*Get n*/ 722 if (iomodel-> rheology_n) {723 for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel-> rheology_n[index];722 if (iomodel->f(RheologyNEnum)) { 723 for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->f(RheologyNEnum)[index]; 724 724 this->inputs->AddInput(new PentaVertexInput(RheologyNEnum,nodeinputs)); 725 725 } 726 726 727 727 /*Control Inputs*/ 728 if (control_analysis && iomodel-> control_type){728 if (control_analysis && iomodel->f(ControlTypeEnum)){ 729 729 for(i=0;i<num_control_type;i++){ 730 switch((int)iomodel-> control_type[i]){730 switch((int)iomodel->f(ControlTypeEnum)[i]){ 731 731 case RheologyBbarEnum: 732 if (iomodel-> rheology_B){733 _assert_(iomodel-> rheology_B);_assert_(iomodel->cm_min); _assert_(iomodel->cm_max);734 for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel-> rheology_B[int(iomodel->elements[num_vertices*index+j]-1)];735 for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel-> cm_min[int(iomodel->elements[num_vertices*index+j]-1)*num_control_type+i];736 for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel-> cm_max[int(iomodel->elements[num_vertices*index+j]-1)*num_control_type+i];732 if (iomodel->f(RheologyBEnum)){ 733 _assert_(iomodel->f(RheologyBEnum));_assert_(iomodel->f(CmMinEnum)); _assert_(iomodel->f(CmMaxEnum)); 734 for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->f(RheologyBEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)]; 735 for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->f(CmMinEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)*num_control_type+i]; 736 for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->f(CmMaxEnum)[int(iomodel->f(ElementsEnum)[num_vertices*index+j]-1)*num_control_type+i]; 737 737 this->inputs->AddInput(new ControlInput(RheologyBEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 738 738 } -
issm/trunk/src/c/objects/Materials/Matpar.cpp
r9356 r9362 26 26 27 27 this->mid = matpar_mid; 28 iomodel-> parameters->FindParam(&this->rho_ice,RhoIceEnum);29 iomodel-> parameters->FindParam(&this->rho_water,RhoWaterEnum);30 iomodel-> parameters->FindParam(&this->heatcapacity,HeatcapacityEnum);31 iomodel-> parameters->FindParam(&this->thermalconductivity,ThermalconductivityEnum);32 iomodel-> parameters->FindParam(&this->latentheat,LatentheatEnum);33 iomodel-> parameters->FindParam(&this->beta,BetaEnum);34 iomodel-> parameters->FindParam(&this->meltingpoint,MeltingpointEnum);35 iomodel-> parameters->FindParam(&this->referencetemperature,ReferencetemperatureEnum);36 iomodel-> parameters->FindParam(&this->mixed_layer_capacity,MixedLayerCapacityEnum);37 iomodel-> parameters->FindParam(&this->thermal_exchange_velocity,ThermalExchangeVelocityEnum);38 iomodel-> parameters->FindParam(&this->g,GEnum);39 40 iomodel-> parameters->FindParam(&this->kn,HydroKnEnum);41 iomodel-> parameters->FindParam(&this->hydro_p,HydroPEnum);42 iomodel-> parameters->FindParam(&this->hydro_q,HydroQEnum);43 iomodel-> parameters->FindParam(&this->hydro_CR,HydroCREnum);44 iomodel-> parameters->FindParam(&this->hydro_n,HydroNEnum);28 iomodel->constants->FindParam(&this->rho_ice,RhoIceEnum); 29 iomodel->constants->FindParam(&this->rho_water,RhoWaterEnum); 30 iomodel->constants->FindParam(&this->heatcapacity,HeatcapacityEnum); 31 iomodel->constants->FindParam(&this->thermalconductivity,ThermalconductivityEnum); 32 iomodel->constants->FindParam(&this->latentheat,LatentheatEnum); 33 iomodel->constants->FindParam(&this->beta,BetaEnum); 34 iomodel->constants->FindParam(&this->meltingpoint,MeltingpointEnum); 35 iomodel->constants->FindParam(&this->referencetemperature,ReferencetemperatureEnum); 36 iomodel->constants->FindParam(&this->mixed_layer_capacity,MixedLayerCapacityEnum); 37 iomodel->constants->FindParam(&this->thermal_exchange_velocity,ThermalExchangeVelocityEnum); 38 iomodel->constants->FindParam(&this->g,GEnum); 39 40 iomodel->constants->FindParam(&this->kn,HydroKnEnum); 41 iomodel->constants->FindParam(&this->hydro_p,HydroPEnum); 42 iomodel->constants->FindParam(&this->hydro_q,HydroQEnum); 43 iomodel->constants->FindParam(&this->hydro_CR,HydroCREnum); 44 iomodel->constants->FindParam(&this->hydro_n,HydroNEnum); 45 45 } 46 46 /*}}}1*/ -
issm/trunk/src/c/objects/Node.cpp
r9356 r9362 37 37 38 38 /*Fetch parameters: */ 39 iomodel-> parameters->FindParam(&dim,DimEnum);39 iomodel->constants->FindParam(&dim,DimEnum); 40 40 41 41 /*id: */ … … 46 46 47 47 /*indexing:*/ 48 DistributeNumDofs(&this->indexing,analysis_type,iomodel-> vertices_type+io_index); //number of dofs per node48 DistributeNumDofs(&this->indexing,analysis_type,iomodel->f(VerticesTypeEnum)+io_index); //number of dofs per node 49 49 gsize=this->indexing.gsize; 50 50 … … 54 54 //intialize inputs, and add as many inputs per element as requested: 55 55 this->inputs=new Inputs(); 56 if (iomodel-> nodeonbed) this->inputs->AddInput(new BoolInput(NodeOnBedEnum,(IssmBool)iomodel->nodeonbed[io_index]));57 if (iomodel-> nodeonsurface) this->inputs->AddInput(new BoolInput(NodeOnSurfaceEnum,(IssmBool)iomodel->nodeonsurface[io_index]));58 if (iomodel-> nodeoniceshelf) this->inputs->AddInput(new BoolInput(NodeOnIceShelfEnum,(IssmBool)iomodel->nodeoniceshelf[io_index]));59 if (iomodel-> nodeonicesheet) this->inputs->AddInput(new BoolInput(NodeOnIceSheetEnum,(IssmBool)iomodel->nodeonicesheet[io_index]));56 if (iomodel->f(NodeOnBedEnum)) this->inputs->AddInput(new BoolInput(NodeOnBedEnum,(IssmBool)iomodel->f(NodeOnBedEnum)[io_index])); 57 if (iomodel->f(NodeOnSurfaceEnum)) this->inputs->AddInput(new BoolInput(NodeOnSurfaceEnum,(IssmBool)iomodel->f(NodeOnSurfaceEnum)[io_index])); 58 if (iomodel->f(NodeOnIceShelfEnum)) this->inputs->AddInput(new BoolInput(NodeOnIceShelfEnum,(IssmBool)iomodel->f(NodeOnIceShelfEnum)[io_index])); 59 if (iomodel->f(NodeOnIceSheetEnum)) this->inputs->AddInput(new BoolInput(NodeOnIceSheetEnum,(IssmBool)iomodel->f(NodeOnIceSheetEnum)[io_index])); 60 60 if (iomodel->numbernodetoelementconnectivity) this->inputs->AddInput(new IntInput(NumberNodeToElementConnectivityEnum,(IssmInt)iomodel->numbernodetoelementconnectivity[io_index])); 61 if (analysis_type==DiagnosticHorizAnalysisEnum) this->inputs->AddInput(new IntInput(ApproximationEnum,(IssmInt)iomodel-> vertices_type[io_index]));61 if (analysis_type==DiagnosticHorizAnalysisEnum) this->inputs->AddInput(new IntInput(ApproximationEnum,(IssmInt)iomodel->f(VerticesTypeEnum)[io_index])); 62 62 63 63 /*set single point constraints: */ 64 64 65 65 /*spc all nodes on water*/ 66 if (!iomodel-> nodeonwater) _error_("iomodel->nodeonwater is NULL");67 if (iomodel-> nodeonwater[io_index]){66 if (!iomodel->f(NodeOnWaterEnum)) _error_("iomodel->nodeonwater is NULL"); 67 if (iomodel->f(NodeOnWaterEnum)[io_index]){ 68 68 for(k=1;k<=gsize;k++){ 69 69 this->FreezeDof(k); … … 75 75 if (dim==3){ 76 76 /*We have a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */ 77 if (!iomodel-> nodeonbed) _error_("iomodel->nodeonbed is NULL");78 if (!iomodel-> vertices_type) _error_("iomodel->vertices_type is NULL");79 if (iomodel-> vertices_type[io_index]==MacAyealApproximationEnum && !iomodel->nodeonbed[io_index]){77 if (!iomodel->f(NodeOnBedEnum)) _error_("iomodel->nodeonbed is NULL"); 78 if (!iomodel->f(VerticesTypeEnum)) _error_("iomodel->vertices_type is NULL"); 79 if (iomodel->f(VerticesTypeEnum)[io_index]==MacAyealApproximationEnum && !iomodel->f(NodeOnBedEnum)[io_index]){ 80 80 for(k=1;k<=gsize;k++) this->FreezeDof(k); 81 81 } 82 if (iomodel-> vertices_type[io_index]==MacAyealPattynApproximationEnum && iomodel->nodeonmacayeal[io_index]){83 if(!iomodel-> nodeonbed[io_index]){82 if (iomodel->f(VerticesTypeEnum)[io_index]==MacAyealPattynApproximationEnum && iomodel->f(NodeOnMacayealEnum)[io_index]){ 83 if(!iomodel->f(NodeOnBedEnum)[io_index]){ 84 84 for(k=1;k<=gsize;k++) this->FreezeDof(k); 85 85 } 86 86 } 87 if (iomodel-> vertices_type[io_index]==MacAyealStokesApproximationEnum && iomodel->nodeonmacayeal[io_index]){88 if(!iomodel-> nodeonbed[io_index]){87 if (iomodel->f(VerticesTypeEnum)[io_index]==MacAyealStokesApproximationEnum && iomodel->f(NodeOnMacayealEnum)[io_index]){ 88 if(!iomodel->f(NodeOnBedEnum)[io_index]){ 89 89 for(k=1;k<=2;k++) this->FreezeDof(k); 90 90 } … … 92 92 } 93 93 /*spc all nodes on hutter*/ 94 if (!iomodel-> nodeonhutter) _error_("iomodel->nodeonhutter is NULL");95 if (iomodel-> nodeonhutter[io_index]){94 if (!iomodel->f(NodeOnHutterEnum)) _error_("iomodel->nodeonhutter is NULL"); 95 if (iomodel->f(NodeOnHutterEnum)[io_index]){ 96 96 for(k=1;k<=gsize;k++){ 97 97 this->FreezeDof(k); … … 104 104 if (analysis_type==DiagnosticHutterAnalysisEnum){ 105 105 /*Constrain all nodes that are not Hutter*/ 106 if (!iomodel-> nodeonhutter) _error_("iomodel->nodeonhutter is NULL");107 if (!iomodel-> nodeonhutter[io_index]){106 if (!iomodel->f(NodeOnHutterEnum)) _error_("iomodel->nodeonhutter is NULL"); 107 if (!iomodel->f(NodeOnHutterEnum)[io_index]){ 108 108 for(k=1;k<=gsize;k++){ 109 109 this->FreezeDof(k); … … 122 122 if (dim==3){ 123 123 /*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */ 124 _assert_(iomodel-> nodeonbed);125 if (!iomodel-> nodeonbed[io_index]){124 _assert_(iomodel->f(NodeOnBedEnum)); 125 if (!iomodel->f(NodeOnBedEnum)[io_index]){ 126 126 for(k=1;k<=gsize;k++){ 127 127 this->FreezeDof(k); -
issm/trunk/src/c/objects/Params/DoubleMatParam.cpp
r9356 r9362 229 229 } 230 230 /*}}}*/ 231 232 /*diverse: */ 233 /*FUNCTION DoubleMatParam::GetPointer{{{1*/ 234 double* DoubleMatParam::GetPointer(void){ 235 return this->value; 236 } 237 /*}}}*/ -
issm/trunk/src/c/objects/Params/DoubleMatParam.h
r9356 r9362 79 79 void SetValue(double** array, int M, int* mdim_array, int* ndim_array){_error_("DoubleMat param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));} 80 80 void UnitConversion(int direction_enum); 81 double* GetPointer(void); 81 82 82 83 char* GetParameterName(void); -
issm/trunk/src/c/objects/Vertex.cpp
r9320 r9362 31 31 Vertex::Vertex(int vertex_id, int vertex_sid,int i, IoModel* iomodel){ 32 32 33 this->Init(vertex_id, vertex_sid, iomodel-> x[i],iomodel->y[i],iomodel->z[i],(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]));33 this->Init(vertex_id, vertex_sid, iomodel->f(XEnum)[i],iomodel->f(YEnum)[i],iomodel->f(ZEnum)[i],(iomodel->f(ZEnum)[i]-iomodel->f(BedEnum)[i])/(iomodel->f(ThicknessEnum)[i])); 34 34 35 35 }
Note:
See TracChangeset
for help on using the changeset viewer.