Changeset 4852
- Timestamp:
- 07/28/10 17:52:32 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 2 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
r4784 r4852 135 135 BoolParamEnum, 136 136 DoubleMatParamEnum, 137 DoubleMatArrayParamEnum, 137 138 DoubleParamEnum, 138 139 DoubleVecParamEnum, -
issm/trunk/src/c/io/FetchParams.cpp
r4189 r4852 32 32 double* matrix=NULL; 33 33 char** stringarray=NULL; 34 double** array=NULL; 35 int* mdims_array=NULL; 36 int* ndims_array=NULL; 34 37 int nfields; 35 38 char* name=NULL; … … 113 116 } 114 117 else if (mxIsCell(pfield)){ 115 /*string array: */116 M=mxGetM(pfield);117 stringarray=(char**)xmalloc(M*sizeof(char*));118 118 119 for(i=0;i<M;i++){ 120 char* descriptor=NULL; 121 pfield2=mxGetCell(pfield,i); 122 FetchData(&descriptor,pfield2); 123 stringarray[i]=descriptor; 119 /*This can be a string array, or a matrix array. Check the first 120 *element type to decide: */ 121 pfield2=mxGetCell(pfield,0); 122 if (mxIsChar(pfield2)){ 123 124 /*string array: */ 125 M=mxGetM(pfield); 126 stringarray=(char**)xmalloc(M*sizeof(char*)); 127 128 for(i=0;i<M;i++){ 129 char* descriptor=NULL; 130 pfield2=mxGetCell(pfield,i); 131 FetchData(&descriptor,pfield2); 132 stringarray[i]=descriptor; 133 } 134 135 param= new StringArrayParam(enum_type,stringarray,M); 136 parameters->AddObject(param); 137 138 /*Free ressources:*/ 139 for(i=0;i<M;i++){ 140 char* descriptor=stringarray[i]; 141 xfree((void**)&descriptor); 142 } 143 xfree((void**)&stringarray); 144 124 145 } 125 126 param= new StringArrayParam(enum_type,stringarray,M); 127 parameters->AddObject(param); 146 else{ 147 148 /*matrix array: */ 149 M=mxGetM(pfield); 150 array=(double**)xmalloc(M*sizeof(double*)); 151 mdims_array=(int*)xmalloc(M*sizeof(int)); 152 ndims_array=(int*)xmalloc(M*sizeof(int)); 128 153 129 /*Free ressources:*/ 130 for(i=0;i<M;i++){ 131 char* descriptor=stringarray[i]; 132 xfree((void**)&descriptor); 154 for(i=0;i<M;i++){ 155 double* matrix=NULL; 156 int m,n; 157 pfield2=mxGetCell(pfield,i); 158 FetchData(&matrix,&m,&n,pfield2); 159 array[i]=matrix; 160 mdims_array[i]=m; 161 ndims_array[i]=n; 162 } 163 164 param= new DoubleMatArrayParam(enum_type,array,M,mdims_array,ndims_array); 165 parameters->AddObject(param); 166 167 /*Free ressources:*/ 168 for(i=0;i<M;i++){ 169 double* matrix=array[i]; 170 xfree((void**)&matrix); 171 } 172 xfree((void**)&array); 173 xfree((void**)&mdims_array); 174 xfree((void**)&ndims_array); 133 175 } 134 xfree((void**)&stringarray);135 136 176 } 137 177 else ISSMERROR("%s%i","unknow type in parameters structure field ",i); -
issm/trunk/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp
r4785 r4852 24 24 /*edge 1: */ 25 25 xel[0]=xgrids[0]; yel[0]=ygrids[0]; xel[1]=xgrids[1]; yel[1]=ygrids[1]; 26 edge1=SegmentIntersect(&alpha1,&alpha2, xel,yel,xsegment,ysegment); 26 edge1=SegmentIntersect(&alpha1,&alpha2, xel,yel,xsegment,ysegment); //alpha1: segment coordinate of intersection. alpha2: same thing for second interesection if it exists (colinear edges) 27 27 28 28 /*edge 2: */ … … 33 33 xel[0]=xgrids[2]; yel[0]=ygrids[2]; xel[1]=xgrids[0]; yel[1]=ygrids[0]; 34 34 edge3=SegmentIntersect(&gamma1,&gamma2, xel,yel,xsegment,ysegment); 35 36 /*edge can be either IntersectEnum (one iand only one intersection between the edge and the segment), ColinearEnum (edge and segment are collinear) and SeparateEnum (no intersection): */ 35 37 36 38 if( (edge1==IntersectEnum) && (edge2==IntersectEnum) && (edge3==IntersectEnum) ){ … … 54 56 55 57 segments_dataset->AddObject(new Segment(el+1,xfinal[0],yfinal[0],xfinal[1],yfinal[1])); 58 } 59 else{ 60 /*the segment intersected at the vertex, do not bother with this "0" length segment!:*/ 56 61 } 57 62 } -
issm/trunk/src/c/modules/ModelProcessorx/Qmu/CreateParametersQmu.cpp
r4670 r4852 14 14 15 15 void CreateParametersQmu(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_type){ 16 16 17 /*variable declarations: {{{1*/ 17 18 int i,j,k; 18 19 … … 37 38 38 39 /*parameters for mass flux: */ 40 bool qmu_mass_flux_present=false; 39 41 double* qmu_mass_flux_segments=NULL; 40 42 double* my_qmu_mass_flux_segments=NULL; … … 50 52 mxArray* pfield2=NULL; 51 53 #endif 54 /*}}}*/ 52 55 53 56 /*recover parameters : */ … … 57 60 if(iomodel->qmu_analysis){ 58 61 59 / /name of qmu input, error and output files62 /*name of qmu input, error and output files:{{{1*/ 60 63 qmuinname=(char*)xmalloc((strlen(iomodel->name)+strlen(".qmu.in")+1)*sizeof(char)); 61 64 sprintf(qmuinname,"%s%s",iomodel->name,".qmu.in"); … … 69 72 sprintf(qmuerrname,"%s%s",iomodel->name,".qmu.err"); 70 73 parameters->AddObject(new StringParam(QmuErrNameEnum,qmuerrname)); 71 72 parameters->AddObject(new IntParam(QmuNPartEnum,iomodel->qmu_npart)); 73 74 /*Deal with variables for qmu iomodeling: */ 74 /*}}}*/ 75 76 /*Deal with variable descriptors: {{{1*/ 75 77 variabledescriptors=(char**)xmalloc(iomodel->numberofvariables*sizeof(char*)); 76 78 … … 99 101 parameters->AddObject(new StringArrayParam(VariableDescriptorsEnum,variabledescriptors,iomodel->numberofvariables)); 100 102 101 /*Deal with responses and partition for qmu iomodeling: */ 103 /*}}}*/ 104 105 /*Deal with responses: {{{1*/ 102 106 responsedescriptors=(char**)xmalloc(iomodel->numberofresponses*sizeof(char*)); 103 107 … … 123 127 /*Ok, we have all the response descriptors. Build a parameter with it: */ 124 128 parameters->AddObject(new StringArrayParam(ResponseDescriptorsEnum,responsedescriptors,iomodel->numberofresponses)); 125 129 /*}}}}*/ 130 131 /*Deal with partitioning: {{{1*/ 126 132 /*partition vertices in iomodel->qmu_npart parts, unless a partition is already present: */ 133 parameters->AddObject(new IntParam(QmuNPartEnum,iomodel->qmu_npart)); 134 127 135 IoModelFetchData(&dpart,NULL,NULL,iomodel_handle,"part"); 128 136 … … 136 144 } 137 145 parameters->AddObject(new DoubleVecParam(QmuPartEnum,dpart,iomodel->numberofvertices)); 138 139 /*Ok, now if any of the variables input from Dakota are distributed, we are going to need the parameters: */ 146 /*}}}*/ 147 148 /*Deal with data needed because of qmu variable inputs: {{{1*/ 140 149 for(i=0;i<iomodel->numberofvariables;i++){ 141 150 … … 151 160 } 152 161 } 153 154 /*Deal with data needed for some responses: */ 162 /*}}}*/ 163 164 /*Deal with data needed to compute qmu responses: {{{1*/ 155 165 for(i=0;i<iomodel->numberofresponses;i++){ 156 166 char* descriptor=responsedescriptors[i]; 157 if (strcmp(descriptor,"mass_flux")==0){ 158 159 /*We need the qmu_mass_flux_segments to be able to compute the mass flux: */ 160 IoModelFetchData(&qmu_mass_flux_segments,&tot_qmu_mass_flux_segments,NULL,iomodel_handle,"qmu_mass_flux_segments"); 161 IoModelFetchData(&qmu_mass_flux_num_segments,&tot_qmu_mass_flux_num_segments,NULL,iomodel_handle,"qmu_mass_flux_num_segments"); 162 163 #ifdef _PARALLEL_ 164 165 /*Only if partitioning exist do we care about the segments: */ 166 if(iomodel->my_elements){ 167 168 /*Use the element partitioning vector from the iomodel to down select qmu_mass_flux_segments to only segments that are relevant 169 * to this cpu: */ 170 my_tot_qmu_mass_flux_segments=0; 171 for(j=0;j<tot_qmu_mass_flux_segments;j++){ 172 if ( iomodel->my_elements[(int)(*(qmu_mass_flux_segments+5*j+4))-1])my_tot_qmu_mass_flux_segments++; 173 } 174 175 176 if(my_tot_qmu_mass_flux_segments){ 177 my_qmu_mass_flux_segments=(double*)xcalloc(5*my_tot_qmu_mass_flux_segments,sizeof(double)); 178 second_count=0; 179 for(j=0;j<tot_qmu_mass_flux_segments;j++){ 180 if (iomodel->my_elements[(int)*(qmu_mass_flux_segments+5*j+4)-1]){ 181 for(k=0;k<5;k++)*(my_qmu_mass_flux_segments+5*second_count+k)=*(qmu_mass_flux_segments+5*j+k); 182 second_count++; 183 } 184 } 185 } 186 187 parameters->AddObject(new DoubleMatParam(QmuMassFluxSegmentsEnum,my_qmu_mass_flux_segments,my_tot_qmu_mass_flux_segments,5)); 188 189 } 190 191 #else 192 193 parameters->AddObject(new DoubleMatParam(QmuMassFluxSegmentsEnum,qmu_mass_flux_segments,tot_qmu_mass_flux_segments,5)); 194 parameters->AddObject(new DoubleVecParam(QmuMassFluxNumSegmentsEnum,qmu_mass_flux_num_segments,tot_qmu_mass_flux_num_segments)); 195 196 #endif 197 198 xfree((void**)&qmu_mass_flux_segments); 199 xfree((void**)&my_qmu_mass_flux_segments); 200 xfree((void**)&qmu_mass_flux_num_segments); 201 xfree((void**)&my_qmu_mass_flux_num_segments); 202 } 167 168 if(strncmp(response_descriptor,"MassFlux",8)==0){ 169 qmu_mass_flux_present=true; 170 } 171 203 172 if (strcmp(descriptor,"misfit")==0){ 204 173 … … 210 179 } 211 180 } 212 213 /*Free data: */ 181 182 183 if(qmu_mass_flux_present){ 184 185 /*We need the segments to be able to compute the mass flux. We have as many groups of segments as we have MassFlux 186 *responses. Let's build a DoubleMatArrayParam object with the array of segments: */ 187 188 #ifdef _PARALLEL_ 189 IoModelFetchData(&qmu_mass_flux_segments,&tot_qmu_mass_flux_segments,NULL,iomodel_handle,"qmu_mass_flux_segments"); 190 IoModelFetchData(&qmu_mass_flux_num_segments,&tot_qmu_mass_flux_num_segments,NULL,iomodel_handle,"qmu_mass_flux_num_segments"); 191 192 193 /*Only if partitioning exist do we care about the segments: */ 194 if(iomodel->my_elements){ 195 196 /*Use the element partitioning vector from the iomodel to down select qmu_mass_flux_segments to only segments that are relevant 197 * to this cpu: */ 198 my_tot_qmu_mass_flux_segments=0; 199 for(j=0;j<tot_qmu_mass_flux_segments;j++){ 200 if ( iomodel->my_elements[(int)(*(qmu_mass_flux_segments+5*j+4))-1])my_tot_qmu_mass_flux_segments++; 201 } 202 203 204 if(my_tot_qmu_mass_flux_segments){ 205 my_qmu_mass_flux_segments=(double*)xcalloc(5*my_tot_qmu_mass_flux_segments,sizeof(double)); 206 second_count=0; 207 for(j=0;j<tot_qmu_mass_flux_segments;j++){ 208 if (iomodel->my_elements[(int)*(qmu_mass_flux_segments+5*j+4)-1]){ 209 for(k=0;k<5;k++)*(my_qmu_mass_flux_segments+5*second_count+k)=*(qmu_mass_flux_segments+5*j+k); 210 second_count++; 211 } 212 } 213 } 214 215 parameters->AddObject(new DoubleMatParam(QmuMassFluxSegmentsEnum,my_qmu_mass_flux_segments,my_tot_qmu_mass_flux_segments,5)); 216 217 } 218 219 #else 220 IoModelFetchData(&qmu_mass_flux_segments,&tot_qmu_mass_flux_segments,NULL,iomodel_handle,"qmu_mass_flux_segments"); 221 IoModelFetchData(&qmu_mass_flux_num_segments,&tot_qmu_mass_flux_num_segments,NULL,iomodel_handle,"qmu_mass_flux_num_segments"); 222 223 parameters->AddObject(new DoubleMatParam(QmuMassFluxSegmentsEnum,qmu_mass_flux_segments,tot_qmu_mass_flux_segments,5)); 224 parameters->AddObject(new DoubleVecParam(QmuMassFluxNumSegmentsEnum,qmu_mass_flux_num_segments,tot_qmu_mass_flux_num_segments)); 225 226 #endif 227 228 xfree((void**)&qmu_mass_flux_segments); 229 xfree((void**)&my_qmu_mass_flux_segments); 230 xfree((void**)&qmu_mass_flux_num_segments); 231 xfree((void**)&my_qmu_mass_flux_num_segments); 232 } 233 /*}}}*/ 234 235 /*Free data: {{{1*/ 214 236 xfree((void**)&tag); 215 237 for(i=0;i<iomodel->numberofresponses;i++){ … … 232 254 xfree((void**)&qmuerrname); 233 255 xfree((void**)&qmuoutname); 234 } 256 /*}}}*/ 257 } //if(iomodel->qmu_analysis) 235 258 236 259 /*Assign output pointer: */ -
issm/trunk/src/c/objects/Params/BoolParam.h
r4248 r4852 60 60 void GetParameterValue(double** pdoublearray,int* pM){ISSMERROR("Bool param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 61 61 void GetParameterValue(double** pdoublearray,int* pM, int* pN){ISSMERROR("Bool param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 62 void GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){ISSMERROR("Bool param of enum %i (%s) cannot return a matrix array",enum_type,EnumAsString(enum_type));} 62 63 void GetParameterValue(Vec* pvec){ISSMERROR("Bool param of enum %i (%s) cannot return a Vec",enum_type,EnumAsString(enum_type));} 63 64 void GetParameterValue(Mat* pmat){ISSMERROR("Bool param of enum %i (%s) cannot return a Mat",enum_type,EnumAsString(enum_type));} … … 72 73 void SetValue(Vec vec){ISSMERROR("Bool param of enum %i (%s) cannot hold a Vec",enum_type,EnumAsString(enum_type));} 73 74 void SetValue(Mat mat){ISSMERROR("Bool param of enum %i (%s) cannot hold a Mat",enum_type,EnumAsString(enum_type));} 75 void SetValue(double** array, int M, int* mdim_array, int* ndim_array){ISSMERROR("Bool param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumAsString(enum_type));} 76 74 77 75 78 char* GetParameterName(void); -
issm/trunk/src/c/objects/Params/DoubleMatParam.h
r4248 r4852 31 31 32 32 private: 33 /*just hold 3 values for 3 vertices: */34 33 int enum_type; 35 IssmDouble* value;34 double* value; 36 35 int M; 37 36 int N; … … 63 62 void GetParameterValue(double** pdoublearray,int* pM){ISSMERROR("DoubleMat param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 64 63 void GetParameterValue(double** pdoublearray,int* pM,int* pN); 64 void GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){ISSMERROR("DoubleMat param of enum %i (%s) cannot return a matrix array",enum_type,EnumAsString(enum_type));} 65 65 void GetParameterValue(Vec* pvec){ISSMERROR("DoubleMat param of enum %i (%s) cannot return a Vec",enum_type,EnumAsString(enum_type));} 66 66 void GetParameterValue(Mat* pmat){ISSMERROR("DoubleMat param of enum %i (%s) cannot return a Mat",enum_type,EnumAsString(enum_type));} … … 75 75 void SetValue(Vec vec){ISSMERROR("DoubleMat param of enum %i (%s) cannot hold a Vec",enum_type,EnumAsString(enum_type));} 76 76 void SetValue(Mat mat){ISSMERROR("DoubleMat param of enum %i (%s) cannot hold a Mat",enum_type,EnumAsString(enum_type));} 77 void SetValue(double** array, int M, int* mdim_array, int* ndim_array){ISSMERROR("DoubleMat param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumAsString(enum_type));} 77 78 78 79 char* GetParameterName(void); -
issm/trunk/src/c/objects/Params/DoubleParam.h
r4248 r4852 61 61 void GetParameterValue(double** pdoublearray,int* pM){ISSMERROR("Double param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 62 62 void GetParameterValue(double** pdoublearray,int* pM, int* pN){ISSMERROR("Double param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 63 void GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){ISSMERROR("Double param of enum %i (%s) cannot return a matrix array",enum_type,EnumAsString(enum_type));} 63 64 void GetParameterValue(Vec* pvec){ISSMERROR("Double param of enum %i (%s) cannot return a Vec",enum_type,EnumAsString(enum_type));} 64 65 void GetParameterValue(Mat* pmat){ISSMERROR("Double param of enum %i (%s) cannot return a Mat",enum_type,EnumAsString(enum_type));} … … 73 74 void SetValue(Vec vec){ISSMERROR("Double param of enum %i (%s) cannot hold a Vec",enum_type,EnumAsString(enum_type));} 74 75 void SetValue(Mat mat){ISSMERROR("Double param of enum %i (%s) cannot hold a Mat",enum_type,EnumAsString(enum_type));} 76 void SetValue(double** array, int M, int* mdim_array, int* ndim_array){ISSMERROR("Double param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumAsString(enum_type));} 75 77 76 78 char* GetParameterName(void); -
issm/trunk/src/c/objects/Params/DoubleVecParam.h
r4248 r4852 61 61 void GetParameterValue(double** pdoublearray,int* pM); 62 62 void GetParameterValue(double** pdoublearray,int* pM, int* pN){ISSMERROR("DoubleVec param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 63 void GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){ISSMERROR("DoubleVec param of enum %i (%s) cannot return a matrix array",enum_type,EnumAsString(enum_type));} 63 64 void GetParameterValue(Vec* pvec){ISSMERROR("DoubleVec param of enum %i (%s) cannot return a Vec",enum_type,EnumAsString(enum_type));} 64 65 void GetParameterValue(Mat* pmat){ISSMERROR("DoubleVec param of enum %i (%s) cannot return a Mat",enum_type,EnumAsString(enum_type));} … … 73 74 void SetValue(Vec vec){ISSMERROR("DoubleVec param of enum %i (%s) cannot hold a Vec",enum_type,EnumAsString(enum_type));} 74 75 void SetValue(Mat mat){ISSMERROR("DoubleVec param of enum %i (%s) cannot hold a Mat",enum_type,EnumAsString(enum_type));} 76 void SetValue(double** array, int M, int* mdim_array, int* ndim_array){ISSMERROR("DoubleVec param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumAsString(enum_type));} 75 77 76 78 char* GetParameterName(void); -
issm/trunk/src/c/objects/Params/IntParam.h
r4248 r4852 60 60 void GetParameterValue(double** pdoublearray,int* pM){ISSMERROR("Int param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 61 61 void GetParameterValue(double** pdoublearray,int* pM, int* pN){ISSMERROR("Int param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 62 void GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){ISSMERROR("Int param of enum %i (%s) cannot return a matrix array",enum_type,EnumAsString(enum_type));} 62 63 void GetParameterValue(Vec* pvec){ISSMERROR("Int param of enum %i (%s) cannot return a Vec",enum_type,EnumAsString(enum_type));} 63 64 void GetParameterValue(Mat* pmat){ISSMERROR("Int param of enum %i (%s) cannot return a Mat",enum_type,EnumAsString(enum_type));} … … 72 73 void SetValue(Vec vec){ISSMERROR("Int param of enum %i (%s) cannot hold a Vec",enum_type,EnumAsString(enum_type));} 73 74 void SetValue(Mat mat){ISSMERROR("Int param of enum %i (%s) cannot hold a Mat",enum_type,EnumAsString(enum_type));} 75 void SetValue(double** array, int M, int* mdim_array, int* ndim_array){ISSMERROR("Int param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumAsString(enum_type));} 74 76 75 77 char* GetParameterName(void); -
issm/trunk/src/c/objects/Params/Param.h
r4248 r4852 39 39 virtual void GetParameterValue(double** pdoublearray,int* pM)=0; 40 40 virtual void GetParameterValue(double** pdoublearray,int* pM,int* pN)=0; 41 virtual void GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims)=0; 41 42 virtual void GetParameterValue(Vec* pvec)=0; 42 43 virtual void GetParameterValue(Mat* pmat)=0; … … 51 52 virtual void SetValue(Vec vec)=0; 52 53 virtual void SetValue(Mat mat)=0; 54 virtual void SetValue(double** array, int M, int* mdim_array, int* ndim_array)=0; 53 55 54 56 virtual char* GetParameterName(void)=0; -
issm/trunk/src/c/objects/Params/PetscMatParam.h
r4248 r4852 61 61 void GetParameterValue(double** pdoublearray,int* pM){ISSMERROR("PetscMat param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 62 62 void GetParameterValue(double** pdoublearray,int* pM, int* pN){ISSMERROR("PetscMat param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 63 void GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){ISSMERROR("PetscMat param of enum %i (%s) cannot return a matrix array",enum_type,EnumAsString(enum_type));} 63 64 void GetParameterValue(Vec* pvec){ISSMERROR("PetscMat param of enum %i (%s) cannot return a vec",enum_type,EnumAsString(enum_type));} 64 65 void GetParameterValue(Mat* poutput); … … 73 74 void SetValue(Vec vec){ISSMERROR("PetscMat param of enum %i (%s) cannot hold a Vec",enum_type,EnumAsString(enum_type));} 74 75 void SetValue(Mat mat); 76 void SetValue(double** array, int M, int* mdim_array, int* ndim_array){ISSMERROR("PetscMat param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumAsString(enum_type));} 75 77 76 78 char* GetParameterName(void); -
issm/trunk/src/c/objects/Params/PetscVecParam.h
r4248 r4852 61 61 void GetParameterValue(double** pdoublearray,int* pM){ISSMERROR("PetscVec param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 62 62 void GetParameterValue(double** pdoublearray,int* pM, int* pN){ISSMERROR("PetscVec param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 63 void GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){ISSMERROR("PetscVec param of enum %i (%s) cannot return a matrix array",enum_type,EnumAsString(enum_type));} 63 64 void GetParameterValue(Mat* pmat){ISSMERROR("PetscVec param of enum %i (%s) cannot return a Mat",enum_type,EnumAsString(enum_type));} 64 65 void GetParameterValue(Vec* poutput); 65 66 66 void SetValue(bool boolean){ISSMERROR(" Boolparam of enum %i (%s) cannot hold a boolean",enum_type,EnumAsString(enum_type));}67 void SetValue(int integer){ISSMERROR(" Boolparam of enum %i (%s) cannot hold an integer",enum_type,EnumAsString(enum_type));}68 void SetValue(double scalar){ISSMERROR(" Boolparam of enum %i (%s) cannot hold a scalar",enum_type,EnumAsString(enum_type));}69 void SetValue(char* string){ISSMERROR(" Boolparam of enum %i (%s) cannot hold a string",enum_type,EnumAsString(enum_type));}70 void SetValue(char** stringarray,int M){ISSMERROR(" Boolparam of enum %i (%s) cannot hold a string array",enum_type,EnumAsString(enum_type));}71 void SetValue(double* doublearray,int M){ISSMERROR(" Boolparam of enum %i (%s) cannot hold a double array",enum_type,EnumAsString(enum_type));}72 void SetValue(double* pdoublearray,int M,int N){ISSMERROR(" Boolparam of enum %i (%s) cannot hold a double array",enum_type,EnumAsString(enum_type));}67 void SetValue(bool boolean){ISSMERROR("PetscVec param of enum %i (%s) cannot hold a boolean",enum_type,EnumAsString(enum_type));} 68 void SetValue(int integer){ISSMERROR("PetscVec param of enum %i (%s) cannot hold an integer",enum_type,EnumAsString(enum_type));} 69 void SetValue(double scalar){ISSMERROR("PetscVec param of enum %i (%s) cannot hold a scalar",enum_type,EnumAsString(enum_type));} 70 void SetValue(char* string){ISSMERROR("PetscVec param of enum %i (%s) cannot hold a string",enum_type,EnumAsString(enum_type));} 71 void SetValue(char** stringarray,int M){ISSMERROR("PetscVec param of enum %i (%s) cannot hold a string array",enum_type,EnumAsString(enum_type));} 72 void SetValue(double* doublearray,int M){ISSMERROR("PetscVec param of enum %i (%s) cannot hold a double array",enum_type,EnumAsString(enum_type));} 73 void SetValue(double* pdoublearray,int M,int N){ISSMERROR("PetscVec param of enum %i (%s) cannot hold a double array",enum_type,EnumAsString(enum_type));} 73 74 void SetValue(Vec vec); 74 void SetValue(Mat mat){ISSMERROR("Bool param of enum %i (%s) cannot hold a Mat",enum_type,EnumAsString(enum_type));} 75 void SetValue(Mat mat){ISSMERROR("PetscVec param of enum %i (%s) cannot hold a Mat",enum_type,EnumAsString(enum_type));} 76 void SetValue(double** array, int M, int* mdim_array, int* ndim_array){ISSMERROR("PetscVec param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumAsString(enum_type));} 75 77 76 78 char* GetParameterName(void); -
issm/trunk/src/c/objects/Params/StringArrayParam.h
r4248 r4852 63 63 void GetParameterValue(double** pdoublearray,int* pM){ISSMERROR("StringArray param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 64 64 void GetParameterValue(double** pdoublearray,int* pM, int* pN){ISSMERROR("StringArray param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 65 void GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){ISSMERROR("Vec param of enum %i (%s) cannot return a matrix array",enum_type,EnumAsString(enum_type));} 65 66 void GetParameterValue(Vec* pvec){ISSMERROR("StringArray param of enum %i (%s) cannot return a Vec",enum_type,EnumAsString(enum_type));} 66 67 void GetParameterValue(Mat* pmat){ISSMERROR("StringArray param of enum %i (%s) cannot return a Mat",enum_type,EnumAsString(enum_type));} … … 75 76 void SetValue(Vec vec){ISSMERROR("StringArray param of enum %i (%s) cannot hold a Vec",enum_type,EnumAsString(enum_type));} 76 77 void SetValue(Mat mat){ISSMERROR("StringArray param of enum %i (%s) cannot hold a Mat",enum_type,EnumAsString(enum_type));} 78 void SetValue(double** array, int M, int* mdim_array, int* ndim_array){ISSMERROR("StringArray param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumAsString(enum_type));} 77 79 78 80 char* GetParameterName(void); -
issm/trunk/src/c/objects/Params/StringParam.h
r4248 r4852 61 61 void GetParameterValue(double** pdoublearray,int* pM){ISSMERROR("String param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 62 62 void GetParameterValue(double** pdoublearray,int* pM, int* pN){ISSMERROR("String param of enum %i (%s) cannot return a double array",enum_type,EnumAsString(enum_type));} 63 void GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){ISSMERROR("String param of enum %i (%s) cannot return a matrix array",enum_type,EnumAsString(enum_type));} 63 64 void GetParameterValue(Vec* pvec){ISSMERROR("String param of enum %i (%s) cannot return a Vec",enum_type,EnumAsString(enum_type));} 64 65 void GetParameterValue(Mat* pmat){ISSMERROR("String param of enum %i (%s) cannot return a Mat",enum_type,EnumAsString(enum_type));} … … 73 74 void SetValue(Vec vec){ISSMERROR("String param of enum %i (%s) cannot hold a Vec",enum_type,EnumAsString(enum_type));} 74 75 void SetValue(Mat mat){ISSMERROR("String param of enum %i (%s) cannot hold a Mat",enum_type,EnumAsString(enum_type));} 76 void SetValue(double** array, int M, int* mdim_array, int* ndim_array){ISSMERROR("String param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumAsString(enum_type));} 75 77 76 78 char* GetParameterName(void); -
issm/trunk/src/m/qmu/process_qmu_response_data.m
r4791 r4852 10 10 process_mass_flux_profiles=0; 11 11 12 num_mass_flux=0; 12 13 13 14 %loop through response descriptors, and act accordingly … … 16 17 %Do we have to process mass flux profiles? 17 18 if strncmpi(md.responsedescriptors{i},'MassFlux',8), 19 num_mass_flux=num_mass_flux+1; 18 20 process_mass_flux_profiles=1; 19 21 end … … 37 39 end 38 40 41 if num_mass_flux~=numel(md.qmu_mass_flux_profiles), 42 error('process_qmu_response_data error message: qmu_mass_flux_profiles should be of the same size as the number of MassFlux responses asked for in the Qmu analysis'); 43 end 44 39 45 %ok, process the domains named in qmu_mass_flux_profiles, to build a list of segments 40 md.qmu_mass_flux_segments=cell(num el(md.qmu_mass_flux_profiles),1);46 md.qmu_mass_flux_segments=cell(num_mass_flux,1); 41 47 42 for i=1:num el(md.qmu_mass_flux_profiles),43 md.qmu_mass_flux_segments{i}=M assFluxProcessProfile(md,md.qmu_mass_flux_profile_directory,md.qmu_mass_flux_profiles{i});48 for i=1:num_mass_flux, 49 md.qmu_mass_flux_segments{i}=MeshProfileIntersection(md.elements,md.x,md.y,[md.qmu_mass_flux_profile_directory/md.qmu_mass_flux_profiles{i}]); 44 50 end 51 52 %finally, set qmu_mass_flux_num_profiles, for future marshalling 53 md.qmu_mass_flux_num_profiles=num_mass_flux; 45 54 end -
issm/trunk/src/m/qmu/qmumarshall.m
r2110 r4852 70 70 71 71 %write response specific data 72 qmu_segments=0; 72 73 count=0; 73 74 for i=1:length(response_fieldnames), … … 76 77 for j=1:length(fieldresponses), 77 78 descriptor=fieldresponses(j).descriptor; 78 if str cmpi(descriptor,'mass_flux'),79 WriteData(fid,md.qmu_mass_flux_segments,'Mat','qmu_mass_flux_segments');79 if strncmpi(descriptor,'MassFlux',8), 80 qmu_segments=1; 80 81 end 82 end 83 end 84 85 if qmu_segments, 86 WriteData(fid,md.qmu_mass_flux_num_profiles,'Integer','qmu_mass_flux_num_profiles'); 87 for i=1:md.qmu_mass_flux_num_profiles, 88 WriteData(fid,md.qmu_mass_flux_segments{i},'Mat',['qmu_mass_flux_segments' num2str(i)]); 81 89 end 82 90 end
Note:
See TracChangeset
for help on using the changeset viewer.