Changeset 3766
- Timestamp:
- 05/17/10 09:03:42 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/DataSet/Parameters.cpp
r3732 r3766 23 23 using namespace std; 24 24 /*}}}*/ 25 /*Parameters: {{{1*/26 27 25 28 26 /*Object constructors and destructor*/ 29 /*FUNCTION Parameters::Parameters(){{{ 2*/27 /*FUNCTION Parameters::Parameters(){{{1*/ 30 28 Parameters::Parameters(){ 31 29 return; 32 30 } 33 31 /*}}}*/ 34 /*FUNCTION Parameters::Parameters(int in_enum){{{ 2*/32 /*FUNCTION Parameters::Parameters(int in_enum){{{1*/ 35 33 Parameters::Parameters(int in_enum): DataSet(in_enum){ 36 34 //do nothing; … … 38 36 } 39 37 /*}}}*/ 40 /*FUNCTION Parameters::~Parameters(){{{ 2*/38 /*FUNCTION Parameters::~Parameters(){{{1*/ 41 39 Parameters::~Parameters(){ 42 40 return; … … 45 43 46 44 /*Object management*/ 47 /*FUNCTION Parameters::FindParam(bool* pbool,int enum_type){{{ 2*/45 /*FUNCTION Parameters::FindParam(bool* pbool,int enum_type){{{1*/ 48 46 int Parameters::FindParam(bool* pbool,int enum_type){ 49 47 … … 59 57 for ( object=objects.begin() ; object < objects.end(); object++ ){ 60 58 61 /*Find param type objects: */ 62 if((*object)->Enum()==ParamEnum){ 63 64 /*Ok, this object is a parameter, recover it and ask which name it has: */ 65 param=(Param*)(*object); 66 67 if(param->EnumType()==enum_type){ 68 /*Ok, this is the one! Recover the value of this parameter: */ 69 param->GetParameterValue(pbool); 70 found=1; 71 break; 72 } 73 } 74 } 75 return found; 76 } 77 /*}}}*/ 78 /*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{2*/ 59 /*Ok, this object is a parameter, recover it and ask which name it has: */ 60 param=(Param*)(*object); 61 62 if(param->EnumType()==enum_type){ 63 /*Ok, this is the one! Recover the value of this parameter: */ 64 param->GetParameterValue(pbool); 65 found=1; 66 break; 67 } 68 } 69 return found; 70 } 71 /*}}}*/ 72 /*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{1*/ 79 73 int Parameters::FindParam(int* pinteger,int enum_type){ 80 74 81 82 /*Go through a dataset, and find a Param* object 83 *which parameter name is "name" : */ 84 85 vector<Object*>::iterator object; 86 Param* param=NULL; 87 88 int found=0; 89 90 for ( object=objects.begin() ; object < objects.end(); object++ ){ 91 92 /*Find param type objects: */ 93 if((*object)->Enum()==ParamEnum){ 94 95 /*Ok, this object is a parameter, recover it and ask which name it has: */ 96 param=(Param*)(*object); 97 98 if(param->EnumType()==enum_type){ 99 /*Ok, this is the one! Recover the value of this parameter: */ 100 param->GetParameterValue(pinteger); 101 found=1; 102 break; 103 } 104 } 105 } 106 return found; 107 } 108 /*}}}*/ 109 /*FUNCTION Parameters::FindParam(double* pscalar, int enum_type){{{2*/ 75 /*Go through a dataset, and find a Param* object 76 *which parameter name is "name" : */ 77 78 vector<Object*>::iterator object; 79 Param* param=NULL; 80 81 int found=0; 82 83 for ( object=objects.begin() ; object < objects.end(); object++ ){ 84 85 /*Ok, this object is a parameter, recover it and ask which name it has: */ 86 param=(Param*)(*object); 87 88 if(param->EnumType()==enum_type){ 89 /*Ok, this is the one! Recover the value of this parameter: */ 90 param->GetParameterValue(pinteger); 91 found=1; 92 break; 93 } 94 } 95 return found; 96 } 97 /*}}}*/ 98 /*FUNCTION Parameters::FindParam(double* pscalar, int enum_type){{{1*/ 110 99 int Parameters::FindParam(double* pscalar, int enum_type){ 111 100 … … 120 109 for ( object=objects.begin() ; object < objects.end(); object++ ){ 121 110 122 /*Find param type objects: */ 123 if((*object)->Enum()==ParamEnum){ 124 125 /*Ok, this object is a parameter, recover it and ask which name it has: */ 126 param=(Param*)(*object); 127 128 if(param->EnumType()==enum_type){ 129 /*Ok, this is the one! Recover the value of this parameter: */ 130 param->GetParameterValue(pscalar); 131 found=1; 132 break; 133 } 134 } 135 } 136 return found; 137 } 138 /*}}}*/ 139 /*FUNCTION Parameters::FindParam(char** pstring,int enum_type){{{2*/ 111 /*Ok, this object is a parameter, recover it and ask which name it has: */ 112 param=(Param*)(*object); 113 114 if(param->EnumType()==enum_type){ 115 /*Ok, this is the one! Recover the value of this parameter: */ 116 param->GetParameterValue(pscalar); 117 found=1; 118 break; 119 } 120 } 121 return found; 122 } 123 /*}}}*/ 124 /*FUNCTION Parameters::FindParam(char** pstring,int enum_type){{{1*/ 140 125 int Parameters::FindParam(char** pstring,int enum_type){ 141 126 … … 150 135 for ( object=objects.begin() ; object < objects.end(); object++ ){ 151 136 152 /*Find param type objects: */ 153 if((*object)->Enum()==ParamEnum){ 154 155 /*Ok, this object is a parameter, recover it and ask which name it has: */ 156 param=(Param*)(*object); 157 158 if(param->EnumType()==enum_type){ 159 /*Ok, this is the one! Recover the value of this parameter: */ 160 param->GetParameterValue(pstring); 161 found=1; 162 break; 163 } 164 } 165 } 166 return found; 167 168 } 169 /*}}}*/ 170 /*FUNCTION Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){{{2*/ 137 /*Ok, this object is a parameter, recover it and ask which name it has: */ 138 param=(Param*)(*object); 139 140 if(param->EnumType()==enum_type){ 141 /*Ok, this is the one! Recover the value of this parameter: */ 142 param->GetParameterValue(pstring); 143 found=1; 144 break; 145 } 146 } 147 return found; 148 149 } 150 /*}}}*/ 151 /*FUNCTION Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){{{1*/ 171 152 int Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){ 172 153 … … 181 162 for ( object=objects.begin() ; object < objects.end(); object++ ){ 182 163 183 /*Find param type objects: */ 184 if((*object)->Enum()==ParamEnum){ 185 186 /*Ok, this object is a parameter, recover it and ask which name it has: */ 187 param=(Param*)(*object); 188 189 if(param->EnumType()==enum_type){ 190 /*Ok, this is the one! Recover the value of this parameter: */ 191 param->GetParameterValue(pstringarray,pM); 192 found=1; 193 break; 194 } 195 } 196 } 197 return found; 198 199 } 200 /*}}}*/ 201 /*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM,int enum_type){{{2*/ 164 /*Ok, this object is a parameter, recover it and ask which name it has: */ 165 param=(Param*)(*object); 166 167 if(param->EnumType()==enum_type){ 168 /*Ok, this is the one! Recover the value of this parameter: */ 169 param->GetParameterValue(pstringarray,pM); 170 found=1; 171 break; 172 } 173 } 174 return found; 175 176 } 177 /*}}}*/ 178 /*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM,int enum_type){{{1*/ 202 179 int Parameters::FindParam(double** pdoublearray,int* pM, int enum_type){ 203 180 … … 212 189 for ( object=objects.begin() ; object < objects.end(); object++ ){ 213 190 214 /*Find param type objects: */ 215 if((*object)->Enum()==ParamEnum){ 216 217 /*Ok, this object is a parameter, recover it and ask which name it has: */ 218 param=(Param*)(*object); 219 220 if(param->EnumType()==enum_type){ 221 /*Ok, this is the one! Recover the value of this parameter: */ 222 param->GetParameterValue(pdoublearray,pM); 223 found=1; 224 break; 225 } 226 } 227 } 228 return found; 229 230 } 231 /*}}}*/ 232 /*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){{{2*/ 191 /*Ok, this object is a parameter, recover it and ask which name it has: */ 192 param=(Param*)(*object); 193 194 if(param->EnumType()==enum_type){ 195 /*Ok, this is the one! Recover the value of this parameter: */ 196 param->GetParameterValue(pdoublearray,pM); 197 found=1; 198 break; 199 } 200 } 201 return found; 202 203 } 204 /*}}}*/ 205 /*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){{{1*/ 233 206 int Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){ 234 207 … … 243 216 for ( object=objects.begin() ; object < objects.end(); object++ ){ 244 217 245 /*Find param type objects: */ 246 if((*object)->Enum()==ParamEnum){ 247 248 /*Ok, this object is a parameter, recover it and ask which name it has: */ 249 param=(Param*)(*object); 250 251 if(param->EnumType()==enum_type){ 252 /*Ok, this is the one! Recover the value of this parameter: */ 253 param->GetParameterValue(pdoublearray,pM,pN); 254 found=1; 255 break; 256 } 257 } 258 } 259 return found; 260 261 } 262 /*}}}*/ 263 /*FUNCTION Parameters::FindParam(Vec* pvec,int enum_type){{{2*/ 218 /*Ok, this object is a parameter, recover it and ask which name it has: */ 219 param=(Param*)(*object); 220 221 if(param->EnumType()==enum_type){ 222 /*Ok, this is the one! Recover the value of this parameter: */ 223 param->GetParameterValue(pdoublearray,pM,pN); 224 found=1; 225 break; 226 } 227 } 228 return found; 229 230 } 231 /*}}}*/ 232 /*FUNCTION Parameters::FindParam(Vec* pvec,int enum_type){{{1*/ 264 233 int Parameters::FindParam(Vec* pvec,int enum_type){ 265 234 … … 274 243 for ( object=objects.begin() ; object < objects.end(); object++ ){ 275 244 276 /*Find param type objects: */ 277 if((*object)->Enum()==ParamEnum){ 278 279 /*Ok, this object is a parameter, recover it and ask which name it has: */ 280 param=(Param*)(*object); 281 282 if(param->EnumType()==enum_type){ 283 /*Ok, this is the one! Recover the value of this parameter: */ 284 param->GetParameterValue(pvec); 285 found=1; 286 break; 287 } 288 } 289 } 290 return found; 291 292 } 293 /*}}}*/ 294 /*FUNCTION Parameters::FindParamMat* pmat,int enum_type){{{2*/ 245 /*Ok, this object is a parameter, recover it and ask which name it has: */ 246 param=(Param*)(*object); 247 248 if(param->EnumType()==enum_type){ 249 /*Ok, this is the one! Recover the value of this parameter: */ 250 param->GetParameterValue(pvec); 251 found=1; 252 break; 253 } 254 } 255 return found; 256 257 } 258 /*}}}*/ 259 /*FUNCTION Parameters::FindParamMat* pmat,int enum_type){{{1*/ 295 260 int Parameters::FindParam(Mat* pmat,int enum_type){ 296 261 … … 305 270 for ( object=objects.begin() ; object < objects.end(); object++ ){ 306 271 307 /*Find param type objects: */ 308 if((*object)->Enum()==ParamEnum){ 309 310 /*Ok, this object is a parameter, recover it and ask which name it has: */ 311 param=(Param*)(*object); 312 313 if(param->EnumType()==enum_type){ 314 /*Ok, this is the one! Recover the value of this parameter: */ 315 param->GetParameterValue(pmat); 316 found=1; 317 break; 318 } 319 } 320 } 321 return found; 322 323 } 324 /*}}}*/ 325 /*FUNCTION Parameters::FindParamObject{{{2*/ 272 /*Ok, this object is a parameter, recover it and ask which name it has: */ 273 param=(Param*)(*object); 274 275 if(param->EnumType()==enum_type){ 276 /*Ok, this is the one! Recover the value of this parameter: */ 277 param->GetParameterValue(pmat); 278 found=1; 279 break; 280 } 281 } 282 return found; 283 284 } 285 /*}}}*/ 286 /*FUNCTION Parameters::FindParamObject{{{1*/ 326 287 Object* Parameters::FindParamObject(int enum_type){ 327 288 … … 334 295 for ( object=objects.begin() ; object < objects.end(); object++ ){ 335 296 336 /*Find param type objects: */ 337 if((*object)->Enum()==ParamEnum){ 338 339 /*Ok, this object is a parameter, recover it and ask which name it has: */ 340 param=(Param*)(*object); 341 342 if(param->EnumType()==enum_type){ 343 /*Ok, this is the one! Return the object: */ 344 return (*object); 345 } 297 /*Ok, this object is a parameter, recover it and ask which name it has: */ 298 param=(Param*)(*object); 299 300 if(param->EnumType()==enum_type){ 301 /*Ok, this is the one! Return the object: */ 302 return (*object); 346 303 } 347 304 } … … 349 306 } 350 307 /*}}}*/ 351 352 /*Object functions*/353 354 355 /*}}}*/ -
issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp
r3713 r3766 30 30 if (strcmp(iomodel->meshtype,"2d")==0) parameters->AddObject(new IntParam(DimEnum,2)); 31 31 else parameters->AddObject(new IntParam(DimEnum,3)); 32 parameters->AddObject(new 32 parameters->AddObject(new StringParam(OutputFileNameEnum,iomodel->outputfilename)); 33 33 parameters->AddObject(new BoolParam(IsHutterEnum,iomodel->ishutter)); 34 34 parameters->AddObject(new BoolParam(IsMacAyealPattynEnum,iomodel->ismacayealpattyn)); … … 58 58 parameters->AddObject(new DoubleParam(ViscosityOvershootEnum,iomodel->viscosity_overshoot)); 59 59 parameters->AddObject(new BoolParam(WaitOnLockEnum,iomodel->waitonlock)); 60 parameters->AddObject(new 60 parameters->AddObject(new StringParam(SolverStringEnum,iomodel->solverstring)); 61 61 parameters->AddObject(new IntParam(NumberOfVerticesEnum,iomodel->numberofvertices)); 62 62 parameters->AddObject(new IntParam(NumberOfElementsEnum,iomodel->numberofelements));
Note:
See TracChangeset
for help on using the changeset viewer.