Changeset 2333
- Timestamp:
- 09/27/09 21:43:40 (15 years ago)
- Location:
- issm/trunk
- Files:
-
- 4 added
- 7 deleted
- 176 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/cron/configs/linux64_local
r2233 r2333 77 77 #by Matlab and nightlyrun.m 78 78 79 NROPTIONS=" 'analysis_type',{'diagnostic'},'control',1"79 NROPTIONS="" -
issm/trunk/src/c/ComputePressurex/ComputePressurex.cpp
r303 r2333 13 13 #include "../EnumDefinitions/EnumDefinitions.h" 14 14 15 void ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, int numberofnodes){15 void ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials,DataSet* parameters){ 16 16 17 17 int i; 18 18 19 19 int found=0; 20 double numberofnodes; 20 21 21 22 /*output: */ 22 23 Vec p_g=NULL; 24 25 /*Recover numberofnodes: */ 26 parameters->FindParam(&numberofnodes,"numberofnodes"); 23 27 24 28 /*Allocate p_g on numberofnodes (only 1 dof): */ … … 26 30 27 31 /*Get elements configured: */ 28 elements->Configure(elements,loads, nodes, materials); 32 elements->Configure(elements,loads, nodes, materials,parameters); 33 parameters->Configure(elements,loads, nodes, materials,parameters); 29 34 30 35 /*Call on dataset driver: */ -
issm/trunk/src/c/ComputePressurex/ComputePressurex.h
r303 r2333 9 9 10 10 /* local prototypes: */ 11 void ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, int numberofnodes);11 void ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, DataSet* parameters); 12 12 13 13 #endif /* _COMPUTEPRESSUREX_H */ -
issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.cpp
r1464 r2333 13 13 #include "../EnumDefinitions/EnumDefinitions.h" 14 14 15 int ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes,DataSet* materials ){15 int ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes,DataSet* materials,DataSet* parameters){ 16 16 17 17 int noerr=1; … … 24 24 25 25 26 elements->Configure(elements,loads,nodes,materials); 27 loads->Configure(elements,loads,nodes,materials); 28 nodes->Configure(elements,loads,nodes,materials); 26 elements->Configure(elements,loads,nodes,materials,parameters); 27 loads->Configure(elements,loads,nodes,materials,parameters); 28 nodes->Configure(elements,loads,nodes,materials,parameters); 29 parameters->Configure(elements,loads, nodes, materials,parameters); 29 30 30 31 return noerr; -
issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.h
r1 r2333 9 9 10 10 /* local prototypes: */ 11 int ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* materials );11 int ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* materials, DataSet* parameters); 12 12 13 13 #endif /* _CONFIGUREOBJECTSX_H */ -
issm/trunk/src/c/DataSet/DataSet.cpp
r2006 r2333 235 235 dataset->AddObject(param); 236 236 } 237 else if(enum_type==NumparEnum()){ 238 Numpar* numpar=NULL; 239 numpar=new Numpar(); 240 numpar->Demarshall(&marshalled_dataset); 241 dataset->AddObject(numpar); 242 } 237 243 else if(enum_type==TriaEnum()){ 238 244 Tria* tria=NULL; … … 315 321 316 322 } 317 318 int DataSet::FindParam(void* pvalue, char* name){ 319 323 324 #undef __FUNCT__ 325 #define __FUNCT__ "DataSet::FindParam" 326 int DataSet::FindParam(double* pscalar, char* name){ 327 320 328 /*Go through a dataset, and find a Param* object 321 329 *which parameter name is "name" : */ … … 336 344 if (strcmp(param->GetParameterName(),name)==0){ 337 345 /*Ok, this is the one! Recover the value of this parameter: */ 338 param->GetParameterValue(p value);346 param->GetParameterValue(pscalar); 339 347 found=1; 340 348 break; … … 345 353 } 346 354 355 #undef __FUNCT__ 356 #define __FUNCT__ "DataSet::FindParam" 357 int DataSet::FindParam(int* pinteger,char* name){ 358 359 360 /*Go through a dataset, and find a Param* object 361 *which parameter name is "name" : */ 362 363 vector<Object*>::iterator object; 364 Param* param=NULL; 365 366 int found=0; 367 368 for ( object=objects.begin() ; object < objects.end(); object++ ){ 369 370 /*Find param type objects: */ 371 if((*object)->Enum()==ParamEnum()){ 372 373 /*Ok, this object is a parameter, recover it and ask which name it has: */ 374 param=(Param*)(*object); 375 376 if (strcmp(param->GetParameterName(),name)==0){ 377 /*Ok, this is the one! Recover the value of this parameter: */ 378 param->GetParameterValue(pinteger); 379 found=1; 380 break; 381 } 382 } 383 } 384 return found; 385 } 386 387 #undef __FUNCT__ 388 #define __FUNCT__ "DataSet::FindParam" 389 int DataSet::FindParam(char** pstring,char* name){ 390 391 /*Go through a dataset, and find a Param* object 392 *which parameter name is "name" : */ 393 394 vector<Object*>::iterator object; 395 Param* param=NULL; 396 397 int found=0; 398 399 for ( object=objects.begin() ; object < objects.end(); object++ ){ 400 401 /*Find param type objects: */ 402 if((*object)->Enum()==ParamEnum()){ 403 404 /*Ok, this object is a parameter, recover it and ask which name it has: */ 405 param=(Param*)(*object); 406 407 if (strcmp(param->GetParameterName(),name)==0){ 408 /*Ok, this is the one! Recover the value of this parameter: */ 409 param->GetParameterValue(pstring); 410 found=1; 411 break; 412 } 413 } 414 } 415 return found; 416 417 } 418 #undef __FUNCT__ 419 #define __FUNCT__ "DataSet::FindParam" 420 int DataSet::FindParam(char*** pstringarray,int* pM,char* name){ 421 422 /*Go through a dataset, and find a Param* object 423 *which parameter name is "name" : */ 424 425 vector<Object*>::iterator object; 426 Param* param=NULL; 427 428 int found=0; 429 430 for ( object=objects.begin() ; object < objects.end(); object++ ){ 431 432 /*Find param type objects: */ 433 if((*object)->Enum()==ParamEnum()){ 434 435 /*Ok, this object is a parameter, recover it and ask which name it has: */ 436 param=(Param*)(*object); 437 438 if (strcmp(param->GetParameterName(),name)==0){ 439 /*Ok, this is the one! Recover the value of this parameter: */ 440 param->GetParameterValue(pstringarray); 441 if(pM)*pM=param->GetM(); 442 found=1; 443 break; 444 } 445 } 446 } 447 return found; 448 449 } 450 #undef __FUNCT__ 451 #define __FUNCT__ "DataSet::FindParam" 452 int DataSet::FindParam(double** pdoublearray,int* pM, int* pN,char* name){ 453 454 /*Go through a dataset, and find a Param* object 455 *which parameter name is "name" : */ 456 457 vector<Object*>::iterator object; 458 Param* param=NULL; 459 460 int found=0; 461 462 for ( object=objects.begin() ; object < objects.end(); object++ ){ 463 464 /*Find param type objects: */ 465 if((*object)->Enum()==ParamEnum()){ 466 467 /*Ok, this object is a parameter, recover it and ask which name it has: */ 468 param=(Param*)(*object); 469 470 if (strcmp(param->GetParameterName(),name)==0){ 471 /*Ok, this is the one! Recover the value of this parameter: */ 472 param->GetParameterValue(pdoublearray); 473 if(pM)param->GetM(); 474 if(pN)param->GetN(); 475 found=1; 476 break; 477 } 478 } 479 } 480 return found; 481 482 } 483 #undef __FUNCT__ 484 #define __FUNCT__ "DataSet::FindParam" 485 int DataSet::FindParam(Vec* pvec,char* name){ 486 487 /*Go through a dataset, and find a Param* object 488 *which parameter name is "name" : */ 489 490 vector<Object*>::iterator object; 491 Param* param=NULL; 492 493 int found=0; 494 495 for ( object=objects.begin() ; object < objects.end(); object++ ){ 496 497 /*Find param type objects: */ 498 if((*object)->Enum()==ParamEnum()){ 499 500 /*Ok, this object is a parameter, recover it and ask which name it has: */ 501 param=(Param*)(*object); 502 503 if (strcmp(param->GetParameterName(),name)==0){ 504 /*Ok, this is the one! Recover the value of this parameter: */ 505 param->GetParameterValue(pvec); 506 found=1; 507 break; 508 } 509 } 510 } 511 return found; 512 513 } 514 #undef __FUNCT__ 515 #define __FUNCT__ "DataSet::FindParam" 516 int DataSet::FindParam(Mat* pmat,char* name){ 517 518 /*Go through a dataset, and find a Param* object 519 *which parameter name is "name" : */ 520 521 vector<Object*>::iterator object; 522 Param* param=NULL; 523 524 int found=0; 525 526 for ( object=objects.begin() ; object < objects.end(); object++ ){ 527 528 /*Find param type objects: */ 529 if((*object)->Enum()==ParamEnum()){ 530 531 /*Ok, this object is a parameter, recover it and ask which name it has: */ 532 param=(Param*)(*object); 533 534 if (strcmp(param->GetParameterName(),name)==0){ 535 /*Ok, this is the one! Recover the value of this parameter: */ 536 param->GetParameterValue(pmat); 537 found=1; 538 break; 539 } 540 } 541 } 542 return found; 543 544 } 545 546 #undef __FUNCT__ 547 #define __FUNCT__ "DataSet::FindResult" 347 548 int DataSet::FindResult(Vec* presult,char* name){ 348 549 … … 888 1089 889 1090 890 void DataSet::Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials ){1091 void DataSet::Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials,DataSet* parameters){ 891 1092 892 1093 vector<Object*>::iterator object; … … 894 1095 Load* load=NULL; 895 1096 Node* node=NULL; 1097 Numpar* numpar=NULL; 896 1098 897 1099 for ( object=objects.begin() ; object < objects.end(); object++ ){ … … 900 1102 901 1103 element=(Element*)(*object); 902 element->Configure(loads,nodes,materials );1104 element->Configure(loads,nodes,materials,parameters); 903 1105 } 904 1106 if(EnumIsLoad((*object)->Enum())){ … … 912 1114 node=(Node*)(*object); 913 1115 node->Configure(nodes); 1116 } 1117 1118 if((*object)->Enum()==NumparEnum()){ 1119 numpar=(Numpar*)(*object); 1120 numpar->Configure(parameters); 914 1121 } 915 1122 -
issm/trunk/src/c/DataSet/DataSet.h
r1805 r2333 44 44 int DeleteObject(int id); 45 45 int Size(); 46 int FindParam(void* pvalue, char* name); 46 int FindParam(double* pscalar, char* name); 47 int FindParam(int* pinteger,char* name); 48 int FindParam(char** pstring,char* name); 49 int FindParam(char*** pstringarray,int* pM,char* name); 50 int FindParam(double** pdoublearray,int* pM,int* pN,char* name); 51 int FindParam(Vec* pvec,char* name); 52 int FindParam(Mat* pmat,char* name); 47 53 int FindResult(Vec* presult,char* name); 48 54 Object* FindParamObject(char* name); … … 58 64 void FlagNodeSets(Vec pv_g, Vec pv_m, Vec pv_n, Vec pv_f, Vec pv_s); 59 65 void clear(); 60 void Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials );66 void Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* materials,DataSet* parameters); 61 67 Object* GetObjectByOffset(int offset); 62 68 Object* GetObjectById(int* poffset,int eid); -
issm/trunk/src/c/Dofx/Dofx.cpp
r2316 r2333 35 35 36 36 /*First, recover number of grids from parameters: */ 37 found=params->FindParam( (void*)&numberofnodes,"numberofnodes");37 found=params->FindParam(&numberofnodes,"numberofnodes"); 38 38 if(!found)throw ErrorException(__FUNCT__," could not find numberofnodes in parameters"); 39 39 40 40 /*Recover number of dofs per node: */ 41 found=params->FindParam( (void*)&numberofdofspernode,"numberofdofspernode");41 found=params->FindParam(&numberofdofspernode,"numberofdofspernode"); 42 42 if(!found)throw ErrorException(__FUNCT__," could not find numberofdofspernode in parameters"); 43 43 -
issm/trunk/src/c/Dux/Dux.cpp
r1185 r2333 13 13 #include "../EnumDefinitions/EnumDefinitions.h" 14 14 15 void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 15 void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters, 16 16 ParameterInputs* inputs,int analysis_type,int sub_analysis_type){ 17 17 … … 24 24 25 25 /*First, get elements and loads configured: */ 26 elements->Configure(elements,loads, nodes, materials); 26 elements->Configure(elements,loads, nodes, materials,parameters); 27 parameters->Configure(elements,loads, nodes, materials,parameters); 27 28 28 29 /*Get size of matrix: */ -
issm/trunk/src/c/Dux/Dux.h
r1185 r2333 9 9 10 10 /* local prototypes: */ 11 void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 11 void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters, 12 12 ParameterInputs* inputs,int analysis_type,int sub_analysis_type); 13 13 -
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.cpp
r2309 r2333 81 81 int MaticeEnum(void){ return 441; } 82 82 int MatparEnum(void){ return 442; } 83 int NumparEnum(void){ return 443; } 83 84 /*Inputs: */ 84 85 int InputEnum(void){ return 450; } -
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
r2309 r2333 82 82 int MaticeEnum(void); 83 83 int MatparEnum(void); 84 int NumparEnum(void); 84 85 /*Inputs: */ 85 86 int InputEnum(void); -
issm/trunk/src/c/FieldDepthAveragex/FieldDepthAveragex.cpp
r848 r2333 13 13 #include "../EnumDefinitions/EnumDefinitions.h" 14 14 15 void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, char* fieldname){15 void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,char* fieldname){ 16 16 17 17 double* field_serial=NULL; 18 18 19 19 /*First, get elements and nodes configured: */ 20 elements->Configure(elements,loads, nodes, materials); 21 nodes->Configure(elements,loads, nodes, materials); 20 elements->Configure(elements,loads, nodes, materials,parameters); 21 nodes->Configure(elements,loads, nodes, materials,parameters); 22 parameters->Configure(elements,loads, nodes, materials,parameters); 22 23 23 24 /*Serialize field: */ -
issm/trunk/src/c/FieldDepthAveragex/FieldDepthAveragex.h
r848 r2333 9 9 10 10 /* local prototypes: */ 11 void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, char* fieldname);11 void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,char* fieldname); 12 12 13 13 #endif /* _FIELDDEPTHAVERAGEX_H */ -
issm/trunk/src/c/FieldExtrudex/FieldExtrudex.cpp
r848 r2333 13 13 #include "../EnumDefinitions/EnumDefinitions.h" 14 14 15 void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, char* field_name,int collapse){15 void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,char* field_name,int collapse){ 16 16 17 17 double* field_serial=NULL; 18 18 19 19 /*First, get elements and nodes configured: */ 20 elements->Configure(elements,loads, nodes, materials); 21 nodes->Configure(elements,loads, nodes, materials); 20 elements->Configure(elements,loads, nodes, materials,parameters); 21 nodes->Configure(elements,loads, nodes, materials,parameters); 22 parameters->Configure(elements,loads, nodes, materials,parameters); 22 23 23 24 /*Serialize field: */ -
issm/trunk/src/c/FieldExtrudex/FieldExtrudex.h
r848 r2333 9 9 10 10 /* local prototypes: */ 11 void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, char* field_name, int collapse);11 void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,char* field_name, int collapse); 12 12 13 13 #endif /* _FIELDEXTRUDEX_H */ -
issm/trunk/src/c/Gradjx/Gradjx.cpp
r1188 r2333 13 13 #include "../EnumDefinitions/EnumDefinitions.h" 14 14 15 void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 15 void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters, 16 16 ParameterInputs* inputs,int analysis_type,int sub_analysis_type,char* control_type){ 17 17 … … 20 20 21 21 /*First, get elements and loads configured: */ 22 elements->Configure(elements,loads, nodes, materials); 22 elements->Configure(elements,loads, nodes, materials,parameters); 23 parameters->Configure(elements,loads, nodes, materials,parameters); 23 24 24 25 /*Allocate grad_g: */ -
issm/trunk/src/c/Gradjx/Gradjx.h
r1188 r2333 9 9 10 10 /* local prototypes: */ 11 void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 11 void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters, 12 12 ParameterInputs* inputs,int analysis_type,int sub_analysis_type,char* control_type); 13 13 -
issm/trunk/src/c/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp
r2304 r2333 117 117 /*Get indices i and j that form a square around the currant triangle*/ 118 118 if (yflip){ 119 i1= floor((y_tria_max-y_grid_max)/yposting)-1;120 i2= ceil((y_tria_min-y_grid_max)/yposting);119 i1=(int)floor((y_tria_max-y_grid_max)/yposting)-1; 120 i2= (int)ceil((y_tria_min-y_grid_max)/yposting); 121 121 } 122 122 else{ 123 i1= floor((y_tria_min-y_grid_min)/yposting)-1;124 i2= ceil((y_tria_max-y_grid_min)/yposting);123 i1=(int)floor((y_tria_min-y_grid_min)/yposting)-1; 124 i2= (int)ceil((y_tria_max-y_grid_min)/yposting); 125 125 } 126 126 if (xflip){ 127 j1= floor((x_tria_max-x_grid_max)/xposting)-1;128 j2= ceil((x_tria_min-x_grid_max)/xposting);127 j1=(int)floor((x_tria_max-x_grid_max)/xposting)-1; 128 j2= (int)ceil((x_tria_min-x_grid_max)/xposting); 129 129 } 130 130 else{ 131 j1= floor((x_tria_min-x_grid_min)/xposting)-1;132 j2= ceil((x_tria_max-x_grid_min)/xposting);131 j1=(int)floor((x_tria_min-x_grid_min)/xposting)-1; 132 j2= (int)ceil((x_tria_max-x_grid_min)/xposting); 133 133 } 134 134 -
issm/trunk/src/c/Makefile.am
r2316 r2333 60 60 ./objects/Matpar.h\ 61 61 ./objects/Matpar.cpp\ 62 ./objects/Numpar.h\ 63 ./objects/Numpar.cpp\ 62 64 ./objects/Input.h\ 63 65 ./objects/Input.cpp\ … … 170 172 ./io/WriteData.cpp\ 171 173 ./io/WriteDataToDisk.cpp\ 172 ./io/SerialFetchData.cpp\173 ./io/ParallelFetchData.cpp\174 ./io/ParallelFetchInteger.cpp\175 ./io/ParallelFetchMat.cpp\176 ./io/ParallelFetchScalar.cpp\177 ./io/ParallelFetchString.cpp\178 174 ./io/IoModelFetchData.cpp\ 179 175 ./io/WriteNodeSets.cpp\ 180 176 ./io/WriteParams.cpp\ 177 ./io/FetchParams.cpp\ 181 178 ./io/FetchNodeSets.cpp\ 182 179 ./io/ParameterInputsInit.cpp\ … … 359 356 ./objects/Matpar.h\ 360 357 ./objects/Matpar.cpp\ 358 ./objects/Numpar.h\ 359 ./objects/Numpar.cpp\ 361 360 ./objects/Input.h\ 362 361 ./objects/Input.cpp\ … … 467 466 ./io/WriteData.cpp\ 468 467 ./io/WriteDataToDisk.cpp\ 469 ./io/SerialFetchData.cpp\470 ./io/ParallelFetchData.cpp\471 ./io/ParallelFetchInteger.cpp\472 ./io/ParallelFetchMat.cpp\473 ./io/ParallelFetchScalar.cpp\474 ./io/ParallelFetchString.cpp\475 468 ./io/IoModelFetchData.cpp\ 476 469 ./io/WriteNodeSets.cpp\ -
issm/trunk/src/c/MassFluxx/MassFluxx.cpp
r2112 r2333 13 13 #include "../EnumDefinitions/EnumDefinitions.h" 14 14 15 void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, 16 double* segments,int num_segments,double* ug){ 15 void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials,DataSet* parameters, double* segments,int num_segments,double* ug){ 17 16 18 17 int i,j; … … 28 27 29 28 /*First, get elements and loads configured: */ 30 elements->Configure(elements,loads, nodes, materials); 31 loads->Configure(elements, loads, nodes, materials); 29 elements->Configure(elements,loads, nodes, materials,parameters); 30 loads->Configure(elements, loads, nodes, materials,parameters); 31 parameters->Configure(elements,loads, nodes, materials,parameters); 32 32 33 33 /*Go through segments, and then elements, and figure out which elements belong to a segment. -
issm/trunk/src/c/MassFluxx/MassFluxx.h
r2112 r2333 10 10 11 11 /* local prototypes: */ 12 void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, double* segments,int num_segments,double* ug);12 void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, DataSet* parameters,double* segments,int num_segments,double* ug); 13 13 14 14 -
issm/trunk/src/c/Misfitx/Misfitx.cpp
r1185 r2333 13 13 #include "../EnumDefinitions/EnumDefinitions.h" 14 14 15 void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 15 void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials,DataSet* parameters, 16 16 ParameterInputs* inputs,int analysis_type,int sub_analysis_type){ 17 17 … … 21 21 22 22 /*First, get elements and loads configured: */ 23 elements->Configure(elements,loads, nodes, materials); 23 elements->Configure(elements,loads, nodes, materials,parameters); 24 parameters->Configure(elements,loads, nodes, materials,parameters); 24 25 25 26 /*Compute gradients: */ -
issm/trunk/src/c/Misfitx/Misfitx.h
r1185 r2333 9 9 10 10 /* local prototypes: */ 11 void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, 11 void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters, 12 12 ParameterInputs* inputs,int analysis_type,int sub_analysis_type); 13 13 -
issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp
r2268 r2333 45 45 //control analysis? 46 46 count++; 47 param= new Param(count,"control_analysis", INTEGER);48 param->Set Integer(iomodel->control_analysis);47 param= new Param(count,"control_analysis",DOUBLE); 48 param->SetDouble(iomodel->control_analysis); 49 49 parameters->AddObject(param); 50 50 … … 66 66 /*control_steady: */ 67 67 count++; 68 param= new Param(count,"control_steady", INTEGER);69 param->Set Integer(0);68 param= new Param(count,"control_steady",DOUBLE); 69 param->SetDouble(0); 70 70 parameters->AddObject(param); 71 71 72 72 /*nsteps: */ 73 73 count++; 74 param= new Param(count,"nsteps", INTEGER);75 param->Set Integer(iomodel->nsteps);74 param= new Param(count,"nsteps",DOUBLE); 75 param->SetDouble(iomodel->nsteps); 76 76 parameters->AddObject(param); 77 77 … … 119 119 120 120 /*Now, recover fit, optscal and maxiter as vectors: */ 121 IoModelFetchData( (void**)&iomodel->fit,NULL,NULL,iomodel_handle,"fit","Matrix","Mat");122 IoModelFetchData( (void**)&iomodel->cm_jump,NULL,NULL,iomodel_handle,"cm_jump","Matrix","Mat");123 IoModelFetchData( (void**)&iomodel->optscal,NULL,NULL,iomodel_handle,"optscal","Matrix","Mat");124 IoModelFetchData( (void**)&iomodel->maxiter,NULL,NULL,iomodel_handle,"maxiter","Matrix","Mat");121 IoModelFetchData(&iomodel->fit,NULL,NULL,iomodel_handle,"fit"); 122 IoModelFetchData(&iomodel->cm_jump,NULL,NULL,iomodel_handle,"cm_jump"); 123 IoModelFetchData(&iomodel->optscal,NULL,NULL,iomodel_handle,"optscal"); 124 IoModelFetchData(&iomodel->maxiter,NULL,NULL,iomodel_handle,"maxiter"); 125 125 126 126 count++; … … 150 150 151 151 /*Get vx, vx_obs, vy, vy_obs, and the parameter value: */ 152 IoModelFetchData( (void**)&vx,NULL,NULL,iomodel_handle,"vx","Matrix","Mat");153 IoModelFetchData( (void**)&vy,NULL,NULL,iomodel_handle,"vy","Matrix","Mat");154 IoModelFetchData( (void**)&vz,NULL,NULL,iomodel_handle,"vz","Matrix","Mat");155 IoModelFetchData( (void**)&vx_obs,NULL,NULL,iomodel_handle,"vx_obs","Matrix","Mat");156 IoModelFetchData( (void**)&vy_obs,NULL,NULL,iomodel_handle,"vy_obs","Matrix","Mat");157 IoModelFetchData( (void**)&control_parameter,NULL,NULL,iomodel_handle,iomodel->control_type,"Matrix","Mat");152 IoModelFetchData(&vx,NULL,NULL,iomodel_handle,"vx"); 153 IoModelFetchData(&vy,NULL,NULL,iomodel_handle,"vy"); 154 IoModelFetchData(&vz,NULL,NULL,iomodel_handle,"vz"); 155 IoModelFetchData(&vx_obs,NULL,NULL,iomodel_handle,"vx_obs"); 156 IoModelFetchData(&vy_obs,NULL,NULL,iomodel_handle,"vy_obs"); 157 IoModelFetchData(&control_parameter,NULL,NULL,iomodel_handle,iomodel->control_type); 158 158 159 159 u_g=(double*)xcalloc(iomodel->numberofnodes*3,sizeof(double)); -
issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp
r2330 r2333 20 20 DataSet* parameters = NULL; 21 21 Param* param = NULL; 22 int count=1; 22 Numpar* numpar=NULL; 23 int count=0; 23 24 int numberofdofspernode; 24 25 int dim; … … 33 34 /*Initialize dataset: */ 34 35 parameters = new DataSet(ParametersEnum()); 35 36 37 //solution parameters: always 1'st, to speed-up its lookup by elements.. 38 count++; 39 numpar= new Numpar(count, 40 iomodel->meanvel, iomodel->epsvel, iomodel->artdiff, iomodel->viscosity_overshoot, iomodel->stokesreconditioning, iomodel->cm_noisedampening); 41 parameters->AddObject(numpar); 42 43 36 44 //analysis and subanalysis 37 45 count++; 38 param= new Param(count,"analysis_type",INTEGER); 39 param->SetInteger(iomodel->analysis_type); 40 parameters->AddObject(param); 41 42 count++; 43 param= new Param(count,"sub_analysis_type",INTEGER); 44 param->SetInteger(iomodel->sub_analysis_type); 45 parameters->AddObject(param); 46 46 param= new Param(count,"analysis_type",DOUBLE); 47 param->SetDouble(iomodel->analysis_type); 48 parameters->AddObject(param); 49 50 count++; 51 param= new Param(count,"sub_analysis_type",DOUBLE); 52 param->SetDouble(iomodel->sub_analysis_type); 53 parameters->AddObject(param); 54 55 47 56 //dimension 2d or 3d: 48 57 if (strcmp(iomodel->meshtype,"2d")==0)dim=2; … … 50 59 51 60 count++; 52 param= new Param(count,"dim", INTEGER);53 param->Set Integer(dim);61 param= new Param(count,"dim",DOUBLE); 62 param->SetDouble(dim); 54 63 parameters->AddObject(param); 55 64 56 65 //elements types 57 66 count++; 58 param= new Param(count,"ishutter", INTEGER);59 param->Set Integer(iomodel->ishutter);60 parameters->AddObject(param); 61 62 count++; 63 param= new Param(count,"ismacayealpattyn", INTEGER);64 param->Set Integer(iomodel->ismacayealpattyn);65 parameters->AddObject(param); 66 67 68 count++; 69 param= new Param(count,"isstokes", INTEGER);70 param->Set Integer(iomodel->isstokes);67 param= new Param(count,"ishutter",DOUBLE); 68 param->SetDouble(iomodel->ishutter); 69 parameters->AddObject(param); 70 71 count++; 72 param= new Param(count,"ismacayealpattyn",DOUBLE); 73 param->SetDouble(iomodel->ismacayealpattyn); 74 parameters->AddObject(param); 75 76 77 count++; 78 param= new Param(count,"isstokes",DOUBLE); 79 param->SetDouble(iomodel->isstokes); 71 80 parameters->AddObject(param); 72 81 73 82 /*verbose: */ 74 param= new Param(count,"verbose",INTEGER); 75 param->SetInteger(iomodel->verbose); 83 count++; 84 param= new Param(count,"verbose",DOUBLE); 85 param->SetDouble(iomodel->verbose); 76 86 parameters->AddObject(param); 77 87 … … 126 136 /*lowmem: */ 127 137 count++; 128 param= new Param(count,"lowmem", INTEGER);129 param->Set Integer(iomodel->lowmem);138 param= new Param(count,"lowmem",DOUBLE); 139 param->SetDouble(iomodel->lowmem); 130 140 parameters->AddObject(param); 131 141 132 142 /*connectivity: */ 133 143 count++; 134 param= new Param(count,"connectivity", INTEGER);135 param->Set Integer(iomodel->connectivity);144 param= new Param(count,"connectivity",DOUBLE); 145 param->SetDouble(iomodel->connectivity); 136 146 parameters->AddObject(param); 137 147 … … 160 170 parameters->AddObject(param); 161 171 172 /*meanvel: */ 173 count++; 174 param= new Param(count,"meanvel",DOUBLE); 175 param->SetDouble(iomodel->meanvel); 176 parameters->AddObject(param); 177 178 /*artdiff: */ 179 count++; 180 param= new Param(count,"artdiff",DOUBLE); 181 param->SetDouble(iomodel->artdiff); 182 parameters->AddObject(param); 183 184 /*epsvel: */ 185 count++; 186 param= new Param(count,"epsvel",DOUBLE); 187 param->SetDouble(iomodel->epsvel); 188 parameters->AddObject(param); 189 162 190 /*penalty_melting: */ 163 191 count++; … … 168 196 /*min_thermal_constraints: */ 169 197 count++; 170 param= new Param(count,"min_thermal_constraints", INTEGER);171 param->Set Integer(iomodel->min_thermal_constraints);198 param= new Param(count,"min_thermal_constraints",DOUBLE); 199 param->SetDouble(iomodel->min_thermal_constraints); 172 200 parameters->AddObject(param); 173 201 174 202 /*stabilize_constraints: */ 175 203 count++; 176 param= new Param(count,"stabilize_constraints", INTEGER);177 param->Set Integer(iomodel->stabilize_constraints);204 param= new Param(count,"stabilize_constraints",DOUBLE); 205 param->SetDouble(iomodel->stabilize_constraints); 178 206 parameters->AddObject(param); 179 207 … … 184 212 parameters->AddObject(param); 185 213 214 /*viscosity_overshoot: */ 215 count++; 216 param= new Param(count,"viscosity_overshoot",DOUBLE); 217 param->SetDouble(iomodel->viscosity_overshoot); 218 parameters->AddObject(param); 219 220 /*cm_noisedampening: */ 221 count++; 222 param= new Param(count,"cm_noisedampening",DOUBLE); 223 param->SetDouble(iomodel->cm_noisedampening); 224 parameters->AddObject(param); 225 186 226 /*waitonlock: */ 187 227 count++; 188 param= new Param(count,"waitonlock", INTEGER);189 param->Set Integer(iomodel->waitonlock);228 param= new Param(count,"waitonlock",DOUBLE); 229 param->SetDouble(iomodel->waitonlock); 190 230 parameters->AddObject(param); 191 231 … … 198 238 /*plot: */ 199 239 count++; 200 param= new Param(count,"plot", INTEGER);201 param->Set Integer(iomodel->plot);240 param= new Param(count,"plot",DOUBLE); 241 param->SetDouble(iomodel->plot); 202 242 parameters->AddObject(param); 203 243 204 244 /*numberofgrids: */ 205 245 count++; 206 param= new Param(count,"numberofnodes", INTEGER);207 param->Set Integer(iomodel->numberofnodes);246 param= new Param(count,"numberofnodes",DOUBLE); 247 param->SetDouble(iomodel->numberofnodes); 208 248 parameters->AddObject(param); 209 249 … … 212 252 213 253 count++; 214 param= new Param(count,"numberofdofspernode", INTEGER);215 param->Set Integer(numberofdofspernode);254 param= new Param(count,"numberofdofspernode",DOUBLE); 255 param->SetDouble(numberofdofspernode); 216 256 parameters->AddObject(param) 217 257 ; 218 258 /*numrifts: */ 219 IoModelFetchData( (void**)&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo","Matrix","Mat");220 count++; 221 param= new Param(count,"numrifts", INTEGER);222 param->Set Integer(iomodel->numrifts);259 IoModelFetchData(&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo"); 260 count++; 261 param= new Param(count,"numrifts",DOUBLE); 262 param->SetDouble(iomodel->numrifts); 223 263 parameters->AddObject(param); 224 264 xfree((void**)&iomodel->riftinfo); … … 227 267 /*parameteroutput: */ 228 268 count++; 229 param= new Param(count,"numoutput", INTEGER);230 param->Set Integer(iomodel->numoutput);269 param= new Param(count,"numoutput",DOUBLE); 270 param->SetDouble(iomodel->numoutput); 231 271 parameters->AddObject(param); 232 272 … … 238 278 for(i=0;i<iomodel->numoutput;i++){ 239 279 pfield2=mxGetCell(pfield,i); 240 FetchData( (void**)&descriptor,NULL,NULL,pfield2,"String",NULL);280 FetchData(&descriptor,pfield2); 241 281 parameteroutput[i]=descriptor; 242 282 } … … 245 285 for(i=0;i<iomodel->numoutput;i++){ 246 286 sprintf(tag,"%s%i","parameteroutput_",i); 247 IoModelFetchData( (void**)&descriptor,NULL,NULL,iomodel_handle,tag,"String",NULL);287 IoModelFetchData(&descriptor,iomodel_handle,tag); 248 288 parameteroutput[i]=descriptor; 249 289 } -
issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
r1832 r2333 47 47 48 48 /*Fetch data: */ 49 IoModelFetchData( (void**)&spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity","Matrix","Mat");50 IoModelFetchData( (void**)&gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","Matrix","Mat");49 IoModelFetchData(&spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity"); 50 IoModelFetchData(&gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter"); 51 51 52 52 count=0; … … 96 96 /*First fetch penalties: */ 97 97 if (strcmp(iomodel->meshtype,"3d")==0){ 98 IoModelFetchData( (void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");98 IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties"); 99 99 } 100 100 -
issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
r1904 r2333 52 52 int tria_mid; 53 53 int tria_mparid; 54 int tria_numparid; 54 55 int tria_g[3]; 55 56 double tria_h[3]; … … 64 65 double tria_q; 65 66 int tria_shelf; 66 double tria_meanvel;/*!scaling ratio for velocities*/67 double tria_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/68 double tria_viscosity_overshoot;69 int tria_artdiff;70 67 bool tria_onwater; 71 68 … … 79 76 int penta_mid; 80 77 int penta_mparid; 78 int penta_numparid; 81 79 int penta_g[6]; 82 80 double penta_h[6]; … … 90 88 int penta_onbed; 91 89 int penta_onsurface; 92 double penta_meanvel;/*!scaling ratio for velocities*/93 double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/94 90 int penta_collapse; 95 91 double penta_melting[6]; 96 92 double penta_accumulation[6]; 97 93 double penta_geothermalflux[6]; 98 int penta_artdiff;99 94 int penta_thermal_steadystate; 100 double penta_viscosity_overshoot;101 double penta_stokesreconditioning;102 95 bool penta_onwater; 103 96 … … 165 158 if(strcmp(iomodel->meshtype,"2d")==0){ 166 159 /*load elements: */ 167 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");160 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 168 161 } 169 162 else{ 170 163 /*load elements2d: */ 171 IoModelFetchData( (void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");164 IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d"); 172 165 } 173 166 … … 180 173 181 174 /*Deal with rifts, they have to be included into one partition only, not several: */ 182 IoModelFetchData( (void**)&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo","Matrix","Mat");175 IoModelFetchData(&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo"); 183 176 184 177 for(i=0;i<iomodel->numrifts;i++){ … … 202 195 203 196 /*Fetch data needed: */ 204 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");205 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");206 IoModelFetchData( (void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");207 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");208 IoModelFetchData( (void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");209 IoModelFetchData( (void**)&iomodel->p,NULL,NULL,iomodel_handle,"p","Matrix","Mat");210 IoModelFetchData( (void**)&iomodel->q,NULL,NULL,iomodel_handle,"q","Matrix","Mat");211 IoModelFetchData( (void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");212 IoModelFetchData( (void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");213 IoModelFetchData( (void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");214 IoModelFetchData( (void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");215 IoModelFetchData( (void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");216 IoModelFetchData( (void**)&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");217 IoModelFetchData( (void**)&iomodel->melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");197 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 198 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 199 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 200 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 201 IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag"); 202 IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p"); 203 IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q"); 204 IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf"); 205 IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater"); 206 IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type"); 207 IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B"); 208 IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n"); 209 IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation"); 210 IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting"); 218 211 219 212 for (i=0;i<iomodel->numberofelements;i++){ … … 230 223 tria_mid=i+1; //refers to the corresponding material property card 231 224 tria_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card 225 tria_numparid=1; 232 226 233 227 /*vertices offsets: */ … … 272 266 tria_onwater=(bool)*(iomodel->elementonwater+i); 273 267 274 tria_meanvel=iomodel->meanvel;275 tria_epsvel=iomodel->epsvel;276 277 /*viscosity_overshoot*/278 tria_viscosity_overshoot=iomodel->viscosity_overshoot;279 280 268 /*Create tria element using its constructor:*/ 281 tria=new Tria(tria_id, tria_mid, tria_mparid, tria_ g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_meanvel, tria_epsvel, tria_viscosity_overshoot,tria_artdiff,tria_onwater);269 tria=new Tria(tria_id, tria_mid, tria_mparid, tria_numparid,tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_onwater); 282 270 283 271 /*Add tria element to elements dataset: */ … … 339 327 340 328 /*Fetch data needed: */ 341 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");342 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");343 IoModelFetchData( (void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");344 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");345 IoModelFetchData( (void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");346 IoModelFetchData( (void**)&iomodel->p,NULL,NULL,iomodel_handle,"p","Matrix","Mat");347 IoModelFetchData( (void**)&iomodel->q,NULL,NULL,iomodel_handle,"q","Matrix","Mat");348 IoModelFetchData( (void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");349 IoModelFetchData( (void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");350 IoModelFetchData( (void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");351 IoModelFetchData( (void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");352 IoModelFetchData( (void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");353 IoModelFetchData( (void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");354 IoModelFetchData( (void**)&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");355 IoModelFetchData( (void**)&iomodel->melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");356 IoModelFetchData( (void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");329 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 330 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 331 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 332 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 333 IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag"); 334 IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p"); 335 IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q"); 336 IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf"); 337 IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed"); 338 IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface"); 339 IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type"); 340 IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B"); 341 IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n"); 342 IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation"); 343 IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting"); 344 IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater"); 357 345 358 346 for (i=0;i<iomodel->numberofelements;i++){ … … 368 356 penta_mid=i+1; //refers to the corresponding material property card 369 357 penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card 358 penta_numparid=1; 370 359 371 360 /*vertices,thickness,surface,bed and drag: */ … … 390 379 penta_onbed=(int)*(iomodel->elementonbed+i); 391 380 penta_onsurface=(int)*(iomodel->elementonsurface+i); 392 penta_meanvel=iomodel->meanvel;393 penta_epsvel=iomodel->epsvel;394 381 penta_onwater=(bool)*(iomodel->elementonwater+i); 395 382 396 /*viscosity_overshoot*/397 penta_viscosity_overshoot=iomodel->viscosity_overshoot;398 399 383 if (*(iomodel->elements_type+2*i+0)==MacAyealFormulationEnum()){ //elements of type 3 are MacAyeal type Penta. We collapse the formulation on their base. 400 384 penta_collapse=1; … … 406 390 407 391 /*Create Penta using its constructor:*/ 408 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_ g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,409 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface, penta_meanvel,penta_epsvel,410 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux, penta_artdiff,411 penta_thermal_steadystate,penta_ viscosity_overshoot,penta_stokesreconditioning,penta_onwater);392 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type, 393 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface, 394 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux, 395 penta_thermal_steadystate,penta_onwater); 412 396 413 397 /*Add penta element to elements dataset: */ … … 524 508 525 509 /*Get penalties: */ 526 IoModelFetchData( (void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");510 IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties"); 527 511 528 512 if(iomodel->numpenalties){ … … 560 544 /*First fetch data: */ 561 545 if (strcmp(iomodel->meshtype,"3d")==0){ 562 IoModelFetchData( (void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");563 IoModelFetchData( (void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");564 } 565 IoModelFetchData( (void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");566 IoModelFetchData( (void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");567 IoModelFetchData( (void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");568 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");569 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");570 IoModelFetchData( (void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");571 IoModelFetchData( (void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");572 IoModelFetchData( (void**)&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","Matrix","Mat");573 IoModelFetchData( (void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");574 IoModelFetchData( (void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");546 IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids"); 547 IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids"); 548 } 549 IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x"); 550 IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y"); 551 IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z"); 552 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 553 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 554 IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed"); 555 IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface"); 556 IoModelFetchData(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter"); 557 IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet"); 558 IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf"); 575 559 576 560 /*Get number of dofs per node: */ -
issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
r1854 r2333 79 79 /*Create pressure loads as boundary conditions. Pay attention to the partitioning if we are running in parallel (the grids 80 80 * referenced by a certain load must belong to the cluster node): */ 81 IoModelFetchData( (void**)&iomodel->pressureload,&iomodel->numberofpressureloads,NULL,iomodel_handle,"pressureload","Matrix","Mat");82 IoModelFetchData( (void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");83 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");84 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");81 IoModelFetchData(&iomodel->pressureload,&iomodel->numberofpressureloads,NULL,iomodel_handle,"pressureload"); 82 IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type"); 83 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 84 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 85 85 86 86 /*First load data:*/ … … 157 157 /*Create penpair loads also for rift grids, so that they don't penetrate one another, if needed: */ 158 158 /*First fetch rifts: */ 159 IoModelFetchData( (void**)&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo","Matrix","Mat");160 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");161 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");162 IoModelFetchData( (void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");163 IoModelFetchData( (void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");159 IoModelFetchData(&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo"); 160 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 161 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 162 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 163 IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf"); 164 164 165 165 if(iomodel->numrifts){ -
issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateParametersDiagnosticHoriz.cpp
r1832 r2333 34 34 35 35 /*Get vx and vy: */ 36 IoModelFetchData( (void**)&vx,NULL,NULL,iomodel_handle,"vx","Matrix","Mat");37 IoModelFetchData( (void**)&vy,NULL,NULL,iomodel_handle,"vy","Matrix","Mat");38 IoModelFetchData( (void**)&vz,NULL,NULL,iomodel_handle,"vz","Matrix","Mat");36 IoModelFetchData(&vx,NULL,NULL,iomodel_handle,"vx"); 37 IoModelFetchData(&vy,NULL,NULL,iomodel_handle,"vy"); 38 IoModelFetchData(&vz,NULL,NULL,iomodel_handle,"vz"); 39 39 40 40 ug=(double*)xcalloc(iomodel->numberofnodes*3,sizeof(double)); -
issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp
r1835 r2333 45 45 46 46 /*Fetch data: */ 47 IoModelFetchData( (void**)&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","Matrix","Mat");47 IoModelFetchData(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter"); 48 48 49 49 /*vx and vy are spc'd if we are not on gridonhutter: */ -
issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateElementsNodesAndMaterialsDiagnosticHutter.cpp
r1941 r2333 53 53 int sing_mid; 54 54 int sing_mparid; 55 int sing_numparid; 55 56 int sing_g; 56 57 double sing_h,sing_k; … … 60 61 int beam_mid; 61 62 int beam_mparid; 63 int beam_numparid; 62 64 int beam_g[2]; 63 65 double beam_h[2]; … … 122 124 if(strcmp(iomodel->meshtype,"2d")==0){ 123 125 /*load elements: */ 124 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");126 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 125 127 } 126 128 else{ 127 129 /*load elements2d: */ 128 IoModelFetchData( (void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");130 IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d"); 129 131 } 130 132 … … 141 143 #ifdef _PARALLEL_ 142 144 if(strcmp(iomodel->meshtype,"2d")==0){ 143 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");145 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 144 146 for (i=0;i<iomodel->numberofelements;i++){ 145 147 if(my_rank==epart[i]){ … … 156 158 } 157 159 else{ 158 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");160 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 159 161 for (i=0;i<iomodel->numberofelements;i++){ 160 162 if(my_rank==epart[i]){ … … 198 200 199 201 /*Fetch data temporarily needed: */ 200 IoModelFetchData( (void**)&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","Matrix","Mat");201 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");202 IoModelFetchData( (void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");203 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");204 IoModelFetchData( (void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");205 IoModelFetchData( (void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");206 IoModelFetchData( (void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");207 IoModelFetchData( (void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");208 IoModelFetchData( (void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");209 IoModelFetchData( (void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");202 IoModelFetchData(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter"); 203 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 204 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 205 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 206 IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface"); 207 IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed"); 208 IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids"); 209 IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag"); 210 IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B"); 211 IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n"); 210 212 211 213 /*2d mesh: */ … … 224 226 sing_mid=i+1; //refers to the corresponding material property card 225 227 sing_mparid=iomodel->numberofnodes+1;//refers to the corresponding matpar property card 228 sing_numparid=1; 226 229 sing_g=i+1; 227 230 sing_h=iomodel->thickness[i]; … … 229 232 230 233 /*Create sing element using its constructor:*/ 231 sing=new Sing(sing_id, sing_mid, sing_mparid, sing_ g, sing_h, sing_k);234 sing=new Sing(sing_id, sing_mid, sing_mparid, sing_numparid, sing_g, sing_h, sing_k); 232 235 233 236 /*Add tria element to elements dataset: */ … … 268 271 beam_mid=i+1; //refers to the corresponding material property card 269 272 beam_mparid=iomodel->numberofnodes-iomodel->numberofnodes2d+1;//refers to the corresponding matpar property card 273 beam_numparid=1; 270 274 beam_g[0]=i+1; 271 275 beam_g[1]=(int)iomodel->uppernodes[i]; //grid that lays right on top … … 282 286 283 287 /*Create beam element ubeam its constructor:*/ 284 beam=new Beam(beam_id, beam_mid, beam_mparid, beam_ g, beam_h, beam_s,beam_b,beam_k,beam_onbed);288 beam=new Beam(beam_id, beam_mid, beam_mparid, beam_numparid,beam_g, beam_h, beam_s,beam_b,beam_k,beam_onbed); 285 289 286 290 /*Add tria element to elements dataset: */ … … 347 351 /*First fetch data: */ 348 352 if (strcmp(iomodel->meshtype,"3d")==0){ 349 IoModelFetchData( (void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");350 IoModelFetchData( (void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");351 } 352 IoModelFetchData( (void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");353 IoModelFetchData( (void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");354 IoModelFetchData( (void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");355 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");356 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");357 IoModelFetchData( (void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");358 IoModelFetchData( (void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");359 IoModelFetchData( (void**)&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter","Matrix","Mat");360 IoModelFetchData( (void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");361 IoModelFetchData( (void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");353 IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids"); 354 IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids"); 355 } 356 IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x"); 357 IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y"); 358 IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z"); 359 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 360 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 361 IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed"); 362 IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface"); 363 IoModelFetchData(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter"); 364 IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet"); 365 IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf"); 362 366 363 367 /*Get number of dofs per node: */ -
issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp
r1834 r2333 37 37 38 38 /*Fetch data: */ 39 IoModelFetchData( (void**)&gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes","Matrix","Mat");39 IoModelFetchData(&gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes"); 40 40 41 41 count=0; -
issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp
r1904 r2333 58 58 int penta_mid; 59 59 int penta_mparid; 60 int penta_numparid; 60 61 int penta_g[6]; 61 62 double penta_h[6]; … … 69 70 int penta_onbed; 70 71 int penta_onsurface; 71 double penta_meanvel;/*!scaling ratio for velocities*/72 double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/73 72 int penta_collapse=0; 74 73 double penta_melting[6]; 75 74 double penta_accumulation[6]; 76 75 double penta_geothermalflux[6]; 77 int penta_artdiff;78 76 int penta_thermal_steadystate; 79 double penta_viscosity_overshoot;80 double penta_stokesreconditioning;81 77 bool penta_onwater; 82 78 … … 139 135 if(strcmp(iomodel->meshtype,"2d")==0){ 140 136 /*load elements: */ 141 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");137 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 142 138 } 143 139 else{ 144 140 /*load elements2d: */ 145 IoModelFetchData( (void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");141 IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d"); 146 142 } 147 143 … … 169 165 170 166 /*Fetch data needed: */ 171 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");172 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");173 IoModelFetchData( (void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");174 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");175 IoModelFetchData( (void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");176 IoModelFetchData( (void**)&iomodel->p,NULL,NULL,iomodel_handle,"p","Matrix","Mat");177 IoModelFetchData( (void**)&iomodel->q,NULL,NULL,iomodel_handle,"q","Matrix","Mat");178 IoModelFetchData( (void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");179 IoModelFetchData( (void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");180 IoModelFetchData( (void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");181 IoModelFetchData( (void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");182 IoModelFetchData( (void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");183 IoModelFetchData( (void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");184 IoModelFetchData( (void**)&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");185 IoModelFetchData( (void**)&iomodel->melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");186 IoModelFetchData( (void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");167 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 168 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 169 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 170 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 171 IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag"); 172 IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p"); 173 IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q"); 174 IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf"); 175 IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed"); 176 IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface"); 177 IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type"); 178 IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B"); 179 IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n"); 180 IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation"); 181 IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting"); 182 IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater"); 187 183 188 184 for (i=0;i<iomodel->numberofelements;i++){ … … 197 193 penta_mid=i+1; //refers to the corresponding material property card 198 194 penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card 195 penta_numparid=1; 199 196 200 197 /*vertices,thickness,surface,bed and drag: */ … … 219 216 penta_onbed=(int)*(iomodel->elementonbed+i); 220 217 penta_onsurface=(int)*(iomodel->elementonsurface+i); 221 penta_meanvel=iomodel->meanvel;222 penta_epsvel=iomodel->epsvel;223 218 penta_onwater=(bool)*(iomodel->elementonwater+i); 224 219 225 /*viscosity_overshoot*/226 penta_viscosity_overshoot=iomodel->viscosity_overshoot;227 228 /*stokesreconditioning: */229 penta_stokesreconditioning=iomodel->stokesreconditioning;230 231 232 220 if (*(iomodel->elements_type+2*i+1)==StokesFormulationEnum()){ 233 221 234 222 /*Create Penta using its constructor:*/ 235 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_ g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,236 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface, penta_meanvel,penta_epsvel,237 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux, penta_artdiff,238 penta_thermal_steadystate,penta_ viscosity_overshoot,penta_stokesreconditioning,penta_onwater);223 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type, 224 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface, 225 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux, 226 penta_thermal_steadystate,penta_onwater); 239 227 240 228 /*Add penta element to elements dataset: */ … … 353 341 354 342 /*Get penalties: */ 355 IoModelFetchData( (void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");343 IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties"); 356 344 357 345 if(iomodel->numpenalties){ … … 389 377 /*First fetch data: */ 390 378 if (strcmp(iomodel->meshtype,"3d")==0){ 391 IoModelFetchData( (void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");392 IoModelFetchData( (void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");393 } 394 IoModelFetchData( (void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");395 IoModelFetchData( (void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");396 IoModelFetchData( (void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");397 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");398 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");399 IoModelFetchData( (void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");400 IoModelFetchData( (void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");401 IoModelFetchData( (void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");402 IoModelFetchData( (void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");403 IoModelFetchData( (void**)&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes","Matrix","Mat");404 IoModelFetchData( (void**)&iomodel->borderstokes,NULL,NULL,iomodel_handle,"borderstokes","Matrix","Mat");379 IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids"); 380 IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids"); 381 } 382 IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x"); 383 IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y"); 384 IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z"); 385 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 386 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 387 IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed"); 388 IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface"); 389 IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet"); 390 IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf"); 391 IoModelFetchData(&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes"); 392 IoModelFetchData(&iomodel->borderstokes,NULL,NULL,iomodel_handle,"borderstokes"); 405 393 406 394 -
issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateLoadsDiagnosticStokes.cpp
r2212 r2333 63 63 /*Create pressure loads as boundary conditions. Pay attention to the partitioning if we are running in parallel (the grids 64 64 * referenced by a certain load must belong to the cluster node): */ 65 IoModelFetchData( (void**)&iomodel->pressureload_stokes,&numberofpressureloads_stokes,NULL,iomodel_handle,"pressureload_stokes","Matrix","Mat");66 IoModelFetchData( (void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");67 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");68 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");65 IoModelFetchData(&iomodel->pressureload_stokes,&numberofpressureloads_stokes,NULL,iomodel_handle,"pressureload_stokes"); 66 IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type"); 67 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 68 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 69 69 70 70 count=0; … … 127 127 //create penalties for grids on the base of icesheet. We must have wb=ub*db/dx+vb*db/dy 128 128 129 IoModelFetchData( (void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");130 IoModelFetchData( (void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");131 IoModelFetchData( (void**)&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes","Matrix","Mat");129 IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed"); 130 IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet"); 131 IoModelFetchData(&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes"); 132 132 133 133 for (i=0;i<iomodel->numberofnodes;i++){ -
issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp
r2283 r2333 37 37 38 38 /*Fetch data: */ 39 IoModelFetchData( (void**)&spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity","Matrix","Mat");39 IoModelFetchData(&spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity"); 40 40 41 41 count=0; -
issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateElementsNodesAndMaterialsDiagnosticVert.cpp
r1904 r2333 57 57 int penta_mid; 58 58 int penta_mparid; 59 int penta_numparid; 59 60 int penta_g[6]; 60 61 double penta_h[6]; … … 68 69 int penta_onbed; 69 70 int penta_onsurface; 70 double penta_meanvel;/*!scaling ratio for velocities*/71 double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/72 71 int penta_collapse; 73 72 double penta_melting[6]; … … 139 138 if(strcmp(iomodel->meshtype,"2d")==0){ 140 139 /*load elements: */ 141 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");140 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 142 141 } 143 142 else{ 144 143 /*load elements2d: */ 145 IoModelFetchData( (void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");144 IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d"); 146 145 } 147 146 … … 159 158 /*Create 3d elements: */ 160 159 /*Fetch data needed: */ 161 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");162 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");163 IoModelFetchData( (void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");164 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");165 IoModelFetchData( (void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");166 IoModelFetchData( (void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");167 IoModelFetchData( (void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");168 IoModelFetchData( (void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");169 IoModelFetchData( (void**)&iomodel->melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");170 IoModelFetchData( (void**)&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");171 IoModelFetchData( (void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");160 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 161 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 162 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 163 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 164 IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf"); 165 IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed"); 166 IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface"); 167 IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type"); 168 IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting"); 169 IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation"); 170 IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater"); 172 171 173 172 for (i=0;i<iomodel->numberofelements;i++){ … … 182 181 penta_mid=i+1; //refers to the corresponding material property card 183 182 penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card 183 penta_numparid=1; 184 184 185 185 /*vertices,thickness,surface,bed and drag: */ … … 201 201 202 202 /*Create Penta using its constructor:*/ 203 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_ g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,204 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface, penta_meanvel,penta_epsvel,205 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux, penta_artdiff,206 penta_thermal_steadystate,penta_ viscosity_overshoot,penta_stokesreconditioning,penta_onwater);203 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type, 204 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface, 205 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux, 206 penta_thermal_steadystate,penta_onwater); 207 207 208 208 /*Add penta element to elements dataset: */ … … 309 309 /*First fetch data: */ 310 310 if (strcmp(iomodel->meshtype,"3d")==0){ 311 IoModelFetchData( (void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");312 IoModelFetchData( (void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");311 IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids"); 312 IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids"); 313 313 } 314 IoModelFetchData( (void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");315 IoModelFetchData( (void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");316 IoModelFetchData( (void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");317 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");318 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");319 IoModelFetchData( (void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");320 IoModelFetchData( (void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");321 IoModelFetchData( (void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");322 IoModelFetchData( (void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");314 IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x"); 315 IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y"); 316 IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z"); 317 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 318 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 319 IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed"); 320 IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface"); 321 IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet"); 322 IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf"); 323 323 324 324 -
issm/trunk/src/c/ModelProcessorx/IoModel.cpp
r2330 r2333 135 135 iomodel->yts=0; 136 136 iomodel->viscosity_overshoot=0; 137 iomodel->artdiff=0; 137 138 iomodel->stokesreconditioning=0; 138 139 iomodel->waitonlock=0; … … 290 291 291 292 /*In IoModelInit, we get all the data that is not difficult to get, and that is small: */ 292 IoModelFetchData( (void**)&iomodel->name,NULL,NULL,iomodel_handle,"name","String",NULL);293 IoModelFetchData( (void**)&iomodel->analysis_type,NULL,NULL,iomodel_handle,"analysis_type","Integer",NULL);294 IoModelFetchData( (void**)&iomodel->sub_analysis_type,NULL,NULL,iomodel_handle,"sub_analysis_type","Integer",NULL);295 IoModelFetchData( (void**)&iomodel->qmu_analysis,NULL,NULL,iomodel_handle,"qmu_analysis","Integer",NULL);296 IoModelFetchData( (void**)&iomodel->control_analysis,NULL,NULL,iomodel_handle,"control_analysis","Integer",NULL);297 IoModelFetchData( (void**)&iomodel->meshtype,NULL,NULL,iomodel_handle,"type","String",NULL);293 IoModelFetchData(&iomodel->name,iomodel_handle,"name"); 294 IoModelFetchData(&iomodel->analysis_type,iomodel_handle,"analysis_type"); 295 IoModelFetchData(&iomodel->sub_analysis_type,iomodel_handle,"sub_analysis_type"); 296 IoModelFetchData(&iomodel->qmu_analysis,iomodel_handle,"qmu_analysis"); 297 IoModelFetchData(&iomodel->control_analysis,iomodel_handle,"control_analysis"); 298 IoModelFetchData(&iomodel->meshtype,iomodel_handle,"type"); 298 299 /*!Get numberofelements and numberofnodes: */ 299 IoModelFetchData( (void**)&iomodel->numberofnodes,NULL,NULL,iomodel_handle,"numberofgrids","Integer",NULL);300 IoModelFetchData( (void**)&iomodel->numberofelements,NULL,NULL,iomodel_handle,"numberofelements","Integer",NULL);300 IoModelFetchData(&iomodel->numberofnodes,iomodel_handle,"numberofgrids"); 301 IoModelFetchData(&iomodel->numberofelements,iomodel_handle,"numberofelements"); 301 302 /*!In case we are running 3d, we are going to need the collapsed and non-collapsed 2d meshes, from which the 3d mesh was extruded: */ 302 303 if (strcmp(iomodel->meshtype,"3d")==0){ 303 304 304 305 /*!Deal with 2d mesh: */ 305 IoModelFetchData( (void**)&iomodel->numberofelements2d,NULL,NULL,iomodel_handle,"numberofelements2d","Integer",NULL);306 IoModelFetchData( (void**)&iomodel->numberofnodes2d,NULL,NULL,iomodel_handle,"numberofgrids2d","Integer",NULL);307 IoModelFetchData( (void**)&iomodel->numlayers,NULL,NULL,iomodel_handle,"numlayers","Integer",NULL);306 IoModelFetchData(&iomodel->numberofelements2d,iomodel_handle,"numberofelements2d"); 307 IoModelFetchData(&iomodel->numberofnodes2d,iomodel_handle,"numberofgrids2d"); 308 IoModelFetchData(&iomodel->numlayers,iomodel_handle,"numlayers"); 308 309 } 309 310 310 311 311 312 /*elements type: */ 312 IoModelFetchData( (void**)&iomodel->ishutter,NULL,NULL,iomodel_handle,"ishutter","Integer",NULL);313 IoModelFetchData( (void**)&iomodel->ismacayealpattyn,NULL,NULL,iomodel_handle,"ismacayealpattyn","Integer",NULL);314 IoModelFetchData( (void**)&iomodel->isstokes,NULL,NULL,iomodel_handle,"isstokes","Integer",NULL);313 IoModelFetchData(&iomodel->ishutter,iomodel_handle,"ishutter"); 314 IoModelFetchData(&iomodel->ismacayealpattyn,iomodel_handle,"ismacayealpattyn"); 315 IoModelFetchData(&iomodel->isstokes,iomodel_handle,"isstokes"); 315 316 316 317 /*!Get drag_type, drag and p,q: */ 317 IoModelFetchData( (void**)&iomodel->drag_type,NULL,NULL,iomodel_handle,"drag_type","Integer",NULL);318 IoModelFetchData(&iomodel->drag_type,iomodel_handle,"drag_type"); 318 319 319 320 /*!Get materials: */ 320 IoModelFetchData( (void**)&iomodel->rho_water,NULL,NULL,iomodel_handle,"rho_water","Scalar",NULL);321 IoModelFetchData( (void**)&iomodel->rho_ice,NULL,NULL,iomodel_handle,"rho_ice","Scalar",NULL);322 IoModelFetchData( (void**)&iomodel->g,NULL,NULL,iomodel_handle,"g","Scalar",NULL);321 IoModelFetchData(&iomodel->rho_water,iomodel_handle,"rho_water"); 322 IoModelFetchData(&iomodel->rho_ice,iomodel_handle,"rho_ice"); 323 IoModelFetchData(&iomodel->g,iomodel_handle,"g"); 323 324 324 325 /*Get control parameters: */ 325 IoModelFetchData( (void**)&iomodel->control_type,NULL,NULL,iomodel_handle,"control_type","String",NULL);326 IoModelFetchData(&iomodel->control_type,iomodel_handle,"control_type"); 326 327 327 328 /*!Get solution parameters: */ 328 IoModelFetchData((void**)&iomodel->yts,NULL,NULL,iomodel_handle,"yts","Scalar",NULL); 329 IoModelFetchData((void**)&iomodel->meanvel,NULL,NULL,iomodel_handle,"meanvel","Scalar",NULL); 330 IoModelFetchData((void**)&iomodel->epsvel,NULL,NULL,iomodel_handle,"epsvel","Scalar",NULL); 331 IoModelFetchData((void**)&iomodel->verbose,NULL,NULL,iomodel_handle,"verbose","Integer",NULL); 332 IoModelFetchData((void**)&iomodel->plot,NULL,NULL,iomodel_handle,"plot","Integer",NULL); 333 IoModelFetchData((void**)&iomodel->artificial_diffusivity,NULL,NULL,iomodel_handle,"artificial_diffusivity","Integer",NULL); 334 IoModelFetchData((void**)&iomodel->nsteps,NULL,NULL,iomodel_handle,"nsteps","Integer",NULL); 335 IoModelFetchData((void**)&iomodel->eps_cm,NULL,NULL,iomodel_handle,"eps_cm","Scalar",NULL); 336 IoModelFetchData((void**)&iomodel->tolx,NULL,NULL,iomodel_handle,"tolx","Scalar",NULL); 337 IoModelFetchData((void**)&iomodel->cm_noisedampening,NULL,NULL,iomodel_handle,"cm_noisedampening","Scalar",NULL); 338 IoModelFetchData((void**)&iomodel->mincontrolconstraint,NULL,NULL,iomodel_handle,"mincontrolconstraint","Scalar",NULL); 339 IoModelFetchData((void**)&iomodel->maxcontrolconstraint,NULL,NULL,iomodel_handle,"maxcontrolconstraint","Scalar",NULL); 340 IoModelFetchData((void**)&iomodel->eps_res,NULL,NULL,iomodel_handle,"eps_res","Scalar",NULL); 341 IoModelFetchData((void**)&iomodel->eps_rel,NULL,NULL,iomodel_handle,"eps_rel","Scalar",NULL); 342 IoModelFetchData((void**)&iomodel->eps_abs,NULL,NULL,iomodel_handle,"eps_abs","Scalar",NULL); 343 IoModelFetchData((void**)&iomodel->dt,NULL,NULL,iomodel_handle,"dt","Scalar",NULL); 344 IoModelFetchData((void**)&iomodel->ndt,NULL,NULL,iomodel_handle,"ndt","Scalar",NULL); 345 IoModelFetchData((void**)&iomodel->penalty_offset,NULL,NULL,iomodel_handle,"penalty_offset","Scalar",NULL); 346 IoModelFetchData((void**)&iomodel->penalty_melting,NULL,NULL,iomodel_handle,"penalty_melting","Scalar",NULL); 347 IoModelFetchData((void**)&iomodel->penalty_lock,NULL,NULL,iomodel_handle,"penalty_lock","Integer",NULL); 348 IoModelFetchData((void**)&iomodel->sparsity,NULL,NULL,iomodel_handle,"sparsity","Scalar",NULL); 349 IoModelFetchData((void**)&iomodel->connectivity,NULL,NULL,iomodel_handle,"connectivity","Integer",NULL); 350 IoModelFetchData((void**)&iomodel->lowmem,NULL,NULL,iomodel_handle,"lowmem","Integer",NULL); 351 IoModelFetchData((void**)&iomodel->solverstring,NULL,NULL,iomodel_handle,"solverstring","String",NULL); 352 IoModelFetchData((void**)&iomodel->viscosity_overshoot,NULL,NULL,iomodel_handle,"viscosity_overshoot","Scalar",NULL); 353 IoModelFetchData((void**)&iomodel->stokesreconditioning,NULL,NULL,iomodel_handle,"stokesreconditioning","Scalar",NULL); 354 IoModelFetchData((void**)&iomodel->waitonlock,NULL,NULL,iomodel_handle,"waitonlock","Integer",NULL); 329 IoModelFetchData(&iomodel->yts,iomodel_handle,"yts"); 330 IoModelFetchData(&iomodel->meanvel,iomodel_handle,"meanvel"); 331 IoModelFetchData(&iomodel->epsvel,iomodel_handle,"epsvel"); 332 IoModelFetchData(&iomodel->verbose,iomodel_handle,"verbose"); 333 IoModelFetchData(&iomodel->plot,iomodel_handle,"plot"); 334 IoModelFetchData(&iomodel->artificial_diffusivity,iomodel_handle,"artificial_diffusivity"); 335 IoModelFetchData(&iomodel->nsteps,iomodel_handle,"nsteps"); 336 IoModelFetchData(&iomodel->eps_cm,iomodel_handle,"eps_cm"); 337 IoModelFetchData(&iomodel->tolx,iomodel_handle,"tolx"); 338 IoModelFetchData(&iomodel->cm_noisedampening,iomodel_handle,"cm_noisedampening"); 339 IoModelFetchData(&iomodel->mincontrolconstraint,iomodel_handle,"mincontrolconstraint"); 340 IoModelFetchData(&iomodel->maxcontrolconstraint,iomodel_handle,"maxcontrolconstraint"); 341 IoModelFetchData(&iomodel->eps_res,iomodel_handle,"eps_res"); 342 IoModelFetchData(&iomodel->eps_rel,iomodel_handle,"eps_rel"); 343 IoModelFetchData(&iomodel->eps_abs,iomodel_handle,"eps_abs"); 344 IoModelFetchData(&iomodel->dt,iomodel_handle,"dt"); 345 IoModelFetchData(&iomodel->ndt,iomodel_handle,"ndt"); 346 IoModelFetchData(&iomodel->penalty_offset,iomodel_handle,"penalty_offset"); 347 IoModelFetchData(&iomodel->penalty_melting,iomodel_handle,"penalty_melting"); 348 IoModelFetchData(&iomodel->penalty_lock,iomodel_handle,"penalty_lock"); 349 IoModelFetchData(&iomodel->sparsity,iomodel_handle,"sparsity"); 350 IoModelFetchData(&iomodel->connectivity,iomodel_handle,"connectivity"); 351 IoModelFetchData(&iomodel->lowmem,iomodel_handle,"lowmem"); 352 IoModelFetchData(&iomodel->solverstring,iomodel_handle,"solverstring"); 353 IoModelFetchData(&iomodel->viscosity_overshoot,iomodel_handle,"viscosity_overshoot"); 354 IoModelFetchData(&iomodel->artdiff,iomodel_handle,"artificial_diffusivity"); 355 IoModelFetchData(&iomodel->stokesreconditioning,iomodel_handle,"stokesreconditioning"); 356 IoModelFetchData(&iomodel->waitonlock,iomodel_handle,"waitonlock"); 355 357 356 358 /*!Get thermal parameters: */ 357 IoModelFetchData( (void**)&iomodel->beta,NULL,NULL,iomodel_handle,"beta","Scalar",NULL);358 IoModelFetchData( (void**)&iomodel->meltingpoint,NULL,NULL,iomodel_handle,"meltingpoint","Scalar",NULL);359 IoModelFetchData( (void**)&iomodel->latentheat,NULL,NULL,iomodel_handle,"latentheat","Scalar",NULL);360 IoModelFetchData( (void**)&iomodel->heatcapacity,NULL,NULL,iomodel_handle,"heatcapacity","Scalar",NULL);361 IoModelFetchData( (void**)&iomodel->thermalconductivity,NULL,NULL,iomodel_handle,"thermalconductivity","Scalar",NULL);362 IoModelFetchData( (void**)&iomodel->min_thermal_constraints,NULL,NULL,iomodel_handle,"min_thermal_constraints","Integer",NULL);363 IoModelFetchData( (void**)&iomodel->stabilize_constraints,NULL,NULL,iomodel_handle,"stabilize_constraints","Integer",NULL);364 IoModelFetchData( (void**)&iomodel->mixed_layer_capacity,NULL,NULL,iomodel_handle,"mixed_layer_capacity","Scalar",NULL);365 IoModelFetchData( (void**)&iomodel->thermal_exchange_velocity,NULL,NULL,iomodel_handle,"thermal_exchange_velocity","Scalar",NULL);359 IoModelFetchData(&iomodel->beta,iomodel_handle,"beta"); 360 IoModelFetchData(&iomodel->meltingpoint,iomodel_handle,"meltingpoint"); 361 IoModelFetchData(&iomodel->latentheat,iomodel_handle,"latentheat"); 362 IoModelFetchData(&iomodel->heatcapacity,iomodel_handle,"heatcapacity"); 363 IoModelFetchData(&iomodel->thermalconductivity,iomodel_handle,"thermalconductivity"); 364 IoModelFetchData(&iomodel->min_thermal_constraints,iomodel_handle,"min_thermal_constraints"); 365 IoModelFetchData(&iomodel->stabilize_constraints,iomodel_handle,"stabilize_constraints"); 366 IoModelFetchData(&iomodel->mixed_layer_capacity,iomodel_handle,"mixed_layer_capacity"); 367 IoModelFetchData(&iomodel->thermal_exchange_velocity,iomodel_handle,"thermal_exchange_velocity"); 366 368 367 369 /*qmu: */ 368 370 if(iomodel->qmu_analysis){ 369 IoModelFetchData( (void**)&iomodel->numberofvariables,NULL,NULL,iomodel_handle,"numberofvariables","Integer",NULL);370 IoModelFetchData( (void**)&iomodel->numberofresponses,NULL,NULL,iomodel_handle,"numberofresponses","Integer",NULL);371 IoModelFetchData( (void**)&iomodel->qmu_npart,NULL,NULL,iomodel_handle,"npart","Integer",NULL);371 IoModelFetchData(&iomodel->numberofvariables,iomodel_handle,"numberofvariables"); 372 IoModelFetchData(&iomodel->numberofresponses,iomodel_handle,"numberofresponses"); 373 IoModelFetchData(&iomodel->qmu_npart,iomodel_handle,"npart"); 372 374 } 373 375 374 376 /*parameter output : */ 375 IoModelFetchData( (void**)&iomodel->numoutput,NULL,NULL,iomodel_handle,"numoutput","Integer",NULL);377 IoModelFetchData(&iomodel->numoutput,iomodel_handle,"numoutput"); 376 378 377 379 /*Assign output pointers: */ -
issm/trunk/src/c/ModelProcessorx/IoModel.h
r2330 r2333 102 102 double* n; 103 103 104 /*numerical parameters: */ 105 double meanvel; 106 double epsvel; 107 int artdiff; 108 double viscosity_overshoot; 109 double stokesreconditioning; 110 double cm_noisedampening; 111 104 112 /*control methods: */ 105 113 char* control_type; … … 108 116 double* fit; 109 117 double* cm_jump; 110 double meanvel,epsvel;111 118 int artificial_diffusivity; 112 119 int nsteps; … … 114 121 double tolx; 115 122 double* maxiter; 116 double cm_noisedampening;117 123 double mincontrolconstraint; 118 124 double maxcontrolconstraint; … … 131 137 double* optscal; 132 138 double yts; 133 double viscosity_overshoot;134 double stokesreconditioning;135 139 int waitonlock; 136 140 -
issm/trunk/src/c/ModelProcessorx/Melting/CreateElementsNodesAndMaterialsMelting.cpp
r1905 r2333 57 57 int penta_mid; 58 58 int penta_mparid; 59 int penta_numparid; 59 60 int penta_g[6]; 60 61 double penta_h[6]; … … 68 69 int penta_onbed; 69 70 int penta_onsurface; 70 double penta_meanvel;/*!scaling ratio for velocities*/71 double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/72 71 int penta_collapse; 73 72 double penta_melting[6]; 74 73 double penta_accumulation[6]; 75 74 double penta_geothermalflux[6]; 76 int penta_artdiff;77 75 int penta_thermal_steadystate; 78 double penta_viscosity_overshoot;79 double penta_stokesreconditioning;80 76 bool penta_onwater; 81 77 … … 129 125 #ifdef _PARALLEL_ 130 126 /*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/ 131 IoModelFetchData( (void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");127 IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d"); 132 128 133 129 … … 146 142 147 143 /*Fetch data needed: */ 148 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");149 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");150 IoModelFetchData( (void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");151 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");152 IoModelFetchData( (void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");153 IoModelFetchData( (void**)&iomodel->p,NULL,NULL,iomodel_handle,"p","Matrix","Mat");154 IoModelFetchData( (void**)&iomodel->q,NULL,NULL,iomodel_handle,"q","Matrix","Mat");155 IoModelFetchData( (void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");156 IoModelFetchData( (void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");157 IoModelFetchData( (void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");158 IoModelFetchData( (void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");159 IoModelFetchData( (void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");160 IoModelFetchData( (void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");161 IoModelFetchData( (void**)&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");162 IoModelFetchData( (void**)&iomodel->melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");163 IoModelFetchData( (void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");144 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 145 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 146 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 147 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 148 IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag"); 149 IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p"); 150 IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q"); 151 IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf"); 152 IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed"); 153 IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface"); 154 IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type"); 155 IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B"); 156 IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n"); 157 IoModelFetchData(&iomodel->accumulation,NULL,NULL,iomodel_handle,"accumulation"); 158 IoModelFetchData(&iomodel->melting,NULL,NULL,iomodel_handle,"melting"); 159 IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater"); 164 160 165 161 for (i=0;i<iomodel->numberofelements;i++){ … … 174 170 penta_mid=i+1; //refers to the corresponding material property card 175 171 penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card 172 penta_numparid=1; 176 173 177 174 /*vertices,thickness,surface,bed and drag: */ … … 196 193 penta_onbed=(int)*(iomodel->elementonbed+i); 197 194 penta_onsurface=(int)*(iomodel->elementonsurface+i); 198 penta_meanvel=iomodel->meanvel;199 penta_epsvel=iomodel->epsvel;200 195 penta_onwater=(bool)*(iomodel->elementonwater+i); 201 202 /*viscosity_overshoot*/203 penta_viscosity_overshoot=iomodel->viscosity_overshoot;204 196 penta_collapse=1; 205 197 206 198 /*Create Penta using its constructor:*/ 207 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_ g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,208 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface, penta_meanvel,penta_epsvel,209 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux, penta_artdiff,210 penta_thermal_steadystate,penta_ viscosity_overshoot,penta_stokesreconditioning,penta_onwater);199 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type, 200 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface, 201 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux, 202 penta_thermal_steadystate,penta_onwater); 211 203 212 204 /*Add penta element to elements dataset: */ … … 320 312 321 313 /*Get penalties: */ 322 IoModelFetchData( (void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");314 IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties"); 323 315 324 316 if(iomodel->numpenalties){ … … 356 348 /*First fetch data: */ 357 349 if (strcmp(iomodel->meshtype,"3d")==0){ 358 IoModelFetchData( (void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");359 IoModelFetchData( (void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");350 IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids"); 351 IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids"); 360 352 } 361 IoModelFetchData( (void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");362 IoModelFetchData( (void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");363 IoModelFetchData( (void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");364 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");365 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");366 IoModelFetchData( (void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");367 IoModelFetchData( (void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");368 IoModelFetchData( (void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");369 IoModelFetchData( (void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");353 IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x"); 354 IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y"); 355 IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z"); 356 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 357 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 358 IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed"); 359 IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface"); 360 IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet"); 361 IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf"); 370 362 371 363 -
issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp
r2212 r2333 50 50 51 51 //create penalties for grids: no grid can have a temperature over the melting point 52 IoModelFetchData( (void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");52 IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed"); 53 53 54 54 for (i=0;i<iomodel->numberofnodes;i++){ -
issm/trunk/src/c/ModelProcessorx/Melting/CreateParametersMelting.cpp
r1905 r2333 34 34 35 35 /*Get melting: */ 36 IoModelFetchData( (void**)&melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");36 IoModelFetchData(&melting,NULL,NULL,iomodel_handle,"melting"); 37 37 if(melting) { 38 38 for(i=0;i<iomodel->numberofnodes;i++)melting[i]=melting[i]/iomodel->yts; //m/s instead of m/yr -
issm/trunk/src/c/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp
r1834 r2333 35 35 36 36 /*Fetch data: */ 37 IoModelFetchData( (void**)&spcthickness,NULL,NULL,iomodel_handle,"spcthickness","Matrix","Mat");37 IoModelFetchData(&spcthickness,NULL,NULL,iomodel_handle,"spcthickness"); 38 38 39 39 count=0; -
issm/trunk/src/c/ModelProcessorx/Prognostic/CreateElementsNodesAndMaterialsPrognostic.cpp
r1904 r2333 52 52 int tria_mid; 53 53 int tria_mparid; 54 int tria_numparid; 54 55 int tria_g[3]; 55 56 double tria_h[3]; … … 64 65 double tria_q; 65 66 int tria_shelf; 66 double tria_meanvel;/*!scaling ratio for velocities*/67 double tria_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/68 double tria_viscosity_overshoot;69 int tria_artdiff;70 67 bool tria_onwater; 71 68 … … 80 77 int penta_mid; 81 78 int penta_mparid; 79 int penta_numparid; 82 80 int penta_g[6]; 83 81 double penta_h[6]; … … 91 89 int penta_onbed; 92 90 int penta_onsurface; 93 double penta_meanvel;/*!scaling ratio for velocities*/94 double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/95 91 int penta_collapse; 96 92 double penta_melting[6]; 97 93 double penta_accumulation[6]; 98 94 double penta_geothermalflux[6]; 99 int penta_artdiff;100 95 int penta_thermal_steadystate; 101 double penta_viscosity_overshoot;102 double penta_stokesreconditioning;103 96 bool penta_onwater; 104 97 … … 157 150 if(strcmp(iomodel->meshtype,"2d")==0){ 158 151 /*load elements: */ 159 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");152 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 160 153 } 161 154 else{ 162 155 /*load elements2d: */ 163 IoModelFetchData( (void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");156 IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d"); 164 157 } 165 158 … … 183 176 184 177 /*Fetch data needed: */ 185 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");186 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");187 IoModelFetchData( (void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");188 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");189 IoModelFetchData( (void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");190 IoModelFetchData( (void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");178 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 179 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 180 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 181 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 182 IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf"); 183 IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater"); 191 184 192 185 for (i=0;i<iomodel->numberofelements;i++){ … … 202 195 tria_mid=-1; //no need for materials 203 196 tria_mparid=-1; //no need for materials 197 tria_numparid=1; 204 198 205 199 /*vertices offsets: */ … … 224 218 tria_shelf=(int)*(iomodel->elementoniceshelf+i); 225 219 tria_onwater=(bool)*(iomodel->elementonwater+i); 226 tria_artdiff=iomodel->artificial_diffusivity;227 220 228 221 /*Create tria element using its constructor:*/ 229 tria=new Tria(tria_id, tria_mid, tria_mparid, tria_ g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_meanvel, tria_epsvel, tria_viscosity_overshoot,tria_artdiff,tria_onwater);222 tria=new Tria(tria_id, tria_mid, tria_mparid, tria_numparid,tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_onwater); 230 223 231 224 /*Add tria element to elements dataset: */ … … 261 254 262 255 /*Fetch data needed: */ 263 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");264 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");265 IoModelFetchData( (void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");266 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");267 IoModelFetchData( (void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");268 IoModelFetchData( (void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");269 IoModelFetchData( (void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");270 IoModelFetchData( (void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");256 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 257 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 258 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 259 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 260 IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf"); 261 IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed"); 262 IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface"); 263 IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater"); 271 264 272 265 for (i=0;i<iomodel->numberofelements;i++){ … … 281 274 penta_mid=-1; 282 275 penta_mparid=-1; //no need for materials 276 penta_numparid=1; 283 277 284 278 /*vertices,thickness,surface,bed and drag: */ … … 295 289 penta_onsurface=(int)*(iomodel->elementonsurface+i); 296 290 penta_collapse=1; 297 penta_artdiff=iomodel->artificial_diffusivity;298 291 penta_onwater=(bool)*(iomodel->elementonwater+i); 299 292 300 293 301 294 /*Create Penta using its constructor:*/ 302 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_ g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,303 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface, penta_meanvel,penta_epsvel,304 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux, penta_artdiff,305 penta_thermal_steadystate,penta_ viscosity_overshoot,penta_stokesreconditioning,penta_onwater);295 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type, 296 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface, 297 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux, 298 penta_thermal_steadystate,penta_onwater); 306 299 307 300 /*Add penta element to elements dataset: */ … … 390 383 391 384 /*Get penalties: */ 392 IoModelFetchData( (void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");385 IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties"); 393 386 394 387 if(iomodel->numpenalties){ … … 426 419 /*First fetch data: */ 427 420 if (strcmp(iomodel->meshtype,"3d")==0){ 428 IoModelFetchData( (void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");429 IoModelFetchData( (void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");430 } 431 IoModelFetchData( (void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");432 IoModelFetchData( (void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");433 IoModelFetchData( (void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");434 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");435 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");436 IoModelFetchData( (void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");437 IoModelFetchData( (void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");438 IoModelFetchData( (void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");439 IoModelFetchData( (void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");421 IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids"); 422 IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids"); 423 } 424 IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x"); 425 IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y"); 426 IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z"); 427 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 428 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 429 IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed"); 430 IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface"); 431 IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet"); 432 IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf"); 440 433 441 434 -
issm/trunk/src/c/ModelProcessorx/Prognostic/CreateParametersPrognostic.cpp
r1834 r2333 39 39 40 40 /*Get vx and vy: */ 41 IoModelFetchData( (void**)&vx,NULL,NULL,iomodel_handle,"vx","Matrix","Mat");42 IoModelFetchData( (void**)&vy,NULL,NULL,iomodel_handle,"vy","Matrix","Mat");43 IoModelFetchData( (void**)&vz,NULL,NULL,iomodel_handle,"vz","Matrix","Mat");41 IoModelFetchData(&vx,NULL,NULL,iomodel_handle,"vx"); 42 IoModelFetchData(&vy,NULL,NULL,iomodel_handle,"vy"); 43 IoModelFetchData(&vz,NULL,NULL,iomodel_handle,"vz"); 44 44 45 45 u_g=(double*)xcalloc(iomodel->numberofnodes*3,sizeof(double)); … … 61 61 62 62 /*Get pressure if 3d iomodel: */ 63 parameters->FindParam( (void*)&dim,"dim");63 parameters->FindParam(&dim,"dim"); 64 64 if (dim==3){ 65 IoModelFetchData( (void**)&pressure,NULL,NULL,iomodel_handle,"pressure","Matrix","Mat");65 IoModelFetchData(&pressure,NULL,NULL,iomodel_handle,"pressure"); 66 66 67 67 count++; … … 76 76 77 77 /*Get temperature if 3d iomodel: */ 78 parameters->FindParam( (void*)&dim,"dim");78 parameters->FindParam(&dim,"dim"); 79 79 if (dim==3){ 80 IoModelFetchData( (void**)&temperature,NULL,NULL,iomodel_handle,"temperature","Matrix","Mat");80 IoModelFetchData(&temperature,NULL,NULL,iomodel_handle,"temperature"); 81 81 82 82 count++; … … 91 91 92 92 /*Get thickness: */ 93 IoModelFetchData( (void**)&thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");93 IoModelFetchData(&thickness,NULL,NULL,iomodel_handle,"thickness"); 94 94 95 95 count++; … … 103 103 104 104 /*Get surface: */ 105 IoModelFetchData( (void**)&surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");105 IoModelFetchData(&surface,NULL,NULL,iomodel_handle,"surface"); 106 106 107 107 count++; … … 115 115 116 116 /*Get bed: */ 117 IoModelFetchData( (void**)&bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");117 IoModelFetchData(&bed,NULL,NULL,iomodel_handle,"bed"); 118 118 119 119 count++; … … 127 127 128 128 /*Get melting: */ 129 IoModelFetchData( (void**)&melting,NULL,NULL,iomodel_handle,"melting","Matrix","Mat");129 IoModelFetchData(&melting,NULL,NULL,iomodel_handle,"melting"); 130 130 if(melting) for(i=0;i<iomodel->numberofnodes;i++)melting[i]=melting[i]/iomodel->yts; 131 131 … … 140 140 141 141 /*Get accumulation: */ 142 IoModelFetchData( (void**)&accumulation,NULL,NULL,iomodel_handle,"accumulation","Matrix","Mat");142 IoModelFetchData(&accumulation,NULL,NULL,iomodel_handle,"accumulation"); 143 143 if(accumulation) for(i=0;i<iomodel->numberofnodes;i++)accumulation[i]=accumulation[i]/iomodel->yts; 144 144 -
issm/trunk/src/c/ModelProcessorx/Qmu/CreateParametersQmu.cpp
r2112 r2333 60 60 //qmu analysis? 61 61 count++; 62 param= new Param(count,"qmu_analysis", INTEGER);63 param->Set Integer(iomodel->qmu_analysis);62 param= new Param(count,"qmu_analysis",DOUBLE); 63 param->SetDouble(iomodel->qmu_analysis); 64 64 parameters->AddObject(param); 65 65 … … 94 94 //npart 95 95 count++; 96 param= new Param(count,"qmu_npart", INTEGER);97 param->Set Integer(iomodel->qmu_npart);96 param= new Param(count,"qmu_npart",DOUBLE); 97 param->SetDouble(iomodel->qmu_npart); 98 98 parameters->AddObject(param); 99 99 … … 110 110 for(i=0;i<iomodel->numberofvariables;i++){ 111 111 pfield2=mxGetCell(pfield,i); 112 FetchData( (void**)&descriptor,NULL,NULL,pfield2,"String",NULL);112 FetchData(&descriptor,pfield2); 113 113 variabledescriptors[i]=descriptor; 114 114 } … … 117 117 for(i=0;i<iomodel->numberofvariables;i++){ 118 118 sprintf(tag,"%s%i","variabledescriptor",i); 119 IoModelFetchData( (void**)&descriptor,NULL,NULL,iomodel_handle,tag,"String",NULL);119 IoModelFetchData(&descriptor,iomodel_handle,tag); 120 120 variabledescriptors[i]=descriptor; 121 121 } … … 138 138 for(i=0;i<iomodel->numberofresponses;i++){ 139 139 pfield2=mxGetCell(pfield,i); 140 FetchData( (void**)&descriptor,NULL,NULL,pfield2,"String",NULL);140 FetchData(&descriptor,pfield2); 141 141 responsedescriptors[i]=descriptor; 142 142 } … … 147 147 for(i=0;i<iomodel->numberofresponses;i++){ 148 148 sprintf(tag,"%s%i","responsedescriptor",i); 149 IoModelFetchData( (void**)&descriptor,NULL,NULL,iomodel_handle,tag,"String",NULL);149 IoModelFetchData(&descriptor,iomodel_handle,tag); 150 150 responsedescriptors[i]=descriptor; 151 151 } … … 171 171 172 172 /*partition grids in iomodel->qmu_npart parts, unless a partition is already present: */ 173 IoModelFetchData( (void**)&dpart,NULL,NULL,iomodel_handle,"part","Matrix","Mat");173 IoModelFetchData(&dpart,NULL,NULL,iomodel_handle,"part"); 174 174 175 175 if(!dpart){ 176 176 177 177 if(strcmp(iomodel->meshtype,"2d")==0){ 178 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");178 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 179 179 elements_width=3; //tria elements 180 180 } 181 181 else{ 182 IoModelFetchData( (void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");182 IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d"); 183 183 elements_width=6; //penta elements 184 184 } … … 206 206 207 207 //Fetch data: 208 IoModelFetchData( (void**)&dakota_parameter,NULL,NULL,iomodel_handle,descriptor,"Matrix","Mat");208 IoModelFetchData(&dakota_parameter,NULL,NULL,iomodel_handle,descriptor); 209 209 210 210 //Add parameter … … 227 227 228 228 /*We need the qmu_mass_flux_segments to be able to compute the mass flux: */ 229 IoModelFetchData( (void**)&qmu_mass_flux_segments,&num_qmu_mass_flux_segments,NULL,iomodel_handle,"qmu_mass_flux_segments","Matrix","Mat");229 IoModelFetchData(&qmu_mass_flux_segments,&num_qmu_mass_flux_segments,NULL,iomodel_handle,"qmu_mass_flux_segments"); 230 230 231 231 #ifdef _PARALLEL_ -
issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateElementsNodesAndMaterialsSlopeCompute.cpp
r1904 r2333 48 48 int tria_mid; 49 49 int tria_mparid; 50 int tria_numparid; 50 51 int tria_g[3]; 51 52 double tria_h[3]; … … 60 61 double tria_q; 61 62 int tria_shelf; 62 double tria_meanvel;/*!scaling ratio for velocities*/63 double tria_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/64 double tria_viscosity_overshoot;65 int tria_artdiff;66 63 bool tria_onwater; 67 64 … … 71 68 int penta_mid; 72 69 int penta_mparid; 70 int penta_numparid; 73 71 int penta_g[6]; 74 72 double penta_h[6]; … … 82 80 int penta_onbed; 83 81 int penta_onsurface; 84 double penta_meanvel;/*!scaling ratio for velocities*/85 double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/86 82 int penta_collapse; 87 83 double penta_melting[6]; 88 84 double penta_accumulation[6]; 89 85 double penta_geothermalflux[6]; 90 int penta_artdiff;91 86 int penta_thermal_steadystate; 92 double penta_viscosity_overshoot;93 double penta_stokesreconditioning;94 87 bool penta_onwater; 95 88 … … 138 131 if(strcmp(iomodel->meshtype,"2d")==0){ 139 132 /*load elements: */ 140 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");133 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 141 134 } 142 135 else{ 143 136 /*load elements2d: */ 144 IoModelFetchData( (void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");137 IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d"); 145 138 } 146 139 … … 165 158 166 159 /*Fetch data needed: */ 167 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");168 IoModelFetchData( (void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");169 IoModelFetchData( (void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");170 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");160 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 161 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 162 IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater"); 163 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 171 164 172 165 for (i=0;i<iomodel->numberofelements;i++){ … … 182 175 tria_mid=-1; //no materials 183 176 tria_mparid=-1; //no materials 177 tria_numparid=1; //no materials 184 178 185 179 /*vertices offsets: */ … … 201 195 202 196 /*Create tria element using its constructor:*/ 203 tria=new Tria(tria_id, tria_mid, tria_mparid, tria_ g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_meanvel, tria_epsvel, tria_viscosity_overshoot,tria_artdiff,tria_onwater);197 tria=new Tria(tria_id, tria_mid, tria_mparid, tria_numparid,tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_onwater); 204 198 205 199 /*Add tria element to elements dataset: */ … … 233 227 234 228 /*Fetch data needed: */ 235 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");236 IoModelFetchData( (void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");237 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");238 IoModelFetchData( (void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");239 IoModelFetchData( (void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");229 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 230 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 231 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 232 IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed"); 233 IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater"); 240 234 241 235 for (i=0;i<iomodel->numberofelements;i++){ … … 250 244 penta_mid=-1; //no materials 251 245 penta_mparid=-1; //no materials 246 penta_numparid=1; //no materials 252 247 253 248 … … 264 259 265 260 /*Create Penta using its constructor:*/ 266 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_ g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,267 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface, penta_meanvel,penta_epsvel,268 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux, penta_artdiff,269 penta_thermal_steadystate,penta_ viscosity_overshoot,penta_stokesreconditioning,penta_onwater);261 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type, 262 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface, 263 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux, 264 penta_thermal_steadystate,penta_onwater); 270 265 271 266 /*Add penta element to elements dataset: */ … … 331 326 332 327 /*Get penalties: */ 333 IoModelFetchData( (void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");328 IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties"); 334 329 335 330 if(iomodel->numpenalties){ … … 367 362 /*First fetch data: */ 368 363 if (strcmp(iomodel->meshtype,"3d")==0){ 369 IoModelFetchData( (void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");370 IoModelFetchData( (void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");371 } 372 IoModelFetchData( (void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");373 IoModelFetchData( (void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");374 IoModelFetchData( (void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");375 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");376 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");377 IoModelFetchData( (void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");378 IoModelFetchData( (void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");379 IoModelFetchData( (void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");380 IoModelFetchData( (void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");364 IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids"); 365 IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids"); 366 } 367 IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x"); 368 IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y"); 369 IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z"); 370 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 371 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 372 IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed"); 373 IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface"); 374 IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet"); 375 IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf"); 381 376 382 377 -
issm/trunk/src/c/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp
r1905 r2333 38 38 39 39 /*Fetch data: */ 40 IoModelFetchData( (void**)&spctemperature,NULL,NULL,iomodel_handle,"spctemperature","Matrix","Mat");40 IoModelFetchData(&spctemperature,NULL,NULL,iomodel_handle,"spctemperature"); 41 41 42 42 count=0; -
issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp
r1905 r2333 58 58 int penta_mid; 59 59 int penta_mparid; 60 int penta_numparid; 60 61 int penta_g[6]; 61 62 double penta_h[6]; … … 69 70 int penta_onbed; 70 71 int penta_onsurface; 71 double penta_meanvel;/*!scaling ratio for velocities*/72 double penta_epsvel; /*!minimum velocity to avoid infinite velocity ratios*/73 72 int penta_collapse; 74 73 double penta_melting[6]; 75 74 double penta_accumulation[6]; 76 75 double penta_geothermalflux[6]; 77 int penta_artdiff;78 76 int penta_thermal_steadystate; 79 double penta_viscosity_overshoot;80 double penta_stokesreconditioning;81 77 bool penta_onwater; 82 78 … … 131 127 #ifdef _PARALLEL_ 132 128 /*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/ 133 IoModelFetchData( (void**)&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d","Matrix","Mat");129 IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d"); 134 130 135 131 MeshPartitionx(&epart, &npart,iomodel->numberofelements,iomodel->numberofnodes,iomodel->elements, iomodel->numberofelements2d,iomodel->numberofnodes2d,iomodel->elements2d,iomodel->numlayers,elements_width, iomodel->meshtype,num_procs); … … 146 142 147 143 /*Fetch data needed: */ 148 IoModelFetchData( (void**)&iomodel->elements,NULL,NULL,iomodel_handle,"elements","Matrix","Mat");149 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");150 IoModelFetchData( (void**)&iomodel->surface,NULL,NULL,iomodel_handle,"surface","Matrix","Mat");151 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");152 IoModelFetchData( (void**)&iomodel->drag,NULL,NULL,iomodel_handle,"drag","Matrix","Mat");153 IoModelFetchData( (void**)&iomodel->p,NULL,NULL,iomodel_handle,"p","Matrix","Mat");154 IoModelFetchData( (void**)&iomodel->q,NULL,NULL,iomodel_handle,"q","Matrix","Mat");155 IoModelFetchData( (void**)&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf","Matrix","Mat");156 IoModelFetchData( (void**)&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed","Matrix","Mat");157 IoModelFetchData( (void**)&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface","Matrix","Mat");158 IoModelFetchData( (void**)&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type","Matrix","Mat");159 IoModelFetchData( (void**)&iomodel->geothermalflux,NULL,NULL,iomodel_handle,"geothermalflux","Matrix","Mat");160 IoModelFetchData( (void**)&iomodel->B,NULL,NULL,iomodel_handle,"B","Matrix","Mat");161 IoModelFetchData( (void**)&iomodel->n,NULL,NULL,iomodel_handle,"n","Matrix","Mat");162 IoModelFetchData( (void**)&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater","Matrix","Mat");144 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 145 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 146 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 147 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 148 IoModelFetchData(&iomodel->drag,NULL,NULL,iomodel_handle,"drag"); 149 IoModelFetchData(&iomodel->p,NULL,NULL,iomodel_handle,"p"); 150 IoModelFetchData(&iomodel->q,NULL,NULL,iomodel_handle,"q"); 151 IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf"); 152 IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed"); 153 IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface"); 154 IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type"); 155 IoModelFetchData(&iomodel->geothermalflux,NULL,NULL,iomodel_handle,"geothermalflux"); 156 IoModelFetchData(&iomodel->B,NULL,NULL,iomodel_handle,"B"); 157 IoModelFetchData(&iomodel->n,NULL,NULL,iomodel_handle,"n"); 158 IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater"); 163 159 164 160 for (i=0;i<iomodel->numberofelements;i++){ … … 173 169 penta_mid=i+1; //refers to the corresponding material property card 174 170 penta_mparid=iomodel->numberofelements+1;//refers to the corresponding parmat property card 171 penta_numparid=1; 175 172 176 173 /*vertices,thickness,surface,bed and drag: */ … … 194 191 penta_onbed=(int)*(iomodel->elementonbed+i); 195 192 penta_onsurface=(int)*(iomodel->elementonsurface+i); 196 penta_meanvel=iomodel->meanvel;197 penta_epsvel=iomodel->epsvel;198 193 penta_onwater=(bool)*(iomodel->elementonwater+i); 199 penta_artdiff=iomodel->artificial_diffusivity;200 194 201 195 /*We need the field collapse for transient, so that we can use compute B with the average temperature*/ … … 209 203 210 204 /*Create Penta using its constructor:*/ 211 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_ g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,212 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface, penta_meanvel,penta_epsvel,213 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux, penta_artdiff,214 penta_thermal_steadystate,penta_ viscosity_overshoot,penta_stokesreconditioning,penta_onwater);205 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type, 206 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface, 207 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux, 208 penta_thermal_steadystate,penta_onwater); 215 209 216 210 /*Add penta element to elements dataset: */ … … 322 316 323 317 /*Get penalties: */ 324 IoModelFetchData( (void**)&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties","Matrix","Mat");318 IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties"); 325 319 326 320 if(iomodel->numpenalties){ … … 358 352 /*First fetch data: */ 359 353 if (strcmp(iomodel->meshtype,"3d")==0){ 360 IoModelFetchData( (void**)&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids","Matrix","Mat");361 IoModelFetchData( (void**)&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids","Matrix","Mat");354 IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids"); 355 IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids"); 362 356 } 363 IoModelFetchData( (void**)&iomodel->x,NULL,NULL,iomodel_handle,"x","Matrix","Mat");364 IoModelFetchData( (void**)&iomodel->y,NULL,NULL,iomodel_handle,"y","Matrix","Mat");365 IoModelFetchData( (void**)&iomodel->z,NULL,NULL,iomodel_handle,"z","Matrix","Mat");366 IoModelFetchData( (void**)&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness","Matrix","Mat");367 IoModelFetchData( (void**)&iomodel->bed,NULL,NULL,iomodel_handle,"bed","Matrix","Mat");368 IoModelFetchData( (void**)&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed","Matrix","Mat");369 IoModelFetchData( (void**)&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface","Matrix","Mat");370 IoModelFetchData( (void**)&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet","Matrix","Mat");371 IoModelFetchData( (void**)&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf","Matrix","Mat");357 IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x"); 358 IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y"); 359 IoModelFetchData(&iomodel->z,NULL,NULL,iomodel_handle,"z"); 360 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 361 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 362 IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed"); 363 IoModelFetchData(&iomodel->gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface"); 364 IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet"); 365 IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf"); 372 366 373 367 /*Get number of dofs per node: */ -
issm/trunk/src/c/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
r2212 r2333 51 51 52 52 //create penalties for grids: no grid can have a temperature over the melting point 53 IoModelFetchData( (void**)&iomodel->spctemperature,NULL,NULL,iomodel_handle,"spctemperature","Matrix","Mat");53 IoModelFetchData(&iomodel->spctemperature,NULL,NULL,iomodel_handle,"spctemperature"); 54 54 55 55 for (i=0;i<iomodel->numberofnodes;i++){ -
issm/trunk/src/c/ModelProcessorx/Thermal/CreateParametersThermal.cpp
r1905 r2333 36 36 37 37 /*Get vx vy and vz: */ 38 IoModelFetchData( (void**)&vx,NULL,NULL,iomodel_handle,"vx","Matrix","Mat");39 IoModelFetchData( (void**)&vy,NULL,NULL,iomodel_handle,"vy","Matrix","Mat");40 IoModelFetchData( (void**)&vz,NULL,NULL,iomodel_handle,"vz","Matrix","Mat");38 IoModelFetchData(&vx,NULL,NULL,iomodel_handle,"vx"); 39 IoModelFetchData(&vy,NULL,NULL,iomodel_handle,"vy"); 40 IoModelFetchData(&vz,NULL,NULL,iomodel_handle,"vz"); 41 41 42 42 u_g=(double*)xcalloc(iomodel->numberofnodes*3,sizeof(double)); … … 57 57 58 58 /*Get pressure: */ 59 IoModelFetchData( (void**)&pressure,NULL,NULL,iomodel_handle,"pressure","Matrix","Mat");59 IoModelFetchData(&pressure,NULL,NULL,iomodel_handle,"pressure"); 60 60 61 61 count++; … … 72 72 73 73 /*Get melting and temperature: */ 74 IoModelFetchData( (void**)&temperature,NULL,NULL,iomodel_handle,"temperature","Matrix","Mat");74 IoModelFetchData(&temperature,NULL,NULL,iomodel_handle,"temperature"); 75 75 76 76 count++; -
issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.cpp
r1787 r2333 15 15 16 16 void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes, 17 DataSet* loads,DataSet* materials, ParameterInputs* inputs,int analysis_type,int sub_analysis_type){17 DataSet* loads,DataSet* materials, DataSet* parameters,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){ 18 18 19 19 int i; … … 27 27 28 28 /*First, get loads configured: */ 29 loads->Configure(elements, loads, nodes, materials );29 loads->Configure(elements, loads, nodes, materials,parameters); 30 30 31 31 /*Do we have penalties linked to rifts? In this case, run our special rifts penalty -
issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.h
r465 r2333 11 11 /* local prototypes: */ 12 12 void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes, 13 DataSet* loads,DataSet* materials, ParameterInputs* inputs,int analysis_type,int sub_analysis_type);13 DataSet* loads,DataSet* materials, DataSet* parameters,ParameterInputs* inputs,int analysis_type,int sub_analysis_type); 14 14 15 15 #endif /* _PENALTYCONSTRAINTSX_H */ -
issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.cpp
r1904 r2333 13 13 #include "../EnumDefinitions/EnumDefinitions.h" 14 14 15 void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, 15 void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, DataSet* parameters, 16 16 int kflag,int pflag,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){ 17 17 … … 23 23 24 24 /*First, get elements and loads configured: */ 25 elements->Configure(elements,loads, nodes, materials); 26 loads->Configure(elements, loads, nodes, materials); 25 elements->Configure(elements,loads, nodes, materials,parameters); 26 loads->Configure(elements, loads, nodes, materials,parameters); 27 parameters->Configure(elements,loads, nodes, materials,parameters); 27 28 28 29 /*Now, figure out maximum value of K_gg, so that we can penalize it correctly: */ -
issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.h
r472 r2333 10 10 11 11 /* local prototypes: */ 12 void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, 12 void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax, DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, DataSet* parameters, 13 13 int kflag,int pflag,ParameterInputs* inputs,int analysis_type,int sub_analysis_type); 14 14 -
issm/trunk/src/c/ProcessParamsx/ProcessParamsx.cpp
r1937 r2333 34 34 35 35 /*Some parameters needed: */ 36 parameters->FindParam( (void*)&numberofnodes,"numberofnodes");36 parameters->FindParam(&numberofnodes,"numberofnodes"); 37 37 38 38 /*serialize partition vector: */ -
issm/trunk/src/c/Qmux/DakotaResponses.cpp
r2114 r2333 262 262 if(!param)throw ErrorException(__FUNCT__," could not find qmu_mass_flux_segments to compute mass_flux"); 263 263 264 param->GetParameterValue( (void*)&segments);264 param->GetParameterValue(&segments); 265 265 num_segments=param->GetM(); 266 266 267 267 /*call mass flux module: */ 268 MassFluxx(&mass_flux,femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials, segments,num_segments,ug_serial);268 MassFluxx(&mass_flux,femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,femmodel->parameters,segments,num_segments,ug_serial); 269 269 270 270 if(my_rank==0)responses[i]=mass_flux; -
issm/trunk/src/c/Qmux/SpawnCoreParallel.cpp
r2330 r2333 69 69 /*Recover partitioning for dakota: */ 70 70 model->FindParam(&qmu_npart,"qmu_npart"); 71 model->FindParam(&qmu_part, "qmu_part");71 model->FindParam(&qmu_part,NULL,NULL,"qmu_part"); 72 72 #ifdef _ISSM_DEBUG_ 73 73 for(i=0;i<numresponses;i++){ -
issm/trunk/src/c/SystemMatricesx/SystemMatricesx.cpp
r465 r2333 13 13 #include "../EnumDefinitions/EnumDefinitions.h" 14 14 15 void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, 15 void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, DataSet* parameters, 16 16 int kflag,int pflag,int connectivity,int numberofdofspernode,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){ 17 17 … … 29 29 30 30 /*First, get elements and loads configured: */ 31 elements->Configure(elements,loads, nodes, materials); 32 loads->Configure(elements, loads, nodes, materials); 31 elements->Configure(elements,loads, nodes, materials,parameters); 32 loads->Configure(elements, loads, nodes, materials,parameters); 33 parameters->Configure(elements,loads, nodes, materials,parameters); 33 34 34 35 /*Get size of matrix: */ -
issm/trunk/src/c/SystemMatricesx/SystemMatricesx.h
r465 r2333 10 10 11 11 /* local prototypes: */ 12 void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, 12 void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes,DataSet* loads,DataSet* materials, DataSet* parameters, 13 13 int kflag,int pflag,int connectivity,int numberofdofspernode,ParameterInputs* inputs,int analysis_type,int sub_analysis_type); 14 14 -
issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.cpp
r246 r2333 13 13 #include "../EnumDefinitions/EnumDefinitions.h" 14 14 15 int UpdateFromInputsx( DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, ParameterInputs* inputs) {15 int UpdateFromInputsx( DataSet* elements,DataSet* nodes, DataSet* loads, DataSet* materials, DataSet* parameters,ParameterInputs* inputs) { 16 16 17 17 int noerr=1; … … 23 23 24 24 /*First, get elements and loads configured: */ 25 elements->Configure(elements,loads, nodes, materials); 26 loads->Configure(elements, loads, nodes, materials); 27 nodes->Configure(elements, loads, nodes, materials); 25 elements->Configure(elements,loads, nodes, materials,parameters); 26 loads->Configure(elements, loads, nodes, materials,parameters); 27 nodes->Configure(elements, loads, nodes, materials,parameters); 28 parameters->Configure(elements,loads, nodes, materials,parameters); 28 29 29 30 /*Update elements, nodes, loads and materials from inputs: */ -
issm/trunk/src/c/UpdateFromInputsx/UpdateFromInputsx.h
r1 r2333 10 10 11 11 /* local prototypes: */ 12 int UpdateFromInputsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, ParameterInputs* inputs);12 int UpdateFromInputsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, DataSet* parameters,ParameterInputs* inputs); 13 13 14 14 #endif /* _UPDATEFROMINPUTSXX_H */ -
issm/trunk/src/c/UpdateGeometryx/UpdateGeometryx.cpp
r821 r2333 15 15 16 16 void UpdateGeometryx(Vec* poutthickness,Vec* poutbed,Vec* poutsurface, 17 DataSet* elements, DataSet* nodes,DataSet* loads, DataSet* materials, 17 DataSet* elements, DataSet* nodes,DataSet* loads, DataSet* materials, DataSet* parameters, 18 18 Vec vec_newthickness,Vec vec_bed,Vec vec_surface){ 19 19 … … 46 46 47 47 /*First, get elements and loads configured: */ 48 elements->Configure(elements,loads, nodes, materials); 49 materials->Configure(elements, loads, nodes, materials); 50 loads->Configure(elements, loads, nodes, materials); 48 elements->Configure(elements,loads, nodes, materials,parameters); 49 materials->Configure(elements, loads, nodes, materials,parameters); 50 loads->Configure(elements, loads, nodes, materials,parameters); 51 parameters->Configure(elements,loads, nodes, materials,parameters); 51 52 52 53 /*Serialize inputs :*/ -
issm/trunk/src/c/UpdateGeometryx/UpdateGeometryx.h
r825 r2333 11 11 /* local prototypes: */ 12 12 void UpdateGeometryx(Vec* poutthickness,Vec* poutbed,Vec* poutsurface, 13 DataSet* elements, DataSet* nodes,DataSet* loads, DataSet* materials, 13 DataSet* elements, DataSet* nodes,DataSet* loads, DataSet* materials, DataSet* parameters, 14 14 Vec newthickness,Vec bed,Vec surface); 15 15 -
issm/trunk/src/c/UpdateNodePositionsx/UpdateNodePositionsx.cpp
r848 r2333 13 13 #include "../EnumDefinitions/EnumDefinitions.h" 14 14 15 void UpdateNodePositionsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, Vec thickness,Vec bed){15 void UpdateNodePositionsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, DataSet* parameters,Vec thickness,Vec bed){ 16 16 17 17 /*intermediary: */ … … 20 20 21 21 /*First, get elements and loads configured: */ 22 elements->Configure(elements,loads, nodes, materials); 23 loads->Configure(elements, loads, nodes, materials); 24 nodes->Configure(elements, loads, nodes, materials); 22 elements->Configure(elements,loads, nodes, materials,parameters); 23 loads->Configure(elements, loads, nodes, materials,parameters); 24 nodes->Configure(elements, loads, nodes, materials,parameters); 25 parameters->Configure(elements,loads, nodes, materials,parameters); 25 26 26 27 /*serialize inputs: */ -
issm/trunk/src/c/UpdateNodePositionsx/UpdateNodePositionsx.h
r848 r2333 10 10 11 11 /* local prototypes: */ 12 void UpdateNodePositionsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, Vec thickness,Vec bed);12 void UpdateNodePositionsx( DataSet* elements,DataSet* nodes,DataSet* loads, DataSet* materials, DataSet* parameters,Vec thickness,Vec bed); 13 13 14 14 #endif /* _UPDATENODEPOSITIONSXX_H */ -
issm/trunk/src/c/include/types.h
r1881 r2333 16 16 typedef FILE* DataHandle; 17 17 #endif 18 enum param_type { STRING, INTEGER, STRINGARRAY, DOUBLE, DOUBLEVEC, DOUBLEMAT, PETSCVEC, PETSCMAT }; 18 19 19 20 #endif //ifndef _TYPES_H_ -
issm/trunk/src/c/io/FetchData.cpp
r1 r2333 10 10 11 11 #include "./io.h" 12 #include "../shared/shared.h" 13 14 #undef __FUNCT__ 15 #define __FUNCT__ "FetchData" 16 17 18 19 /***************** **************** **************** **************** **************** **************** **************** **************** **************** **************** 20 Serial Fetch Data Routines, all overloaded. 21 **************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/ 12 22 13 23 #ifdef _SERIAL_ 14 24 15 25 #include <mex.h> 16 void FetchData(void** pdata,int* pM,int* pN,const mxArray* pdataref,char* data_type,char* sub_data_type){ 26 27 void FetchData(DataSet** pdataset,const mxArray* dataref){ 28 29 /*output*/ 30 DataSet* outdataset=NULL; 31 char* outdataset_buffer=NULL; 32 int outdataset_size; 33 34 /*First, check that our reference is a double, otherwise, error out: */ 35 if (mxIsDouble(dataref)){ 36 37 /*We need to copy the data pointed by dataref, so that our dataset is not actually a pointer!:*/ 38 if (!mxIsEmpty(dataref)){ 39 outdataset_buffer=(char*)mxGetPr(dataref); 40 outdataset_size=mxGetM(dataref)*mxGetN(dataref); 41 if(outdataset_size)outdataset=DataSetDemarshall(outdataset_buffer); 42 } 43 } 44 else{ 45 if (mxIsEmpty(dataref)){ 46 /*Nothing to pick up. Just initialize pointer to NULL, and warn the server we are not uploading anything: */ 47 outdataset_size=0; 48 outdataset=NULL; 49 } 50 else{ 51 /*This is an error: we don't have the correct input!: */ 52 throw ErrorException(__FUNCT__," wrong input parameter!"); 53 } 54 } 55 56 /*Assign output pointers:*/ 57 *pdataset=outdataset; 58 } 59 60 void FetchData(double** pmatrix,int* pM,int *pN,const mxArray* dataref){ 61 62 double* outmatrix=NULL; 63 int outmatrix_rows,outmatrix_cols; 64 65 if(mxIsEmpty(dataref) ){ 66 /*Nothing to pick up. Just initialize matrix pointer to NULL: */ 67 outmatrix_rows=0; 68 outmatrix_cols=0; 69 outmatrix=NULL; 70 } 71 else if (mxIsDouble(dataref) ){ 72 73 /*Check dataref is not pointing to NaN: */ 74 if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetM(dataref)==1) && (mxGetN(dataref)==1) ){ 75 outmatrix_rows=0; 76 outmatrix_cols=0; 77 outmatrix=NULL; 78 } 79 else{ 80 81 /*Convert matlab matrix to double* matrix: */ 82 MatlabMatrixToDoubleMatrix(&outmatrix,&outmatrix_rows,&outmatrix_cols,dataref); 83 } 84 } 85 else{ 86 /*This is an error: we don't have the correct input!: */ 87 throw ErrorException(__FUNCT__,"wrong input parameter"); 88 } 89 90 91 /*Assign output pointers:*/ 92 *pmatrix=outmatrix; 93 if (pM)*pM=outmatrix_rows; 94 if (pN)*pN=outmatrix_cols; 95 96 97 } 98 99 void FetchData(Mat* pmatrix,const mxArray* dataref){ 17 100 18 SerialFetchData(pdata,pM,pN,pdataref,data_type,sub_data_type); 19 20 } 101 Mat outmatrix=NULL; 102 int dummy=0; 103 104 if(mxIsEmpty(dataref) ){ 105 /*Nothing to pick up. Just initialize matrix pointer to NULL: */ 106 outmatrix=NULL; 107 } 108 else if (mxIsDouble(dataref) ){ 109 110 /*Check dataref is not pointing to NaN: */ 111 if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetM(dataref)==1) && (mxGetN(dataref)==1) ){ 112 outmatrix=NULL; 113 } 114 else{ 115 116 /*Convert matlab matrix to petsc matrix: */ 117 MatlabMatrixToPetscMatrix(&outmatrix,&dummy,&dummy,dataref); 118 } 119 } 120 else{ 121 /*This is an error: we don't have the correct input!: */ 122 throw ErrorException(__FUNCT__,"wrong input parameter"); 123 } 124 125 /*Assign output pointers:*/ 126 *pmatrix=outmatrix; 127 } 128 129 void FetchData(double** pvector,int* pM,const mxArray* dataref){ 130 131 double* outvector=NULL; 132 int outvector_rows; 133 134 if(mxIsEmpty(dataref)){ 135 /*Nothing to pick up. Just initialize matrix pointer to NULL: */ 136 outvector_rows=0; 137 outvector=NULL; 138 } 139 else if (mxIsDouble(dataref) ){ 140 141 /*Convert matlab vector to double* vector: */ 142 MatlabVectorToDoubleVector(&outvector,&outvector_rows,dataref); 143 144 } 145 else{ 146 /*This is an error: we don't have the correct input!: */ 147 throw ErrorException(__FUNCT__,"wrong input parameter"); 148 } 149 150 /*Assign output pointers:*/ 151 *pvector=outvector; 152 if (pM)*pM=outvector_rows; 153 } 154 155 void FetchData(Vec* pvector,const mxArray* dataref){ 156 157 Vec vector=NULL; 158 int dummy; 159 160 if(mxIsEmpty(dataref)){ 161 /*Nothing to pick up. Just initialize matrix pointer to NULL: */ 162 vector=NULL; 163 } 164 else if (mxIsDouble(dataref) ){ 165 166 /*Convert matlab vector to petsc vector: */ 167 MatlabVectorToPetscVector(&vector,&dummy,dataref); 168 } 169 else{ 170 /*This is an error: we don't have the correct input!: */ 171 throw ErrorException(__FUNCT__,"wrong input parameter"); 172 } 173 174 /*Assign output pointers:*/ 175 *pvector=vector; 176 } 177 178 void FetchData(char** pstring,const mxArray* dataref){ 179 180 char* outstring=NULL; 181 182 183 /*Ok, the string should be coming directly from the matlab workspace: */ 184 if (!mxIsChar(dataref)){ 185 throw ErrorException(__FUNCT__,"input data_type is not a string!"); 186 } 187 else{ 188 /*Recover the string:*/ 189 int stringlen; 190 191 stringlen = mxGetM(dataref)*mxGetN(dataref)+1; 192 outstring = (char*)xmalloc(sizeof(mxChar)*stringlen); 193 mxGetString(dataref,outstring,stringlen); 194 } 195 196 /*Assign output pointers:*/ 197 *pstring=outstring; 198 } 199 200 void FetchData(double* pscalar,const mxArray* dataref){ 201 202 double scalar; 203 204 if (!mxIsDouble(dataref)){ 205 throw ErrorException(__FUNCT__,"input data_type is not a scalar!"); 206 } 207 else{ 208 /*Recover the double: */ 209 scalar=mxGetScalar(dataref); 210 } 211 212 /*Assign output pointers:*/ 213 *pscalar=scalar; 214 } 215 216 void FetchData(int* pinteger,const mxArray* dataref){ 217 218 int integer; 219 220 if (!mxIsDouble(dataref)){ 221 throw ErrorException(__FUNCT__,"input data_type is not a scalar!"); 222 } 223 else{ 224 /*Recover the double: */ 225 integer=(int)mxGetScalar(dataref); 226 } 227 228 /*Assign output pointers:*/ 229 *pinteger=integer; 230 } 231 232 21 233 #endif 22 234 23 235 #if defined(_PARALLEL_) && defined(_HAVE_PETSC_) 24 void FetchData(void** pdata,int* pM,int* pN,FILE* fid,char* data_type,char* sub_data_type){ 25 26 ParallelFetchData(pdata,pM,pN,fid, data_type,sub_data_type); 27 28 } 236 237 /***************** **************** **************** **************** **************** **************** **************** **************** **************** **************** 238 Parallel Fetch Data Routines, all overloaded. 239 **************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/ 240 241 void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid){ 242 243 extern int my_rank; 244 extern int num_procs; 245 246 /*output: */ 247 int M,N; 248 double* matrix=NULL; 249 250 /*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */ 251 /*numberofelements: */ 252 if(my_rank==0){ 253 if(fread(&M,sizeof(int),1,fid)!=1) throw ErrorException(__FUNCT__,"could not read number of rows for matrix "); 254 } 255 256 MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD); 257 258 if(my_rank==0){ 259 if(fread(&N,sizeof(int),1,fid)!=1) throw ErrorException(__FUNCT__," could not read number of columns for matrix "); 260 } 261 MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD); 262 263 /*Now allocate matrix: */ 264 if(M*N){ 265 matrix=(double*)xmalloc(M*N*sizeof(double)); 266 267 /*Read matrix on node 0, then broadcast: */ 268 if(my_rank==0){ 269 if(fread(matrix,M*N*sizeof(double),1,fid)!=1) throw ErrorException(__FUNCT__," could not read matrix "); 270 } 271 272 MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD); 273 } 274 275 276 /*Assign output pointers: */ 277 *pmatrix=matrix; 278 if (pM)*pM=M; 279 if (pN)*pN=N; 280 281 } 282 283 void FetchData(char** pstring,FILE* fid){ 284 285 extern int my_rank; 286 extern int num_procs; 287 288 /*output: */ 289 char* string=NULL; 290 int string_size; 291 292 /*We have to read a string from disk. First read the dimensions of the string, then the string: */ 293 if(my_rank==0){ 294 if(fread(&string_size,sizeof(int),1,fid)!=1)throw ErrorException(__FUNCT__," could not read length of string "); 295 } 296 297 MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD); 298 299 /*Now allocate string: */ 300 if(string_size){ 301 string=(char*)xmalloc((string_size+1)*sizeof(char)); 302 string[string_size]='\0'; 303 304 /*Read string on node 0, then broadcast: */ 305 if(my_rank==0){ 306 if(fread(string,string_size*sizeof(char),1,fid)!=1)throw ErrorException(__FUNCT__," could not read string "); 307 } 308 MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD); 309 } 310 else{ 311 string=(char*)xmalloc(sizeof(char)); 312 string[0]='\0'; 313 } 314 315 316 /*Assign output pointers: */ 317 *pstring=string; 318 } 319 320 321 void FetchData(double* pscalar,FILE* fid){ 322 323 extern int my_rank; 324 extern int num_procs; 325 326 /*output: */ 327 double scalar; 328 329 /*We have to read a scalar from disk. First read the dimensions of the scalar, then the scalar: */ 330 if(my_rank==0){ 331 if(fread(&scalar,sizeof(double),1,fid)!=1)throw ErrorException(__FUNCT__," could not read scalar "); 332 } 333 MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD); 334 335 /*Assign output pointers: */ 336 *pscalar=scalar; 337 338 } 339 340 void FetchData(int* pinteger,FILE* fid){ 341 342 extern int my_rank; 343 extern int num_procs; 344 345 /*output: */ 346 int integer; 347 348 /*We have to read a integer from disk. First read the dimensions of the integer, then the integer: */ 349 if(my_rank==0){ 350 if(fread(&integer,sizeof(int),1,fid)!=1) throw ErrorException(__FUNCT__," could not read integer "); 351 } 352 353 MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD); 354 355 /*Assign output pointers: */ 356 *pinteger=integer; 357 358 } 359 360 29 361 #endif -
issm/trunk/src/c/io/FetchNodeSets.cpp
r304 r2333 37 37 else{ 38 38 39 FetchData( (void**)&pv_m,NULL,NULL,mxGetField(dataref,0,"pv_m"),"Vector","Vec");40 FetchData( (void**)&pv_n,NULL,NULL,mxGetField(dataref,0,"pv_n"),"Vector","Vec");41 FetchData( (void**)&pv_f,NULL,NULL,mxGetField(dataref,0,"pv_f"),"Vector","Vec");42 FetchData( (void**)&pv_s,NULL,NULL,mxGetField(dataref,0,"pv_s"),"Vector","Vec");39 FetchData(&pv_m,NULL,mxGetField(dataref,0,"pv_m")); 40 FetchData(&pv_n,NULL,mxGetField(dataref,0,"pv_n")); 41 FetchData(&pv_f,NULL,mxGetField(dataref,0,"pv_f")); 42 FetchData(&pv_s,NULL,mxGetField(dataref,0,"pv_s")); 43 43 44 44 gsize=(int)mxGetScalar(mxGetField(dataref,0,"gsize")); -
issm/trunk/src/c/io/IoModelFetchData.cpp
r1940 r2333 13 13 #include "../shared/shared.h" 14 14 15 void IoModelFetchData(void** pdata,int* pM,int* pN,ConstDataHandle model_handle,char* data_name,char* data_type,char* sub_data_type){ 15 16 17 #ifdef _SERIAL_ 18 /***************** **************** **************** **************** **************** **************** **************** **************** **************** **************** 19 Serial IoModelFetch Data Routines, all overloaded. 20 **************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/ 21 22 void IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name){ 23 24 FetchData(pdataset,mxGetAssignedField(model_handle,0,data_name)); 25 26 } 27 void IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name){ 16 28 29 FetchData(pmatrix,pM,pN,mxGetAssignedField(model_handle,0,data_name)); 30 31 } 32 void IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name){ 33 34 FetchData(pmatrix,mxGetAssignedField(model_handle,0,data_name)); 35 36 } 37 void IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name){ 38 39 FetchData(pvector,pM,mxGetAssignedField(model_handle,0,data_name)); 40 41 } 42 void IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name){ 43 44 FetchData(pvector,mxGetAssignedField(model_handle,0,data_name)); 45 46 } 47 void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){ 48 49 FetchData(pstring,mxGetAssignedField(model_handle,0,data_name)); 50 51 } 52 void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){ 53 54 FetchData(pscalar,mxGetAssignedField(model_handle,0,data_name)); 55 56 } 57 void IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){ 58 59 FetchData(pinteger,mxGetAssignedField(model_handle,0,data_name)); 60 } 61 #endif 62 63 64 65 /***************** **************** **************** **************** **************** **************** **************** **************** **************** **************** 66 Parallel IoModelFetch Data Routines, all overloaded. 67 **************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/ 68 #ifdef _PARALLEL_ 69 FILE* SetFilePointerToData(ConstDataHandle model_handle,char* data_name){ 17 70 18 71 extern int my_rank; 19 72 extern int num_procs; 20 73 21 74 int string_size; 22 75 int record_length; 23 76 char* string=NULL; 24 25 /*Why this routine? To make IoModel management simpler. FetchData is enough for regular I/O, but here, we are dealing with26 * I/O that can act on the model matlab array (in case we are running serially), or I/O on the binary file when running27 * in parallel. On a matlab model array, it is easy to find the data with name "data_name", but not in a binary file. We28 * are abstracting all of this with one function, operating on the DataHandle object. */29 30 77 char* repository=NULL; 31 78 FILE* fid=NULL; 32 79 int found=0; 33 80 34 /*Ok, on the matlab side: */ 35 #ifdef _SERIAL_ 36 37 /*The typical model_handle is a const mxArray*, to which FetchData is applied. But here, we are dealing with a structure, the 38 *model. Therefore, we are looking to fetch a certain field of this data. So get this field first, and then feed it to the 39 FetchData routine. : */ 40 41 FetchData((void**)pdata,pM,pN,mxGetAssignedField(model_handle,0,data_name),data_type,sub_data_type); 42 43 #else 44 45 /*In parallel, we have a FetchData, which will recover data, but it will do a good job provided the FILE* descriptor 46 * is pointing to the start of the data we want. Here, we have to go looking for the beginning of this data. */ 47 81 /*Go find in the binary file, the position of the data we want to fetch: */ 48 82 if(my_rank==0){ 49 83 … … 93 127 if(!found)throw ErrorException(__FUNCT__,exprintf("%s %s ","could not find data with name",data_name)); 94 128 95 /*We are at the correct position! Go for it: */ 96 FetchData((void**)pdata,pM,pN,fid,data_type,sub_data_type); 97 #endif 129 return fid; 98 130 } 131 132 void IoModelFetchData(double** pmatrix,int* pM,int* pN,ConstDataHandle model_handle,char* data_name){ 133 134 FILE* fid=NULL; 135 136 /*Set file pointer to beginning of the data: */ 137 fid=SetFilePointerToData(model_handle,data_name); 138 139 /*Now fetch: */ 140 FetchData(pmatrix,pM,pN,fid); 141 142 } 143 void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){ 144 145 FILE* fid=NULL; 146 147 /*Set file pointer to beginning of the data: */ 148 fid=SetFilePointerToData(model_handle,data_name); 149 150 /*Now fetch: */ 151 FetchData(pstring,fid); 152 } 153 154 void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){ 155 156 FILE* fid=NULL; 157 158 /*Set file pointer to beginning of the data: */ 159 fid=SetFilePointerToData(model_handle,data_name); 160 161 /*Now fetch: */ 162 FetchData(pscalar,fid); 163 } 164 165 void IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){ 166 167 FILE* fid=NULL; 168 169 /*Set file pointer to beginning of the data: */ 170 fid=SetFilePointerToData(model_handle,data_name); 171 172 /*Now fetch: */ 173 FetchData(pinteger,fid); 174 } 175 #endif -
issm/trunk/src/c/io/WriteParams.cpp
r2110 r2333 48 48 49 49 /*Recover data from the parameters dataset: */ 50 nfields=(mwSize)parameters->Size() ;50 nfields=(mwSize)parameters->Size()-1; //don't include Numpar 51 51 52 52 fnames=(const char**)xmalloc(nfields*sizeof(char*)); … … 54 54 /*Build structure in matlab workspace with all the parameter fields: */ 55 55 for(i=0;i<nfields;i++){ 56 param=(Param*)parameters->GetObjectByOffset(i );56 param=(Param*)parameters->GetObjectByOffset(i+1); 57 57 fnames[i]=(const char*)xmalloc((strlen(param->GetParameterName())+1)*sizeof(char)); 58 58 strcpy((char*)fnames[i],param->GetParameterName()); … … 64 64 for(i=0;i<nfields;i++){ 65 65 66 param=(Param*)parameters->GetObjectByOffset(i );66 param=(Param*)parameters->GetObjectByOffset(i+1); 67 67 68 68 switch(param->GetType()){ 69 69 case INTEGER: 70 param->GetParameterValue( (void*)&integer);70 param->GetParameterValue(&integer); 71 71 mxSetField( dataref, 0, param->GetParameterName(),mxCreateDoubleScalar((double)integer)); 72 72 break; 73 73 74 74 case DOUBLE: 75 param->GetParameterValue( (void*)&ddouble);75 param->GetParameterValue(&ddouble); 76 76 mxSetField( dataref, 0, param->GetParameterName(),mxCreateDoubleScalar((double)ddouble)); 77 77 break; 78 78 79 79 case STRING: 80 param->GetParameterValue( (void*)&string);80 param->GetParameterValue(&string); 81 81 mxSetField( dataref, 0, param->GetParameterName(),mxCreateString(string)); 82 82 break; 83 83 84 84 case STRINGARRAY: 85 param->GetParameterValue( (void*)&stringarray);85 param->GetParameterValue(&stringarray); 86 86 M=param->GetM(); 87 87 dims[0]=M; … … 96 96 97 97 case DOUBLEVEC: 98 param->GetParameterValue( (void*)&doublevec);98 param->GetParameterValue(&doublevec); 99 99 M=param->GetM(); 100 100 pfield=mxCreateDoubleMatrix(0,0,mxREAL); … … 106 106 107 107 case DOUBLEMAT: 108 param->GetParameterValue( (void*)&doublemat);108 param->GetParameterValue(&doublemat); 109 109 M=param->GetM(); 110 110 N=param->GetN(); … … 119 119 120 120 case PETSCVEC: 121 param->GetParameterValue( (void*)&vec);121 param->GetParameterValue(&vec); 122 122 VecToMPISerial(&serial_vec,vec); 123 123 VecFree(&vec); … … 131 131 132 132 case PETSCMAT: 133 param->GetParameterValue( (void*)&mat);133 param->GetParameterValue(&mat); 134 134 MatToSerial(&serial_mat,mat); 135 135 MatFree(&mat); -
issm/trunk/src/c/io/io.h
r2316 r2333 13 13 class DataSet; 14 14 15 void FetchData(void** pdata,int* pM,int* pN,ConstDataHandle data_handle,char* data_type,char* sub_data_type);16 void IoModelFetchData(void** pdata,int* pM,int* pN,ConstDataHandle model_handle,char* data_name,char* data_type,char* sub_data_type);15 FILE* pfopen(char* filename,char* format); 16 void pfclose(FILE* fid,char* filename); 17 17 18 /*Serial: */19 18 #ifdef _SERIAL_ 20 /*Write: */ 19 21 20 void WriteData(mxArray** pdataref,DataSet* dataset); 22 21 void WriteData(mxArray** pdataref,Mat matrix); … … 28 27 void WriteData(mxArray** pdataref,char* string); 29 28 void WriteData(mxArray** pdataref,DofVec* vector); 29 30 30 void WriteNodeSets(DataHandle* pdataref,NodeSets* nodesets); 31 31 void WriteParams(DataHandle* pdataref,DataSet* parameters); 32 32 33 /*Fetch: */ 34 void SerialFetchData(void** pdata,int* pM,int* pN,ConstDataHandle data_handle,char* data_type,char* sub_data_type); 33 void FetchData(DataSet** pdataset,const mxArray* dataref); 34 void FetchData(double** pmatrix,int* pM,int *pN,const mxArray* dataref); 35 void FetchData(Mat* pmatrix,const mxArray* dataref); 36 void FetchData(double** pvector,int* pM,const mxArray* dataref); 37 void FetchData(Vec* pvector,const mxArray* dataref); 38 void FetchData(char** pstring,const mxArray* dataref); 39 void FetchData(double* pscalar,const mxArray* dataref); 40 void FetchData(int* pinteger,const mxArray* dataref); 41 42 43 void IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name); 44 void IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name); 45 void IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name); 46 void IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name); 47 void IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name); 48 void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name); 49 void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name); 50 void IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name); 51 35 52 void FetchNodeSets(NodeSets** pnodesets,ConstDataHandle dataref); 53 void FetchParams(DataSet** pparameters, DataHandle dataref); 54 36 55 #endif 37 56 38 /*Parallel: */ 57 58 59 60 39 61 #ifdef _PARALLEL_ 40 void ParallelFetchData(void** pdata,int* pM,int* pN,DataHandle data_handle, char* data_type,char* sub_data_type); 41 void ParallelFetchMat(double** pdata,int* pM,int* pN,DataHandle data_handle); 42 void ParallelFetchString(char** pdata,DataHandle data_handle); 43 void ParallelFetchScalar(double* pdata,DataHandle data_handle); 44 void ParallelFetchInteger(int* pdata,DataHandle data_handle); 62 void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid); 63 void FetchData(char** pstring,FILE* fid); 64 void FetchData(double* pscalar,FILE* fid); 65 void FetchData(int* pinteger,FILE* fid); 66 67 68 FILE* SetFilePointerToData(ConstDataHandle model_handle,char* data_name); 69 void IoModelFetchData(double** pmatrix,int* pM,int* pN,ConstDataHandle model_handle,char* data_name); 70 void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name); 71 void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name); 72 void IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name); 73 74 void WriteData(int* pdummy,void* data,char* data_type); 45 75 void WriteDataToDisk(void* data,int* pM,int* pN,char* datatype,FILE* fid); 46 void WriteData(int* pdummy,void* data,char* data_type); 76 47 77 #endif 48 78 49 /*File I/O: */50 FILE* pfopen(char* filename,char* format);51 void pfclose(FILE* fid,char* filename);52 79 53 #endif /* _IMDB_H */54 80 81 82 83 84 #endif /* _IO_H_ */ -
issm/trunk/src/c/objects/Beam.cpp
r2112 r2333 26 26 } 27 27 28 Beam::Beam(int beam_id, int beam_mid, int beam_mparid, int beam_ g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2],bool beam_onbed){28 Beam::Beam(int beam_id, int beam_mid, int beam_mparid, int beam_numparid, int beam_g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2],bool beam_onbed){ 29 29 30 30 int i; … … 33 33 mid=beam_mid; 34 34 mparid=beam_mparid; 35 numparid=beam_numparid; 35 36 for(i=0;i<2;i++){ 36 37 node_ids[i]=beam_g[i]; … … 46 47 matpar=NULL; 47 48 matpar_offset=UNDEF; 49 numpar=NULL; 50 numpar_offset=UNDEF; 48 51 onbed=beam_onbed; 49 52 … … 127 130 memcpy(marshalled_dataset,&matpar,sizeof(matpar));marshalled_dataset+=sizeof(matpar); 128 131 memcpy(marshalled_dataset,&matpar_offset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset); 132 memcpy(marshalled_dataset,&numparid,sizeof(numparid));marshalled_dataset+=sizeof(numparid); 133 memcpy(marshalled_dataset,&numpar,sizeof(numpar));marshalled_dataset+=sizeof(numpar); 134 memcpy(marshalled_dataset,&numpar_offset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset); 129 135 memcpy(marshalled_dataset,&h,sizeof(h));marshalled_dataset+=sizeof(h); 130 136 memcpy(marshalled_dataset,&s,sizeof(s));marshalled_dataset+=sizeof(s); … … 148 154 +sizeof(matpar) 149 155 +sizeof(matpar_offset) 156 +sizeof(numparid) 157 +sizeof(numpar) 158 +sizeof(numpar_offset) 150 159 +sizeof(h) 151 160 +sizeof(s) … … 181 190 memcpy(&matpar,marshalled_dataset,sizeof(matpar));marshalled_dataset+=sizeof(matpar); 182 191 memcpy(&matpar_offset,marshalled_dataset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset); 192 memcpy(&numparid,marshalled_dataset,sizeof(numparid));marshalled_dataset+=sizeof(numparid); 193 memcpy(&numpar,marshalled_dataset,sizeof(numpar));marshalled_dataset+=sizeof(numpar); 194 memcpy(&numpar_offset,marshalled_dataset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset); 183 195 memcpy(&h,marshalled_dataset,sizeof(h));marshalled_dataset+=sizeof(h); 184 196 memcpy(&s,marshalled_dataset,sizeof(s));marshalled_dataset+=sizeof(s); … … 211 223 #undef __FUNCT__ 212 224 #define __FUNCT__ "Beam::Configure" 213 void Beam::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin ){225 void Beam::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin,void* pparametersin){ 214 226 215 227 int i; … … 218 230 DataSet* nodesin=NULL; 219 231 DataSet* materialsin=NULL; 232 DataSet* parametersin=NULL; 220 233 221 234 /*Recover pointers :*/ … … 223 236 nodesin=(DataSet*)pnodesin; 224 237 materialsin=(DataSet*)pmaterialsin; 238 parametersin=(DataSet*)pparametersin; 225 239 226 240 /*Link this element with its nodes, ie find pointers to the nodes in the nodes dataset.: */ … … 230 244 ResolvePointers((Object**)&matice,&mid,&matice_offset,1,materialsin); 231 245 ResolvePointers((Object**)&matpar,&mparid,&matpar_offset,1,materialsin); 246 247 /*Same for numpar: */ 248 ResolvePointers((Object**)&numpar,&numparid,&numpar_offset,1,parametersin); 232 249 233 250 } -
issm/trunk/src/c/objects/Beam.h
r2112 r2333 33 33 Matpar* matpar; 34 34 int matpar_offset; 35 36 int numparid; 37 Numpar* numpar; 38 int numpar_offset; 35 39 36 40 double h[2]; … … 44 48 45 49 Beam(); 46 Beam(int beam_id, int beam_mid, int beam_mparid, int beam_ g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2],bool beam_onbed);50 Beam(int beam_id, int beam_mid, int beam_mparid, int beam_numparid,int beam_g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2],bool beam_onbed); 47 51 ~Beam(); 48 52 … … 56 60 int GetId(); 57 61 int MyRank(); 58 void Configure(void* loads,void* nodes,void* materials );62 void Configure(void* loads,void* nodes,void* materials,void* parameters); 59 63 void CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type); 60 64 void CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type); -
issm/trunk/src/c/objects/Element.h
r2112 r2333 24 24 virtual char* GetName()=0; 25 25 virtual void Demarshall(char** pmarshalled_dataset)=0; 26 virtual void Configure(void* loads,void* nodes,void* materials )=0;26 virtual void Configure(void* loads,void* nodes,void* materials,void* parameters)=0; 27 27 virtual void CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type)=0; 28 28 virtual void CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type)=0; -
issm/trunk/src/c/objects/FemModel.cpp
r2316 r2333 177 177 } 178 178 179 #undef __FUNCT__ 180 #define __FUNCT__ "FemModel::FindParam" 181 int FemModel::FindParam(void* pparameter,char* parametername){ 182 183 return parameters->FindParam(pparameter,parametername); 184 185 } 179 180 #undef __FUNCT__ 181 #define __FUNCT__ "FemModel::FindParam" 182 int FemModel::FindParam(double* pscalar,char* name){ 183 184 return parameters->FindParam(pscalar,name); 185 186 } 187 #undef __FUNCT__ 188 #define __FUNCT__ "FemModel::FindParam" 189 int FemModel::FindParam(int* pinteger,char* name){ 190 191 return parameters->FindParam(pinteger,name); 192 193 } 194 195 #undef __FUNCT__ 196 #define __FUNCT__ "FemModel::FindParam" 197 int FemModel::FindParam(char** pstring,char* name){ 198 199 return parameters->FindParam(pstring,name); 200 201 } 202 203 #undef __FUNCT__ 204 #define __FUNCT__ "FemModel::FindParam" 205 int FemModel::FindParam(char*** pstringarray,int* pM,char* name){ 206 207 return parameters->FindParam(pstringarray,pM,name); 208 209 } 210 211 #undef __FUNCT__ 212 #define __FUNCT__ "FemModel::FindParam" 213 int FemModel::FindParam(double** pdoublearray,int* pM,int* pN,char* name){ 214 215 return parameters->FindParam(pdoublearray,pM,pN,name); 216 217 } 218 219 #undef __FUNCT__ 220 #define __FUNCT__ "FemModel::FindParam" 221 int FemModel::FindParam(Vec* pvec,char* name){ 222 223 return parameters->FindParam(pvec,name); 224 225 } 226 227 #undef __FUNCT__ 228 #define __FUNCT__ "FemModel::FindParam" 229 int FemModel::FindParam(Mat* pmat,char* name){ 230 231 return parameters->FindParam(pmat,name); 232 233 } 234 186 235 187 236 /*access to internal data: */ -
issm/trunk/src/c/objects/FemModel.h
r2316 r2333 53 53 Object* copy(); 54 54 55 int FindParam(void* pparameter,char* parametername); 55 int FindParam(double* pscalar,char* name); 56 int FindParam(int* pinteger,char* name); 57 int FindParam(char** pstring,char* name); 58 int FindParam(char*** pstringarray,int* pM,char* name); 59 int FindParam(double** pdoublearray,int* pM, int* pN,char* name); 60 int FindParam(Vec* pvec,char* name); 61 int FindParam(Mat* pmat,char* name); 56 62 DataSet* get_elements(void); 57 63 DataSet* get_nodes(void); -
issm/trunk/src/c/objects/Model.cpp
r2316 r2333 106 106 107 107 _printf_(" configuring element and loads:\n"); 108 ConfigureObjectsx(elements, loads, nodes, materials );108 ConfigureObjectsx(elements, loads, nodes, materials,parameters); 109 109 110 110 _printf_(" process parameters:\n"); … … 184 184 185 185 _printf_(" configuring element and loads:\n"); 186 ConfigureObjectsx(elements, loads, nodes, materials );186 ConfigureObjectsx(elements, loads, nodes, materials,parameters); 187 187 188 188 _printf_(" process parameters:\n"); … … 216 216 if(!femmodel)return 0; 217 217 218 femmodel->FindParam( (void*)pparameter,parametername);218 femmodel->FindParam(pparameter,parametername); 219 219 220 220 } … … 231 231 if(!femmodel)return 0; 232 232 233 femmodel->FindParam( (void*)pparameter,parametername);234 235 236 } 237 int Model::FindParam(double** pparameter, char* parametername){233 femmodel->FindParam(pparameter,parametername); 234 235 236 } 237 int Model::FindParam(double** pparameter,int* pM, int *pN,char* parametername){ 238 238 239 239 FemModel* femmodel=NULL; … … 247 247 if(!femmodel)return 0; 248 248 249 femmodel->FindParam( (void*)pparameter,parametername);249 femmodel->FindParam(pparameter,pM, pN,parametername); 250 250 251 251 … … 263 263 if(!femmodel)return 0; 264 264 265 femmodel->FindParam( (void*)pparameter,parametername);265 femmodel->FindParam(pparameter,parametername); 266 266 267 267 } … … 277 277 278 278 /*extract our parameter from the found formulation: */ 279 femmodel->FindParam( (void*)pparameter,parametername);279 femmodel->FindParam(pparameter,parametername); 280 280 } 281 281 … … 290 290 291 291 /*extract our parameter from the found formulation: */ 292 femmodel->FindParam( (void*)pparameter,parametername);293 } 294 295 296 int Model::FindParam(double** pparameter, char* parametername,int analysis_type,int sub_analysis_type){292 femmodel->FindParam(pparameter,parametername); 293 } 294 295 296 int Model::FindParam(double** pparameter,int* pM, int* pN,char* parametername,int analysis_type,int sub_analysis_type){ 297 297 298 298 FemModel* femmodel=NULL; … … 304 304 305 305 /*extract our parameter from the found formulation: */ 306 femmodel->FindParam( (void*)pparameter,parametername);306 femmodel->FindParam(pparameter,pM, pN,parametername); 307 307 } 308 308 … … 317 317 318 318 /*extract our parameter from the found formulation: */ 319 femmodel->FindParam( (void*)pparameter,parametername);319 femmodel->FindParam(pparameter,parametername); 320 320 } 321 321 … … 330 330 331 331 /*extract our parameter from the found formulation: */ 332 femmodel->FindParam( (void*)pparameter,parametername);332 femmodel->FindParam(pparameter,parametername); 333 333 } 334 334 … … 343 343 344 344 /*extract our parameter from the found formulation: */ 345 femmodel->FindParam( (void*)pparameter,parametername);346 } 347 348 349 int Model::FindParam(double** pparameter, char* parametername,int analysis_type){345 femmodel->FindParam(pparameter,parametername); 346 } 347 348 349 int Model::FindParam(double** pparameter,int* pM, int* pN,char* parametername,int analysis_type){ 350 350 351 351 FemModel* femmodel=NULL; … … 357 357 358 358 /*extract our parameter from the found formulation: */ 359 femmodel->FindParam( (void*)pparameter,parametername);359 femmodel->FindParam(pparameter,pM,pN,parametername); 360 360 } 361 361 … … 370 370 371 371 /*extract our parameter from the found formulation: */ 372 femmodel->FindParam( (void*)pparameter,parametername);372 femmodel->FindParam(pparameter,parametername); 373 373 } 374 374 … … 390 390 391 391 femmodel=(FemModel*)femmodels->GetObjectByOffset(i); 392 femmodel->FindParam( (void*)&femmodel_analysis_type,"analysis_type");393 femmodel->FindParam( (void*)&femmodel_sub_analysis_type,"sub_analysis_type");392 femmodel->FindParam(&femmodel_analysis_type,"analysis_type"); 393 femmodel->FindParam(&femmodel_sub_analysis_type,"sub_analysis_type"); 394 394 395 395 if((analysis_type==femmodel_analysis_type) && (sub_analysis_type==femmodel_sub_analysis_type)){ … … 420 420 421 421 femmodel=(FemModel*)femmodels->GetObjectByOffset(i); 422 femmodel->FindParam( (void*)&femmodel_analysis_type,"analysis_type");422 femmodel->FindParam(&femmodel_analysis_type,"analysis_type"); 423 423 424 424 if((analysis_type==femmodel_analysis_type)){ -
issm/trunk/src/c/objects/Model.h
r1886 r2333 35 35 int FindParam(int* pparameter,char* parametername); 36 36 int FindParam(double* pparameter,char* parametername); 37 int FindParam(double** pparameter, char* parametername);37 int FindParam(double** pparameter,int* pM,int* pN,char* parametername); 38 38 int FindParam(char** pparameter,char* parametername); 39 39 40 40 int FindParam(int* pparameter,char* parametername,int analysis_type,int sub_analysis_type); 41 41 int FindParam(double* pparameter,char* parametername,int analysis_type,int sub_analysis_type); 42 int FindParam(double** pparameter, char* parametername,int analysis_type,int sub_analysis_type);42 int FindParam(double** pparameter,int* pM, int* pN,char* parametername,int analysis_type,int sub_analysis_type); 43 43 int FindParam(char** pparameter,char* parametername,int analysis_type,int sub_analysis_type); 44 44 45 45 int FindParam(int* pparameter,char* parametername,int analysis_type); 46 46 int FindParam(double* pparameter,char* parametername,int analysis_type); 47 int FindParam(double** pparameter, char* parametername,int analysis_type);47 int FindParam(double** pparameter,int* pM,int* pN,char* parametername,int analysis_type); 48 48 int FindParam(char** pparameter,char* parametername,int analysis_type); 49 49 -
issm/trunk/src/c/objects/Param.cpp
r2112 r2333 116 116 break; 117 117 118 case INTEGER:119 printf(" integer value: %i\n",integer);120 break;121 122 118 case DOUBLE: 123 119 printf(" double value: %g\n",ddouble); … … 175 171 } 176 172 177 case INTEGER:178 printf(" integer value: %i\n",integer);179 break;180 181 173 case DOUBLE: 182 174 printf(" double value: %g\n",ddouble); … … 254 246 break; 255 247 256 case INTEGER:257 memcpy(marshalled_dataset,&integer,sizeof(integer));marshalled_dataset+=sizeof(integer);258 break;259 248 case DOUBLE: 260 249 memcpy(marshalled_dataset,&ddouble,sizeof(ddouble));marshalled_dataset+=sizeof(ddouble); … … 343 332 break; 344 333 345 case INTEGER:346 size+= sizeof(integer);347 break;348 334 case DOUBLE: 349 335 size+= sizeof(ddouble); … … 411 397 for(i=0;i<M;i++){ 412 398 int size; 413 memcpy(&size,marshalled_dataset,sizeof(int eger));marshalled_dataset+=sizeof(integer);399 memcpy(&size,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int); 414 400 tempstring=(char*)xmalloc(size); 415 401 memcpy(tempstring,marshalled_dataset,size);marshalled_dataset+=size; … … 417 403 } 418 404 } 419 break;420 421 case INTEGER:422 memcpy(&integer,marshalled_dataset,sizeof(integer));marshalled_dataset+=sizeof(integer);423 405 break; 424 406 … … 510 492 } 511 493 512 void Param::GetParameterValue(void* pvalue){ 494 #undef __FUNCT__ 495 #define __FUNCT__ "GetParameterValue" 496 void Param::GetParameterValue(double* pdouble){ 497 498 if(type!=DOUBLE)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a double from a param with type",type)); 499 *pdouble=ddouble; 500 } 501 502 #undef __FUNCT__ 503 #define __FUNCT__ "GetParameterValue" 504 void Param::GetParameterValue(int* pinteger){ 505 506 if(type!=DOUBLE)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover an integer from a param with type",type)); 507 *pinteger=(int)ddouble; 508 } 509 510 #undef __FUNCT__ 511 #define __FUNCT__ "GetParameterValue" 512 void Param::GetParameterValue(char** pstring){ 513 514 char* outstring=NULL; 515 516 if(type!=STRING)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a string from a param with type",type)); 517 outstring=(char*)xmalloc((strlen(string)+1)*sizeof(char)); 518 strcpy(outstring,string); 519 *pstring=outstring; 520 521 } 522 523 #undef __FUNCT__ 524 #define __FUNCT__ "GetParameterValue" 525 void Param::GetParameterValue(char*** pstringarray){ 513 526 514 527 int i; 515 516 if (type==STRING){ 517 char** pstring=(char**)pvalue; //a little dangerous, but hey! 518 char* outstring=NULL; 519 outstring=(char*)xmalloc((strlen(string)+1)*sizeof(char)); 520 strcpy(outstring,string); 521 *pstring=outstring; 522 } 523 else if (type==STRINGARRAY){ 524 char*** pstringarray=(char***)pvalue; //a little dangerous, but hey! 525 char** outstringarray=NULL; 526 outstringarray=(char**)xmalloc(M*sizeof(char*)); 527 for(i=0;i<M;i++){ 528 char* outstring=(char*)xmalloc((strlen(stringarray[i])+1)*sizeof(char)); 529 strcpy(outstring,stringarray[i]); 530 outstringarray[i]=outstring; 528 if(type!=STRINGARRAY)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a string array from a param with type",type)); 529 530 char** outstringarray=NULL; 531 outstringarray=(char**)xmalloc(M*sizeof(char*)); 532 for(i=0;i<M;i++){ 533 char* outstring=(char*)xmalloc((strlen(stringarray[i])+1)*sizeof(char)); 534 strcpy(outstring,stringarray[i]); 535 outstringarray[i]=outstring; 536 } 537 *pstringarray=outstringarray; 538 } 539 540 #undef __FUNCT__ 541 #define __FUNCT__ "GetParameterValue" 542 543 void Param::GetParameterValue(double** pdoublearray){ 544 545 546 double* outdoublearray=NULL; 547 548 if((type!=DOUBLEVEC) & (type!=DOUBLEMAT)) throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a double array from a param with type",type)); 549 550 if(type==DOUBLEVEC){ 551 552 if(M){ 553 outdoublearray=(double*)xmalloc(M*sizeof(double)); 554 memcpy(outdoublearray,doublevec,M*sizeof(double)); 531 555 } 532 *pstringarray=outstringarray; 533 } 534 else if(type==INTEGER){ 535 int* pinteger=(int*)pvalue; 536 *pinteger=integer; 537 } 538 else if(type==DOUBLE){ 539 double* pdouble=(double*)pvalue; 540 *pdouble=ddouble; 541 } 542 else if(type==DOUBLEVEC){ 543 double** pdoublevec=(double**)pvalue; 544 double* outdoublevec=NULL; 545 if(M){ 546 outdoublevec=(double*)xmalloc(M*sizeof(double)); 547 memcpy(outdoublevec,doublevec,M*sizeof(double)); 556 } 557 558 if(type==DOUBLEMAT){ 559 560 if(M*N){ 561 outdoublearray=(double*)xmalloc(M*N*sizeof(double)); 562 memcpy(outdoublearray,doublemat,M*N*sizeof(double)); 548 563 } 549 *pdoublevec=outdoublevec;550 } 551 else if(type==DOUBLEMAT){552 double** pdoublemat=(double**)pvalue; 553 double* outdoublemat=NULL; 554 if(M*N){ 555 outdoublemat=(double*)xmalloc(M*N*sizeof(double)); 556 memcpy(outdoublemat,doublemat,M*N*sizeof(double)); 557 }558 *pdoublemat=outdoublemat;559 }560 else if(type==PETSCVEC){561 Vec* pvec=(Vec*)pvalue; 562 Vec outvec=NULL;563 if(vec){564 VecDuplicate(vec,&outvec);565 VecCopy(vec,outvec);566 }567 *pvec=outvec; 568 } 569 else if(type==PETSCMAT){ 570 Mat* pmat=(Mat*)pvalue; 571 Mat outmat=NULL; 572 if(mat){573 MatDuplicate(mat,MAT_COPY_VALUES,&outmat);574 }575 *pmat=outmat;576 }577 else{578 _printf_("%s%s%i\n",__FUNCT__," error message: unknow type ",type);579 abort();580 } 581 return;564 } 565 566 *pdoublearray=outdoublearray; 567 } 568 569 #undef __FUNCT__ 570 #define __FUNCT__ "GetParameterValue" 571 void Param::GetParameterValue(Vec* pvec){ 572 573 Vec outvec=NULL; 574 575 if(type!=PETSCVEC) throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a Petsc vec from a param with type",type)); 576 577 if(vec){ 578 VecDuplicate(vec,&outvec); 579 VecCopy(vec,outvec); 580 } 581 *pvec=outvec; 582 } 583 584 #undef __FUNCT__ 585 #define __FUNCT__ "GetParameterValue" 586 587 void Param::GetParameterValue(Mat* pmat){ 588 589 Mat outmat=NULL; 590 591 if(type!=PETSCMAT) throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a Petsc mat from a param with type",type)); 592 593 if(mat){ 594 MatDuplicate(mat,MAT_COPY_VALUES,&outmat); 595 } 596 *pmat=outmat; 582 597 } 583 598 … … 608 623 609 624 #undef __FUNCT__ 610 #define __FUNCT__ "SetInteger" 611 void Param::SetInteger(int value){ 612 if (type!=INTEGER) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set integer for type",type)); 613 integer=value; 614 } 625 #define __FUNCT__ "SetDouble" 626 void Param::SetDouble(int value){ 627 if (type!=DOUBLE) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set double for type",type)); 628 ddouble=(double)value; 629 } 630 615 631 616 632 #undef __FUNCT__ -
issm/trunk/src/c/objects/Param.h
r2110 r2333 8 8 #include "./Object.h" 9 9 #include "../toolkits/toolkits.h" 10 #include "../include/types.h" 10 11 11 12 #define PARAMSTRING 200 //max string length 12 13 13 enum param_type { STRING, STRINGARRAY, INTEGER, DOUBLE, DOUBLEVEC, DOUBLEMAT, PETSCVEC, PETSCMAT };14 14 15 15 class Param: public Object{ … … 20 20 int type; /*! param type, from enum above*/ 21 21 22 int integer;23 22 double ddouble; 24 23 char string[PARAMSTRING]; … … 48 47 49 48 void SetDouble(double value); 49 void SetDouble(int value); 50 50 void SetDoubleVec(double* value,int size); 51 51 void SetDoubleVec(double* value,int size,int ndof); 52 52 void SetDoubleMat(double* value,int M,int N); 53 53 void SetVec(Vec value); 54 void SetInteger(int value);55 54 void SetString(char* value); 56 55 void SetStringArray(char** value,int size); 57 void GetParameterValue(void* pvalue); 56 57 void GetParameterValue(double* pdouble); 58 void GetParameterValue(int* pinteger); 59 void GetParameterValue(char** pstring); 60 void GetParameterValue(char*** pstringarray); 61 void GetParameterValue(double** pdoublearray); 62 void GetParameterValue(Vec* pvec); 63 void GetParameterValue(Mat* pmat); 58 64 59 65 int GetId(); -
issm/trunk/src/c/objects/ParameterInputs.cpp
r1904 r2333 295 295 296 296 /*retrive some necessary parameters first: */ 297 found=parameters->FindParam( (void*)&numberofnodes,"numberofnodes");297 found=parameters->FindParam(&numberofnodes,"numberofnodes"); 298 298 if(!found)throw ErrorException(__FUNCT__,"coud not find numberofnodes in parameters dataset!"); 299 299 … … 321 321 322 322 /*Now, pick up the parameter corresponding to root: */ 323 found=parameters->FindParam( (void*)¶meter,root);323 found=parameters->FindParam(¶meter,NULL,NULL,root); 324 324 if(!found)throw ErrorException(__FUNCT__,exprintf("%s%s%s"," could not find parameter ",root," for Dakota input update")); 325 325 -
issm/trunk/src/c/objects/Penta.cpp
r2112 r2333 19 19 return; 20 20 } 21 Penta::Penta( int penta_id, int penta_mid, int penta_mparid, int penta_node_ids[6], double penta_h[6], double penta_s[6], double penta_b[6], double penta_k[6], int penta_friction_type, 22 double penta_p, double penta_q, int penta_shelf, int penta_onbed, int penta_onsurface, double penta_meanvel,double penta_epsvel, 23 int penta_collapse, double penta_melting[6], double penta_accumulation[6], double penta_geothermalflux[6], 24 int penta_artdiff, int penta_thermal_steadystate,double penta_viscosity_overshoot,double penta_stokesreconditioning,bool penta_onwater){ 21 Penta::Penta( int penta_id, int penta_mid, int penta_mparid, int penta_numparid, int penta_node_ids[6], double penta_h[6], double penta_s[6], double penta_b[6], double penta_k[6], int penta_friction_type, 22 double penta_p, double penta_q, int penta_shelf, int penta_onbed, int penta_onsurface, int penta_collapse, double penta_melting[6], double penta_accumulation[6], double penta_geothermalflux[6], 23 int penta_thermal_steadystate,bool penta_onwater){ 25 24 26 25 int i; … … 29 28 mid = penta_mid; 30 29 mparid = penta_mparid; 30 numparid=penta_numparid; 31 31 32 32 for(i =0;i<6;i++){ … … 46 46 matpar=NULL; 47 47 matpar_offset=UNDEF; 48 numpar=NULL; 49 numpar_offset=UNDEF; 48 50 49 51 friction_type = penta_friction_type; … … 54 56 onwater = penta_onwater; 55 57 onsurface = penta_onsurface; 56 meanvel = penta_meanvel;57 epsvel = penta_epsvel;58 58 collapse = penta_collapse; 59 artdiff = penta_artdiff;60 59 thermal_steadystate = penta_thermal_steadystate; 61 viscosity_overshoot = penta_viscosity_overshoot;62 stokesreconditioning = penta_stokesreconditioning;63 60 64 61 return; … … 92 89 printf(" onwater: %i\n",onwater); 93 90 printf(" onsurface: %i\n",onsurface); 94 printf(" meanvel: %g\n",meanvel);95 printf(" epsvel: %g\n",epsvel);96 91 printf(" collapse: %i\n",collapse); 97 92 … … 99 94 printf(" accumulation=[%g,%g,%g,%g,%g,%g]\n",accumulation[0],accumulation[1],accumulation[2],accumulation[3],accumulation[4],accumulation[5]); 100 95 printf(" geothermalflux=[%g,%g,%g,%g,%g,%g]\n",geothermalflux[0],geothermalflux[1],geothermalflux[2],geothermalflux[3],geothermalflux[4],geothermalflux[5]); 101 printf(" artdiff: %i\n",artdiff);102 96 printf(" thermal_steadystate: %i\n",thermal_steadystate); 103 printf(" viscosity_overshoot: %i\n",viscosity_overshoot);104 printf(" stokesreconditioning: %i\n",stokesreconditioning);105 97 return; 106 98 } … … 129 121 printf(" onwater: %i\n",onwater); 130 122 printf(" onsurface: %i\n",onsurface); 131 printf(" meanvel: %g\n",meanvel);132 printf(" epsvel: %g\n",epsvel);133 123 printf(" collapse: %i\n",collapse); 134 124 … … 136 126 printf(" accumulation=[%i,%i,%i,%i,%i,%i]\n",accumulation[0],accumulation[1],accumulation[2],accumulation[3],accumulation[4],accumulation[5]); 137 127 printf(" geothermalflux=[%i,%i,%i,%i,%i,%i]\n",geothermalflux[0],geothermalflux[1],geothermalflux[2],geothermalflux[3],geothermalflux[4],geothermalflux[5]); 138 printf(" artdiff: %i\n",artdiff);139 128 printf(" thermal_steadystate: %i\n",thermal_steadystate); 140 printf(" viscosity_overshoot: %i\n",viscosity_overshoot);141 printf(" stokesreconditioning: %i\n",stokesreconditioning);142 129 return; 143 130 } … … 167 154 memcpy(marshalled_dataset,&matpar,sizeof(matpar));marshalled_dataset+=sizeof(matpar); 168 155 memcpy(marshalled_dataset,&matpar_offset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset); 156 memcpy(marshalled_dataset,&numparid,sizeof(numparid));marshalled_dataset+=sizeof(numparid); 157 memcpy(marshalled_dataset,&numpar,sizeof(numpar));marshalled_dataset+=sizeof(numpar); 158 memcpy(marshalled_dataset,&numpar_offset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset); 169 159 memcpy(marshalled_dataset,&h,sizeof(h));marshalled_dataset+=sizeof(h); 170 160 memcpy(marshalled_dataset,&s,sizeof(s));marshalled_dataset+=sizeof(s); … … 178 168 memcpy(marshalled_dataset,&onwater,sizeof(onwater));marshalled_dataset+=sizeof(onwater); 179 169 memcpy(marshalled_dataset,&onsurface,sizeof(onsurface));marshalled_dataset+=sizeof(onsurface); 180 memcpy(marshalled_dataset,&meanvel,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);181 memcpy(marshalled_dataset,&epsvel,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);182 170 memcpy(marshalled_dataset,&collapse,sizeof(collapse));marshalled_dataset+=sizeof(collapse); 183 171 memcpy(marshalled_dataset,&melting,sizeof(melting));marshalled_dataset+=sizeof(melting); 184 172 memcpy(marshalled_dataset,&accumulation,sizeof(accumulation));marshalled_dataset+=sizeof(accumulation); 185 173 memcpy(marshalled_dataset,&geothermalflux,sizeof(geothermalflux));marshalled_dataset+=sizeof(geothermalflux); 186 memcpy(marshalled_dataset,&artdiff,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);187 174 memcpy(marshalled_dataset,&thermal_steadystate,sizeof(thermal_steadystate));marshalled_dataset+=sizeof(thermal_steadystate); 188 memcpy(marshalled_dataset,&viscosity_overshoot,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);189 memcpy(marshalled_dataset,&stokesreconditioning,sizeof(stokesreconditioning));marshalled_dataset+=sizeof(stokesreconditioning);190 175 191 176 *pmarshalled_dataset=marshalled_dataset; … … 205 190 sizeof(matpar)+ 206 191 sizeof(matpar_offset)+ 192 +sizeof(numparid)+ 193 +sizeof(numpar)+ 194 +sizeof(numpar_offset)+ 207 195 sizeof(h)+ 208 196 sizeof(s)+ … … 216 204 sizeof(onwater)+ 217 205 sizeof(onsurface)+ 218 sizeof(meanvel)+219 sizeof(epsvel)+220 206 sizeof(collapse)+ 221 207 sizeof(melting)+ 222 208 sizeof(accumulation)+ 223 209 sizeof(geothermalflux)+ 224 sizeof(artdiff)+225 210 sizeof(thermal_steadystate) + 226 sizeof(viscosity_overshoot) +227 sizeof(stokesreconditioning) +228 211 sizeof(int); //sizeof(int) for enum type 229 212 } … … 254 237 memcpy(&matpar,marshalled_dataset,sizeof(matpar));marshalled_dataset+=sizeof(matpar); 255 238 memcpy(&matpar_offset,marshalled_dataset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset); 239 memcpy(&numparid,marshalled_dataset,sizeof(numparid));marshalled_dataset+=sizeof(numparid); 240 memcpy(&numpar,marshalled_dataset,sizeof(numpar));marshalled_dataset+=sizeof(numpar); 241 memcpy(&numpar_offset,marshalled_dataset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset); 256 242 memcpy(&h,marshalled_dataset,sizeof(h));marshalled_dataset+=sizeof(h); 257 243 memcpy(&s,marshalled_dataset,sizeof(s));marshalled_dataset+=sizeof(s); … … 265 251 memcpy(&onwater,marshalled_dataset,sizeof(onwater));marshalled_dataset+=sizeof(onwater); 266 252 memcpy(&onsurface,marshalled_dataset,sizeof(onsurface));marshalled_dataset+=sizeof(onsurface); 267 memcpy(&meanvel,marshalled_dataset,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);268 memcpy(&epsvel,marshalled_dataset,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);269 253 memcpy(&collapse,marshalled_dataset,sizeof(collapse));marshalled_dataset+=sizeof(collapse); 270 254 memcpy(&melting,marshalled_dataset,sizeof(melting));marshalled_dataset+=sizeof(melting); 271 255 memcpy(&accumulation,marshalled_dataset,sizeof(accumulation));marshalled_dataset+=sizeof(accumulation); 272 256 memcpy(&geothermalflux,marshalled_dataset,sizeof(geothermalflux));marshalled_dataset+=sizeof(geothermalflux); 273 memcpy(&artdiff,marshalled_dataset,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);274 257 memcpy(&thermal_steadystate,marshalled_dataset,sizeof(thermal_steadystate));marshalled_dataset+=sizeof(thermal_steadystate); 275 memcpy(&viscosity_overshoot,marshalled_dataset,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);276 memcpy(&stokesreconditioning,marshalled_dataset,sizeof(stokesreconditioning));marshalled_dataset+=sizeof(stokesreconditioning);277 258 278 259 /*nodes and materials are not pointing to correct objects anymore:*/ … … 300 281 #undef __FUNCT__ 301 282 #define __FUNCT__ "Penta::Configure" 302 void Penta::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin ){283 void Penta::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin,void* pparametersin){ 303 284 304 285 int i; … … 307 288 DataSet* nodesin=NULL; 308 289 DataSet* materialsin=NULL; 290 DataSet* parametersin=NULL; 309 291 310 292 /*Recover pointers :*/ … … 312 294 nodesin=(DataSet*)pnodesin; 313 295 materialsin=(DataSet*)pmaterialsin; 296 parametersin=(DataSet*)pparametersin; 314 297 315 298 /*Link this element with its nodes, ie find pointers to the nodes in the nodes dataset.: */ … … 319 302 ResolvePointers((Object**)&matice,&mid,&matice_offset,1,materialsin); 320 303 ResolvePointers((Object**)&matpar,&mparid,&matpar_offset,1,materialsin); 304 305 /*Same for numpar: */ 306 ResolvePointers((Object**)&numpar,&numparid,&numpar_offset,1,parametersin); 321 307 322 308 } … … 576 562 onto this scalar matrix, so that we win some computational time: */ 577 563 578 newviscosity=viscosity+ viscosity_overshoot*(viscosity-oldviscosity);564 newviscosity=viscosity+numpar->viscosity_overshoot*(viscosity-oldviscosity); 579 565 D_scalar=newviscosity*gauss_weight*Jdet; 580 566 for (i=0;i<5;i++){ … … 915 901 } 916 902 for (i=6;i<8;i++){ 917 D[i][i]=-D_scalar* stokesreconditioning;903 D[i][i]=-D_scalar*numpar->stokesreconditioning; 918 904 } 919 905 … … 1012 998 DLStokes[9][8]=-viscosity*gauss_weight*Jdet2d*bed_normal[0]/2.0; 1013 999 DLStokes[10][10]=-viscosity*gauss_weight*Jdet2d*bed_normal[1]/2.0; 1014 DLStokes[11][11]= stokesreconditioning*gauss_weight*Jdet2d*bed_normal[0];1015 DLStokes[12][12]= stokesreconditioning*gauss_weight*Jdet2d*bed_normal[1];1016 DLStokes[13][13]= stokesreconditioning*gauss_weight*Jdet2d*bed_normal[2];1000 DLStokes[11][11]=numpar->stokesreconditioning*gauss_weight*Jdet2d*bed_normal[0]; 1001 DLStokes[12][12]=numpar->stokesreconditioning*gauss_weight*Jdet2d*bed_normal[1]; 1002 DLStokes[13][13]=numpar->stokesreconditioning*gauss_weight*Jdet2d*bed_normal[2]; 1017 1003 1018 1004 /* Do the triple product tL*D*L: */ … … 1397 1383 tria_node_offsets[2]=node_offsets[g2]; 1398 1384 1399 tria= new Tria(id,mid,mparid, tria_node_ids,tria_h,tria_s,tria_b,tria_k, tria_melting, tria_accumulation, tria_geothermalflux,friction_type,p,q,shelf,meanvel,epsvel,viscosity_overshoot,artdiff,onwater);1385 tria= new Tria(id,mid,mparid,numparid,tria_node_ids,tria_h,tria_s,tria_b,tria_k, tria_melting, tria_accumulation, tria_geothermalflux,friction_type,p,q,shelf,onwater); 1400 1386 1401 1387 tria->NodeConfiguration(tria_node_ids,tria_nodes,tria_node_offsets); … … 3223 3209 } 3224 3210 for (i=6;i<8;i++){ 3225 D[i][i]=-D_scalar* stokesreconditioning;3211 D[i][i]=-D_scalar*numpar->stokesreconditioning; 3226 3212 } 3227 3213 … … 3583 3569 3584 3570 /*Artifficial diffusivity*/ 3585 if( artdiff){3571 if(numpar->artdiff){ 3586 3572 /*Build K: */ 3587 D_scalar=gauss_weight*Jdet/(pow(u,2)+pow(v,2)+ epsvel);3573 D_scalar=gauss_weight*Jdet/(pow(u,2)+pow(v,2)+numpar->epsvel); 3588 3574 if(dt){ 3589 3575 D_scalar=D_scalar*dt; -
issm/trunk/src/c/objects/Penta.h
r2112 r2333 32 32 Matpar* matpar; 33 33 int matpar_offset; 34 35 int numparid; 36 Numpar* numpar; 37 int numpar_offset; 34 38 35 39 … … 46 50 int onbed; 47 51 int onsurface; 48 bool onwater; 49 double meanvel;/*!scaling ratio for velocities*/ 50 double epsvel; /*!minimum velocity to avoid infinite velocity ratios*/ 52 bool onwater; 51 53 int collapse; 52 54 double geothermalflux[6]; 53 int artdiff;54 55 int thermal_steadystate; 55 double viscosity_overshoot;56 double stokesreconditioning;57 56 58 57 public: 59 58 60 59 Penta(); 61 Penta( int id, int mid, int mparid, int node_ids[6], double h[6], double s[6], double b[6], double k[6], int friction_type, 62 double p, double q, int shelf, int onbed, int onsurface, double meanvel,double epsvel, 63 int collapse, double melting[6], double accumulation[6], double geothermalflux[6], 64 int artdiff, int thermal_steadystate,double viscosity_overshoot,double stokesreconditioning,bool onwater); 60 Penta( int id, int mid, int mparid, int numparid, int node_ids[6], double h[6], double s[6], double b[6], double k[6], int friction_type, 61 double p, double q, int shelf, int onbed, int onsurface, int collapse, double melting[6], double accumulation[6], double geothermalflux[6], 62 int thermal_steadystate,bool onwater); 65 63 ~Penta(); 66 64 … … 74 72 int GetId(); 75 73 int MyRank(); 76 void Configure(void* loads,void* nodes,void* materials );74 void Configure(void* loads,void* nodes,void* materials,void* parameters); 77 75 void CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type); 78 76 void CreateKMatrixDiagnosticHoriz( Mat Kgg, void* inputs, int analysis_type,int sub_analysis_type); -
issm/trunk/src/c/objects/Sing.cpp
r2112 r2333 26 26 } 27 27 28 Sing::Sing(int sing_id, int sing_mid, int sing_mparid, int sing_ g, double sing_h, double sing_k){28 Sing::Sing(int sing_id, int sing_mid, int sing_mparid, int sing_numparid,int sing_g, double sing_h, double sing_k){ 29 29 30 30 id=sing_id; 31 31 mid=sing_mid; 32 32 mparid=sing_mparid; 33 numparid=sing_numparid; 33 34 34 35 node_id=sing_g; 35 36 node_offset=UNDEF; 36 37 node=NULL; 38 39 numpar=NULL; 40 numpar_offset=UNDEF; 37 41 38 42 h=sing_h; … … 43 47 matpar=NULL; 44 48 matpar_offset=UNDEF; 49 50 numpar=NULL; 51 numpar_offset=UNDEF; 45 52 46 53 return; … … 116 123 memcpy(marshalled_dataset,&matpar,sizeof(matpar));marshalled_dataset+=sizeof(matpar); 117 124 memcpy(marshalled_dataset,&matpar_offset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset); 125 memcpy(marshalled_dataset,&numparid,sizeof(numparid));marshalled_dataset+=sizeof(numparid); 126 memcpy(marshalled_dataset,&numpar,sizeof(numpar));marshalled_dataset+=sizeof(numpar); 127 memcpy(marshalled_dataset,&numpar_offset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset); 118 128 memcpy(marshalled_dataset,&h,sizeof(h));marshalled_dataset+=sizeof(h); 119 129 memcpy(marshalled_dataset,&k,sizeof(k));marshalled_dataset+=sizeof(k); … … 134 144 +sizeof(matpar) 135 145 +sizeof(matpar_offset) 146 +sizeof(numparid) 147 +sizeof(numpar) 148 +sizeof(numpar_offset) 136 149 +sizeof(h) 137 150 +sizeof(k) … … 164 177 memcpy(&matpar,marshalled_dataset,sizeof(matpar));marshalled_dataset+=sizeof(matpar); 165 178 memcpy(&matpar_offset,marshalled_dataset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset); 179 memcpy(&numparid,marshalled_dataset,sizeof(numparid));marshalled_dataset+=sizeof(numparid); 180 memcpy(&numpar,marshalled_dataset,sizeof(numpar));marshalled_dataset+=sizeof(numpar); 181 memcpy(&numpar_offset,marshalled_dataset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset); 166 182 memcpy(&h,marshalled_dataset,sizeof(h));marshalled_dataset+=sizeof(h); 167 183 memcpy(&k,marshalled_dataset,sizeof(k));marshalled_dataset+=sizeof(k); … … 191 207 #undef __FUNCT__ 192 208 #define __FUNCT__ "Sing::Configure" 193 void Sing::Configure(void* ploadsin, void* pnodesin,void* pmaterialsin ){209 void Sing::Configure(void* ploadsin, void* pnodesin,void* pmaterialsin,void* pparametersin){ 194 210 195 211 int i; … … 197 213 DataSet* nodesin=NULL; 198 214 DataSet* materialsin=NULL; 215 DataSet* parametersin=NULL; 199 216 200 217 /*Recover pointers :*/ 201 218 nodesin=(DataSet*)pnodesin; 202 219 materialsin=(DataSet*)pmaterialsin; 220 parametersin=(DataSet*)pparametersin; 203 221 204 222 /*Link this element with its nodes, ie find pointers to the nodes in the nodes dataset.: */ … … 208 226 ResolvePointers((Object**)&matice,&mid,&matice_offset,1,materialsin); 209 227 ResolvePointers((Object**)&matpar,&mparid,&matpar_offset,1,materialsin); 228 229 /*Same for numpar: */ 230 ResolvePointers((Object**)&numpar,&numparid,&numpar_offset,1,parametersin); 210 231 211 232 } -
issm/trunk/src/c/objects/Sing.h
r2112 r2333 32 32 Matpar* matpar; 33 33 int matpar_offset; 34 35 int numparid; 36 Numpar* numpar; 37 int numpar_offset; 34 38 35 39 double h; … … 39 43 40 44 Sing(); 41 Sing(int sing_id, int sing_mid, int sing_mparid, int sing_ g, double sing_h, double sing_k);45 Sing(int sing_id, int sing_mid, int sing_mparid, int sing_numparid,int sing_g, double sing_h, double sing_k); 42 46 ~Sing(); 43 47 … … 51 55 int GetId(); 52 56 int MyRank(); 53 void Configure(void* loads,void* nodes,void* materials );57 void Configure(void* loads,void* nodes,void* materials,void* parameters); 54 58 void CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type); 55 59 void CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type); -
issm/trunk/src/c/objects/Tria.cpp
r2268 r2333 32 32 } 33 33 34 Tria::Tria(int tria_id,int tria_mid,int tria_mparid,int tria_node_ids[3],double tria_h[3],double tria_s[3],double tria_b[3],double tria_k[3],double tria_melting[3], 35 double tria_accumulation[3],double tria_geothermalflux[3],int tria_friction_type,double tria_p,double tria_q,int tria_shelf,double tria_meanvel,double tria_epsvel, 36 double tria_viscosity_overshoot,int tria_artdiff,bool tria_onwater){ 34 Tria::Tria(int tria_id,int tria_mid,int tria_mparid,int tria_numparid,int tria_node_ids[3],double tria_h[3],double tria_s[3],double tria_b[3],double tria_k[3],double tria_melting[3], 35 double tria_accumulation[3],double tria_geothermalflux[3],int tria_friction_type,double tria_p,double tria_q,int tria_shelf, bool tria_onwater){ 37 36 38 37 int i; … … 41 40 mid=tria_mid; 42 41 mparid=tria_mparid; 42 numparid=tria_numparid; 43 43 for(i=0;i<3;i++){ 44 44 node_ids[i]=tria_node_ids[i]; … … 57 57 matpar=NULL; 58 58 matpar_offset=UNDEF; 59 numpar=NULL; 60 numpar_offset=UNDEF; 59 61 friction_type=tria_friction_type; 60 62 p=tria_p; 61 63 q=tria_q; 62 64 shelf=tria_shelf; 63 meanvel=tria_meanvel;64 epsvel=tria_epsvel;65 65 onbed=1; 66 66 onwater=tria_onwater; 67 viscosity_overshoot=tria_viscosity_overshoot;68 artdiff=tria_artdiff;69 67 70 68 return; … … 95 93 printf(" q: %g\n",q); 96 94 printf(" shelf: %i\n",shelf); 97 printf(" meanvel: %g\n",meanvel);98 printf(" epsvel: %g\n",epsvel);99 95 printf(" onbed: %i\n",onbed); 100 96 printf(" onwater: %i\n",onwater); 101 printf(" viscosity_overshoot=%g\n",viscosity_overshoot);102 printf(" artdiff=%g\n",artdiff);103 97 printf(" nodes: \n"); 104 98 if(nodes[0])nodes[0]->Echo(); … … 134 128 printf(" q: %g\n",q); 135 129 printf(" shelf: %i\n",shelf); 136 printf(" meanvel: %g\n",meanvel);137 printf(" epsvel: %g\n",epsvel);138 130 printf(" onbed: %i\n",onbed); 139 131 printf(" onwater: %i\n",onwater); 140 printf(" viscosity_overshoot=%g\n",viscosity_overshoot);141 printf(" artdiff=%g\n",artdiff);142 132 printf(" nodes: \n"); 143 133 if(nodes[0])nodes[0]->Echo(); … … 174 164 memcpy(marshalled_dataset,&matpar,sizeof(matpar));marshalled_dataset+=sizeof(matpar); 175 165 memcpy(marshalled_dataset,&matpar_offset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset); 166 memcpy(marshalled_dataset,&numparid,sizeof(numparid));marshalled_dataset+=sizeof(numparid); 167 memcpy(marshalled_dataset,&numpar,sizeof(numpar));marshalled_dataset+=sizeof(numpar); 168 memcpy(marshalled_dataset,&numpar_offset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset); 176 169 memcpy(marshalled_dataset,&h,sizeof(h));marshalled_dataset+=sizeof(h); 177 170 memcpy(marshalled_dataset,&s,sizeof(s));marshalled_dataset+=sizeof(s); … … 187 180 memcpy(marshalled_dataset,&q,sizeof(q));marshalled_dataset+=sizeof(q); 188 181 memcpy(marshalled_dataset,&shelf,sizeof(shelf));marshalled_dataset+=sizeof(shelf); 189 memcpy(marshalled_dataset,&meanvel,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);190 memcpy(marshalled_dataset,&epsvel,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);191 memcpy(marshalled_dataset,&viscosity_overshoot,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);192 memcpy(marshalled_dataset,&artdiff,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);193 182 194 183 *pmarshalled_dataset=marshalled_dataset; … … 207 196 +sizeof(matpar) 208 197 +sizeof(matpar_offset) 198 +sizeof(numparid) 199 +sizeof(numpar) 200 +sizeof(numpar_offset) 209 201 +sizeof(h) 210 202 +sizeof(s) … … 220 212 +sizeof(q) 221 213 +sizeof(shelf) 222 +sizeof(meanvel)223 +sizeof(epsvel)224 +sizeof(viscosity_overshoot)225 +sizeof(artdiff)226 214 +sizeof(int); //sizeof(int) for enum type 227 215 } … … 252 240 memcpy(&matpar,marshalled_dataset,sizeof(matpar));marshalled_dataset+=sizeof(matpar); 253 241 memcpy(&matpar_offset,marshalled_dataset,sizeof(matpar_offset));marshalled_dataset+=sizeof(matpar_offset); 242 memcpy(&numparid,marshalled_dataset,sizeof(numparid));marshalled_dataset+=sizeof(numparid); 243 memcpy(&numpar,marshalled_dataset,sizeof(numpar));marshalled_dataset+=sizeof(numpar); 244 memcpy(&numpar_offset,marshalled_dataset,sizeof(numpar_offset));marshalled_dataset+=sizeof(numpar_offset); 254 245 memcpy(&h,marshalled_dataset,sizeof(h));marshalled_dataset+=sizeof(h); 255 246 memcpy(&s,marshalled_dataset,sizeof(s));marshalled_dataset+=sizeof(s); … … 265 256 memcpy(&q,marshalled_dataset,sizeof(q));marshalled_dataset+=sizeof(q); 266 257 memcpy(&shelf,marshalled_dataset,sizeof(shelf));marshalled_dataset+=sizeof(shelf); 267 memcpy(&meanvel,marshalled_dataset,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel);268 memcpy(&epsvel,marshalled_dataset,sizeof(epsvel));marshalled_dataset+=sizeof(epsvel);269 memcpy(&viscosity_overshoot,marshalled_dataset,sizeof(viscosity_overshoot));marshalled_dataset+=sizeof(viscosity_overshoot);270 memcpy(&artdiff,marshalled_dataset,sizeof(artdiff));marshalled_dataset+=sizeof(artdiff);271 258 272 259 /*nodes and materials are not pointing to correct objects anymore:*/ … … 274 261 matice=NULL; 275 262 matpar=NULL; 263 numpar=NULL; 276 264 277 265 /*return: */ … … 294 282 #undef __FUNCT__ 295 283 #define __FUNCT__ "Tria::Configure" 296 void Tria::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin ){284 void Tria::Configure(void* ploadsin,void* pnodesin,void* pmaterialsin,void* pparametersin){ 297 285 298 286 int i; … … 301 289 DataSet* nodesin=NULL; 302 290 DataSet* materialsin=NULL; 291 DataSet* parametersin=NULL; 303 292 304 293 /*Recover pointers :*/ … … 306 295 nodesin=(DataSet*)pnodesin; 307 296 materialsin=(DataSet*)pmaterialsin; 297 parametersin=(DataSet*)pparametersin; 308 298 309 299 /*Link this element with its nodes, ie find pointers to the nodes in the nodes dataset.: */ … … 313 303 ResolvePointers((Object**)&matice,&mid,&matice_offset,1,materialsin); 314 304 ResolvePointers((Object**)&matpar,&mparid,&matpar_offset,1,materialsin); 305 306 /*Same for numpar: */ 307 ResolvePointers((Object**)&numpar,&numparid,&numpar_offset,1,parametersin); 315 308 316 309 } … … 479 472 /* Build the D matrix: we plug the gaussian weight, the thickness, the viscosity, and the jacobian determinant 480 473 onto this scalar matrix, so that we win some computational time: */ 481 newviscosity=viscosity+ viscosity_overshoot*(viscosity-oldviscosity);474 newviscosity=viscosity+numpar->viscosity_overshoot*(viscosity-oldviscosity); 482 475 D_scalar=newviscosity*thickness*gauss_weight*Jdet; 483 476 … … 645 638 646 639 //Create Artificial diffusivity once for all if requested 647 if( artdiff){640 if(numpar->artdiff){ 648 641 //Get the Jacobian determinant 649 642 gauss_l1l2l3[0]=1.0/3.0; gauss_l1l2l3[1]=1.0/3.0; gauss_l1l2l3[2]=1.0/3.0; … … 724 717 for( i=0; i<numdof; i++) for(j=0;j<numdof;j++) Ke_gg[i][j]+=Ke_gg_thickness2[i][j]; 725 718 726 if( artdiff){719 if(numpar->artdiff){ 727 720 728 721 /* Compute artificial diffusivity */ … … 2083 2076 /*We are using a relative misfit: */ 2084 2077 for (i=0;i<numgrids;i++){ 2085 scalex=pow( meanvel/(obs_vx_list[i]+epsvel),2);2086 scaley=pow( meanvel/(obs_vy_list[i]+epsvel),2);2078 scalex=pow(numpar->meanvel/(obs_vx_list[i]+numpar->epsvel),2); 2079 scaley=pow(numpar->meanvel/(obs_vy_list[i]+numpar->epsvel),2); 2087 2080 if(obs_vx_list[i]==0)scalex=0; 2088 2081 if(obs_vy_list[i]==0)scaley=0; … … 2094 2087 /*We are using a logarithmic misfit: */ 2095 2088 for (i=0;i<numgrids;i++){ 2096 velocity_mag=sqrt(pow(vx_list[i],2)+pow(vy_list[i],2))+ epsvel; //epsvel to avoid velocity being nil.2097 obs_velocity_mag=sqrt(pow(obs_vx_list[i],2)+pow(obs_vy_list[i],2))+ epsvel; //epsvel to avoid observed velocity being nil.2098 scale=-8*pow( meanvel,2)/pow(velocity_mag,2)*log(velocity_mag/obs_velocity_mag);2089 velocity_mag=sqrt(pow(vx_list[i],2)+pow(vy_list[i],2))+numpar->epsvel; //epsvel to avoid velocity being nil. 2090 obs_velocity_mag=sqrt(pow(obs_vx_list[i],2)+pow(obs_vy_list[i],2))+numpar->epsvel; //epsvel to avoid observed velocity being nil. 2091 scale=-8*pow(numpar->meanvel,2)/pow(velocity_mag,2)*log(velocity_mag/obs_velocity_mag); 2099 2092 logarithmicx_list[i]=scale*vx_list[i]; 2100 2093 logarithmicy_list[i]=scale*vy_list[i]; … … 2255 2248 double lambda,mu; 2256 2249 double bed,thickness,Neff; 2257 double cm_noisedampening;2258 2250 2259 2251 /*drag: */ … … 2300 2292 if(!inputs->Recover("adjoint",&adjxadjy_list[0][0],2,dofs2,numgrids,(void**)nodes)){ 2301 2293 throw ErrorException(__FUNCT__,"missing adjoint input parameter"); 2302 }2303 if(!inputs->Recover("cm_noisedampening",&cm_noisedampening)){2304 throw ErrorException(__FUNCT__,"missing cm_noisedampening");2305 2294 } 2306 2295 … … 2407 2396 grade_g_gaussian[i]= 2408 2397 -2*drag*alpha_complement*((lambda*vx+mu*vy))*Jdet*gauss_weight*l1l2l3[i] //standard term dJ/dki 2409 + cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]); // regularization term d/dki(1/2*(dk/dx)^2)2398 +numpar->cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]); // regularization term d/dki(1/2*(dk/dx)^2) 2410 2399 } 2411 2400 … … 2469 2458 double bed_normal[3]; 2470 2459 double dk[NDOF2]; 2471 double cm_noisedampening;2472 2460 2473 2461 /*drag: */ … … 2510 2498 if(!inputs->Recover("adjoint",&adjxyz_list[0][0],3,dofs3,numgrids,(void**)nodes)){ 2511 2499 throw ErrorException(__FUNCT__,"missing adjoint input parameter"); 2512 }2513 if(!inputs->Recover("cm_noisedampening",&cm_noisedampening)){2514 throw ErrorException(__FUNCT__,"missing cm_noisedampening");2515 2500 } 2516 2501 … … 2634 2619 2635 2620 //Add regularization term 2636 grade_g_gaussian[i]+= cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);2621 grade_g_gaussian[i]+=numpar->cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]); 2637 2622 } 2638 2623 … … 2741 2726 int dofs[1]={0}; 2742 2727 double dk[NDOF2]; 2743 double cm_noisedampening;2744 2728 2745 2729 ParameterInputs* inputs=NULL; … … 2763 2747 if(!inputs->Recover("adjoint",&adjxadjy_list[0][0],2,dofs2,numgrids,(void**)nodes)){ 2764 2748 throw ErrorException(__FUNCT__,"missing adjoint input parameter"); 2765 }2766 if(!inputs->Recover("cm_noisedampening",&cm_noisedampening)){2767 throw ErrorException(__FUNCT__,"missing cm_noisedampening");2768 2749 } 2769 2750 … … 2828 2809 2829 2810 //Add regularization term 2830 grade_g_gaussian[i]+= cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]);2811 grade_g_gaussian[i]+=numpar->cm_noisedampening*Jdet*gauss_weight*(dh1dh2dh3_basic[0][i]*dk[0]+dh1dh2dh3_basic[1][i]*dk[1]); 2831 2812 } 2832 2813 … … 2890 2871 double dk[NDOF2]; 2891 2872 double dB[NDOF2]; 2892 double cm_noisedampening;2893 2873 2894 2874 /* Jacobian: */ … … 2919 2899 if(!inputs->Recover("velocity",&vxvy_list[0][0],2,dofs2,numgrids,(void**)nodes)){ 2920 2900 throw ErrorException(__FUNCT__,"missing velocity input parameter"); 2921 }2922 if(!inputs->Recover("cm_noisedampening",&cm_noisedampening)){2923 throw ErrorException(__FUNCT__,"missing cm_noisedampening");2924 2901 } 2925 2902 … … 2942 2919 /*We are using a relative misfit: */ 2943 2920 for (i=0;i<numgrids;i++){ 2944 scalex=pow( meanvel/(obs_vx_list[i]+epsvel),(double)2);2945 scaley=pow( meanvel/(obs_vy_list[i]+epsvel),(double)2);2921 scalex=pow(numpar->meanvel/(obs_vx_list[i]+numpar->epsvel),(double)2); 2922 scaley=pow(numpar->meanvel/(obs_vy_list[i]+numpar->epsvel),(double)2); 2946 2923 if(obs_vx_list[i]==0)scalex=0; 2947 2924 if(obs_vy_list[i]==0)scaley=0; … … 2952 2929 /*We are using a logarithmic misfit: */ 2953 2930 for (i=0;i<numgrids;i++){ 2954 velocity_mag=sqrt(pow(vx_list[i],(double)2)+pow(vy_list[i],(double)2))+ epsvel; //epsvel to avoid velocity being nil.2955 obs_velocity_mag=sqrt(pow(obs_vx_list[i],(double)2)+pow(obs_vy_list[i],(double)2))+ epsvel; //epsvel to avoid observed velocity being nil.2956 logarithmic_list[i]=4*pow( meanvel,(double)2)*pow(log(velocity_mag/obs_velocity_mag),(double)2);2931 velocity_mag=sqrt(pow(vx_list[i],(double)2)+pow(vy_list[i],(double)2))+numpar->epsvel; //epsvel to avoid velocity being nil. 2932 obs_velocity_mag=sqrt(pow(obs_vx_list[i],(double)2)+pow(obs_vy_list[i],(double)2))+numpar->epsvel; //epsvel to avoid observed velocity being nil. 2933 logarithmic_list[i]=4*pow(numpar->meanvel,(double)2)*pow(log(velocity_mag/obs_velocity_mag),(double)2); 2957 2934 } 2958 2935 } … … 2991 2968 if (strcmp(control_type,"drag")==0 & !shelf){ 2992 2969 GetParameterDerivativeValue(&dk[0], &k[0],&xyz_list[0][0], gauss_l1l2l3); 2993 Jelem+= cm_noisedampening*1/2*(pow(dk[0],2)+pow(dk[1],2))*Jdet*gauss_weight;2970 Jelem+=numpar->cm_noisedampening*1/2*(pow(dk[0],2)+pow(dk[1],2))*Jdet*gauss_weight; 2994 2971 if (id==1){ 2995 2972 printf("id=%i value=%g k=[%g %g %g]\n",id,(pow(dk[0],2)+pow(dk[1],2)),k[0],k[1],k[2]); … … 3002 2979 B=matice->GetB(); 3003 2980 GetParameterDerivativeValue(&dB[0], &B[0],&xyz_list[0][0], gauss_l1l2l3); 3004 Jelem+= cm_noisedampening*1/2*(pow(dB[0],2)+pow(dB[1],2))*Jdet*gauss_weight;2981 Jelem+=numpar->cm_noisedampening*1/2*(pow(dB[0],2)+pow(dB[1],2))*Jdet*gauss_weight; 3005 2982 } 3006 2983 */ -
issm/trunk/src/c/objects/Tria.h
r2112 r2333 11 11 #include "./Matice.h" 12 12 #include "./Matpar.h" 13 #include "./Numpar.h" 13 14 #include "./ParameterInputs.h" 14 15 … … 33 34 Matpar* matpar; 34 35 int matpar_offset; 36 37 int numparid; 38 Numpar* numpar; 39 int numpar_offset; 35 40 36 41 double h[3]; … … 45 50 double q; 46 51 int shelf; 47 double meanvel;/*!scaling ratio for velocities*/48 double epsvel; /*!minimum velocity to avoid infinite velocity ratios*/49 52 int onbed; 50 53 bool onwater; 51 double viscosity_overshoot;52 int artdiff;53 54 54 55 public: 55 56 56 57 Tria(); 57 Tria(int id,int mid,int mparid,int node_ids[3],double h[3],double s[3],double b[3],double k[3],double melting[3],double accumulation[3],double geothermalflux[3], 58 int friction_type,double p,double q,int shelf,double meanvel,double epsvel,double viscosity_overshoot,int artdiff,bool onwater); 58 Tria(int id,int mid,int mparid,int numparid,int node_ids[3],double h[3],double s[3],double b[3],double k[3],double melting[3],double accumulation[3],double geothermalflux[3],int friction_type,double p,double q,int shelf,bool onwater); 59 59 ~Tria(); 60 60 … … 68 68 int GetId(); 69 69 int MyRank(); 70 void Configure(void* loads,void* nodes,void* materials );70 void Configure(void* loads,void* nodes,void* materials,void* parameters); 71 71 void CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type); 72 72 void CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type); -
issm/trunk/src/c/parallel/ControlInitialization.cpp
r2330 r2333 70 70 71 71 //specific parameters for specific models 72 fem_dh->FindParam( (void*)&numberofdofspernode_dh,"numberofdofspernode");73 fem_sl->FindParam( (void*)&numberofdofspernode_sl,"numberofdofspernode");74 fem_ds->FindParam( (void*)&numberofdofspernode_ds,"numberofdofspernode");72 fem_dh->FindParam(&numberofdofspernode_dh,"numberofdofspernode"); 73 fem_sl->FindParam(&numberofdofspernode_sl,"numberofdofspernode"); 74 fem_ds->FindParam(&numberofdofspernode_ds,"numberofdofspernode"); 75 75 76 76 /*if no Stokes, assign output and return*/ … … 86 86 diagnostic_core_linear(&slopex,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum()); 87 87 diagnostic_core_linear(&slopey,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum()); 88 FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials, "slopex",0);89 FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials, "slopey",0);88 FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopex",0); 89 FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopey",0); 90 90 91 91 //Add in inputs … … 100 100 diagnostic_core_nonlinear(&ug,NULL,NULL,NULL,fem_dh,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 101 101 if(verbose)_printf_("%s\n"," extruding horizontal velocities..."); 102 VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->loads,fem_dh-> materials, "velocity",1);102 VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->loads,fem_dh-> materials,fem_dh->parameters,"velocity",1); 103 103 104 104 //vertical velocity … … 116 116 //Create 4d u_g 117 117 if(verbose)_printf_("%s\n"," computing pressure according to Pattyn..."); 118 ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads, fem_dh->materials, numberofnodes);118 ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads, fem_dh->materials, fem_dh->parameters); 119 119 VecScale(pg,1.0/stokesreconditioning); 120 120 ug_stokes=NewVec(fem_ds->nodesets->GetGSize()); -
issm/trunk/src/c/parallel/DakotaResponses.cpp
r804 r2333 27 27 28 28 /*some data needed across the responses: */ 29 found=fem->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");29 found=fem->parameters->FindParam(&numberofnodes,"numberofnodes"); 30 30 if(!found)throw ErrorException(__FUNCT__," could not find numberofnodes in fem model"); 31 31 … … 41 41 double min_vel=0; 42 42 43 found=results->FindResult( (void*)&vel,"vel");43 found=results->FindResult(&vel,"vel"); 44 44 if(!found)throw ErrorException(__FUNCT__," could not find vel to compute min_vel"); 45 45 … … 56 56 double max_vel=0; 57 57 58 found=results->FindResult( (void*)&vel,"vel");58 found=results->FindResult(&vel,"vel"); 59 59 if(!found)throw ErrorException(__FUNCT__," could not find vel to compute max_vel"); 60 60 … … 69 69 double min_vx=0; 70 70 71 found=results->FindResult( (void*)&vx,"vx");71 found=results->FindResult(&vx,"vx"); 72 72 if(!found)throw ErrorException(__FUNCT__," could not find vx to compute min_vx"); 73 73 … … 82 82 double max_vx=0; 83 83 84 found=results->FindResult( (void*)&vx,"vx");84 found=results->FindResult(&vx,"vx"); 85 85 if(!found)throw ErrorException(__FUNCT__," could not find vx to compute max_vx"); 86 86 … … 95 95 double max_abs_vx=0; 96 96 97 found=results->FindResult( (void*)&vx,"vx");97 found=results->FindResult(&vx,"vx"); 98 98 if(!found)throw ErrorException(__FUNCT__," could not find vx to compute max_abs_vx"); 99 99 … … 108 108 double min_vy=0; 109 109 110 found=results->FindResult( (void*)&vy,"vy");110 found=results->FindResult(&vy,"vy"); 111 111 if(!found)throw ErrorException(__FUNCT__," could not find vy to compute min_vy"); 112 112 … … 121 121 double max_vy=0; 122 122 123 found=results->FindResult( (void*)&vy,"vy");123 found=results->FindResult(&vy,"vy"); 124 124 if(!found)throw ErrorException(__FUNCT__," could not find vy to compute max_vy"); 125 125 … … 134 134 double max_abs_vy=0; 135 135 136 found=results->FindResult( (void*)&vy,"vy");136 found=results->FindResult(&vy,"vy"); 137 137 if(!found)throw ErrorException(__FUNCT__," could not find vy to compute max_abs_vy"); 138 138 … … 147 147 double min_vz=0; 148 148 149 found=results->FindResult( (void*)&vz,"vz");149 found=results->FindResult(&vz,"vz"); 150 150 if(!found)throw ErrorException(__FUNCT__," could not find vz to compute min_vz"); 151 151 … … 160 160 double max_vz=0; 161 161 162 found=results->FindResult( (void*)&vz,"vz");162 found=results->FindResult(&vz,"vz"); 163 163 if(!found)throw ErrorException(__FUNCT__," could not find vz to compute max_vz"); 164 164 … … 173 173 double max_abs_vz=0; 174 174 175 found=results->FindResult( (void*)&vz,"vz");175 found=results->FindResult(&vz,"vz"); 176 176 if(!found)throw ErrorException(__FUNCT__," could not find vz to compute max_abs_vz"); 177 177 -
issm/trunk/src/c/parallel/ProcessResults.cpp
r2316 r2333 126 126 /*ok, 2 dofs, on number of nodes: */ 127 127 if(ismacayealpattyn){ 128 fem_dh->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");128 fem_dh->parameters->FindParam(&numberofnodes,"numberofnodes"); 129 129 VecToMPISerial(&partition,fem_dh->partition->vector); 130 fem_dh->parameters->FindParam( (void*)&yts,"yts");130 fem_dh->parameters->FindParam(&yts,"yts"); 131 131 } 132 132 else{ 133 fem_dhu->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");133 fem_dhu->parameters->FindParam(&numberofnodes,"numberofnodes"); 134 134 VecToMPISerial(&partition,fem_dhu->partition->vector); 135 fem_dhu->parameters->FindParam( (void*)&yts,"yts");135 fem_dhu->parameters->FindParam(&yts,"yts"); 136 136 } 137 137 vx=(double*)xmalloc(numberofnodes*sizeof(double)); … … 152 152 /*ok, 3 dofs, on number of nodes: */ 153 153 if(ismacayealpattyn){ 154 fem_dh->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");154 fem_dh->parameters->FindParam(&numberofnodes,"numberofnodes"); 155 155 VecToMPISerial(&partition,fem_dh->partition->vector); 156 fem_dh->parameters->FindParam( (void*)&yts,"yts");156 fem_dh->parameters->FindParam(&yts,"yts"); 157 157 } 158 158 else{ 159 fem_dhu->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");159 fem_dhu->parameters->FindParam(&numberofnodes,"numberofnodes"); 160 160 VecToMPISerial(&partition,fem_dhu->partition->vector); 161 fem_dhu->parameters->FindParam( (void*)&yts,"yts");161 fem_dhu->parameters->FindParam(&yts,"yts"); 162 162 } 163 163 vx=(double*)xmalloc(numberofnodes*sizeof(double)); … … 175 175 else{ 176 176 /* 4 dofs on number of nodes. discard pressure: */ 177 fem_ds->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");177 fem_ds->parameters->FindParam(&numberofnodes,"numberofnodes"); 178 178 VecToMPISerial(&partition,fem_ds->partition->vector); 179 fem_ds->parameters->FindParam( (void*)&yts,"yts");179 fem_ds->parameters->FindParam(&yts,"yts"); 180 180 vx=(double*)xmalloc(numberofnodes*sizeof(double)); 181 181 vy=(double*)xmalloc(numberofnodes*sizeof(double)); … … 220 220 if(!isstokes){ 221 221 if(ismacayealpattyn){ 222 fem_dh->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");222 fem_dh->parameters->FindParam(&numberofnodes,"numberofnodes"); 223 223 VecToMPISerial(&partition,fem_dh->partition->vector); 224 224 } 225 225 else{ 226 fem_dhu->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");226 fem_dhu->parameters->FindParam(&numberofnodes,"numberofnodes"); 227 227 VecToMPISerial(&partition,fem_dhu->partition->vector); 228 228 } 229 229 } 230 230 else{ 231 fem_ds->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");231 fem_ds->parameters->FindParam(&numberofnodes,"numberofnodes"); 232 232 VecToMPISerial(&partition,fem_ds->partition->vector); 233 233 } … … 253 253 result->GetField(&t_g); 254 254 VecToMPISerial(&t_g_serial,t_g); 255 fem_t->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");255 fem_t->parameters->FindParam(&numberofnodes,"numberofnodes"); 256 256 VecToMPISerial(&partition,fem_t->partition->vector); 257 257 … … 276 276 result->GetField(&m_g); 277 277 VecToMPISerial(&m_g_serial,m_g); 278 fem_t->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");279 fem_t->parameters->FindParam( (void*)&yts,"yts");278 fem_t->parameters->FindParam(&numberofnodes,"numberofnodes"); 279 fem_t->parameters->FindParam(&yts,"yts"); 280 280 VecToMPISerial(&partition,fem_t->partition->vector); 281 281 … … 300 300 result->GetField(&h_g); 301 301 VecToMPISerial(&h_g_serial,h_g); 302 fem_p->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");302 fem_p->parameters->FindParam(&numberofnodes,"numberofnodes"); 303 303 VecToMPISerial(&partition,fem_p->partition->vector); 304 304 … … 323 323 result->GetField(&s_g); 324 324 VecToMPISerial(&s_g_serial,s_g); 325 fem_p->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");325 fem_p->parameters->FindParam(&numberofnodes,"numberofnodes"); 326 326 VecToMPISerial(&partition,fem_p->partition->vector); 327 327 … … 346 346 result->GetField(&b_g); 347 347 VecToMPISerial(&b_g_serial,b_g); 348 fem_p->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");348 fem_p->parameters->FindParam(&numberofnodes,"numberofnodes"); 349 349 VecToMPISerial(&partition,fem_p->partition->vector); 350 350 … … 368 368 /*easy, param_g is of size numberofnodes, on 1 dof, just repartition: */ 369 369 result->GetField(¶m_g); 370 fem_dh->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");370 fem_dh->parameters->FindParam(&numberofnodes,"numberofnodes"); 371 371 VecToMPISerial(&partition,fem_dh->partition->vector); 372 372 … … 388 388 else if(strcmp(result->GetFieldName(),"riftproperties")==0){ 389 389 result->GetField(&riftproperties); 390 fem_dh->parameters->FindParam( (void*)&numrifts,"numrifts");390 fem_dh->parameters->FindParam(&numrifts,"numrifts"); 391 391 VecToMPISerial(&riftproperties_serial,riftproperties); 392 392 -
issm/trunk/src/c/parallel/control_core.cpp
r2330 r2333 63 63 model->FindParam(&nsteps,"nsteps"); 64 64 model->FindParam(&control_type,"control_type"); 65 model->FindParam(&fit, "fit");66 model->FindParam(&optscal, "optscal");67 model->FindParam(&maxiter, "maxiter");68 model->FindParam(&cm_jump, "cm_jump");65 model->FindParam(&fit,NULL,NULL,"fit"); 66 model->FindParam(&optscal,NULL,NULL,"optscal"); 67 model->FindParam(&maxiter,NULL,NULL,"maxiter"); 68 model->FindParam(&cm_jump,NULL,NULL,"cm_jump"); 69 69 model->FindParam(&eps_cm,"eps_cm"); 70 70 model->FindParam(&tolx,"tolx"); 71 71 model->FindParam(&mincontrolconstraint,"mincontrolconstraint"); 72 72 model->FindParam(&maxcontrolconstraint,"maxcontrolconstraint"); 73 model->FindParam(¶m_g, "param_g");73 model->FindParam(¶m_g,NULL,NULL,"param_g"); 74 74 model->FindParam(&analysis_type,"analysis_type"); 75 75 model->FindParam(&sub_analysis_type,"sub_analysis_type"); … … 106 106 107 107 /*Update parameters: */ 108 UpdateFromInputsx(fem_model->elements,fem_model->nodes,fem_model->loads, fem_model->materials, inputs);108 UpdateFromInputsx(fem_model->elements,fem_model->nodes,fem_model->loads, fem_model->materials,fem_model->parameters,inputs); 109 109 110 110 _printf_("%s\n"," computing gradJ..."); -
issm/trunk/src/c/parallel/convergence.cpp
r2330 r2333 34 34 35 35 /*get convergence options*/ 36 parameters->FindParam( (void*)&eps_res,"eps_res");37 parameters->FindParam( (void*)&eps_rel,"eps_rel");38 parameters->FindParam( (void*)&eps_abs,"eps_abs");39 parameters->FindParam( (void*)&yts,"yts");40 parameters->FindParam( (void*)&verbose,"verbose");36 parameters->FindParam(&eps_res,"eps_res"); 37 parameters->FindParam(&eps_rel,"eps_rel"); 38 parameters->FindParam(&eps_abs,"eps_abs"); 39 parameters->FindParam(&yts,"yts"); 40 parameters->FindParam(&verbose,"verbose"); 41 41 42 42 /*Display solver caracteristics*/ -
issm/trunk/src/c/parallel/diagnostic.cpp
r2268 r2333 91 91 92 92 _printf_("initialize inputs:\n"); 93 model->FindParam(&u_g_initial, "u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());93 model->FindParam(&u_g_initial,NULL,NULL,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 94 94 model->FindParam(&numberofnodes,"numberofnodes"); 95 95 if(control_analysis){ 96 model->FindParam(&u_g_obs, "u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());96 model->FindParam(&u_g_obs,NULL,NULL,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 97 97 } 98 98 … … 102 102 model->FindParam(&cm_noisedampening,"cm_noisedampening"); 103 103 inputs->Add("cm_noisedampening",cm_noisedampening); 104 model->FindParam(&u_g_obs, "u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());104 model->FindParam(&u_g_obs,NULL,NULL,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 105 105 inputs->Add("velocity_obs",u_g_obs,2,numberofnodes); 106 106 } -
issm/trunk/src/c/parallel/diagnostic_core.cpp
r2330 r2333 80 80 81 81 //specific parameters for specific models 82 fem_dh->FindParam( (void*)&numberofdofspernode_dh,"numberofdofspernode");83 fem_sl->FindParam( (void*)&numberofdofspernode_sl,"numberofdofspernode");84 fem_ds->FindParam( (void*)&numberofdofspernode_ds,"numberofdofspernode");82 fem_dh->FindParam(&numberofdofspernode_dh,"numberofdofspernode"); 83 fem_sl->FindParam(&numberofdofspernode_sl,"numberofdofspernode"); 84 fem_ds->FindParam(&numberofdofspernode_ds,"numberofdofspernode"); 85 85 86 86 //for qmu analysis, be sure the velocity input we are starting from is the one in the parameters: */ 87 87 if(qmu_analysis){ 88 model->FindParam(&u_g_initial, "u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());88 model->FindParam(&u_g_initial,NULL,NULL,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 89 89 inputs->Add("velocity",u_g_initial,3,numberofnodes); 90 90 } … … 99 99 100 100 if(verbose)_printf_("%s\n","extruding slopes in 3d..."); 101 FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials, "slopex",0);102 FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials, "slopex",0);101 FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopex",0); 102 FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopex",0); 103 103 } 104 104 … … 112 112 113 113 if(verbose)_printf_("%s\n"," computing pressure according to MacAyeal..."); 114 ComputePressurex( &pg,fem_dhu->elements,fem_dhu->nodes,fem_dhu->loads,fem_dhu->materials, numberofnodes);114 ComputePressurex( &pg,fem_dhu->elements,fem_dhu->nodes,fem_dhu->loads,fem_dhu->materials, fem_dhu->parameters); 115 115 116 116 if(verbose)_printf_("%s\n"," update boundary conditions for macyeal pattyn using hutter results..."); … … 130 130 if(dim==2){ 131 131 if(verbose)_printf_("%s\n"," computing pressure according to MacAyeal..."); 132 ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads, fem_dh->materials, numberofnodes);132 ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads, fem_dh->materials, fem_dh->parameters); 133 133 } 134 134 … … 139 139 140 140 if(verbose)_printf_("%s\n"," extruding horizontal velocities..."); 141 VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->loads,fem_dh->materials, "velocity",1);141 VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->loads,fem_dh->materials,fem_dh->parameters,"velocity",1); 142 142 143 143 if(verbose)_printf_("%s\n"," computing vertical velocities..."); … … 153 153 154 154 if(verbose)_printf_("%s\n"," computing pressure according to Pattyn..."); 155 ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads, fem_dh->materials, numberofnodes);155 ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->loads, fem_dh->materials,fem_dh->parameters); 156 156 157 157 if (isstokes){ … … 163 163 diagnostic_core_linear(&slopex,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum()); 164 164 diagnostic_core_linear(&slopey,fem_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum()); 165 FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials, "slopex",0);166 FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials, "slopey",0);165 FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopex",0); 166 FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopey",0); 167 167 168 168 inputs->Add("bedslopex",slopex,numberofdofspernode_sl,numberofnodes); -
issm/trunk/src/c/parallel/diagnostic_core_linear.cpp
r2330 r2333 31 31 /*Recover parameters: */ 32 32 kflag=1; pflag=1; 33 fem->parameters->FindParam( (void*)&connectivity,"connectivity");34 fem->parameters->FindParam( (void*)&numberofdofspernode,"numberofdofspernode");35 fem->parameters->FindParam( (void*)&verbose,"verbose");36 fem->parameters->FindParam( (void*)&solver_string,"solverstring");33 fem->parameters->FindParam(&connectivity,"connectivity"); 34 fem->parameters->FindParam(&numberofdofspernode,"numberofdofspernode"); 35 fem->parameters->FindParam(&verbose,"verbose"); 36 fem->parameters->FindParam(&solver_string,"solverstring"); 37 37 38 38 /*Update parameters: */ 39 UpdateFromInputsx(fem->elements,fem->nodes,fem->loads, fem->materials, inputs);39 UpdateFromInputsx(fem->elements,fem->nodes,fem->loads, fem->materials,fem->parameters,inputs); 40 40 41 41 //*Generate system matrices 42 42 if (verbose) _printf_(" Generating matrices\n"); 43 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->loads,fem->materials, kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);43 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 44 44 45 45 if (verbose) _printf_(" Generating penalty matrices\n"); 46 46 //*Generate penalty system matrices 47 PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,fem->loads,fem->materials, kflag,pflag,inputs,analysis_type,sub_analysis_type);47 PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type); 48 48 49 49 /*!Reduce matrix from g to f size:*/ -
issm/trunk/src/c/parallel/diagnostic_core_nonlinear.cpp
r2330 r2333 42 42 /*Recover parameters: */ 43 43 kflag=1; pflag=1; 44 fem->FindParam( (void*)&connectivity,"connectivity");45 fem->FindParam( (void*)&numberofdofspernode,"numberofdofspernode");46 fem->FindParam( (void*)&numberofnodes,"numberofnodes");47 fem->FindParam( (void*)&solver_string,"solverstring");44 fem->FindParam(&connectivity,"connectivity"); 45 fem->FindParam(&numberofdofspernode,"numberofdofspernode"); 46 fem->FindParam(&numberofnodes,"numberofnodes"); 47 fem->FindParam(&solver_string,"solverstring"); 48 48 fem->FindParam(&verbose,"verbose"); 49 49 … … 79 79 80 80 /*Update parameters: */ 81 UpdateFromInputsx(fem->elements,fem->nodes,loads, fem->materials, inputs);81 UpdateFromInputsx(fem->elements,fem->nodes,loads, fem->materials,fem->parameters,inputs); 82 82 83 83 if (verbose) _printf_(" Generating matrices\n"); 84 84 //*Generate system matrices 85 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,loads,fem->materials, kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);85 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 86 86 87 87 if (verbose) _printf_(" Generating penalty matrices\n"); 88 88 //*Generate penalty system matrices 89 PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,loads,fem->materials, kflag,pflag,inputs,analysis_type,sub_analysis_type);89 PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type); 90 90 91 91 if (verbose) _printf_(" reducing matrix from g to f set\n"); … … 116 116 if (old_ug) inputs->Add("old_velocity",old_ug,numberofdofspernode,numberofnodes); 117 117 inputs->Add("velocity",ug,numberofdofspernode,numberofnodes); 118 PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,loads,fem->materials, inputs,analysis_type,sub_analysis_type);118 PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,loads,fem->materials,fem->parameters,inputs,analysis_type,sub_analysis_type); 119 119 120 120 if(verbose)_printf_(" number of unstable constraints: %i\n",num_unstable_constraints); … … 149 149 kflag=1; pflag=0; //stiffness generation only 150 150 151 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,loads,fem->materials, kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);151 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 152 152 Reducematrixfromgtofx(&Kff,&Kfs,Kgg,fem->Gmn,fem->nodesets); 153 153 MatFree(&Kgg);VecFree(&pg); -
issm/trunk/src/c/parallel/gradjcompute_core.cpp
r2330 r2333 53 53 /*some parameters:*/ 54 54 femmodel=model->GetActiveFormulation(); 55 femmodel->parameters->FindParam( (void*)&analysis_type,"analysis_type");56 femmodel->parameters->FindParam( (void*)&sub_analysis_type,"sub_analysis_type");57 femmodel->parameters->FindParam( (void*)&control_steady,"control_steady");58 femmodel->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");59 femmodel->parameters->FindParam( (void*)&numberofdofspernode,"numberofdofspernode");60 femmodel->parameters->FindParam( (void*)&solverstring,"solverstring");61 femmodel->parameters->FindParam( (void*)&control_type,"control_type");62 femmodel->parameters->FindParam( (void*)&extrude_param,"extrude_param");63 femmodel->parameters->FindParam( (void*)&verbose,"verbose");64 femmodel->parameters->FindParam( (void*)&dim,"dim");55 femmodel->parameters->FindParam(&analysis_type,"analysis_type"); 56 femmodel->parameters->FindParam(&sub_analysis_type,"sub_analysis_type"); 57 femmodel->parameters->FindParam(&control_steady,"control_steady"); 58 femmodel->parameters->FindParam(&numberofnodes,"numberofnodes"); 59 femmodel->parameters->FindParam(&numberofdofspernode,"numberofdofspernode"); 60 femmodel->parameters->FindParam(&solverstring,"solverstring"); 61 femmodel->parameters->FindParam(&control_type,"control_type"); 62 femmodel->parameters->FindParam(&extrude_param,"extrude_param"); 63 femmodel->parameters->FindParam(&verbose,"verbose"); 64 femmodel->parameters->FindParam(&dim,"dim"); 65 65 66 66 _printf_("%s\n"," recover solution for this stiffness and right hand side:"); … … 70 70 71 71 _printf_("%s\n"," buid Du, difference between observed velocity and model velocity:"); 72 Dux( &du_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials, inputs,analysis_type,sub_analysis_type);72 Dux( &du_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,femmodel->parameters,inputs,analysis_type,sub_analysis_type); 73 73 74 74 _printf_("%s\n"," reduce adjoint load from g-set to f-set:"); … … 88 88 inputs->Add("adjoint",lambda_g_double,numberofdofspernode,numberofnodes); 89 89 90 Gradjx( &grad_g, numberofnodes,femmodel->elements,femmodel->nodes, femmodel->loads, femmodel->materials, 90 Gradjx( &grad_g, numberofnodes,femmodel->elements,femmodel->nodes, femmodel->loads, femmodel->materials,femmodel->parameters, 91 91 inputs,analysis_type,sub_analysis_type,control_type); 92 92 … … 94 94 95 95 _printf_("%s\n"," extruding gradient..."); 96 FieldExtrudex( grad_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials, "gradj",0);96 FieldExtrudex( grad_g, femmodel->elements,femmodel->nodes,femmodel->loads,femmodel->materials,femmodel->parameters,"gradj",0); 97 97 } 98 98 -
issm/trunk/src/c/parallel/objectivefunctionC.cpp
r2217 r2333 65 65 66 66 gsize=femmodel->nodesets->GetGSize(); 67 femmodel->parameters->FindParam( (void*)&optscal,"optscal");68 femmodel->parameters->FindParam( (void*)&mincontrolconstraint,"mincontrolconstraint");69 femmodel->parameters->FindParam( (void*)&maxcontrolconstraint,"maxcontrolconstraint");70 femmodel->parameters->FindParam( (void*)&control_type,"control_type");71 femmodel->parameters->FindParam( (void*)&fit,"fit");72 femmodel->parameters->FindParam( (void*)&analysis_type,"analysis_type");73 femmodel->parameters->FindParam( (void*)&sub_analysis_type,"sub_analysis_type");74 femmodel->parameters->FindParam( (void*)&control_steady,"control_steady");75 femmodel->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");76 femmodel->parameters->FindParam( (void*)&numberofdofspernode,"numberofdofspernode");77 femmodel->parameters->FindParam( (void*)&isstokes,"isstokes");67 femmodel->parameters->FindParam(&optscal,NULL,NULL,"optscal"); 68 femmodel->parameters->FindParam(&fit,NULL,NULL,"fit"); 69 femmodel->parameters->FindParam(&mincontrolconstraint,"mincontrolconstraint"); 70 femmodel->parameters->FindParam(&maxcontrolconstraint,"maxcontrolconstraint"); 71 femmodel->parameters->FindParam(&control_type,"control_type"); 72 femmodel->parameters->FindParam(&analysis_type,"analysis_type"); 73 femmodel->parameters->FindParam(&sub_analysis_type,"sub_analysis_type"); 74 femmodel->parameters->FindParam(&control_steady,"control_steady"); 75 femmodel->parameters->FindParam(&numberofnodes,"numberofnodes"); 76 femmodel->parameters->FindParam(&numberofdofspernode,"numberofdofspernode"); 77 femmodel->parameters->FindParam(&isstokes,"isstokes"); 78 78 79 79 /*First copy param_g so we don't modify it: */ … … 97 97 /*Compute misfit for this velocity field.*/ 98 98 inputs->Add("fit",fit[n]); 99 Misfitx( &J, femmodel->elements,femmodel->nodes, femmodel->loads, femmodel->materials, 100 inputs,analysis_type,sub_analysis_type); 99 Misfitx( &J, femmodel->elements,femmodel->nodes, femmodel->loads, femmodel->materials, femmodel->parameters,inputs,analysis_type,sub_analysis_type); 101 100 102 101 /*Free ressources:*/ -
issm/trunk/src/c/parallel/prognostic.cpp
r2112 r2333 81 81 _printf_("initialize inputs:\n"); 82 82 83 model->FindParam(&u_g_serial, "u_g",PrognosticAnalysisEnum());84 model->FindParam(&h_g_initial, "h_g",PrognosticAnalysisEnum());85 model->FindParam(&melting_g, "m_g",PrognosticAnalysisEnum());86 model->FindParam(&accumulation_g, "a_g",PrognosticAnalysisEnum());83 model->FindParam(&u_g_serial,NULL,NULL,"u_g",PrognosticAnalysisEnum()); 84 model->FindParam(&h_g_initial,NULL,NULL,"h_g",PrognosticAnalysisEnum()); 85 model->FindParam(&melting_g,NULL,NULL,"m_g",PrognosticAnalysisEnum()); 86 model->FindParam(&accumulation_g,NULL,NULL,"a_g",PrognosticAnalysisEnum()); 87 87 model->FindParam(&dt,"dt"); 88 88 model->FindParam(&yts,"yts"); -
issm/trunk/src/c/parallel/prognostic_core.cpp
r2330 r2333 46 46 _printf_("depth averaging velocity...\n"); 47 47 u_g=inputs->Get("velocity",&dofs[0],2); //take (vx,vy) from inputs velocity 48 FieldDepthAveragex( u_g, fem_p->elements,fem_p->nodes, fem_p->loads, fem_p->materials, "velocity");48 FieldDepthAveragex( u_g, fem_p->elements,fem_p->nodes, fem_p->loads, fem_p->materials,fem_p->parameters,"velocity"); 49 49 inputs->Add("velocity_average",u_g,2,numberofnodes); 50 50 … … 53 53 54 54 _printf_("extrude computed thickness on all layers:\n"); 55 FieldExtrudex( h_g, fem_p->elements,fem_p->nodes, fem_p->loads, fem_p->materials, "thickness",0);55 FieldExtrudex( h_g, fem_p->elements,fem_p->nodes, fem_p->loads, fem_p->materials,fem_p->parameters,"thickness",0); 56 56 57 57 /*Plug results into output dataset: */ -
issm/trunk/src/c/parallel/steadystate.cpp
r2268 r2333 99 99 100 100 _printf_("initialize inputs:\n"); 101 model->FindParam(&u_g_initial, "u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());102 model->FindParam(&p_g_initial, "p_g",ThermalAnalysisEnum());101 model->FindParam(&u_g_initial,NULL,NULL,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 102 model->FindParam(&p_g_initial,NULL,NULL,"p_g",ThermalAnalysisEnum()); 103 103 model->FindParam(&dt,"dt"); 104 104 model->FindParam(&numberofnodes,"numberofnodes"); … … 112 112 model->FindParam(&cm_noisedampening,"cm_noisedampening"); 113 113 inputs->Add("cm_noisedampening",cm_noisedampening); 114 model->FindParam(&u_g_obs, "u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());114 model->FindParam(&u_g_obs,NULL,NULL,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 115 115 inputs->Add("velocity_obs",u_g_obs,2,numberofnodes); 116 116 } … … 139 139 fem_ds=model->GetFormulation(DiagnosticAnalysisEnum(),StokesAnalysisEnum()); 140 140 param=(Param*)fem_dh->parameters->FindParamObject("control_steady"); 141 param->Set Integer(1);141 param->SetDouble(1); 142 142 param=(Param*)fem_ds->parameters->FindParamObject("control_steady"); 143 param->Set Integer(1);143 param->SetDouble(1); 144 144 /*run control analysis: */ 145 145 _printf_("call computational core:\n"); -
issm/trunk/src/c/parallel/steadystate_core.cpp
r2330 r2333 95 95 //compute depth averaged temperature and add to inputs 96 96 VecDuplicatePatch(&t_g_average,t_g); 97 FieldDepthAveragex( t_g_average, fem_t->elements,fem_t->nodes, fem_t->loads, fem_t->materials, "temperature");97 FieldDepthAveragex( t_g_average, fem_t->elements,fem_t->nodes, fem_t->loads, fem_t->materials,fem_t->parameters,"temperature"); 98 98 inputs->Add("temperature_average",t_g_average,1,numberofnodes); 99 99 inputs->Add("temperature",t_g,1,numberofnodes); -
issm/trunk/src/c/parallel/thermal.cpp
r2112 r2333 78 78 79 79 _printf_("initialize inputs:\n"); 80 model->FindParam(&u_g, "u_g",ThermalAnalysisEnum());81 model->FindParam(&p_g, "p_g",ThermalAnalysisEnum());80 model->FindParam(&u_g,NULL,NULL,"u_g",ThermalAnalysisEnum()); 81 model->FindParam(&p_g,NULL,NULL,"p_g",ThermalAnalysisEnum()); 82 82 model->FindParam(&numberofnodes,"numberofnodes"); 83 83 model->FindParam(&dt,"dt"); -
issm/trunk/src/c/parallel/thermal_core.cpp
r2330 r2333 52 52 53 53 //first recover parameters common to all solutions 54 fem_t->FindParam( (void*)&numberofnodes,"numberofnodes");55 fem_t->FindParam( (void*)&sub_analysis_type,"sub_analysis_type");56 fem_t->FindParam( (void*)&verbose,"verbose");57 fem_t->FindParam( (void*)&ndt,"ndt");58 fem_t->FindParam( (void*)&dt,"dt");54 fem_t->FindParam(&numberofnodes,"numberofnodes"); 55 fem_t->FindParam(&sub_analysis_type,"sub_analysis_type"); 56 fem_t->FindParam(&verbose,"verbose"); 57 fem_t->FindParam(&ndt,"ndt"); 58 fem_t->FindParam(&dt,"dt"); 59 59 60 60 if(dt==0){ … … 86 86 87 87 //initialize temperature and melting 88 fem_t->FindParam( (void*)&t_g_serial,"t_g");88 fem_t->FindParam(&t_g_serial,NULL,NULL,"t_g"); 89 89 t_g[0]=SerialToVec(t_g_serial,numberofnodes); 90 90 xfree((void**)&t_g_serial); 91 fem_m->FindParam( (void*)&m_g_serial,"m_g");91 fem_m->FindParam(&m_g_serial,NULL,NULL,"m_g"); 92 92 m_g[0]=SerialToVec(m_g_serial,numberofnodes); 93 93 xfree((void**)&m_g_serial); -
issm/trunk/src/c/parallel/thermal_core_nonlinear.cpp
r2330 r2333 44 44 kflag=1; pflag=1; 45 45 46 fem->parameters->FindParam( (void*)&connectivity,"connectivity");47 fem->parameters->FindParam( (void*)&numberofdofspernode,"numberofdofspernode");48 fem->parameters->FindParam( (void*)&numberofnodes,"numberofnodes");49 fem->parameters->FindParam( (void*)&solver_string,"solverstring");50 fem->parameters->FindParam( (void*)&verbose,"verbose");51 fem->parameters->FindParam( (void*)&lowmem,"lowmem");52 fem->parameters->FindParam( (void*)&min_thermal_constraints,"min_thermal_constraints");46 fem->parameters->FindParam(&connectivity,"connectivity"); 47 fem->parameters->FindParam(&numberofdofspernode,"numberofdofspernode"); 48 fem->parameters->FindParam(&numberofnodes,"numberofnodes"); 49 fem->parameters->FindParam(&solver_string,"solverstring"); 50 fem->parameters->FindParam(&verbose,"verbose"); 51 fem->parameters->FindParam(&lowmem,"lowmem"); 52 fem->parameters->FindParam(&min_thermal_constraints,"min_thermal_constraints"); 53 53 54 54 count=1; … … 63 63 64 64 /*Update parameters: */ 65 UpdateFromInputsx(fem->elements,fem->nodes,fem->loads, fem->materials, inputs);65 UpdateFromInputsx(fem->elements,fem->nodes,fem->loads, fem->materials,fem->parameters,inputs); 66 66 67 67 //*Generate system matrices … … 70 70 /*Compute Kgg_nopenalty and pg_nopenalty once for all: */ 71 71 if (count==1){ 72 SystemMatricesx(&Kgg_nopenalty, &pg_nopenalty,fem->elements,fem->nodes,fem->loads,fem->materials, kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);72 SystemMatricesx(&Kgg_nopenalty, &pg_nopenalty,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 73 73 } 74 74 … … 78 78 79 79 //apply penalties each time 80 PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->loads,fem->materials, kflag,pflag,inputs,analysis_type,sub_analysis_type);80 PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type); 81 81 } 82 82 else{ 83 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->loads,fem->materials, kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);83 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 84 84 //apply penalties 85 PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->loads,fem->materials, kflag,pflag,inputs,analysis_type,sub_analysis_type);85 PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type); 86 86 } 87 87 … … 117 117 inputs->Add("temperature",tg,numberofdofspernode,numberofnodes); 118 118 119 PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->loads,fem->materials, inputs,analysis_type,sub_analysis_type);119 PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->loads,fem->materials,fem->parameters,inputs,analysis_type,sub_analysis_type); 120 120 121 121 if (!converged){ -
issm/trunk/src/c/parallel/transient.cpp
r2113 r2333 102 102 103 103 _printf_("initialize inputs:\n"); 104 model->FindParam(&u_g, "u_g",PrognosticAnalysisEnum());105 model->FindParam(&m_g, "m_g",PrognosticAnalysisEnum());106 model->FindParam(&a_g, "a_g",PrognosticAnalysisEnum());104 model->FindParam(&u_g,NULL,NULL,"u_g",PrognosticAnalysisEnum()); 105 model->FindParam(&m_g,NULL,NULL,"m_g",PrognosticAnalysisEnum()); 106 model->FindParam(&a_g,NULL,NULL,"a_g",PrognosticAnalysisEnum()); 107 107 model->FindParam(&numberofnodes,"numberofnodes"); 108 108 model->FindParam(&dt,"dt"); -
issm/trunk/src/c/parallel/transient_core_2d.cpp
r2330 r2333 84 84 time=0; 85 85 86 fem_p->parameters->FindParam( (void*)&u_g_serial3d,"u_g");86 fem_p->parameters->FindParam(&u_g_serial3d,NULL,NULL,"u_g"); 87 87 u_g_serial=(double*)xmalloc(2*numberofnodes*sizeof(double)); 88 88 for(i=0;i<numberofnodes;i++){ … … 92 92 u_g=SerialToVec(u_g_serial,2*numberofnodes); xfree((void**)&u_g_serial); 93 93 94 fem_p->parameters->FindParam( (void*)&h_g_serial,"h_g");94 fem_p->parameters->FindParam(&h_g_serial,NULL,NULL,"h_g"); 95 95 h_g=SerialToVec(h_g_serial,1*numberofnodes); xfree((void**)&h_g_serial); 96 96 97 fem_p->parameters->FindParam( (void*)&s_g_serial,"s_g");97 fem_p->parameters->FindParam(&s_g_serial,NULL,NULL,"s_g"); 98 98 s_g=SerialToVec(s_g_serial,1*numberofnodes); xfree((void**)&s_g_serial); 99 99 100 fem_p->parameters->FindParam( (void*)&b_g_serial,"b_g");100 fem_p->parameters->FindParam(&b_g_serial,NULL,NULL,"b_g"); 101 101 b_g=SerialToVec(b_g_serial,1*numberofnodes); xfree((void**)&b_g_serial); 102 102 … … 143 143 //update surface and bed using the new thickness 144 144 _printf_(" updating geometry\n"); 145 UpdateGeometryx(&new_h_g,&new_b_g,&new_s_g, 146 fem_p->elements, fem_p->nodes,fem_p->loads, fem_p->materials, 147 h_g_intermediary,b_g,s_g); 145 UpdateGeometryx(&new_h_g,&new_b_g,&new_s_g, fem_p->elements, fem_p->nodes,fem_p->loads, fem_p->materials, fem_p->parameters,h_g_intermediary,b_g,s_g); 148 146 149 147 VecFree(&h_g);h_g=new_h_g; -
issm/trunk/src/c/parallel/transient_core_3d.cpp
r2330 r2333 90 90 time=0; 91 91 92 fem_p->parameters->FindParam( (void*)&u_g_serial,"u_g");92 fem_p->parameters->FindParam(&u_g_serial,NULL,NULL,"u_g"); 93 93 u_g=SerialToVec(u_g_serial,3*numberofnodes); xfree((void**)&u_g_serial); 94 94 95 fem_p->parameters->FindParam( (void*)&p_g_serial,"p_g");95 fem_p->parameters->FindParam(&p_g_serial,NULL,NULL,"p_g"); 96 96 p_g=SerialToVec(p_g_serial,1*numberofnodes); xfree((void**)&p_g_serial); 97 97 98 fem_p->parameters->FindParam( (void*)&h_g_serial,"h_g");98 fem_p->parameters->FindParam(&h_g_serial,NULL,NULL,"h_g"); 99 99 h_g=SerialToVec(h_g_serial,1*numberofnodes); xfree((void**)&h_g_serial); 100 100 101 fem_p->parameters->FindParam( (void*)&s_g_serial,"s_g");101 fem_p->parameters->FindParam(&s_g_serial,NULL,NULL,"s_g"); 102 102 s_g=SerialToVec(s_g_serial,1*numberofnodes); xfree((void**)&s_g_serial); 103 103 104 fem_p->parameters->FindParam( (void*)&b_g_serial,"b_g");104 fem_p->parameters->FindParam(&b_g_serial,NULL,NULL,"b_g"); 105 105 b_g=SerialToVec(b_g_serial,1*numberofnodes); xfree((void**)&b_g_serial); 106 106 107 fem_p->parameters->FindParam( (void*)&t_g_serial,"t_g");107 fem_p->parameters->FindParam(&t_g_serial,NULL,NULL,"t_g"); 108 108 t_g=SerialToVec(t_g_serial,1*numberofnodes); xfree((void**)&t_g_serial); 109 109 110 fem_p->parameters->FindParam( (void*)&m_g_serial,"m_g");110 fem_p->parameters->FindParam(&m_g_serial,NULL,NULL,"m_g"); 111 111 m_g=SerialToVec(m_g_serial,1*numberofnodes); xfree((void**)&m_g_serial); 112 112 … … 146 146 if(verbose)_printf_("%s\n","computing depth average temperature"); 147 147 VecDuplicatePatch(&t_g_average,t_g); 148 FieldDepthAveragex( t_g_average, fem_t->elements,fem_t->nodes, fem_t->loads, fem_t->materials, "temperature");148 FieldDepthAveragex( t_g_average, fem_t->elements,fem_t->nodes, fem_t->loads, fem_t->materials,fem_t->parameters,"temperature"); 149 149 inputs->Add("temperature_average",t_g_average,1,numberofnodes); 150 150 VecFree(&t_g_average); //not needed anymore … … 171 171 //update surface and bed using the new thickness 172 172 if(verbose)_printf_(" updating geometry\n"); 173 UpdateGeometryx(&h_g,&b_g,&s_g, 174 fem_p->elements, fem_p->nodes,fem_p->loads, fem_p->materials, 175 h_g_intermediary,b_g,s_g); 173 UpdateGeometryx(&h_g,&b_g,&s_g, fem_p->elements, fem_p->nodes,fem_p->loads, fem_p->materials, fem_p->parameters,h_g_intermediary,b_g,s_g); 176 174 VecFree(&h_g_intermediary); 177 175 178 176 if(verbose)_printf_("%s\n","updating node positions"); 179 UpdateNodePositionsx( fem_dh->elements,fem_dh->nodes,fem_dh->loads,fem_dh->materials, h_g,b_g);180 UpdateNodePositionsx( fem_dv->elements,fem_dv->nodes,fem_dv->loads,fem_dv->materials, h_g,b_g);181 UpdateNodePositionsx( fem_dhu->elements,fem_dhu->nodes,fem_dhu->loads,fem_dhu->materials, h_g,b_g);182 UpdateNodePositionsx( fem_ds->elements,fem_ds->nodes,fem_ds->loads,fem_ds->materials, h_g,b_g);183 UpdateNodePositionsx( fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials, h_g,b_g);184 UpdateNodePositionsx( fem_p->elements,fem_p->nodes,fem_p->loads,fem_p->materials, h_g,b_g);185 UpdateNodePositionsx( fem_t->elements,fem_t->nodes,fem_t->loads,fem_t->materials, h_g,b_g);186 UpdateNodePositionsx( fem_m->elements,fem_m->nodes,fem_m->loads,fem_m->materials, h_g,b_g);177 UpdateNodePositionsx( fem_dh->elements,fem_dh->nodes,fem_dh->loads,fem_dh->materials,fem_dh->parameters,h_g,b_g); 178 UpdateNodePositionsx( fem_dv->elements,fem_dv->nodes,fem_dv->loads,fem_dv->materials,fem_dv->parameters,h_g,b_g); 179 UpdateNodePositionsx( fem_dhu->elements,fem_dhu->nodes,fem_dhu->loads,fem_dhu->materials,fem_dhu->parameters,h_g,b_g); 180 UpdateNodePositionsx( fem_ds->elements,fem_ds->nodes,fem_ds->loads,fem_ds->materials,fem_ds->parameters,h_g,b_g); 181 UpdateNodePositionsx( fem_sl->elements,fem_sl->nodes,fem_sl->loads,fem_sl->materials,fem_sl->parameters,h_g,b_g); 182 UpdateNodePositionsx( fem_p->elements,fem_p->nodes,fem_p->loads,fem_p->materials,fem_p->parameters,h_g,b_g); 183 UpdateNodePositionsx( fem_t->elements,fem_t->nodes,fem_t->loads,fem_t->materials,fem_t->parameters,h_g,b_g); 184 UpdateNodePositionsx( fem_m->elements,fem_m->nodes,fem_m->loads,fem_m->materials,fem_m->parameters,h_g,b_g); 187 185 188 186 //plug into results. -
issm/trunk/src/m/classes/public/plot/applyoptions.m
r2307 r2333 73 73 %Basinzoom 74 74 if ~isnan(options_structure.basinzoom), 75 basinzoom(options_structure.basinzoom); 76 end 75 basinzoom(options_structure.basinzoom,options_structure.unitmultiplier); end 77 76 78 77 %Caxis -
issm/trunk/src/m/solutions/cielo/ControlInitialization.m
r2330 r2333 27 27 slopex=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum()); 28 28 slopey=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum()); 29 slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials, slopex,'slopex',0);30 slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials, slopey,'slopey',0);29 slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopex,'slopex',0); 30 slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopey,'slopey',0); 31 31 32 32 %Add to inputs … … 40 40 u_g=diagnostic_core_nonlinear(m_dh,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 41 41 displaystring(verbose,'\n%s',['extruding horizontal velocities...']); 42 u_g_horiz=FieldExtrude(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials, u_g,'velocity',1);42 u_g_horiz=FieldExtrude(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,m_dh.parameters,u_g,'velocity',1); 43 43 44 44 %vertical velocities -
issm/trunk/src/m/solutions/cielo/CreateFemModel.m
r2330 r2333 9 9 10 10 displaystring(md.verbose,'\n reading data from model %s...',md.name); 11 [m.elements,m.nodes,m.constraints,m.loads,m.materials, parameters]=ModelProcessor(md);11 [m.elements,m.nodes,m.constraints,m.loads,m.materials,m.parameters]=ModelProcessor(md); 12 12 13 13 displaystring(md.verbose,'%s',' generating degrees of freedom...'); 14 [m.nodes,m.part,m.tpart]=Dof(m.elements,m.nodes, parameters);14 [m.nodes,m.part,m.tpart]=Dof(m.elements,m.nodes,m.parameters); 15 15 16 16 displaystring(md.verbose,'%s',' generating single point constraints...'); … … 30 30 31 31 displaystring(md.verbose,'%s',' configuring element and loads...'); 32 [m.elements,m.loads,m.nodes ] = ConfigureObjects( m.elements, m.loads, m.nodes, m.materials);32 [m.elements,m.loads,m.nodes,m.parameters] = ConfigureObjects( m.elements, m.loads, m.nodes, m.materials,m.parameters); 33 33 34 34 displaystring(md.verbose,'%s',' processing parameters...'); 35 parameters= ProcessParams(parameters,m.part.vector); 36 37 displaystring(md.verbose,'%s',' creating parameters in matlab workspace...'); 38 m.parameters= ParamsToWorkspace(parameters); 39 40 %Get rid of parameters dataset. 41 clear parameters; 35 m.parameters= ProcessParams(m.parameters,m.part.vector); 42 36 43 37 end -
issm/trunk/src/m/solutions/cielo/control_core.m
r2330 r2333 45 45 46 46 %Update inputs in datasets 47 [model.elements,model.nodes,model.loads,model.materials ]=UpdateFromInputs(model.elements,model.nodes,model.loads,model.materials,inputs);47 [model.elements,model.nodes,model.loads,model.materials,model.parameters]=UpdateFromInputs(model.elements,model.nodes,model.loads,model.materials,model.parameters,inputs); 48 48 49 49 displaystring(verbose,'\n%s',[' computing gradJ...']); -
issm/trunk/src/m/solutions/cielo/diagnostic.m
r2330 r2333 5 5 % md=diagnostic(md) 6 6 % 7 8 7 %timing 9 8 t1=clock; … … 11 10 %Build all models requested for diagnostic simulation 12 11 models.analysis_type=DiagnosticAnalysisEnum; %needed for processresults 13 12 14 13 displaystring(md.verbose,'%s',['reading diagnostic horiz model data']); 15 14 md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=HorizAnalysisEnum; models.dh=CreateFemModel(md); 16 15 17 16 displaystring(md.verbose,'\n%s',['reading diagnostic vert model data']); 18 17 md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=VertAnalysisEnum; models.dv=CreateFemModel(md); -
issm/trunk/src/m/solutions/cielo/diagnostic_core.m
r2330 r2333 21 21 numrifts=m_dhu.parameters.numrifts; 22 22 23 debug=1; 24 23 25 if ishutter, 24 26 … … 29 31 if dim==3, 30 32 displaystring(verbose,'\n%s',['extruding slopes in 3d...']); 31 slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials, slopex,'slopex',0);32 slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials, slopey,'slopey',0);33 slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopex,'slopex',0); 34 slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopey,'slopey',0); 33 35 end 34 36 … … 63 65 64 66 displaystring(verbose,'\n%s',['extruding horizontal velocities...']); 65 u_g_horiz=FieldExtrude(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials, u_g,'velocity',1);67 u_g_horiz=FieldExtrude(m_dh.elements,m_dh.nodes,m_dh.loads,m_dh.materials,m_dh.parameters,u_g,'velocity',1); 66 68 67 69 displaystring(verbose,'\n%s',['computing vertical velocities...']); … … 85 87 slopex=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedXAnalysisEnum()); 86 88 slopey=diagnostic_core_linear(m_sl,inputs,SlopeComputeAnalysisEnum(),BedYAnalysisEnum()); 87 slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials, slopex,'slopex',0);88 slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials, slopey,'slopey',0);89 slopex=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopex,'slopex',0); 90 slopey=FieldExtrude(m_sl.elements,m_sl.nodes,m_sl.loads,m_sl.materials,m_sl.parameters,slopey,'slopey',0); 89 91 90 92 inputs=add(inputs,'bedslopex',slopex,'doublevec',m_sl.parameters.numberofdofspernode,m_sl.parameters.numberofnodes); -
issm/trunk/src/m/solutions/cielo/diagnostic_core_linear.m
r2330 r2333 9 9 10 10 %Update inputs in datasets 11 [m.elements,m.nodes, m.loads,m.materials ]=UpdateFromInputs(m.elements,m.nodes, m.loads,m.materials,inputs);11 [m.elements,m.nodes, m.loads,m.materials,m.parameters]=UpdateFromInputs(m.elements,m.nodes, m.loads,m.materials,m.parameters,inputs); 12 12 13 13 %system matrices -
issm/trunk/src/m/solutions/cielo/diagnostic_core_nonlinear.m
r2330 r2333 26 26 inputs=add(inputs,'old_velocity',soln(count).u_g,'doublevec',m.parameters.numberofdofspernode,m.parameters.numberofnodes); 27 27 end 28 28 29 29 %Update inputs in datasets 30 [m.elements,m.nodes, loads,m.materials ]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,inputs);30 [m.elements,m.nodes, loads,m.materials,m.parameters]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,m.parameters,inputs); 31 31 32 32 %system matrices 33 33 [K_gg_nopenalty , p_g_nopenalty]=SystemMatrices(m.elements,m.nodes,loads,m.materials,m.parameters,inputs,analysis_type,sub_analysis_type); 34 34 35 35 %penalties 36 36 [K_gg , p_g, kmax]=PenaltySystemMatrices(K_gg_nopenalty,p_g_nopenalty,m.elements,m.nodes,loads,m.materials,m.parameters,inputs,analysis_type,sub_analysis_type); … … 41 41 %Reduce load from g size to f size 42 42 [p_f] = Reduceloadfromgtof( p_g, m.Gmn, K_fs, m.ys, m.nodesets); 43 43 44 44 %Increment index 45 45 count=count+1; 46 46 47 47 %Solve 48 48 [soln(count).u_f]=Solver(K_ff,p_f,[],m.parameters); 49 49 50 50 %Merge back to g set 51 51 [soln(count).u_g]= Mergesolutionfromftog( soln(count).u_f, m.Gmn, m.ys, m.nodesets ); 52 52 53 53 %Deal with penalty loads 54 54 inputs=add(inputs,'velocity',soln(count).u_g,'doublevec',m.parameters.numberofdofspernode,m.parameters.numberofnodes); 55 55 56 56 %penalty constraints 57 57 [loads,constraints_converged,num_unstable_constraints] =PenaltyConstraints( m.elements,m.nodes, loads, m.materials,m.parameters,inputs,analysis_type,sub_analysis_type); 58 58 59 59 displaystring(m.parameters.verbose,'%s%i',' number of unstable constraints: ',num_unstable_constraints); 60 60 61 61 %Figure out if convergence have been reached 62 62 converged=convergence(K_ff,p_f,soln(count).u_f,soln(count-1).u_f,m.parameters); -
issm/trunk/src/m/solutions/cielo/gradjcompute_core.m
r2330 r2333 39 39 if (dim==3 & extrude_param), 40 40 displaystring(verbose,'%s',' extruding gradient...'); 41 grad_g=FieldExtrude(m.elements,m.nodes,m.loads,m.materials, grad_g,'gradj',0);41 grad_g=FieldExtrude(m.elements,m.nodes,m.loads,m.materials,m.parameters,grad_g,'gradj',0); 42 42 end 43 43 -
issm/trunk/src/m/solutions/cielo/prognostic_core.m
r2330 r2333 13 13 %Take only the first two dofs of m.parameters.u_g 14 14 u_g=get(inputs,'velocity',[1 1 0 0]); 15 u_g=FieldDepthAverage(m.elements,m.nodes,m.loads,m.materials, u_g,'velocity');15 u_g=FieldDepthAverage(m.elements,m.nodes,m.loads,m.materials,m.parameters,u_g,'velocity'); 16 16 inputs=add(inputs,'velocity_average',u_g,'doublevec',2,m.parameters.numberofnodes); 17 17 … … 20 20 21 21 displaystring(m.parameters.verbose,'\n%s',['extrude computed thickness on all layers:']); 22 results.h_g=FieldExtrude(m.elements,m.nodes,m.loads,m.materials, results.h_g,'thickness',0);22 results.h_g=FieldExtrude(m.elements,m.nodes,m.loads,m.materials,m.parameters,results.h_g,'thickness',0); 23 23 24 24 end %end function -
issm/trunk/src/m/solutions/cielo/steadystate_core.m
r2330 r2333 46 46 %add temperature to inputs. 47 47 %Compute depth averaged temperature 48 temperature_average=FieldDepthAverage(m_t.elements,m_t.nodes,m_t.loads,m_t.materials, results_thermal.t_g,'temperature');48 temperature_average=FieldDepthAverage(m_t.elements,m_t.nodes,m_t.loads,m_t.materials,m_t.parameters,results_thermal.t_g,'temperature'); 49 49 inputs=add(inputs,'temperature_average',temperature_average,'doublevec',1,m_t.parameters.numberofnodes); 50 50 inputs=add(inputs,'temperature',results_thermal.t_g,'doublevec',1,m_t.parameters.numberofnodes); -
issm/trunk/src/m/solutions/cielo/thermal_core_nonlinear.m
r2330 r2333 23 23 24 24 %Update inputs in datasets 25 [m.elements,m.nodes, loads,m.materials ]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,inputs);25 [m.elements,m.nodes, loads,m.materials,m.parameters]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,m.parameters,inputs); 26 26 27 27 %system matrices … … 57 57 inputs=add(inputs,'temperature',t_g,'doublevec',m.parameters.numberofdofspernode,m.parameters.numberofnodes); 58 58 displaystring(m.parameters.verbose,'%s',[' update inputs']); 59 [m.elements,m.nodes, loads,m.materials ]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,inputs);59 [m.elements,m.nodes, loads,m.materials,m.parameters]=UpdateFromInputs(m.elements,m.nodes, loads,m.materials,m.parameters,inputs); 60 60 61 61 %penalty constraints -
issm/trunk/src/m/solutions/cielo/transient3d.m
r2330 r2333 93 93 94 94 %Compute depth averaged temperature 95 temperature_average=FieldDepthAverage(models.t.elements,models.t.nodes,models.t.loads,models.t.materials, results(n+1).t_g,'temperature');95 temperature_average=FieldDepthAverage(models.t.elements,models.t.nodes,models.t.loads,models.t.materials,models.t.parameters,results(n+1).t_g,'temperature'); 96 96 inputs=add(inputs,'temperature_average',temperature_average,'doublevec',1,models.t.parameters.numberofnodes); 97 97 -
issm/trunk/src/m/utils/Nightly/nightlyrun.m
r2189 r2333 3 3 % 4 4 % This function goes to each directory of 'tests/Verifications' and 5 % launch the nightly tests. A list of option can be given in input:5 % launches the nightly tests. A list of option can be given in input: 6 6 % o analysis_type: cell containing all the analysis that the user wants to run 7 7 % o sub_analysis_type: cell containing all the sub_analysis that the user wants to run -
issm/trunk/src/m/utils/Plot/basinzoom.m
r2308 r2333 1 function varargout=basinzoom(region )1 function varargout=basinzoom(region,unitmultiplier) 2 2 %ANTZOOM - zoom on a basin in Antarctica or Greenland. 3 3 % … … 45 45 %do nothing; 46 46 end 47 end 48 49 if ~isnan(unitmultiplier) 50 x0=x0*unitmultiplier; 51 x1=x1*unitmultiplier; 52 y0=y0*unitmultiplier; 53 y1=y1*unitmultiplier; 47 54 end 48 55 … … 112 119 regions=AddAvailableRegion(regions,'icestreams',-1.2274*10^6,-.137*10^6,-1.1172*10^6,-.138*10^6); 113 120 regions=AddAvailableRegion(regions,'icestreamE',2.2*10^6,2.7*10^6,0,5*10^5); 121 regions=AddAvailableRegion(regions,'jakobshavn',-4.6*10^5,-3*10^5,-2.4*10^6,-2.1*10^6); 114 122 regions=AddAvailableRegion(regions,'larseniceshelf',-2.3855*10^6,-1.9649*10^6,0.9498*10^6,1.2996*10^6); 115 123 regions=AddAvailableRegion(regions,'mcmurdo',1.3750*10^5,4.8255*10^5,-1.4569*10^6,-1.1119*10^6); -
issm/trunk/src/mex/BuildNodeSets/BuildNodeSets.cpp
r1 r2333 24 24 25 25 /*Input datasets: */ 26 FetchData( (void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);26 FetchData(&nodes,NODES); 27 27 28 28 /*!Generate internal degree of freedom numbers: */ -
issm/trunk/src/mex/ComputePressure/ComputePressure.cpp
r2316 r2333 15 15 DataSet* loads=NULL; 16 16 DataSet* materials=NULL; 17 DataSet* parameters=NULL; 17 18 ParameterInputs* inputs=NULL; 18 19 int numberofnodes; … … 28 29 29 30 /*Input datasets: */ 30 FetchData( (void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);31 FetchData( (void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);32 FetchData( (void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);33 FetchData( (void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);34 Fetch Data((void**)&numberofnodes,NULL,NULL,mxGetField(PARAMS,0,"numberofnodes"),"Integer",NULL);31 FetchData(&elements,ELEMENTS); 32 FetchData(&nodes,NODES); 33 FetchData(&loads,LOADS); 34 FetchData(&materials,MATERIALS); 35 FetchParams(¶meters,PARAMETERS); 35 36 36 37 /*!Generate internal degree of freedom numbers: */ … … 39 40 inputs->Init(INPUTS); 40 41 41 UpdateFromInputsx(elements,nodes,loads, materials, inputs);42 UpdateFromInputsx(elements,nodes,loads, materials,parameters,inputs); 42 43 43 44 /*!Generate internal degree of freedom numbers: */ 44 ComputePressurex(&p_g, elements,nodes,loads,materials, numberofnodes);45 ComputePressurex(&p_g, elements,nodes,loads,materials,parameters); 45 46 46 47 /*write output datasets: */ … … 52 53 delete materials; 53 54 delete loads; 55 delete parameters; 54 56 delete inputs; 55 57 VecFree(&p_g); -
issm/trunk/src/mex/ComputePressure/ComputePressure.h
r1042 r2333 21 21 #define LOADS (mxArray*)prhs[2] 22 22 #define MATERIALS (mxArray*)prhs[3] 23 #define PARAM S (mxArray*)prhs[4]23 #define PARAMETERS (mxArray*)prhs[4] 24 24 #define INPUTS (mxArray*)prhs[5] 25 25 -
issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.cpp
r2316 r2333 15 15 DataSet* nodes=NULL; 16 16 DataSet* materials=NULL; 17 DataSet* parameters=NULL; 17 18 18 19 /* output datasets: elements and loads*/ … … 25 26 26 27 /*Input datasets: */ 27 FetchData((void**)&elements,NULL,NULL,ELEMENTSIN,"DataSet",NULL); 28 FetchData((void**)&loads,NULL,NULL,LOADSIN,"DataSet",NULL); 29 FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL); 30 FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL); 28 FetchData(&elements,ELEMENTSIN); 29 FetchData(&loads,LOADSIN); 30 FetchData(&nodes,NODES); 31 FetchData(&materials,MATERIALS); 32 FetchData(¶meters,PARAMETERS); 31 33 32 34 /*!Configure objects:*/ 33 ConfigureObjectsx(elements, loads, nodes, materials );35 ConfigureObjectsx(elements, loads, nodes, materials,parameters); 34 36 35 37 /*write output datasets: */ … … 37 39 WriteData(LOADS,loads); 38 40 WriteData(NODESOUT,nodes); 41 WriteData(PARAMETERSOUT,parameters); 39 42 40 43 /*Free ressources: */ … … 43 46 delete nodes; 44 47 delete materials; 48 delete parameters; 45 49 46 50 /*end module: */ … … 51 55 { 52 56 _printf_("\n"); 53 _printf_(" usage: [elements,loads, nodes ] = %s(elements,loads,nodes, materials);\n",__FUNCT__);57 _printf_(" usage: [elements,loads, nodes,parameters] = %s(elements,loads,nodes, materials,parameters);\n",__FUNCT__); 54 58 _printf_("\n"); 55 59 } -
issm/trunk/src/mex/ConfigureObjects/ConfigureObjects.h
r103 r2333 21 21 #define NODES (mxArray*)prhs[2] 22 22 #define MATERIALS (mxArray*)prhs[3] 23 #define PARAMETERS (mxArray*)prhs[4] 23 24 24 25 /* serial output macros: */ … … 26 27 #define LOADS (mxArray**)&plhs[1] 27 28 #define NODESOUT (mxArray**)&plhs[2] 29 #define PARAMETERSOUT (mxArray**)&plhs[3] 28 30 29 31 /* serial arg counts: */ 30 32 #undef NLHS 31 #define NLHS 333 #define NLHS 4 32 34 #undef NRHS 33 #define NRHS 435 #define NRHS 5 34 36 35 37 -
issm/trunk/src/mex/ContourToMesh/ContourToMesh.cpp
r2316 r2333 59 59 60 60 /*Fetch inputs: */ 61 FetchData( (void**)&index,&nel,NULL,INDEXHANDLE,"Matrix","Mat");62 FetchData( (void**)&x,&nods,NULL,XHANDLE,"Matrix","Mat");63 FetchData( (void**)&y,NULL,NULL,YHANDLE,"Matrix","Mat");64 FetchData( (void**)&edgevalue,NULL,NULL,EDGEVALUEHANDLE,"Integer",NULL);61 FetchData(&index,&nel,NULL,INDEXHANDLE); 62 FetchData(&x,&nods,NULL,XHANDLE); 63 FetchData(&y,NULL,NULL,YHANDLE); 64 FetchData(&edgevalue,EDGEVALUEHANDLE); 65 65 66 66 /*Recover list of contours from the 'contours' structure: */ … … 94 94 95 95 /*Recover interptype: */ 96 FetchData( (void**)&interptype,NULL,NULL,INTERPTYPEHANDLE,"String",NULL);96 FetchData(&interptype,INTERPTYPEHANDLE); 97 97 98 98 /*Run interpolation routine: */ -
issm/trunk/src/mex/ContourToNodes/ContourToNodes.cpp
r2316 r2333 53 53 54 54 /*Fetch inputs: */ 55 FetchData( (void**)&x,&nods,NULL,XHANDLE,"Matrix","Mat");56 FetchData( (void**)&y,NULL,NULL,YHANDLE,"Matrix","Mat");57 FetchData( (void**)&edgevalue,NULL,NULL,EDGEVALUEHANDLE,"Integer",NULL);55 FetchData(&x,&nods,NULL,XHANDLE); 56 FetchData(&y,NULL,NULL,YHANDLE); 57 FetchData(&edgevalue,EDGEVALUEHANDLE); 58 58 59 59 /*Recover list of contours from the 'contours' structure: */ -
issm/trunk/src/mex/ControlConstrain/ControlConstrain.cpp
r2316 r2333 16 16 char* control_type=NULL; 17 17 int gsize; 18 DataSet* parameters=NULL; 18 19 19 20 /*Boot module: */ … … 24 25 25 26 /*Input datasets: */ 26 FetchData((void**)&p_g,&gsize,NULL,PG,"Vector","Vec"); 27 FetchData((void**)&mincontrolconstraint,NULL,NULL,mxGetField(PARAMETERS,0,"mincontrolconstraint"),"Scalar",NULL); 28 FetchData((void**)&maxcontrolconstraint,NULL,NULL,mxGetField(PARAMETERS,0,"maxcontrolconstraint"),"Scalar",NULL); 29 FetchData((void**)&control_type,NULL,NULL,mxGetField(PARAMETERS,0,"control_type"),"String",NULL); 27 FetchData(&p_g,&gsize,PG); 28 FetchParams(¶meters,PARAMETERS); 29 30 parameters->FindParam(&mincontrolconstraint,"mincontrolconstraint"); 31 parameters->FindParam(&maxcontrolconstraint,"maxcontrolconstraint"); 32 parameters->FindParam(&control_type,"control_type"); 30 33 31 34 /*!Call core code: */ … … 37 40 /*Free ressources: */ 38 41 xfree((void**)&control_type); 42 delete parameters; 39 43 40 44 /*end module: */ -
issm/trunk/src/mex/ControlOptimization/ControlOptimization.cpp
r2316 r2333 38 38 39 39 /*Input datasets: */ 40 FetchData( (void**)&function_name,NULL,NULL,FUNCTIONNAME,"String",NULL);41 FetchData( (void**)&xmin,NULL,NULL,XMIN,"Scalar",NULL);42 FetchData( (void**)&xmax,NULL,NULL,XMAX,"Scalar",NULL);43 FetchData( (void**)&tolerance,NULL,NULL,mxGetField(OPTIONS,0,"TolX"),"Scalar",NULL);44 FetchData( (void**)&maxiter,NULL,NULL,mxGetField(OPTIONS,0,"MaxIter"),"Integer",NULL);40 FetchData(&function_name,FUNCTIONNAME); 41 FetchData(&xmin,XMIN); 42 FetchData(&xmax,XMAX); 43 FetchData(&tolerance,mxGetField(OPTIONS,0,"TolX")); 44 FetchData(&maxiter,mxGetField(OPTIONS,0,"MaxIter")); 45 45 46 46 /*Parameters: */ 47 FetchData( (void**)&cm_jump,NULL,NULL,mxGetField(PARAMETERS,0,"cm_jump"),"Matrix","Mat");48 FetchData( (void**)&n_value,NULL,NULL,STEP,"Integer",NULL);47 FetchData(&cm_jump,NULL,NULL,mxGetField(PARAMETERS,0,"cm_jump")); 48 FetchData(&n_value,STEP); 49 49 50 50 optargs.function_name=function_name; -
issm/trunk/src/mex/Dof/Dof.cpp
r2316 r2333 26 26 27 27 /*Input datasets: */ 28 FetchData( (void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);29 FetchData( (void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL);30 FetchData( (void**)¶ms,NULL,NULL,PARAMS,"DataSet",NULL);28 FetchData(&elements,ELEMENTS); 29 FetchData(&nodes,NODESIN); 30 FetchData(¶ms,PARAMS); 31 31 32 32 /*!Generate internal degree of freedom numbers: */ -
issm/trunk/src/mex/Du/Du.cpp
r2316 r2333 15 15 DataSet* loads=NULL; 16 16 DataSet* materials=NULL; 17 DataSet* parameters=NULL; 17 18 ParameterInputs* inputs=NULL; 18 19 int analysis_type; … … 30 31 31 32 /*Input datasets: */ 32 FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL); 33 FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL); 34 FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL); 35 FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL); 36 FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL); 37 FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL); 33 FetchData(&elements,ELEMENTS); 34 FetchData(&nodes,NODES); 35 FetchData(&loads,LOADS); 36 FetchData(&materials,MATERIALS); 37 FetchParams(¶meters,PARAMETERS); 38 FetchData(&analysis_type,ANALYSIS); 39 FetchData(&sub_analysis_type,SUBANALYSIS); 38 40 39 41 /*Fetch inputs: */ … … 42 44 43 45 /*!Call core code: */ 44 Dux(&du_g, elements,nodes,loads,materials, inputs,analysis_type,sub_analysis_type);46 Dux(&du_g, elements,nodes,loads,materials,parameters,inputs,analysis_type,sub_analysis_type); 45 47 46 48 /*write output : */ -
issm/trunk/src/mex/Echo/Echo.cpp
r1 r2333 20 20 21 21 /*Input datasets: */ 22 FetchData( (void**)&dataset,NULL,NULL,DATASET,"DataSet",NULL);22 FetchData(&dataset,DATASET); 23 23 24 24 /*Echo dataset: */ -
issm/trunk/src/mex/ElementConnectivity/ElementConnectivity.cpp
r2316 r2333 23 23 24 24 /*Input datasets: */ 25 FetchData( (void**)&elements,&nel,NULL,ELEMENTS,"Matrix","Mat");26 FetchData( (void**)&nodeconnectivity,&nods,&width,NODECONNECTIVITY,"Matrix","Mat");25 FetchData(&elements,&nel,NULL,ELEMENTS); 26 FetchData(&nodeconnectivity,&nods,&width,NODECONNECTIVITY); 27 27 28 28 /*!Generate internal degree of freedom numbers: */ -
issm/trunk/src/mex/FieldDepthAverage/FieldDepthAverage.cpp
r2316 r2333 15 15 DataSet* loads=NULL; 16 16 DataSet* materials=NULL; 17 DataSet* parameters=NULL; 17 18 Vec field=NULL; 18 19 char* fieldname=NULL; … … 25 26 26 27 /*Input datasets: */ 27 FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL); 28 FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL); 29 FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL); 30 FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL); 31 FetchData((void**)&field,NULL,NULL,FIELD,"Vector",NULL); 32 FetchData((void**)&fieldname,NULL,NULL,FIELDNAME,"String",NULL); 28 FetchData(&elements,ELEMENTS); 29 FetchData(&nodes,NODES); 30 FetchData(&loads,LOADS); 31 FetchData(&materials,MATERIALS); 32 FetchParams(¶meters,PARAMETERS); 33 FetchData(&field,FIELD); 34 FetchData(&fieldname,FIELDNAME); 33 35 34 36 /*!Call core code: */ 35 FieldDepthAveragex(field,elements,nodes,loads,materials, fieldname);37 FieldDepthAveragex(field,elements,nodes,loads,materials,parameters,fieldname); 36 38 37 39 /*write output : */ … … 43 45 delete loads; 44 46 delete materials; 47 delete parameters; 45 48 VecFree(&field); 46 49 xfree((void**)&fieldname); … … 54 57 { 55 58 _printf_("\n"); 56 _printf_(" usage: [field] = %s(elements, nodes,loads, materials, field,fieldname);\n",__FUNCT__);59 _printf_(" usage: [field] = %s(elements, nodes,loads, materials, parameters,field,fieldname);\n",__FUNCT__); 57 60 _printf_("\n"); 58 61 } -
issm/trunk/src/mex/FieldDepthAverage/FieldDepthAverage.h
r847 r2333 21 21 #define LOADS (mxArray*)prhs[2] 22 22 #define MATERIALS (mxArray*)prhs[3] 23 #define FIELD (mxArray*)prhs[4] 24 #define FIELDNAME (mxArray*)prhs[5] 23 #define PARAMETERS (mxArray*)prhs[4] 24 #define FIELD (mxArray*)prhs[5] 25 #define FIELDNAME (mxArray*)prhs[6] 25 26 26 27 /* serial output macros: */ … … 31 32 #define NLHS 1 32 33 #undef NRHS 33 #define NRHS 634 #define NRHS 7 34 35 35 36 -
issm/trunk/src/mex/FieldExtrude/FieldExtrude.cpp
r2316 r2333 15 15 DataSet* loads=NULL; 16 16 DataSet* materials=NULL; 17 DataSet* parameters=NULL; 17 18 Vec field=NULL; 18 19 char* field_name=NULL; … … 26 27 27 28 /*Input datasets: */ 28 FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL); 29 FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL); 30 FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL); 31 FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL); 32 FetchData((void**)&field,NULL,NULL,FIELD,"Vector",NULL); 33 FetchData((void**)&field_name,NULL,NULL,FIELDNAME,"String",NULL); 34 FetchData((void**)&collapse,NULL,NULL,COLLAPSE,"Integer",NULL); 29 FetchData(&elements,ELEMENTS); 30 FetchData(&nodes,NODES); 31 FetchData(&loads,LOADS); 32 FetchData(&materials,MATERIALS); 33 FetchParams(¶meters,PARAMETERS); 34 FetchData(&field,FIELD); 35 FetchData(&field_name,FIELDNAME); 36 FetchData(&collapse,COLLAPSE); 35 37 36 38 /*!Call core code: */ 37 FieldExtrudex(field,elements,nodes,loads,materials, field_name,collapse);39 FieldExtrudex(field,elements,nodes,loads,materials,parameters,field_name,collapse); 38 40 39 41 /*write output : */ … … 45 47 delete loads; 46 48 delete materials; 49 delete parameters; 47 50 VecFree(&field); 48 51 xfree((void**)&field_name); … … 56 59 { 57 60 _printf_("\n"); 58 _printf_(" usage: [field] = %s(elements, nodes,loads, materials, field, field_name, collapse);\n",__FUNCT__);61 _printf_(" usage: [field] = %s(elements, nodes,loads, materials, parameters, field, field_name, collapse);\n",__FUNCT__); 59 62 _printf_("\n"); 60 63 } -
issm/trunk/src/mex/FieldExtrude/FieldExtrude.h
r847 r2333 21 21 #define LOADS (mxArray*)prhs[2] 22 22 #define MATERIALS (mxArray*)prhs[3] 23 #define FIELD (mxArray*)prhs[4] 24 #define FIELDNAME (mxArray*)prhs[5] 25 #define COLLAPSE (mxArray*)prhs[6] 23 #define PARAMETERS (mxArray*)prhs[4] 24 #define FIELD (mxArray*)prhs[5] 25 #define FIELDNAME (mxArray*)prhs[6] 26 #define COLLAPSE (mxArray*)prhs[7] 26 27 27 28 /* serial output macros: */ … … 32 33 #define NLHS 1 33 34 #undef NRHS 34 #define NRHS 735 #define NRHS 8 35 36 36 37 -
issm/trunk/src/mex/Gradj/Gradj.cpp
r2316 r2333 15 15 DataSet* loads=NULL; 16 16 DataSet* materials=NULL; 17 DataSet* parameters=NULL; 17 18 char* control_type=NULL; 18 19 ParameterInputs* inputs=NULL; … … 32 33 33 34 /*Input datasets: */ 34 FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL); 35 FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL); 36 FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL); 37 FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL); 38 FetchData((void**)&numberofnodes,NULL,NULL,mxGetField(PARAMETERS,0,"numberofnodes"),"Integer",NULL); 39 FetchData((void**)&control_type,NULL,NULL,mxGetField(PARAMETERS,0,"control_type"),"String",NULL); 40 FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL); 41 FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL); 35 FetchData(&elements,ELEMENTS); 36 FetchData(&nodes,NODES); 37 FetchData(&loads,LOADS); 38 FetchData(&materials,MATERIALS); 39 FetchParams(¶meters,PARAMETERS); 40 parameters->FindParam(&numberofnodes,"numberofnodes"); 41 parameters->FindParam(&control_type,"control_type"); 42 FetchData(&analysis_type,ANALYSIS); 43 FetchData(&sub_analysis_type,SUBANALYSIS); 42 44 43 45 /*Fetch inputs: */ … … 46 48 47 49 /*!Call core code: */ 48 Gradjx(&grad_g,numberofnodes,elements,nodes,loads,materials, inputs,analysis_type,sub_analysis_type,control_type);50 Gradjx(&grad_g,numberofnodes,elements,nodes,loads,materials,parameters,inputs,analysis_type,sub_analysis_type,control_type); 49 51 50 52 /*write output : */ … … 56 58 delete loads; 57 59 delete materials; 60 delete parameters; 58 61 xfree((void**)&control_type); 59 62 delete inputs; -
issm/trunk/src/mex/HoleFiller/HoleFiller.cpp
r2316 r2333 38 38 39 39 /*Fetch data: */ 40 FetchData( (void**)&imagein,&imagein_rows,&imagein_cols,IMAGEIN,"Matrix","Mat");41 FetchData( (void**)&smooth_flag,NULL,NULL,SMOOTH,"Integer",NULL);40 FetchData(&imagein,&imagein_rows,&imagein_cols,IMAGEIN); 41 FetchData(&smooth_flag,SMOOTH); 42 42 43 43 /*Get smooth flag setup: */ -
issm/trunk/src/mex/InterpFromGridToMesh/InterpFromGridToMesh.cpp
r2316 r2333 53 53 54 54 /*Input datasets: */ 55 FetchData( (void**)&x,&x_rows,NULL,XHANDLE,"Matrix","Mat");56 FetchData( (void**)&y,&y_rows,NULL,YHANDLE,"Matrix","Mat");57 FetchData( (void**)&data,&data_rows,&data_cols,DATAHANDLE,"Matrix","Mat");58 FetchData( (void**)&x_mesh,&x_mesh_rows,NULL,XMESHHANDLE,"Matrix","Mat");59 FetchData( (void**)&y_mesh,&y_mesh_rows,NULL,YMESHHANDLE,"Matrix","Mat");60 FetchData( (void**)&default_value,NULL,NULL,DEFAULTHANDLE,"Scalar",NULL);55 FetchData(&x,&x_rows,NULL,XHANDLE); 56 FetchData(&y,&y_rows,NULL,YHANDLE); 57 FetchData(&data,&data_rows,&data_cols,DATAHANDLE); 58 FetchData(&x_mesh,&x_mesh_rows,NULL,XMESHHANDLE); 59 FetchData(&y_mesh,&y_mesh_rows,NULL,YMESHHANDLE); 60 FetchData(&default_value,DEFAULTHANDLE); 61 61 62 62 /* Run core computations: */ -
issm/trunk/src/mex/InterpFromMeshToGrid/InterpFromMeshToGrid.cpp
r2316 r2333 35 35 36 36 /*Input datasets: */ 37 FetchData( (void**)&index,&nel,NULL,INDEX,"Matrix","Mat");38 FetchData( (void**)&x,&nods,NULL,X,"Matrix","Mat");39 FetchData( (void**)&y,NULL,NULL,Y,"Matrix","Mat");40 FetchData( (void**)&meshdata,&meshdata_length,NULL,MESHDATA,"Matrix","Mat");41 FetchData( (void**)&cornereast,NULL,NULL,CORNEREAST,"Scalar",NULL);42 FetchData( (void**)&cornernorth,NULL,NULL,CORNERNORTH,"Scalar",NULL);43 FetchData( (void**)&xposting,NULL,NULL,XPOSTING,"Scalar",NULL);44 FetchData( (void**)&yposting,NULL,NULL,YPOSTING,"Scalar",NULL);45 FetchData( (void**)&nlines,NULL,NULL,NLINES,"Integer",NULL);46 FetchData( (void**)&ncols,NULL,NULL,NCOLS,"Integer",NULL);47 FetchData( (void**)&default_value,NULL,NULL,DEFAULTVALUE,"Scalar",NULL);37 FetchData(&index,&nel,NULL,INDEX); 38 FetchData(&x,&nods,NULL,X); 39 FetchData(&y,NULL,NULL,Y); 40 FetchData(&meshdata,&meshdata_length,NULL,MESHDATA); 41 FetchData(&cornereast,CORNEREAST); 42 FetchData(&cornernorth,CORNERNORTH); 43 FetchData(&xposting,XPOSTING); 44 FetchData(&yposting,YPOSTING); 45 FetchData(&nlines,NLINES); 46 FetchData(&ncols,NCOLS); 47 FetchData(&default_value,DEFAULTVALUE); 48 48 49 49 /*Call core of computation: */ -
issm/trunk/src/mex/InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp
r2316 r2333 60 60 61 61 /*Input datasets: */ 62 FetchData( (void**)&index_data,&index_data_rows,NULL,INDEXHANDLE,"Matrix","Mat");63 FetchData( (void**)&x_data,&x_data_rows,NULL,XHANDLE,"Matrix","Mat");64 FetchData( (void**)&y_data,&y_data_rows,NULL,YHANDLE,"Matrix","Mat");65 FetchData( (void**)&data,&data_rows,&data_cols,DATAHANDLE,"Matrix","Mat");66 FetchData( (void**)&x_prime,&x_prime_rows,NULL,XPRIMEHANDLE,"Matrix","Mat");67 FetchData( (void**)&y_prime,&y_prime_rows,NULL,YPRIMEHANDLE,"Matrix","Mat");68 FetchData( (void**)&default_value,NULL,NULL,DEFAULTHANDLE,"Scalar",NULL);62 FetchData(&index_data,&index_data_rows,NULL,INDEXHANDLE); 63 FetchData(&x_data,&x_data_rows,NULL,XHANDLE); 64 FetchData(&y_data,&y_data_rows,NULL,YHANDLE); 65 FetchData(&data,&data_rows,&data_cols,DATAHANDLE); 66 FetchData(&x_prime,&x_prime_rows,NULL,XPRIMEHANDLE); 67 FetchData(&y_prime,&y_prime_rows,NULL,YPRIMEHANDLE); 68 FetchData(&default_value,DEFAULTHANDLE); 69 69 70 70 /*some checks*/ -
issm/trunk/src/mex/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
r2316 r2333 64 64 65 65 /*Input datasets: */ 66 FetchData( (void**)&index_data,&index_data_rows,NULL,INDEXHANDLE,"Matrix","Mat");67 FetchData( (void**)&x_data,&x_data_rows,NULL,XHANDLE,"Matrix","Mat");68 FetchData( (void**)&y_data,&y_data_rows,NULL,YHANDLE,"Matrix","Mat");69 FetchData( (void**)&z_data,&z_data_rows,NULL,ZHANDLE,"Matrix","Mat");70 FetchData( (void**)&data,&data_rows,&data_cols,DATAHANDLE,"Matrix","Mat");71 FetchData( (void**)&x_prime,&x_prime_rows,NULL,XPRIMEHANDLE,"Matrix","Mat");72 FetchData( (void**)&y_prime,&y_prime_rows,NULL,YPRIMEHANDLE,"Matrix","Mat");73 FetchData( (void**)&z_prime,&z_prime_rows,NULL,ZPRIMEHANDLE,"Matrix","Mat");74 FetchData( (void**)&default_value,NULL,NULL,DEFAULTHANDLE,"Scalar",NULL);66 FetchData(&index_data,&index_data_rows,NULL,INDEXHANDLE); 67 FetchData(&x_data,&x_data_rows,NULL,XHANDLE); 68 FetchData(&y_data,&y_data_rows,NULL,YHANDLE); 69 FetchData(&z_data,&z_data_rows,NULL,ZHANDLE); 70 FetchData(&data,&data_rows,&data_cols,DATAHANDLE); 71 FetchData(&x_prime,&x_prime_rows,NULL,XPRIMEHANDLE); 72 FetchData(&y_prime,&y_prime_rows,NULL,YPRIMEHANDLE); 73 FetchData(&z_prime,&z_prime_rows,NULL,ZPRIMEHANDLE); 74 FetchData(&default_value,DEFAULTHANDLE); 75 75 76 76 /*some checks*/ -
issm/trunk/src/mex/Makefile.am
r2300 r2333 32 32 Orth\ 33 33 OutputRifts\ 34 ParamsToWorkspace\35 34 PenaltyConstraints\ 36 35 PenaltySystemMatrices\ … … 165 164 OutputRifts/OutputRifts.h 166 165 167 ParamsToWorkspace_SOURCES = ParamsToWorkspace/ParamsToWorkspace.cpp\168 ParamsToWorkspace/ParamsToWorkspace.h169 170 166 PenaltyConstraints_SOURCES = PenaltyConstraints/PenaltyConstraints.cpp\ 171 167 PenaltyConstraints/PenaltyConstraints.h -
issm/trunk/src/mex/MassFlux/MassFlux.cpp
r2316 r2333 15 15 DataSet* loads=NULL; 16 16 DataSet* materials=NULL; 17 DataSet* parameters=NULL; 17 18 double* segments=NULL; 18 19 int num_segments; … … 30 31 31 32 /*Input datasets: */ 32 FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL); 33 FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL); 34 FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL); 35 FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL); 36 37 /*parameters: */ 38 FetchData((void**)&segments,&num_segments,NULL,mxGetField(PARAMETERS,0,"qmu_mass_flux_segments"),"Matrix","Mat"); 33 FetchData(&elements,ELEMENTS); 34 FetchData(&nodes,NODES); 35 FetchData(&loads,LOADS); 36 FetchData(&materials,MATERIALS); 37 FetchParams(¶meters,PARAMETERS); 38 parameters->FindParam(&segments,&num_segments,NULL,"qmu_mass_flux_segments"); 39 39 40 40 /*results: */ 41 FetchData( (void**)&ug,NULL,NULL,UG,"Matrix","Mat");41 FetchData(&ug,NULL,NULL,UG); 42 42 43 43 /*!Compute mass flux along the profile: */ 44 MassFluxx(&mass_flux, elements,nodes,loads,materials, segments,num_segments,ug);44 MassFluxx(&mass_flux, elements,nodes,loads,materials,parameters,segments,num_segments,ug); 45 45 46 46 /*write output datasets: */ … … 52 52 delete loads; 53 53 delete materials; 54 delete parameters; 54 55 xfree((void**)&ug); 55 56 -
issm/trunk/src/mex/Mergesolutionfromftog/Mergesolutionfromftog.cpp
r2316 r2333 26 26 27 27 /*Input datasets: */ 28 FetchData( (void**)&uf,NULL,NULL,UF,"Vector",NULL);29 FetchData( (void**)&Gmn,NULL,NULL,GMN,"Matrix",NULL);30 FetchData( (void**)&ys,NULL,NULL,YS,"Vector",NULL);28 FetchData(&uf,UF); 29 FetchData(&Gmn,GMN); 30 FetchData(&ys,YS); 31 31 FetchNodeSets(&nodesets,NODESETS); 32 32 -
issm/trunk/src/mex/MeshPartition/MeshPartition.cpp
r2316 r2333 57 57 58 58 /*Fetch data: */ 59 FetchData( (void**)&meshtype,NULL,NULL,mxGetField(MODEL,0,"type"),"String",NULL);60 FetchData( (void**)&numberofelements,NULL,NULL,mxGetField(MODEL,0,"numberofelements"),"Integer",NULL);61 FetchData( (void**)&numberofgrids,NULL,NULL,mxGetField(MODEL,0,"numberofgrids"),"Integer",NULL);62 FetchData( (void**)&elements,NULL,&elements_width,mxGetField(MODEL,0,"elements"),"Matrix","Mat");59 FetchData(&meshtype,mxGetField(MODEL,0,"type")); 60 FetchData(&numberofelements,mxGetField(MODEL,0,"numberofelements")); 61 FetchData(&numberofgrids,mxGetField(MODEL,0,"numberofgrids")); 62 FetchData(&elements,NULL,&elements_width,mxGetField(MODEL,0,"elements")); 63 63 64 64 … … 66 66 if (strcmp(meshtype,"3d")==0){ 67 67 68 FetchData( (void**)&numberofelements2d,NULL,NULL,mxGetField(MODEL,0,"numberofelements2d"),"Integer",NULL);69 FetchData( (void**)&numberofgrids2d,NULL,NULL,mxGetField(MODEL,0,"numberofgrids2d"),"Integer",NULL);70 FetchData( (void**)&elements2d,NULL,NULL,mxGetField(MODEL,0,"elements2d"),"Matrix","Mat");68 FetchData(&numberofelements2d,mxGetField(MODEL,0,"numberofelements2d")); 69 FetchData(&numberofgrids2d,mxGetField(MODEL,0,"numberofgrids2d")); 70 FetchData(&elements2d,NULL,NULL,mxGetField(MODEL,0,"elements2d")); 71 71 72 72 } 73 FetchData( (void**)&numlayers,NULL,NULL,mxGetField(MODEL,0,"numlayers"),"Integer",NULL);74 FetchData( (void**)&numareas,NULL,NULL,NUMAREAS,"Integer",NULL);73 FetchData(&numlayers,mxGetField(MODEL,0,"numlayers")); 74 FetchData(&numareas,NUMAREAS); 75 75 76 76 /*Run partitioning algorithm based on a "clever" use of the Metis partitioner: */ -
issm/trunk/src/mex/Misfit/Misfit.cpp
r2316 r2333 15 15 DataSet* loads=NULL; 16 16 DataSet* materials=NULL; 17 DataSet* parameters=NULL; 17 18 ParameterInputs* inputs=NULL; 18 19 int analysis_type; … … 29 30 30 31 /*Input datasets: */ 31 FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL); 32 FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL); 33 FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL); 34 FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL); 35 FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL); 36 FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL); 32 FetchData(&elements,ELEMENTS); 33 FetchData(&nodes,NODES); 34 FetchData(&loads,LOADS); 35 FetchData(&materials,MATERIALS); 36 FetchParams(¶meters,PARAMETERS); 37 FetchData(&analysis_type,ANALYSIS); 38 FetchData(&sub_analysis_type,SUBANALYSIS); 37 39 38 40 /*Fetch inputs: */ … … 41 43 42 44 /*!Call core code: */ 43 Misfitx(&J, elements,nodes,loads,materials, inputs,analysis_type,sub_analysis_type);45 Misfitx(&J, elements,nodes,loads,materials,parameters,inputs,analysis_type,sub_analysis_type); 44 46 45 47 /*write output : */ … … 51 53 delete loads; 52 54 delete materials; 55 delete parameters; 53 56 delete inputs; 54 57 -
issm/trunk/src/mex/MpcNodes/MpcNodes.cpp
r2316 r2333 25 25 26 26 /*Input datasets: */ 27 FetchData( (void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL);28 FetchData( (void**)&constraints,NULL,NULL,CONSTRAINTS,"DataSet",NULL);27 FetchData(&nodes,NODESIN); 28 FetchData(&constraints,CONSTRAINTS); 29 29 30 30 /*!Generate internal degree of freedom numbers: */ -
issm/trunk/src/mex/NodeConnectivity/NodeConnectivity.cpp
r2316 r2333 22 22 23 23 /*Input datasets: */ 24 FetchData( (void**)&elements,&nel,NULL,ELEMENTS,"Matrix","Mat");25 FetchData( (void**)&nods,NULL,NULL,NUMNODES,"Integer",NULL);24 FetchData(&elements,&nel,NULL,ELEMENTS); 25 FetchData(&nods,NUMNODES); 26 26 27 27 /*!Generate internal degree of freedom numbers: */ -
issm/trunk/src/mex/NormalizeConstraints/NormalizeConstraints.cpp
r2316 r2333 25 25 /*Input datasets: */ 26 26 FetchNodeSets(&nodesets,NODESETS); 27 FetchData( (void**)&Rmg,NULL,NULL,RMG,"Matrix",NULL);27 FetchData(&Rmg,RMG); 28 28 29 29 /*!Generate internal degree of freedom numbers: */ -
issm/trunk/src/mex/Orth/Orth.cpp
r2316 r2333 24 24 25 25 /*Input datasets: */ 26 FetchData( (void**)&gradj,NULL,NULL,GRADJ,"Vector",NULL);27 FetchData( (void**)&oldgradj,NULL,NULL,OLDGRADJ,"Vector",NULL);26 FetchData(&gradj,GRADJ); 27 FetchData(&oldgradj,OLDGRADJ); 28 28 29 29 /*!Reduce load from g to f size: */ -
issm/trunk/src/mex/OutputRifts/OutputRifts.cpp
r2316 r2333 25 25 26 26 /*Input datasets: */ 27 FetchData( (void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);28 FetchData( (void**)&numrifts,NULL,NULL,mxGetField(PARAMETERS,0,"numrifts"),"Integer",NULL);27 FetchData(&loads,LOADS); 28 FetchData(&numrifts,mxGetField(PARAMETERS,0,"numrifts")); 29 29 30 30 /*!Call core code: */ -
issm/trunk/src/mex/ParameterOutput/ParameterOutput.cpp
r2318 r2333 31 31 32 32 /*Input datasets: */ 33 FetchData( (void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL);34 FetchData( (void**)&nodes,NULL,NULL,NODES,"DataSet",NULL);35 FetchData( (void**)&loads,NULL,NULL,LOADS,"DataSet",NULL);36 FetchData( (void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL);37 FetchData( (void**)&results,NULL,NULL,RESULTS,"DataSet",NULL);33 FetchData(&elements,ELEMENTS); 34 FetchData(&nodes,NODES); 35 FetchData(&loads,LOADS); 36 FetchData(&materials,MATERIALS); 37 FetchData(&results,RESULTS); 38 38 39 39 /*parameters: */ 40 FetchData( (void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);41 FetchData( (void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);40 FetchData(&analysis_type,ANALYSIS); 41 FetchData(&sub_analysis_type,SUBANALYSIS); 42 42 43 43 /*Fetch inputs: */ -
issm/trunk/src/mex/PenaltyConstraints/PenaltyConstraints.cpp
r2316 r2333 15 15 DataSet* loads=NULL; 16 16 DataSet* materials=NULL; 17 DataSet* parameters=NULL; 17 18 ParameterInputs* inputs=NULL; 18 19 int analysis_type; … … 30 31 31 32 /*Input datasets: */ 32 FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL); 33 FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL); 34 FetchData((void**)&loads,NULL,NULL,LOADSIN,"DataSet",NULL); 35 FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL); 33 FetchData(&elements,ELEMENTS); 34 FetchData(&nodes,NODES); 35 FetchData(&loads,LOADSIN); 36 FetchData(&materials,MATERIALS); 37 FetchParams(¶meters,PARAMETERS); 36 38 37 39 /*parameters: */ 38 FetchData( (void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);39 FetchData( (void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);40 FetchData(&analysis_type,ANALYSIS); 41 FetchData(&sub_analysis_type,SUBANALYSIS); 40 42 41 43 /*Fetch inputs: */ … … 44 46 45 47 /*!Generate internal degree of freedom numbers: */ 46 PenaltyConstraintsx(&converged, &num_unstable_constraints, elements,nodes,loads,materials, inputs,analysis_type,sub_analysis_type);48 PenaltyConstraintsx(&converged, &num_unstable_constraints, elements,nodes,loads,materials,parameters,inputs,analysis_type,sub_analysis_type); 47 49 48 50 /*write output datasets: */ … … 57 59 delete loads; 58 60 delete materials; 61 delete parameters; 59 62 delete inputs; 60 63 -
issm/trunk/src/mex/PenaltySystemMatrices/PenaltySystemMatrices.cpp
r2316 r2333 20 20 DataSet* loads=NULL; 21 21 DataSet* materials=NULL; 22 DataSet* parameters=NULL; 22 23 int kflag,pflag; 23 24 ParameterInputs* inputs=NULL; … … 32 33 33 34 /*Input datasets: */ 34 FetchData((void**)&Kgg,NULL,NULL,KGGIN,"Matrix",NULL); 35 FetchData((void**)&pg,NULL,NULL,PGIN,"Vector",NULL); 36 FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL); 37 FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL); 38 FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL); 39 FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL); 35 FetchData(&Kgg,KGGIN); 36 FetchData(&pg,PGIN); 37 FetchData(&elements,ELEMENTS); 38 FetchData(&nodes,NODES); 39 FetchData(&loads,LOADS); 40 FetchData(&materials,MATERIALS); 41 FetchParams(¶meters,PARAMETERS); 42 40 43 /*parameters: */ 41 FetchData((void**)&kflag,NULL,NULL,mxGetField(PARAMETERS,0,"kflag"),"Integer",NULL);42 FetchData((void**)&pflag,NULL,NULL,mxGetField(PARAMETERS,0,"pflag"),"Integer",NULL);43 FetchData( (void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL);44 FetchData( (void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL);44 parameters->FindParam(&kflag,"kflag"); 45 parameters->FindParam(&pflag,"pflag"); 46 FetchData(&analysis_type,ANALYSIS); 47 FetchData(&sub_analysis_type,SUBANALYSIS); 45 48 46 49 /*Fetch inputs: */ … … 49 52 50 53 /*!Generate stiffnesses from penalties: */ 51 PenaltySystemMatricesx(Kgg, pg,&kmax,elements,nodes,loads,materials, kflag,pflag,inputs,analysis_type,sub_analysis_type);54 PenaltySystemMatricesx(Kgg, pg,&kmax,elements,nodes,loads,materials,parameters,kflag,pflag,inputs,analysis_type,sub_analysis_type); 52 55 53 56 /*write output datasets: */ … … 61 64 delete loads; 62 65 delete materials; 66 delete parameters; 63 67 delete inputs; 64 68 MatFree(&Kgg); -
issm/trunk/src/mex/ProcessParams/ProcessParams.cpp
r2316 r2333 21 21 22 22 /*Input datasets: */ 23 FetchData( (void**)¶meters,NULL,NULL,PARAMETERSIN,"DataSet",NULL);24 FetchData( (void**)&partition,NULL,NULL,PARTITION,"Vector",NULL);23 FetchData(¶meters,PARAMETERSIN); 24 FetchData(&partition,PARTITION); 25 25 26 26 /*Shit partition: */ 27 27 if(partition)VecShift(partition,-1.0); 28 28 29 29 30 /*!Generate internal degree of freedom numbers: */ … … 31 32 32 33 /*write output datasets: */ 33 Write Data(PARAMETERSOUT,parameters);34 WriteParams(PARAMETERSOUT,parameters); 34 35 35 36 /*Free ressources: */ -
issm/trunk/src/mex/Qmu/Qmu.cpp
r1028 r2333 41 41 inputs=INPUTS; 42 42 43 FetchData( (void**)&analysis_type,NULL,NULL,mxGetField(PARAMETERS,0,"analysis_type"),"Integer",NULL);44 FetchData( (void**)&sub_analysis_type,NULL,NULL,mxGetField(PARAMETERS,0,"sub_analysis_type"),"Integer",NULL);45 FetchData( (void**)&dakota_input_file,NULL,NULL,mxGetField(PARAMETERS,0,"qmuinname"),"String",NULL);46 FetchData( (void**)&dakota_output_file,NULL,NULL,mxGetField(PARAMETERS,0,"qmuoutname"),"String",NULL);47 FetchData( (void**)&dakota_error_file,NULL,NULL,mxGetField(PARAMETERS,0,"qmuerrname"),"String",NULL);43 FetchData(&analysis_type,mxGetField(PARAMETERS,0,"analysis_type")); 44 FetchData(&sub_analysis_type,mxGetField(PARAMETERS,0,"sub_analysis_type")); 45 FetchData(&dakota_input_file,mxGetField(PARAMETERS,0,"qmuinname")); 46 FetchData(&dakota_output_file,mxGetField(PARAMETERS,0,"qmuoutname")); 47 FetchData(&dakota_error_file,mxGetField(PARAMETERS,0,"qmuerrname")); 48 48 49 49 /*!Generate internal degree of freedom numbers: */ -
issm/trunk/src/mex/Reduceloadfromgtof/Reduceloadfromgtof.cpp
r2316 r2333 27 27 28 28 /*Input datasets: */ 29 FetchData( (void**)&pg,NULL,NULL,PG,"Vector",NULL);30 FetchData( (void**)&Gmn,NULL,NULL,GMN,"Matrix",NULL);31 FetchData( (void**)&Kfs,NULL,NULL,KFS,"Matrix",NULL);32 FetchData( (void**)&ys,NULL,NULL,YS,"Vector",NULL);29 FetchData(&pg,PG); 30 FetchData(&Gmn,GMN); 31 FetchData(&Kfs,KFS); 32 FetchData(&ys,YS); 33 33 FetchNodeSets(&nodesets,NODESETS); 34 34 -
issm/trunk/src/mex/Reducematrixfromgtof/Reducematrixfromgtof.cpp
r2316 r2333 26 26 27 27 /*Input datasets: */ 28 FetchData( (void**)&Kgg,NULL,NULL,KGG,"Matrix",NULL);29 FetchData( (void**)&Gmn,NULL,NULL,GMN,"Matrix",NULL);28 FetchData(&Kgg,KGG); 29 FetchData(&Gmn,GMN); 30 30 FetchNodeSets(&nodesets,NODESETS); 31 31 -
issm/trunk/src/mex/Reducevectorgtof/Reducevectorgtof.cpp
r2316 r2333 24 24 25 25 /*Input datasets: */ 26 FetchData( (void**)&ug,NULL,NULL,UG,"Vector",NULL);26 FetchData(&ug,UG); 27 27 FetchNodeSets(&nodesets,NODESETS); 28 28 -
issm/trunk/src/mex/Reducevectorgtos/Reducevectorgtos.cpp
r2316 r2333 25 25 26 26 /*Input datasets: */ 27 FetchData( (void**)&yg,NULL,NULL,YG,"Vector",NULL);27 FetchData(&yg,YG); 28 28 FetchNodeSets(&nodesets,NODESETS); 29 29 -
issm/trunk/src/mex/SetStructureField/SetStructureField.cpp
r1 r2333 59 59 60 60 /*Get name in array.name: */ 61 FetchData( (void**)&name,NULL,NULL,NAMEHANDLE,"String",NULL);61 FetchData(&name,NAMEHANDLE); 62 62 63 63 /*Get field in array.field: */ 64 FetchData( (void**)&field,NULL,NULL,FIELDHANDLE,"String",NULL);64 FetchData(&field,FIELDHANDLE); 65 65 66 66 /*Branch out on type of value: */ … … 68 68 69 69 /*Get string store in the value mxArray: */ 70 FetchData( (void**)&string,NULL,NULL,VALUEHANDLE,"String",NULL);70 FetchData(&string,VALUEHANDLE); 71 71 72 72 /*Start looping on output array: */ -
issm/trunk/src/mex/Solver/Solver.cpp
r2316 r2333 15 15 Vec uf0=NULL; 16 16 char* solver_string=NULL; 17 DataSet* parameters=NULL; 17 18 18 19 /* output datasets: */ … … 26 27 27 28 /*Input datasets: */ 28 FetchData((void**)&Kff,NULL,NULL,KFF,"Matrix",NULL); 29 FetchData((void**)&pf,NULL,NULL,PF,"Vector",NULL); 30 FetchData((void**)&uf0,NULL,NULL,UF0,"Vector",NULL); 31 FetchData((void**)&solver_string,NULL,NULL,mxGetField(PARAMS,0,"solverstring"),"String",NULL); 29 FetchData(&Kff,KFF); 30 FetchData(&pf,PF); 31 FetchData(&uf0,UF0); 32 FetchParams(¶meters,PARAMETERS); 33 parameters->FindParam(&solver_string,"solver_string"); 32 34 33 35 /*!Reduce vector: */ … … 43 45 VecFree(&uf); 44 46 xfree((void**)&solver_string); 47 delete parameters; 45 48 46 49 /*end module: */ -
issm/trunk/src/mex/Solver/Solver.h
r1 r2333 20 20 #define PF (mxArray*)prhs[1] 21 21 #define UF0 (mxArray*)prhs[2] 22 #define PARAM S (mxArray*)prhs[3]22 #define PARAMETERS (mxArray*)prhs[3] 23 23 24 24 /* serial output macros: */ -
issm/trunk/src/mex/SpcNodes/SpcNodes.cpp
r2316 r2333 25 25 26 26 /*Input datasets: */ 27 FetchData( (void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL);28 FetchData( (void**)&constraints,NULL,NULL,CONSTRAINTS,"DataSet",NULL);27 FetchData(&nodes,NODESIN); 28 FetchData(&constraints,CONSTRAINTS); 29 29 30 30 /*!Generate internal degree of freedom numbers: */ -
issm/trunk/src/mex/SystemMatrices/SystemMatrices.cpp
r2316 r2333 15 15 DataSet* loads=NULL; 16 16 DataSet* materials=NULL; 17 DataSet* parameters=NULL; 17 18 int kflag,pflag; 18 19 int connectivity; … … 33 34 34 35 /*Input datasets: */ 35 FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL); 36 FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL); 37 FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL); 38 FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL); 36 FetchData(&elements,ELEMENTS); 37 FetchData(&nodes,NODES); 38 FetchData(&loads,LOADS); 39 FetchData(&materials,MATERIALS); 40 FetchParams(¶meters,PARAMETERS); 41 39 42 /*parameters: */ 40 FetchData((void**)&kflag,NULL,NULL,mxGetField(PARAMETERS,0,"kflag"),"Integer",NULL); 41 FetchData((void**)&pflag,NULL,NULL,mxGetField(PARAMETERS,0,"pflag"),"Integer",NULL); 42 FetchData((void**)&connectivity,NULL,NULL,mxGetField(PARAMETERS,0,"connectivity"),"Integer",NULL); 43 FetchData((void**)&numberofdofspernode,NULL,NULL,mxGetField(PARAMETERS,0,"numberofdofspernode"),"Integer",NULL); 44 FetchData((void**)&analysis_type,NULL,NULL,ANALYSIS,"Integer",NULL); 45 FetchData((void**)&sub_analysis_type,NULL,NULL,SUBANALYSIS,"Integer",NULL); 43 parameters->FindParam(&kflag,"kflag"); 44 parameters->FindParam(&pflag,"pflag"); 45 parameters->FindParam(&connectivity,"connectivity"); 46 parameters->FindParam(&numberofdofspernode,"numberofdofspernode"); 47 48 FetchData(&analysis_type,ANALYSIS); 49 FetchData(&sub_analysis_type,SUBANALYSIS); 46 50 47 51 /*Fetch inputs: */ … … 50 54 51 55 /*!Generate internal degree of freedom numbers: */ 52 SystemMatricesx(&Kgg, &pg,elements,nodes,loads,materials, kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type);56 SystemMatricesx(&Kgg, &pg,elements,nodes,loads,materials,parameters,kflag,pflag,connectivity,numberofdofspernode,inputs,analysis_type,sub_analysis_type); 53 57 54 58 /*write output datasets: */ … … 62 66 delete loads; 63 67 delete materials; 68 delete parameters; 64 69 delete inputs; 65 70 MatFree(&Kgg); -
issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.cpp
r2316 r2333 15 15 DataSet* loads=NULL; 16 16 DataSet* materials=NULL; 17 DataSet* parameters=NULL; 17 18 ParameterInputs* inputs=NULL; 18 19 … … 22 23 /*checks on arguments on the matlab side: */ 23 24 CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&UpdateFromInputsUsage); 24 25 25 26 /*Input datasets: */ 26 FetchData((void**)&elements,NULL,NULL,ELEMENTSIN,"DataSet",NULL); 27 FetchData((void**)&nodes,NULL,NULL,NODESIN,"DataSet",NULL); 28 FetchData((void**)&loads,NULL,NULL,LOADSIN,"DataSet",NULL); 29 FetchData((void**)&materials,NULL,NULL,MATERIALSIN,"DataSet",NULL); 30 27 FetchData(&elements,ELEMENTSIN); 28 FetchData(&nodes,NODESIN); 29 FetchData(&loads,LOADSIN); 30 FetchData(&materials,MATERIALSIN); 31 FetchParams(¶meters,PARAMETERSIN); 32 31 33 /*Fetch inputs: */ 32 34 inputs=new ParameterInputs; 33 35 inputs->Init(INPUTS); 34 36 35 37 /*!Generate internal degree of freedom numbers: */ 36 UpdateFromInputsx(elements,nodes,loads, materials, inputs);37 38 UpdateFromInputsx(elements,nodes,loads, materials,parameters,inputs); 39 38 40 /*write output datasets: */ 39 41 WriteData(ELEMENTS,elements); … … 41 43 WriteData(LOADS,loads); 42 44 WriteData(MATERIALS,materials); 43 45 WriteParams(PARAMETERS,parameters); 46 44 47 /*Free ressources: */ 45 48 delete elements; … … 47 50 delete loads; 48 51 delete materials; 52 delete parameters; 49 53 delete inputs; 50 54 51 55 /*end module: */ 52 56 MODULEEND(); … … 56 60 { 57 61 _printf_("\n"); 58 _printf_(" usage: [elements,nodes,loads, materials ] = %s(elements,nodes,loads, materials,inputs);\n",__FUNCT__);62 _printf_(" usage: [elements,nodes,loads, materials, parameters] = %s(elements,nodes,loads, materials,parameters,inputs);\n",__FUNCT__); 59 63 _printf_("\n"); 60 64 } -
issm/trunk/src/mex/UpdateFromInputs/UpdateFromInputs.h
r1 r2333 21 21 #define LOADSIN (mxArray*)prhs[2] 22 22 #define MATERIALSIN (mxArray*)prhs[3] 23 #define INPUTS (mxArray*)prhs[4] 23 #define PARAMETERSIN (mxArray*)prhs[4] 24 #define INPUTS (mxArray*)prhs[5] 24 25 25 26 /* serial output macros: */ … … 28 29 #define LOADS (mxArray**)&plhs[2] 29 30 #define MATERIALS (mxArray**)&plhs[3] 31 #define PARAMETERS (mxArray**)&plhs[4] 30 32 31 33 /* serial arg counts: */ 32 34 #undef NLHS 33 #define NLHS 435 #define NLHS 5 34 36 #undef NRHS 35 #define NRHS 537 #define NRHS 6 36 38 37 39 -
issm/trunk/src/mex/UpdateGeometry/UpdateGeometry.cpp
r2316 r2333 15 15 DataSet* loads=NULL; 16 16 DataSet* materials=NULL; 17 DataSet* parameters=NULL; 17 18 Vec newthickness=NULL; 18 19 Vec bed=NULL; … … 31 32 32 33 /*Input datasets: */ 33 FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL); 34 FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL); 35 FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL); 36 FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL); 34 FetchData(&elements,ELEMENTS); 35 FetchData(&nodes,NODES); 36 FetchData(&loads,LOADS); 37 FetchData(&materials,MATERIALS); 38 FetchParams(¶meters,PARAMETERS); 37 39 38 FetchData( (void**)&newthickness,NULL,NULL,NEWTHICKNESS,"Vector",NULL);39 FetchData( (void**)&bed,NULL,NULL,BED,"Vector",NULL);40 FetchData( (void**)&surface,NULL,NULL,SURFACE,"Vector",NULL);40 FetchData(&newthickness,NEWTHICKNESS); 41 FetchData(&bed,BED); 42 FetchData(&surface,SURFACE); 41 43 42 44 /*!Generate internal degree of freedom numbers: */ 43 UpdateGeometryx(&outthickness,&outbed,&outsurface, elements, nodes,loads, materials, newthickness,bed,surface);45 UpdateGeometryx(&outthickness,&outbed,&outsurface, elements, nodes,loads, materials, parameters,newthickness,bed,surface); 44 46 45 47 /*write output data: */ … … 53 55 delete loads; 54 56 delete materials; 57 delete parameters; 55 58 VecFree(&newthickness); 56 59 VecFree(&bed); … … 66 69 void UpdateGeometryUsage(void) { 67 70 _printf_("\n"); 68 _printf_(" usage: [outthickness,outbed,outsrface] = %s(elements, nodes, materials, param s,newthickness,bed,surface);\n",__FUNCT__);71 _printf_(" usage: [outthickness,outbed,outsrface] = %s(elements, nodes, materials, parameters,newthickness,bed,surface);\n",__FUNCT__); 69 72 _printf_("\n"); 70 73 } -
issm/trunk/src/mex/UpdateNodePositions/UpdateNodePositions.cpp
r2316 r2333 14 14 DataSet* nodes=NULL; 15 15 DataSet* loads=NULL; 16 DataSet* materials=NULL; 16 DataSet* materials=NULL; 17 DataSet* parameters=NULL; 17 18 Vec thickness=NULL; 18 19 Vec bed=NULL; … … 25 26 26 27 /*Input datasets: */ 27 FetchData((void**)&elements,NULL,NULL,ELEMENTS,"DataSet",NULL); 28 FetchData((void**)&nodes,NULL,NULL,NODES,"DataSet",NULL); 29 FetchData((void**)&loads,NULL,NULL,LOADS,"DataSet",NULL); 30 FetchData((void**)&materials,NULL,NULL,MATERIALS,"DataSet",NULL); 31 FetchData((void**)&thickness,NULL,NULL,THICKNESS,"Vector",NULL); 32 FetchData((void**)&bed,NULL,NULL,BED,"Vector",NULL); 28 FetchData(&elements,ELEMENTS); 29 FetchData(&nodes,NODES); 30 FetchData(&loads,LOADS); 31 FetchData(&materials,MATERIALS); 32 FetchParams(¶meters,PARAMETERS); 33 FetchData(&thickness,THICKNESS); 34 FetchData(&bed,BED); 33 35 34 36 /*!Generate internal degree of freedom numbers: */ 35 UpdateNodePositionsx(elements,nodes,loads, materials, thickness,bed);37 UpdateNodePositionsx(elements,nodes,loads, materials,parameters,thickness,bed); 36 38 37 39 /*write output datasets: */ … … 43 45 delete loads; 44 46 delete materials; 47 delete parameters; 45 48 VecFree(&thickness); 46 49 VecFree(&bed); … … 53 56 { 54 57 _printf_("\n"); 55 _printf_(" usage: [elements,nodes,loads, materials] = %s(elements,nodes,loads, materials, inputs);\n",__FUNCT__);58 _printf_(" usage: [elements,nodes,loads, materials] = %s(elements,nodes,loads, materials,parameters, inputs);\n",__FUNCT__); 56 59 _printf_("\n"); 57 60 } -
issm/trunk/src/mex/UpdateNodePositions/UpdateNodePositions.h
r847 r2333 21 21 #define LOADS (mxArray*)prhs[2] 22 22 #define MATERIALS (mxArray*)prhs[3] 23 #define BED (mxArray*)prhs[4] 24 #define THICKNESS (mxArray*)prhs[5] 23 #define PARAMETERS (mxArray*)prhs[4] 24 #define BED (mxArray*)prhs[5] 25 #define THICKNESS (mxArray*)prhs[6] 25 26 26 27 /* serial output macros: */ … … 31 32 #define NLHS 1 32 33 #undef NRHS 33 #define NRHS 634 #define NRHS 7 34 35 35 36
Note:
See TracChangeset
for help on using the changeset viewer.