Changeset 16388
- Timestamp:
- 10/11/13 12:45:40 (11 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 15 added
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/Makefile.am
r16382 r16388 576 576 ./modules/ConstraintsStatex/RiftConstraintsState.cpp 577 577 #}}} 578 #Responses sources {{{ 579 responses_sources= ./classes/Massfluxatgate.h \ 580 ./modules/ModelProcessorx/CreateOutputDefinitions.cpp\ 581 ./modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.h\ 582 ./modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.cpp 583 #}}} 578 584 #Android sources {{{ 579 585 android_sources = … … 957 963 endif 958 964 965 if RESPONSES 966 issm_sources += $(responses_sources) 967 endif 968 959 969 if ANDROID 960 970 issm_sources += $(android_sources) -
issm/trunk-jpl/src/c/classes/Elements/Element.h
r16314 r16388 94 94 virtual void MaxAbsVz(IssmDouble* pmaxabsvz)=0; 95 95 virtual IssmDouble MassFlux(IssmDouble* segment)=0; 96 virtual IssmDouble MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id)=0; 96 97 virtual void ElementResponse(IssmDouble* presponse,int response_enum)=0; 97 98 virtual IssmDouble IceVolume(void)=0; -
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r16373 r16388 3739 3739 Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1. 3740 3740 mass_flux=tria->MassFlux(segment); 3741 delete tria->material; delete tria; 3742 3743 /*Delete Vx and Vy averaged*/ 3744 this->inputs->DeleteInput(VxAverageEnum); 3745 this->inputs->DeleteInput(VyAverageEnum); 3746 3747 /*clean up and return*/ 3748 return mass_flux; 3749 } 3750 /*}}}*/ 3751 /*FUNCTION Penta::MassFlux {{{*/ 3752 IssmDouble Penta::MassFlux( IssmDouble x1, IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id){ 3753 3754 IssmDouble mass_flux=0; 3755 3756 if(!IsOnBed()) return mass_flux; 3757 3758 /*Depth Averaging Vx and Vy*/ 3759 this->InputDepthAverageAtBase(VxEnum,VxAverageEnum); 3760 this->InputDepthAverageAtBase(VyEnum,VyAverageEnum); 3761 3762 /*Spawn Tria element from the base of the Penta: */ 3763 Tria* tria=(Tria*)SpawnTria(0); //lower face is 0, upper face is 1. 3764 mass_flux=tria->MassFlux(x1,y1,x2,y2,segment_id); 3741 3765 delete tria->material; delete tria; 3742 3766 -
issm/trunk-jpl/src/c/classes/Elements/Penta.h
r16314 r16388 122 122 void MinVz(IssmDouble* pminvz); 123 123 IssmDouble MassFlux(IssmDouble* segment); 124 IssmDouble MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id); 124 125 void MaxAbsVx(IssmDouble* pmaxabsvx); 125 126 void MaxAbsVy(IssmDouble* pmaxabsvy); -
issm/trunk-jpl/src/c/classes/Elements/Seg.h
r16382 r16388 135 135 void MinVz(IssmDouble* pminvz){_error_("not implemented yet");}; 136 136 IssmDouble MassFlux(IssmDouble* segment){_error_("not implemented yet");}; 137 IssmDouble MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id){_error_("not implemented yet");} 137 138 void MaxAbsVx(IssmDouble* pmaxabsvx){_error_("not implemented yet");}; 138 139 void MaxAbsVy(IssmDouble* pmaxabsvy){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r16387 r16388 2889 2889 /*Return: */ 2890 2890 return base*(surface-bed+min(rho_water/rho_ice*bathymetry,0.)); 2891 } 2892 /*}}}*/ 2893 /*FUNCTION Tria::MassFlux {{{*/ 2894 IssmDouble Tria::MassFlux( IssmDouble x1, IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id){ 2895 2896 int meshtype; 2897 IssmDouble mass_flux=0.; 2898 IssmDouble xyz_list[NUMVERTICES][3]; 2899 IssmDouble normal[2]; 2900 IssmDouble length,rho_ice; 2901 IssmDouble h1,h2; 2902 IssmDouble vx1,vx2,vy1,vy2; 2903 GaussTria* gauss_1=NULL; 2904 GaussTria* gauss_2=NULL; 2905 2906 /*Get material parameters :*/ 2907 rho_ice=matpar->GetRhoIce(); 2908 2909 /*First off, check that this segment belongs to this element: */ 2910 if (segment_id!=this->id)_error_("error message: segment with id " << segment_id << " does not belong to element with id:" << this->id); 2911 2912 /*Get xyz list: */ 2913 GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 2914 2915 /*get area coordinates of 0 and 1 locations: */ 2916 gauss_1=new GaussTria(); 2917 gauss_1->GaussFromCoords(x1,y1,&xyz_list[0][0]); 2918 gauss_2=new GaussTria(); 2919 gauss_2->GaussFromCoords(x2,y2,&xyz_list[0][0]); 2920 2921 normal[0]=cos(atan2(x1-x2,y2-y1)); 2922 normal[1]=sin(atan2(x1-x2,y2-y1)); 2923 2924 length=sqrt(pow(x2-x1,2)+pow(y2-y1,2)); 2925 2926 Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input); 2927 this->parameters->FindParam(&meshtype,MeshTypeEnum); 2928 Input* vx_input=NULL; 2929 Input* vy_input=NULL; 2930 if(meshtype==Mesh2DhorizontalEnum){ 2931 vx_input=inputs->GetInput(VxEnum); _assert_(vx_input); 2932 vy_input=inputs->GetInput(VyEnum); _assert_(vy_input); 2933 } 2934 else{ 2935 vx_input=inputs->GetInput(VxAverageEnum); _assert_(vx_input); 2936 vy_input=inputs->GetInput(VyAverageEnum); _assert_(vy_input); 2937 } 2938 2939 thickness_input->GetInputValue(&h1, gauss_1); 2940 thickness_input->GetInputValue(&h2, gauss_2); 2941 vx_input->GetInputValue(&vx1,gauss_1); 2942 vx_input->GetInputValue(&vx2,gauss_2); 2943 vy_input->GetInputValue(&vy1,gauss_1); 2944 vy_input->GetInputValue(&vy2,gauss_2); 2945 2946 mass_flux= rho_ice*length*( 2947 (ONETHIRD*(h1-h2)*(vx1-vx2)+0.5*h2*(vx1-vx2)+0.5*(h1-h2)*vx2+h2*vx2)*normal[0]+ 2948 (ONETHIRD*(h1-h2)*(vy1-vy2)+0.5*h2*(vy1-vy2)+0.5*(h1-h2)*vy2+h2*vy2)*normal[1] 2949 ); 2950 2951 /*clean up and return:*/ 2952 delete gauss_1; 2953 delete gauss_2; 2954 return mass_flux; 2891 2955 } 2892 2956 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Elements/Tria.h
r16387 r16388 123 123 void MinVz(IssmDouble* pminvz); 124 124 IssmDouble MassFlux(IssmDouble* segment); 125 IssmDouble MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id); 125 126 void MaxAbsVx(IssmDouble* pmaxabsvx); 126 127 void MaxAbsVy(IssmDouble* pmaxabsvy); -
issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h
r16149 r16388 23 23 private: 24 24 int id; 25 int enum_type; 25 int enum_type; //in case we have an identifiable enum for this result 26 char* enum_string; //in case this result is only identifiable by a unique string, though arbitrary. 26 27 ResultType value; 27 28 int M; … … 34 35 void GenericEcho(void){/*{{{*/ 35 36 _printf_(" id: " << this->id << "\n"); 36 _printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n"); 37 if(this->enum_type!=-1)_printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n"); 38 else _printf_(" string identified: " << this->enum_string ); 37 39 _printf_(" step: " << this->step << "\n"); 38 40 _printf_(" time: " << this->time << "\n"); … … 46 48 47 49 /*First write enum: */ 48 EnumToStringx(&name,this->enum_type); 50 if(this->enum_type!=-1)EnumToStringx(&name,this->enum_type); 51 else{ 52 name=xNew<char>(strlen(this->enum_string)+1); xMemCpy<char>(name,enum_string,strlen(this->enum_string)+1); 53 } 49 54 length=(strlen(name)+1)*sizeof(char); 50 55 fwrite(&length,sizeof(int),1,fid); … … 61 66 GenericExternalResult(){ /*{{{*/ 62 67 id = 0; 63 enum_type = NoneEnum; 68 enum_type = -1; 69 enum_string= NULL; 64 70 M = 0; 65 71 N = 0; … … 69 75 GenericExternalResult(int in_id, int in_enum_type,ResultType in_values, int in_M,int in_N,int in_step,IssmDouble in_time){/*{{{*/ 70 76 id = 0; 71 enum_type = NoneEnum; 77 enum_type = -1; 78 enum_string=NULL; 72 79 M = 0; 73 80 N = 0; … … 80 87 id = in_id; 81 88 enum_type = in_enum_type; 89 enum_string = NULL; 82 90 value = in_value; 83 91 step = in_step; … … 85 93 } 86 94 /*}}}*/ 95 GenericExternalResult(int in_id, char* in_enum_string,ResultType in_value,int in_step, IssmDouble in_time){ /*{{{*/ 96 id = in_id; 97 enum_type = -1; 98 enum_string = xNew<char>(strlen(in_enum_string)+1); xMemCpy<char>(enum_string,in_enum_string,strlen(in_enum_string)+1); 99 value = in_value; 100 step = in_step; 101 time = in_time; 102 } 103 /*}}}*/ 87 104 ~GenericExternalResult(){ /*{{{*/ 105 if(enum_string)xDelete<char>(enum_string); 88 106 } /*}}}*/ 89 107 … … 104 122 } /*}}}*/ 105 123 Object* copy(void) { /*{{{*/ 106 return new GenericExternalResult<ResultType>(this->id,this->enum_type,this->value,this->step,this->time); 124 if(enum_type!=-1) return new GenericExternalResult<ResultType>(this->id,this->enum_type,this->value,this->step,this->time); 125 else return new GenericExternalResult<ResultType>(this->id,this->enum_string,this->value,this->step,this->time); 107 126 } /*}}}*/ 108 127 … … 136 155 } /*}}}*/ 137 156 void GetResultName(char** pname){ /*{{{*/ 138 EnumToStringx(pname,this->enum_type); 157 if(this->enum_type!=-1)EnumToStringx(pname,this->enum_type); 158 else{ 159 char* name=xNew<char>(strlen(enum_string)+1); xMemCpy<char>(name,enum_string,strlen(enum_string)+1); 160 *pname=name; 161 } 139 162 } /*}}}*/ 140 163 int GetStep(void){ /*{{{*/ -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r16374 r16388 13 13 #include "../shared/io/io.h" 14 14 #include "./classes.h" 15 #include "./modules/modules.h" 15 16 #include "../shared/Enum/Enum.h" 16 17 … … 503 504 results->AddObject(new GenericExternalResult<double>(results->Size()+1,MaxVelEnum,reCast<IssmPDouble>(output_value),step,time)); 504 505 } 506 else if (StringToEnumx(output_string,false)==-1){ 507 /*This response can only be computed by going into the output definitions: */ 508 output_value=OutputDefinitionsResponsex(this,output_string); 509 results->AddObject(new GenericExternalResult<double>(results->Size()+1,output_string,reCast<IssmPDouble>(output_value),step,time)); 510 } 505 511 else{ 506 512 /*create this output in the element inputs, and then transfer to results:*/ -
issm/trunk-jpl/src/c/classes/IoModel.cpp
r16363 r16388 1080 1080 } 1081 1081 /*}}}*/ 1082 /*FUNCTION IoModel::FetchMultipleData(char*** pstrings,int* pnumstrings,int data_enum){{{*/ 1083 void IoModel::FetchMultipleData(char*** pstrings,int* pnumstrings,int data_enum){ 1084 1085 int my_rank; 1086 1087 int i; 1088 int num_instances; 1089 int* codes=NULL; 1090 1091 /*output: */ 1092 int numstrings=0; 1093 char** strings=NULL; 1094 1095 /*intermediary: */ 1096 char* string=NULL; 1097 int string_size; 1098 int* code=NULL; 1099 fpos_t* file_positions=NULL; 1100 1101 /*recover my_rank:*/ 1102 my_rank=IssmComm::GetRank(); 1103 1104 /*Get file pointers to beginning of the data (multiple instances of it): */ 1105 file_positions=this->SetFilePointersToData(&codes,NULL,&num_instances,data_enum); 1106 1107 if(num_instances){ 1108 1109 strings=xNew<char*>(num_instances); 1110 1111 1112 for(i=0;i<num_instances;i++){ 1113 1114 fsetpos(fid,file_positions+i); 1115 1116 /*check we are indeed finding a string, not something else: */ 1117 if(codes[i]!=4)_error_("expecting a string for enum " << EnumToStringx(data_enum)); 1118 1119 /*We have to read a string from disk. First read the dimensions of the string, then the string: */ 1120 if(my_rank==0){ 1121 if(fread(&string_size,sizeof(int),1,fid)!=1) _error_("could not read length of string "); 1122 } 1123 1124 1125 ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 1126 1127 /*Now allocate string: */ 1128 if(string_size){ 1129 string=xNew<char>((string_size+1)); 1130 string[string_size]='\0'; 1131 1132 /*Read string on node 0, then broadcast: */ 1133 if(my_rank==0){ 1134 if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string "); 1135 } 1136 ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 1137 } 1138 else{ 1139 string=xNew<char>(1); 1140 string[0]='\0'; 1141 } 1142 strings[i]=string; 1143 } 1144 1145 } 1146 /*Free ressources:*/ 1147 xDelete<int>(codes); 1148 1149 /*Assign output pointers: */ 1150 *pstrings=strings; 1151 *pnumstrings=num_instances; 1152 } 1153 /*}}}*/ 1154 /*FUNCTION IoModel::FetchMultipleData(IssmDouble*** pmatrices,int** pmdims,int** pndims, int* pM,int data_enum){{{*/ 1155 void IoModel::FetchMultipleData(IssmDouble*** pmatrices,int** pmdims,int** pndims, int* pnumrecords,int data_enum){ 1156 1157 int i; 1158 int num_instances; 1159 int my_rank; 1160 1161 fpos_t* file_positions=NULL; 1162 1163 /*output: */ 1164 IssmDouble** matrices=NULL; 1165 int* mdims=NULL; 1166 int* ndims=NULL; 1167 1168 /*intermediary: */ 1169 int M, N; 1170 IssmPDouble *pmatrix = NULL; 1171 IssmDouble *matrix = NULL; 1172 int* codes=NULL; 1173 int code; 1174 1175 /*recover my_rank:*/ 1176 my_rank=IssmComm::GetRank(); 1177 1178 /*Get file pointers to beginning of the data (multiple instances of it): */ 1179 file_positions=this->SetFilePointersToData(&codes,NULL,&num_instances,data_enum); 1180 1181 if(num_instances){ 1182 1183 /*Allocate matrices :*/ 1184 matrices=xNew<IssmDouble*>(num_instances); 1185 mdims=xNew<int>(num_instances); 1186 ndims=xNew<int>(num_instances); 1187 1188 for(i=0;i<num_instances;i++){ 1189 1190 fsetpos(fid,file_positions+i); 1191 code=codes[i]; 1192 1193 if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum)); 1194 1195 /*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */ 1196 /*numberofelements: */ 1197 if(my_rank==0){ 1198 if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix "); 1199 } 1200 ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 1201 1202 if(my_rank==0){ 1203 if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix "); 1204 } 1205 ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 1206 1207 1208 /*Now allocate matrix: */ 1209 if(M*N){ 1210 pmatrix=xNew<IssmPDouble>(M*N); 1211 1212 /*Read matrix on node 0, then broadcast: */ 1213 if(my_rank==0){ 1214 if(fread(pmatrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix "); 1215 } 1216 ISSM_MPI_Bcast(pmatrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 1217 1218 _assert_(this->independents); 1219 if (this->independents[data_enum]){ 1220 /*this data has already been checked out! So cancel all that we've done here, and return 1221 * the data[data_enum] directly: */ 1222 matrix=this->data[data_enum]; 1223 } 1224 else{ 1225 matrix=xNew<IssmDouble>(M*N); 1226 for (int i=0;i<M*N;++i) matrix[i]=pmatrix[i]; 1227 } 1228 xDelete<IssmPDouble>(pmatrix); 1229 } 1230 else 1231 matrix=NULL; 1232 1233 1234 /*Assign: */ 1235 mdims[i]=M; 1236 matrices[i]=matrix; 1237 ndims[i]=N; 1238 } 1239 } 1240 1241 /*Free ressources:*/ 1242 xDelete<int>(codes); 1243 1244 /*Assign output pointers: */ 1245 *pmatrices=matrices; 1246 if(pmdims)*pmdims=mdims; 1247 if(pndims)*pndims=ndims; 1248 *pnumrecords=num_instances; 1249 } 1250 /*}}}*/ 1082 1251 /*FUNCTION IoModel::FetchDataToInput(Elements* elements,int vector_enum,IssmDouble default_value){{{*/ 1083 1252 void IoModel::FetchDataToInput(Elements* elements,int vector_enum,IssmDouble default_value){ … … 1272 1441 ISSM_MPI_Bcast(&record_code,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 1273 1442 ISSM_MPI_Bcast(&vector_type,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 1274 if(record_code==5) ISSM_MPI_Bcast(&vector_type,1,ISSM_MPI_INT,0,IssmComm::GetComm());1275 1443 1276 1444 /*Assign output pointers:*/ … … 1281 1449 } 1282 1450 /*}}}*/ 1451 /*FUNCTION IoModel::SetFilePointersToData{{{*/ 1452 fpos_t* IoModel::SetFilePointersToData(int** pcodes,int** pvector_types, int* pnum_instances, int data_enum){ 1453 1454 int my_rank; 1455 int found = 0; 1456 int record_enum; 1457 int record_length; 1458 int record_code; //1 to 7 number 1459 int vector_type; //1 to 7 number 1460 int* vector_types = NULL; 1461 int* codes= NULL; 1462 int num_instances = 0; 1463 int counter; 1464 fpos_t* file_positions=NULL; 1465 1466 /*recover my_rank:*/ 1467 my_rank=IssmComm::GetRank(); 1468 1469 /*Go find in the binary file, the data we want to fetch and count the number of 1470 * instances it appears: */ 1471 if(my_rank==0){ 1472 1473 /*First set FILE* position to the beginning of the file: */ 1474 fseek(fid,0,SEEK_SET); 1475 1476 /*Now march through file looking for the correct data identifier: */ 1477 for(;;){ 1478 /*Read enum for this size of first string name: */ 1479 if(fread(&record_enum,sizeof(int),1,fid)==0){ 1480 /*Ok, we have reached the end of the file. break: */ 1481 break; 1482 } 1483 1484 /*Is this the record sought for? : */ 1485 if (data_enum==record_enum) num_instances++; 1486 1487 /*Read the record length, and use it to skip the record: */ 1488 if(fread(&record_length,sizeof(int),1,fid)!=1) _error_("Could not read record_length"); 1489 fseek(fid,record_length,SEEK_CUR); 1490 } 1491 1492 /*Ok, initialize the number of file handles we are going to return: */ 1493 if(num_instances){ 1494 file_positions = xNew<fpos_t>(num_instances); 1495 codes = xNew<int>(num_instances); 1496 vector_types = xNew<int>(num_instances); 1497 } 1498 1499 1500 /*Reset FILE* position to the beginning of the file, and start again, this time saving the data information 1501 * as we find it: */ 1502 counter=0; 1503 fseek(fid,0,SEEK_SET); 1504 1505 for(;;){ 1506 /*Read enum for this size of first string name: */ 1507 if(fread(&record_enum,sizeof(int),1,fid)==0){ 1508 /*Ok, we have reached the end of the file. break: */ 1509 break; 1510 } 1511 1512 /*Is this the record sought for? : */ 1513 if (data_enum==record_enum){ 1514 /*Ok, we have found the correct string. Pass the record length, and read data type code: */ 1515 fseek(fid,sizeof(int),SEEK_CUR); 1516 if(fread(&record_code,sizeof(int),1,fid)!=1) _error_("Could not read record_code"); 1517 1518 /*if record_code points to a vector, get its type (nodal or elementary): */ 1519 if(5<=record_code && record_code<=7){ 1520 if(fread(&vector_type,sizeof(int),1,fid)!=1) _error_("Could not read vector_type"); 1521 } 1522 codes[counter]=record_code; 1523 vector_types[counter]=vector_type; 1524 fgetpos(fid,file_positions+counter); 1525 1526 /*backup and skip over the record, as we have more work to do: */ 1527 if(5<=record_code && record_code<=7) fseek(fid,-sizeof(int),SEEK_CUR); 1528 fseek(fid,-sizeof(int),SEEK_CUR); 1529 fseek(fid,-sizeof(int),SEEK_CUR); 1530 1531 /*increment counter: */ 1532 counter++; 1533 } 1534 1535 /*Read the record length, and use it to skip this record, as it has already been processed: */ 1536 if(fread(&record_length,sizeof(int),1,fid)!=1) _error_("Could not read record_length"); 1537 /*skip: */ 1538 fseek(fid,record_length,SEEK_CUR); 1539 } 1540 } 1541 1542 /*Broadcast data: */ 1543 ISSM_MPI_Bcast(&num_instances,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 1544 ISSM_MPI_Bcast(codes,num_instances,ISSM_MPI_INT,0,IssmComm::GetComm()); 1545 ISSM_MPI_Bcast(vector_types,num_instances,ISSM_MPI_INT,0,IssmComm::GetComm()); 1546 1547 /*Assign output pointers:*/ 1548 *pcodes=codes; 1549 *pnum_instances=num_instances; 1550 if(pvector_types)*pvector_types=vector_types; 1551 return file_positions; 1552 } 1553 /*}}}*/ -
issm/trunk-jpl/src/c/classes/IoModel.h
r16363 r16388 77 77 void FetchData(char*** pstringarray,int* pnumstrings,int data_enum); 78 78 void FetchData(IssmDouble*** pmatrixarray,int** pmdims,int** pndims, int* pnumrecords,int data_enum); 79 void FetchMultipleData(char*** pstringarray,int* pnumstrings,int data_enum); 80 void FetchMultipleData(IssmDouble*** pmatrixarray,int** pmdims,int** pndims, int* pnumrecords,int data_enum); 79 81 void FetchData(Option **poption,int data_enum); 80 82 void FetchData(int num,...); … … 83 85 void LastIndex(int *pindex); 84 86 FILE* SetFilePointerToData(int* pcode,int* pvector_type, int data_enum); 87 fpos_t* SetFilePointersToData(int** pcodes,int** pvector_types, int* pnum_instances, int data_enum); 85 88 void DeclareIndependents(void); 86 89 void StartTrace(void); -
issm/trunk-jpl/src/c/classes/classes.h
r16382 r16388 17 17 #include "./IndependentObject.h" 18 18 #include "./Segment.h" 19 #include "./Massfluxatgate.h" 19 20 20 21 /*Constraints: */ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
r16363 r16388 214 214 /*}}}*/ 215 215 216 /*Output definitions dataset: */ 217 CreateOutputDefinitions(¶meters,iomodel); 218 216 219 /*Solution specific parameters*/ 217 220 #ifdef _HAVE_HYDROLOGY_ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/MeshDeformation
-
Property svn:ignore
set to
.deps
.dirstamp
-
Property svn:ignore
set to
-
issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h
r16343 r16388 23 23 void CreateParametersHydrologyDCInefficient(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type); 24 24 void CreateParametersHydrologyDCEfficient(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type); 25 void CreateOutputDefinitions(Parameters** pparameters,IoModel* iomodel); 25 26 void UpdateElementsAndMaterialsControl(Elements* elements,Materials* materials, IoModel* iomodel); 26 27 void UpdateElementsAndMaterialsDakota(Elements* elements,Materials* materials, IoModel* iomodel); -
issm/trunk-jpl/src/c/modules/modules.h
r16237 r16388 72 72 #include "./NodesDofx/NodesDofx.h" 73 73 #include "./Orthx/Orthx.h" 74 #include "./OutputDefinitionsResponsex/OutputDefinitionsResponsex.h" 74 75 #include "./OutputResultsx/OutputResultsx.h" 75 76 #include "./ConstraintsStatex/ConstraintsStatex.h" -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r16371 r16388 546 546 WaterColumnOldEnum, 547 547 /*}}}*/ 548 /*Output Definitions{{{*/ 549 OutputdefinitionEnum, 550 OutputdefinitionEnumsEnum, 551 MassfluxatgateEnum, 552 MassfluxatgateNameEnum, 553 MassfluxatgateSegmentsEnum, 554 /*}}}*/ 548 555 /*Responses{{{*/ 549 556 MinVelEnum, -
issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
r16371 r16388 535 535 case TriaP1ElementResultEnum : return "TriaP1ElementResult"; 536 536 case WaterColumnOldEnum : return "WaterColumnOld"; 537 case OutputdefinitionEnum : return "Outputdefinition"; 538 case OutputdefinitionEnumsEnum : return "OutputdefinitionEnums"; 539 case MassfluxatgateEnum : return "Massfluxatgate"; 540 case MassfluxatgateNameEnum : return "MassfluxatgateName"; 541 case MassfluxatgateSegmentsEnum : return "MassfluxatgateSegments"; 537 542 case MinVelEnum : return "MinVel"; 538 543 case MaxVelEnum : return "MaxVel"; -
issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
r16371 r16388 547 547 else if (strcmp(name,"TriaP1ElementResult")==0) return TriaP1ElementResultEnum; 548 548 else if (strcmp(name,"WaterColumnOld")==0) return WaterColumnOldEnum; 549 else if (strcmp(name,"Outputdefinition")==0) return OutputdefinitionEnum; 550 else if (strcmp(name,"OutputdefinitionEnums")==0) return OutputdefinitionEnumsEnum; 551 else if (strcmp(name,"Massfluxatgate")==0) return MassfluxatgateEnum; 552 else if (strcmp(name,"MassfluxatgateName")==0) return MassfluxatgateNameEnum; 553 else if (strcmp(name,"MassfluxatgateSegments")==0) return MassfluxatgateSegmentsEnum; 549 554 else if (strcmp(name,"MinVel")==0) return MinVelEnum; 550 555 else if (strcmp(name,"MaxVel")==0) return MaxVelEnum; -
issm/trunk-jpl/src/m/classes/masstransport.py
r16385 r16388 66 66 md = checkfield(md,'masstransport.min_thickness','>',0) 67 67 if md.masstransport.requested_outputs: 68 md = checkfield(md,'masstransport.requested_outputs',' size',[1, float('NaN')])68 md = checkfield(md,'masstransport.requested_outputs','cell',1) 69 69 70 70 return md -
issm/trunk-jpl/src/m/classes/model.m
r16369 r16388 45 45 46 46 results = 0; 47 outputdefinition = 0; 47 48 radaroverlay = 0; 48 49 miscellaneous = 0; … … 1078 1079 md.radaroverlay = radaroverlay(); 1079 1080 md.results = struct(); 1081 md.outputdefinition = outputdefinition(); 1080 1082 md.miscellaneous = miscellaneous(); 1081 1083 md.private = private(); … … 1114 1116 disp(sprintf('%19s: %-22s -- %s','inversion' ,['[1x1 ' class(obj.inversion) ']'],'parameters for inverse methods')); 1115 1117 disp(sprintf('%19s: %-22s -- %s','qmu' ,['[1x1 ' class(obj.qmu) ']'],'dakota properties')); 1118 disp(sprintf('%19s: %-22s -- %s','outputdefinition',['[1x1 ' class(obj.outputdefinition) ']'],'output definition')); 1116 1119 disp(sprintf('%19s: %-22s -- %s','results' ,['[1x1 ' class(obj.results) ']'],'model results')); 1117 1120 disp(sprintf('%19s: %-22s -- %s','radaroverlay' ,['[1x1 ' class(obj.radaroverlay) ']'],'radar image for plot overlay')); -
issm/trunk-jpl/src/m/classes/model.py
r16287 r16388 33 33 from flaim import flaim 34 34 from inversion import inversion 35 from outputdefinition import outputdefinition 35 36 from qmu import qmu 36 37 from results import results … … 88 89 89 90 self.results = results() 91 self.outputdefinition = outputdefinition() 90 92 self.radaroverlay = radaroverlay() 91 93 self.miscellaneous = miscellaneous() … … 125 127 'inversion',\ 126 128 'qmu',\ 129 'outputdefinition',\ 127 130 'results',\ 128 131 'radaroverlay',\ … … 162 165 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("inversion","[%s,%s]" % ("1x1",obj.inversion.__class__.__name__),"parameters for inverse methods")) 163 166 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("qmu","[%s,%s]" % ("1x1",obj.qmu.__class__.__name__),"dakota properties")) 167 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("outputdefinition","[%s,%s]" % ("1x1",obj.outputdefinition.__class__.__name__),"output definition")) 164 168 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("results","[%s,%s]" % ("1x1",obj.results.__class__.__name__),"model results")) 165 169 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("radaroverlay","[%s,%s]" % ("1x1",obj.radaroverlay.__class__.__name__),"radar image for plot overlay")) -
issm/trunk-jpl/src/m/classes/steadystate.py
r16385 r16388 52 52 53 53 if md.steadystate.requested_outputs: 54 md = checkfield(md,'steadystate.requested_outputs',' size',[1, float('nan')])54 md = checkfield(md,'steadystate.requested_outputs','cell',1) 55 55 56 56 return md -
issm/trunk-jpl/src/m/classes/stressbalance.py
r16385 r16388 124 124 md = checkfield(md,'stressbalance.loadingforce','size',[md.mesh.numberofvertices,3]) 125 125 if md.stressbalance.requested_outputs: 126 md = checkfield(md,'stressbalance.requested_outputs',' size',[1, float('NaN')])126 md = checkfield(md,'stressbalance.requested_outputs','cell',1); 127 127 128 128 #singular solution -
issm/trunk-jpl/src/m/classes/transient.py
r16385 r16388 57 57 md = checkfield(md,'transient.isgia','numel',[1],'values',[0,1]) 58 58 if md.transient.requested_outputs: 59 md = checkfield(md,'transient.requested_outputs',' size',[1, float('nan')])59 md = checkfield(md,'transient.requested_outputs','cell',1) 60 60 61 61 return md -
issm/trunk-jpl/src/m/enum/EnumDefinitions.py
r16371 r16388 527 527 def TriaP1ElementResultEnum(): return StringToEnum("TriaP1ElementResult")[0] 528 528 def WaterColumnOldEnum(): return StringToEnum("WaterColumnOld")[0] 529 def OutputdefinitionEnum(): return StringToEnum("Outputdefinition")[0] 530 def OutputdefinitionEnumsEnum(): return StringToEnum("OutputdefinitionEnums")[0] 531 def MassfluxatgateEnum(): return StringToEnum("Massfluxatgate")[0] 532 def MassfluxatgateNameEnum(): return StringToEnum("MassfluxatgateName")[0] 533 def MassfluxatgateSegmentsEnum(): return StringToEnum("MassfluxatgateSegments")[0] 529 534 def MinVelEnum(): return StringToEnum("MinVel")[0] 530 535 def MaxVelEnum(): return StringToEnum("MaxVel")[0] -
issm/trunk-jpl/test/Par/SquareEISMINT.par
r16167 r16388 46 46 md.timestepping.final_time=500.; 47 47 md.timestepping.time_step=1; 48 49 %output definitions: 50 md.outputdefinition.definitions={... 51 massfluxatgate('MassFlux1',[pwd '/../Exp/MassFlux1.exp']),... 52 massfluxatgate('MassFlux2',[pwd '/../Exp/MassFlux2.exp']),... 53 massfluxatgate('MassFlux3',[pwd '/../Exp/MassFlux3.exp']),... 54 massfluxatgate('MassFlux4',[pwd '/../Exp/MassFlux4.exp']),... 55 massfluxatgate('MassFlux5',[pwd '/../Exp/MassFlux5.exp']),... 56 massfluxatgate('MassFlux6',[pwd '/../Exp/MassFlux6.exp'])... 57 }; -
issm/trunk-jpl/test/Par/SquareEISMINT.py
r16170 r16388 1 1 import numpy 2 2 from SetMarineIceSheetBC import SetMarineIceSheetBC 3 from massfluxatgate import massfluxatgate 3 4 4 5 #Ok, start defining model parameters here … … 49 50 md.timestepping.final_time=500. 50 51 md.timestepping.time_step=1 52 53 #output definitions: 54 md.outputdefinition.definitions=[ 55 massfluxatgate('MassFlux1',os.getcwd() + '/../Exp/MassFlux1.exp'), 56 massfluxatgate('MassFlux2',os.getcwd() + '/../Exp/MassFlux2.exp'), 57 massfluxatgate('MassFlux3',os.getcwd() + '/../Exp/MassFlux3.exp'), 58 massfluxatgate('MassFlux4',os.getcwd() + '/../Exp/MassFlux4.exp'), 59 massfluxatgate('MassFlux5',os.getcwd() + '/../Exp/MassFlux5.exp'), 60 massfluxatgate('MassFlux6',os.getcwd() + '/../Exp/MassFlux6.exp') 61 ] -
issm/trunk-jpl/test/Par/SquareSheetConstrained.par
r16167 r16388 66 66 A=dbstack; 67 67 if (length(A)>2), md.miscellaneous.name=A(3).file(1:end-2); end 68 69 %output definitions: 70 md.outputdefinition.definitions={... 71 massfluxatgate('MassFlux1',[pwd '/../Exp/MassFlux1.exp']),... 72 massfluxatgate('MassFlux2',[pwd '/../Exp/MassFlux2.exp']),... 73 massfluxatgate('MassFlux3',[pwd '/../Exp/MassFlux3.exp']),... 74 massfluxatgate('MassFlux4',[pwd '/../Exp/MassFlux4.exp']),... 75 massfluxatgate('MassFlux5',[pwd '/../Exp/MassFlux5.exp']),... 76 massfluxatgate('MassFlux6',[pwd '/../Exp/MassFlux6.exp'])... 77 }; -
issm/trunk-jpl/test/Par/SquareSheetConstrained.py
r16170 r16388 7 7 from paterson import paterson 8 8 from SetIceSheetBC import SetIceSheetBC 9 from massfluxatgate import massfluxatgate 9 10 10 11 #Start defining model parameters here … … 77 78 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0] 78 79 80 #output definitions: 81 md.outputdefinition.definitions=[ 82 massfluxatgate('MassFlux1',os.getcwd() + '/../Exp/MassFlux1.exp'), 83 massfluxatgate('MassFlux2',os.getcwd() + '/../Exp/MassFlux2.exp'), 84 massfluxatgate('MassFlux3',os.getcwd() + '/../Exp/MassFlux3.exp'), 85 massfluxatgate('MassFlux4',os.getcwd() + '/../Exp/MassFlux4.exp'), 86 massfluxatgate('MassFlux5',os.getcwd() + '/../Exp/MassFlux5.exp'), 87 massfluxatgate('MassFlux6',os.getcwd() + '/../Exp/MassFlux6.exp') 88 ] -
issm/trunk-jpl/test/Par/SquareSheetShelf.par
r16167 r16388 64 64 A=dbstack; 65 65 if (length(A)>2), md.miscellaneous.name=A(3).file(1:end-2); end 66 67 %output definitions: 68 md.outputdefinition.definitions={... 69 massfluxatgate('MassFlux1',[pwd '/../Exp/MassFlux1.exp']),... 70 massfluxatgate('MassFlux2',[pwd '/../Exp/MassFlux2.exp']),... 71 massfluxatgate('MassFlux3',[pwd '/../Exp/MassFlux3.exp']),... 72 massfluxatgate('MassFlux4',[pwd '/../Exp/MassFlux4.exp']),... 73 massfluxatgate('MassFlux5',[pwd '/../Exp/MassFlux5.exp']),... 74 massfluxatgate('MassFlux6',[pwd '/../Exp/MassFlux6.exp'])... 75 }; -
issm/trunk-jpl/test/Par/SquareSheetShelf.py
r16171 r16388 7 7 from paterson import paterson 8 8 from SetMarineIceSheetBC import SetMarineIceSheetBC 9 from massfluxatgate import massfluxatgate 9 10 10 11 #Start defining model parameters here … … 75 76 if len(inspect.stack()) > 2: 76 77 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0] 78 79 #output definitions: 80 md.outputdefinition.definitions=[ 81 massfluxatgate('MassFlux1',os.getcwd() + '/../Exp/MassFlux1.exp'), 82 massfluxatgate('MassFlux2',os.getcwd() + '/../Exp/MassFlux2.exp'), 83 massfluxatgate('MassFlux3',os.getcwd() + '/../Exp/MassFlux3.exp'), 84 massfluxatgate('MassFlux4',os.getcwd() + '/../Exp/MassFlux4.exp'), 85 massfluxatgate('MassFlux5',os.getcwd() + '/../Exp/MassFlux5.exp'), 86 massfluxatgate('MassFlux6',os.getcwd() + '/../Exp/MassFlux6.exp') 87 ] -
issm/trunk-jpl/test/Par/SquareShelf.par
r16167 r16388 57 57 A=dbstack; 58 58 if (length(A)>2), md.miscellaneous.name=A(3).file(1:end-2); end 59 60 %output definitions: 61 md.outputdefinition.definitions={... 62 massfluxatgate('MassFlux1',[pwd '/../Exp/MassFlux1.exp']),... 63 massfluxatgate('MassFlux2',[pwd '/../Exp/MassFlux2.exp']),... 64 massfluxatgate('MassFlux3',[pwd '/../Exp/MassFlux3.exp']),... 65 massfluxatgate('MassFlux4',[pwd '/../Exp/MassFlux4.exp']),... 66 massfluxatgate('MassFlux5',[pwd '/../Exp/MassFlux5.exp']),... 67 massfluxatgate('MassFlux6',[pwd '/../Exp/MassFlux6.exp'])... 68 }; -
issm/trunk-jpl/test/Par/SquareShelf.py
r16171 r16388 7 7 from paterson import paterson 8 8 from SetIceShelfBC import SetIceShelfBC 9 from massfluxatgate import massfluxatgate 9 10 10 11 #Start defining model parameters here … … 88 89 if len(inspect.stack()) > 2: 89 90 md.miscellaneous.name=os.path.basename(inspect.stack()[2][1]).split('.')[0] 91 92 #output definitions: 93 md.outputdefinition.definitions=[ 94 massfluxatgate('MassFlux1',os.getcwd() + '/../Exp/MassFlux1.exp'), 95 massfluxatgate('MassFlux2',os.getcwd() + '/../Exp/MassFlux2.exp'), 96 massfluxatgate('MassFlux3',os.getcwd() + '/../Exp/MassFlux3.exp'), 97 massfluxatgate('MassFlux4',os.getcwd() + '/../Exp/MassFlux4.exp'), 98 massfluxatgate('MassFlux5',os.getcwd() + '/../Exp/MassFlux5.exp'), 99 massfluxatgate('MassFlux6',os.getcwd() + '/../Exp/MassFlux6.exp') 100 ] -
issm/trunk-jpl/test/Par/SquareShelf2.par
r16167 r16388 57 57 A=dbstack; 58 58 if (length(A)>2), md.miscellaneous.name=A(3).file(1:end-2); end 59 60 %output definitions: 61 md.outputdefinition.definitions={... 62 massfluxatgate('MassFlux1',[pwd '/../Exp/MassFlux1.exp']),... 63 massfluxatgate('MassFlux2',[pwd '/../Exp/MassFlux2.exp']),... 64 massfluxatgate('MassFlux3',[pwd '/../Exp/MassFlux3.exp']),... 65 massfluxatgate('MassFlux4',[pwd '/../Exp/MassFlux4.exp']),... 66 massfluxatgate('MassFlux5',[pwd '/../Exp/MassFlux5.exp']),... 67 massfluxatgate('MassFlux6',[pwd '/../Exp/MassFlux6.exp'])... 68 }; -
issm/trunk-jpl/test/Par/SquareShelf2.py
r16171 r16388 7 7 from paterson import paterson 8 8 from SetIceShelfBC import SetIceShelfBC 9 from massfluxatgate import massfluxatgate 9 10 10 11 #Start defining model parameters here … … 88 89 if len(inspect.stack()) > 2: 89 90 md.miscellaneous.name=os.path.basename(inspect.stack()[2][1]).split('.')[0] 91 92 #output definitions: 93 md.outputdefinition.definitions=[ 94 massfluxatgate('MassFlux1',os.getcwd() + '/../Exp/MassFlux1.exp'), 95 massfluxatgate('MassFlux2',os.getcwd() + '/../Exp/MassFlux2.exp'), 96 massfluxatgate('MassFlux3',os.getcwd() + '/../Exp/MassFlux3.exp'), 97 massfluxatgate('MassFlux4',os.getcwd() + '/../Exp/MassFlux4.exp'), 98 massfluxatgate('MassFlux5',os.getcwd() + '/../Exp/MassFlux5.exp'), 99 massfluxatgate('MassFlux6',os.getcwd() + '/../Exp/MassFlux6.exp') 100 ] -
issm/trunk-jpl/test/Par/SquareShelfConstrained.par
r16167 r16388 61 61 A=dbstack; 62 62 if (length(A)>2), md.miscellaneous.name=A(3).file(1:end-2); end 63 64 %output definitions: 65 md.outputdefinition.definitions={... 66 massfluxatgate('MassFlux1',[pwd '/../Exp/MassFlux1.exp']),... 67 massfluxatgate('MassFlux2',[pwd '/../Exp/MassFlux2.exp']),... 68 massfluxatgate('MassFlux3',[pwd '/../Exp/MassFlux3.exp']),... 69 massfluxatgate('MassFlux4',[pwd '/../Exp/MassFlux4.exp']),... 70 massfluxatgate('MassFlux5',[pwd '/../Exp/MassFlux5.exp']),... 71 massfluxatgate('MassFlux6',[pwd '/../Exp/MassFlux6.exp'])... 72 }; -
issm/trunk-jpl/test/Par/SquareShelfConstrained.py
r16170 r16388 7 7 from paterson import paterson 8 8 from SetIceShelfBC import SetIceShelfBC 9 from massfluxatgate import massfluxatgate 9 10 10 11 #Start defining model parameters here … … 73 74 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0] 74 75 76 #output definitions: 77 md.outputdefinition.definitions=[ 78 massfluxatgate('MassFlux1',os.getcwd() + '/../Exp/MassFlux1.exp'), 79 massfluxatgate('MassFlux2',os.getcwd() + '/../Exp/MassFlux2.exp'), 80 massfluxatgate('MassFlux3',os.getcwd() + '/../Exp/MassFlux3.exp'), 81 massfluxatgate('MassFlux4',os.getcwd() + '/../Exp/MassFlux4.exp'), 82 massfluxatgate('MassFlux5',os.getcwd() + '/../Exp/MassFlux5.exp'), 83 massfluxatgate('MassFlux6',os.getcwd() + '/../Exp/MassFlux6.exp') 84 ] -
issm/trunk-jpl/test/Par/SquareThermal.par
r16227 r16388 43 43 md.basalforcings.geothermalflux=zeros(md.mesh.numberofvertices,1); 44 44 md.basalforcings.geothermalflux(find(md.mask.groundedice_levelset>0.))=1.*10^-3; %1 mW/m^2 45 46 %output definitions: 47 md.outputdefinition.definitions={... 48 massfluxatgate('MassFlux1',[pwd '/../Exp/MassFlux1.exp']),... 49 massfluxatgate('MassFlux2',[pwd '/../Exp/MassFlux2.exp']),... 50 massfluxatgate('MassFlux3',[pwd '/../Exp/MassFlux3.exp']),... 51 massfluxatgate('MassFlux4',[pwd '/../Exp/MassFlux4.exp']),... 52 massfluxatgate('MassFlux5',[pwd '/../Exp/MassFlux5.exp']),... 53 massfluxatgate('MassFlux6',[pwd '/../Exp/MassFlux6.exp'])... 54 }; -
issm/trunk-jpl/test/Par/SquareThermal.py
r16170 r16388 2 2 from paterson import paterson 3 3 from SetMarineIceSheetBC import SetMarineIceSheetBC 4 from massfluxatgate import massfluxatgate 4 5 5 6 #Ok, start defining model parameters here … … 47 48 md.basalforcings.geothermalflux=numpy.zeros((md.mesh.numberofvertices,1)) 48 49 md.basalforcings.geothermalflux[numpy.nonzero(md.mask.groundedice_levelset>0.)[0]]=1.*10**-3 #1 mW/m^2 50 51 #output definitions: 52 md.outputdefinition.definitions=[ 53 massfluxatgate('MassFlux1',os.getcwd() + '/../Exp/MassFlux1.exp'), 54 massfluxatgate('MassFlux2',os.getcwd() + '/../Exp/MassFlux2.exp'), 55 massfluxatgate('MassFlux3',os.getcwd() + '/../Exp/MassFlux3.exp'), 56 massfluxatgate('MassFlux4',os.getcwd() + '/../Exp/MassFlux4.exp'), 57 massfluxatgate('MassFlux5',os.getcwd() + '/../Exp/MassFlux5.exp'), 58 massfluxatgate('MassFlux6',os.getcwd() + '/../Exp/MassFlux6.exp') 59 ]
Note:
See TracChangeset
for help on using the changeset viewer.