Changeset 4532
- Timestamp:
- 07/12/10 12:07:13 (15 years ago)
- Location:
- issm/trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/EnumDefinitions/EnumAsString.cpp
r4521 r4532 249 249 case RhoWaterEnum : return "RhoWater"; 250 250 case GravityEnum : return "Gravity"; 251 case ThermalConductivityEnum : return "ThermalConductivity"; 252 case MixedLayerCapacityEnum : return "MixedLayerCapacity"; 253 case ThermalExchangeVelocityEnum : return "ThermalExchangeVelocity"; 251 254 case BetaEnum : return "Beta"; 252 255 case CmGradientEnum : return "CmGradient"; -
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
r4521 r4532 285 285 RhoWaterEnum, 286 286 GravityEnum, 287 ThermalConductivityEnum, 288 MixedLayerCapacityEnum, 289 ThermalExchangeVelocityEnum, 287 290 /*}}}*/ 288 291 /*Parameters{{{1*/ -
issm/trunk/src/c/EnumDefinitions/StringAsEnum.cpp
r4521 r4532 247 247 else if (strcmp(name,"RhoWater")==0) return RhoWaterEnum; 248 248 else if (strcmp(name,"Gravity")==0) return GravityEnum; 249 else if (strcmp(name,"ThermalConductivity")==0) return ThermalConductivityEnum; 250 else if (strcmp(name,"MixedLayerCapacity")==0) return MixedLayerCapacityEnum; 251 else if (strcmp(name,"ThermalExchangeVelocity")==0) return ThermalExchangeVelocityEnum; 249 252 else if (strcmp(name,"Beta")==0) return BetaEnum; 250 253 else if (strcmp(name,"CmGradient")==0) return CmGradientEnum; -
issm/trunk/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp
r4218 r4532 29 29 load->InputUpdateFromConstant(constant,name); 30 30 } 31 32 for(i=0;i<materials->Size();i++){ 33 Material* material=(Material*)materials->GetObjectByOffset(i); 34 material->InputUpdateFromConstant(constant,name); 35 } 31 36 } 32 37 void InputUpdateFromConstantx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int constant, int name){ … … 49 54 Load* load=(Load*)loads->GetObjectByOffset(i); 50 55 load->InputUpdateFromConstant(constant,name); 56 } 57 58 for(i=0;i<materials->Size();i++){ 59 Material* material=(Material*)materials->GetObjectByOffset(i); 60 material->InputUpdateFromConstant(constant,name); 51 61 } 52 62 } … … 71 81 load->InputUpdateFromConstant(constant,name); 72 82 } 83 84 for(i=0;i<materials->Size();i++){ 85 Material* material=(Material*)materials->GetObjectByOffset(i); 86 material->InputUpdateFromConstant(constant,name); 87 } 88 73 89 } -
issm/trunk/src/c/objects/Elements/Beam.cpp
r4405 r4532 550 550 const int numgrids=2; 551 551 double gaussgrids[numgrids][2]={{0,1},{1,0}}; 552 double vx_values[numgrids];553 double vy_values[numgrids];554 double vz_values[numgrids];555 552 double vel_values[numgrids]; 556 553 double maxvel; … … 560 557 561 558 /*retrive velocity values at nodes */ 562 inputs->GetParameterValues(&vx_values[0],&gaussgrids[0][0],numgrids,VxEnum); 563 inputs->GetParameterValues(&vy_values[0],&gaussgrids[0][0],numgrids,VyEnum); 564 if(dim==3) inputs->GetParameterValues(&vz_values[0],&gaussgrids[0][0],numgrids,VzEnum); 565 566 /*now, compute maximum of velocity :*/ 567 if(dim==2){ 568 for(i=0;i<numgrids;i++)vel_values[i]=sqrt(pow(vx_values[i],2)+pow(vy_values[i],2)); 569 } 570 else{ 571 for(i=0;i<numgrids;i++)vel_values[i]=sqrt(pow(vx_values[i],2)+pow(vy_values[i],2)+pow(vz_values[i],2)); 572 } 559 inputs->GetParameterValues(&vel_values[0],&gaussgrids[0][0],numgrids,VelEnum); 573 560 574 561 /*now, compute maximum:*/ … … 671 658 const int numgrids=2; 672 659 double gaussgrids[numgrids][2]={{0,1},{1,0}}; 673 double vx_values[numgrids];674 double vy_values[numgrids];675 double vz_values[numgrids];676 660 double vel_values[numgrids]; 677 661 double minvel; … … 681 665 682 666 /*retrive velocity values at nodes */ 683 inputs->GetParameterValues(&vx_values[0],&gaussgrids[0][0],numgrids,VxEnum); 684 inputs->GetParameterValues(&vy_values[0],&gaussgrids[0][0],numgrids,VyEnum); 685 if(dim==3) inputs->GetParameterValues(&vz_values[0],&gaussgrids[0][0],numgrids,VzEnum); 686 687 /*now, compute minimum of velocity :*/ 688 if(dim==2){ 689 for(i=0;i<numgrids;i++)vel_values[i]=sqrt(pow(vx_values[i],2)+pow(vy_values[i],2)); 690 } 691 else{ 692 for(i=0;i<numgrids;i++)vel_values[i]=sqrt(pow(vx_values[i],2)+pow(vy_values[i],2)+pow(vz_values[i],2)); 693 } 667 inputs->GetParameterValues(&vel_values[0],&gaussgrids[0][0],numgrids,VelEnum); 694 668 695 669 /*now, compute minimum:*/ -
issm/trunk/src/c/objects/Elements/Penta.cpp
r4521 r4532 1309 1309 const int numgrids=6; 1310 1310 double gaussgrids[numgrids][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}}; 1311 double vx_values[numgrids];1312 double vy_values[numgrids];1313 double vz_values[numgrids];1314 1311 double vel_values[numgrids]; 1315 1312 double maxvel; … … 1319 1316 1320 1317 /*retrive velocity values at nodes */ 1321 inputs->GetParameterValues(&vx_values[0],&gaussgrids[0][0],numgrids,VxEnum); 1322 inputs->GetParameterValues(&vy_values[0],&gaussgrids[0][0],numgrids,VyEnum); 1323 if(dim==3) inputs->GetParameterValues(&vz_values[0],&gaussgrids[0][0],numgrids,VzEnum); 1324 1325 /*now, compute maximum of velocity :*/ 1326 if(dim==2){ 1327 for(i=0;i<numgrids;i++)vel_values[i]=sqrt(pow(vx_values[i],2)+pow(vy_values[i],2)); 1328 } 1329 else{ 1330 for(i=0;i<numgrids;i++)vel_values[i]=sqrt(pow(vx_values[i],2)+pow(vy_values[i],2)+pow(vz_values[i],2)); 1331 } 1318 inputs->GetParameterValues(&vel_values[0],&gaussgrids[0][0],numgrids,VelEnum); 1332 1319 1333 1320 /*now, compute maximum:*/ … … 1430 1417 const int numgrids=6; 1431 1418 double gaussgrids[numgrids][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}}; 1432 double vx_values[numgrids];1433 double vy_values[numgrids];1434 double vz_values[numgrids];1435 1419 double vel_values[numgrids]; 1436 1420 double minvel; … … 1440 1424 1441 1425 /*retrive velocity values at nodes */ 1442 inputs->GetParameterValues(&vx_values[0],&gaussgrids[0][0],numgrids,VxEnum); 1443 inputs->GetParameterValues(&vy_values[0],&gaussgrids[0][0],numgrids,VyEnum); 1444 if(dim==3) inputs->GetParameterValues(&vz_values[0],&gaussgrids[0][0],numgrids,VzEnum); 1445 1446 /*now, compute minimum of velocity :*/ 1447 if(dim==2){ 1448 for(i=0;i<numgrids;i++)vel_values[i]=sqrt(pow(vx_values[i],2)+pow(vy_values[i],2)); 1449 } 1450 else{ 1451 for(i=0;i<numgrids;i++)vel_values[i]=sqrt(pow(vx_values[i],2)+pow(vy_values[i],2)+pow(vz_values[i],2)); 1452 } 1426 inputs->GetParameterValues(&vel_values[0],&gaussgrids[0][0],numgrids,VelEnum); 1453 1427 1454 1428 /*now, compute minimum:*/ -
issm/trunk/src/c/objects/Elements/Sing.cpp
r4285 r4532 489 489 490 490 int dim; 491 double vx;492 double vy;493 double vz;494 491 double maxvel; 495 492 496 /*retrive velocity values at nodes */ 497 inputs->GetParameterValue(&vx,VxEnum); 498 inputs->GetParameterValue(&vy,VyEnum); 499 if(dim==3)inputs->GetParameterValue(&vz,VzEnum); 500 501 /*now, compute maximum of velocity :*/ 502 if(dim==2){ 503 maxvel=sqrt(pow(vx,2)+pow(vy,2)); 504 } 505 else{ 506 maxvel=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2)); 507 } 493 /*retrieve dim parameter: */ 494 parameters->FindParam(&dim,DimEnum); 495 496 /*retrive velocity values at nodes */ 497 inputs->GetParameterValue(&maxvel,VelEnum); 508 498 509 499 /*Assign output pointers:*/ … … 567 557 568 558 int dim; 569 double vx;570 double vy;571 double vz;572 559 double minvel; 573 560 574 /*retrive velocity values at nodes */ 575 inputs->GetParameterValue(&vx,VxEnum); 576 inputs->GetParameterValue(&vy,VyEnum); 577 if(dim==3)inputs->GetParameterValue(&vz,VzEnum); 578 579 /*now, compute minimum of velocity :*/ 580 if(dim==2){ 581 minvel=sqrt(pow(vx,2)+pow(vy,2)); 582 } 583 else{ 584 minvel=sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2)); 585 } 561 /*retrieve dim parameter: */ 562 parameters->FindParam(&dim,DimEnum); 563 564 /*retrive velocity values at nodes */ 565 inputs->GetParameterValue(&minvel,VelEnum); 586 566 587 567 /*Assign output pointers:*/ -
issm/trunk/src/c/objects/Elements/Tria.cpp
r4508 r4532 1658 1658 int dim; 1659 1659 const int numgrids=3; 1660 double gaussgrids[numgrids][3]={{1,0,0},{0,1,0},{0,0,1}}; 1661 double vx_values[numgrids]; 1662 double vy_values[numgrids]; 1663 double vz_values[numgrids]; 1660 double gaussgrids[numgrids][numgrids]={{1,0,0},{0,1,0},{0,0,1}}; 1664 1661 double vel_values[numgrids]; 1665 1662 double maxvel; … … 1669 1666 1670 1667 /*retrive velocity values at nodes */ 1671 inputs->GetParameterValues(&vx_values[0],&gaussgrids[0][0],numgrids,VxEnum); 1672 inputs->GetParameterValues(&vy_values[0],&gaussgrids[0][0],numgrids,VyEnum); 1673 if(dim==3) inputs->GetParameterValues(&vz_values[0],&gaussgrids[0][0],numgrids,VzEnum); 1674 1675 /*now, compute maximum of velocity :*/ 1676 if(dim==2){ 1677 for(i=0;i<numgrids;i++)vel_values[i]=sqrt(pow(vx_values[i],2)+pow(vy_values[i],2)); 1678 } 1679 else{ 1680 for(i=0;i<numgrids;i++)vel_values[i]=sqrt(pow(vx_values[i],2)+pow(vy_values[i],2)+pow(vz_values[i],2)); 1681 } 1668 inputs->GetParameterValues(&vel_values[0],&gaussgrids[0][0],numgrids,VelEnum); 1682 1669 1683 1670 /*now, compute maximum:*/ … … 1779 1766 int dim; 1780 1767 const int numgrids=3; 1781 double gaussgrids[numgrids][3]={{1,0,0},{0,1,0},{0,0,1}}; 1782 double vx_values[numgrids]; 1783 double vy_values[numgrids]; 1784 double vz_values[numgrids]; 1768 double gaussgrids[numgrids][numgrids]={{1,0,0},{0,1,0},{0,0,1}}; 1785 1769 double vel_values[numgrids]; 1786 1770 double minvel; … … 1790 1774 1791 1775 /*retrive velocity values at nodes */ 1792 inputs->GetParameterValues(&vx_values[0],&gaussgrids[0][0],numgrids,VxEnum); 1793 inputs->GetParameterValues(&vy_values[0],&gaussgrids[0][0],numgrids,VyEnum); 1794 if(dim==3) inputs->GetParameterValues(&vz_values[0],&gaussgrids[0][0],numgrids,VzEnum); 1795 1796 /*now, compute minimum of velocity :*/ 1797 if(dim==2){ 1798 for(i=0;i<numgrids;i++)vel_values[i]=sqrt(pow(vx_values[i],2)+pow(vy_values[i],2)); 1799 } 1800 else{ 1801 for(i=0;i<numgrids;i++)vel_values[i]=sqrt(pow(vx_values[i],2)+pow(vy_values[i],2)+pow(vz_values[i],2)); 1802 } 1776 inputs->GetParameterValues(&vel_values[0],&gaussgrids[0][0],numgrids,VelEnum); 1803 1777 1804 1778 /*now, compute minimum:*/ -
issm/trunk/src/c/objects/Materials/Matpar.cpp
r4248 r4532 220 220 /*}}}1*/ 221 221 222 /*Update virtual functions definitions:*/ 223 /*FUNCTION Matpar::InputUpdateFromVector(double* vector, int name, int type) {{{1*/ 224 void Matpar::InputUpdateFromVector(double* vector, int name, int type){ 225 /*Nothing updated yet*/ 226 } 227 /*}}}*/ 228 /*FUNCTION Matpar::InputUpdateFromVector(int* vector, int name, int type) {{{1*/ 229 void Matpar::InputUpdateFromVector(int* vector, int name, int type){ 230 /*Nothing updated yet*/ 231 } 232 /*}}}*/ 233 /*FUNCTION Matpar::InputUpdateFromVector(bool* vector, int name, int type) {{{1*/ 234 void Matpar::InputUpdateFromVector(bool* vector, int name, int type){ 235 /*Nothing updated yet*/ 236 } 237 /*}}}*/ 238 /*FUNCTION Matpar::InputUpdateFromConstant(double constant, int name) {{{1*/ 239 void Matpar::InputUpdateFromConstant(double constant, int name){ 240 241 switch(name){ 242 case RhoIceEnum: 243 this->rho_ice=constant; 244 245 case RhoWaterEnum: 246 this->rho_water=constant; 247 248 case HeatCapacityEnum: 249 this->heatcapacity=constant; 250 251 case ThermalConductivityEnum: 252 this->thermalconductivity=constant; 253 254 case LatentHeatEnum: 255 this->latentheat=constant; 256 257 case BetaEnum: 258 this->beta=constant; 259 260 case MeltingPointEnum: 261 this->meltingpoint=constant; 262 263 case MixedLayerCapacityEnum: 264 this->mixed_layer_capacity=constant; 265 266 case ThermalExchangeVelocityEnum: 267 this->thermalconductivity=constant; 268 269 case GravityEnum: 270 this->g=constant; 271 272 default: 273 break; 274 } 275 276 } 277 /*}}}*/ 278 /*FUNCTION Matpar::InputUpdateFromConstant(int constant, int name) {{{1*/ 279 void Matpar::InputUpdateFromConstant(int constant, int name){ 280 /*Nothing updated yet*/ 281 } 282 /*}}}*/ 283 /*FUNCTION Matpar::InputUpdateFromConstant(bool constant, int name) {{{1*/ 284 void Matpar::InputUpdateFromConstant(bool constant, int name){ 285 /*Nothing updated yet*/ 286 } 287 /*}}}*/ 288 /*FUNCTION Matpar::InputUpdateFromSolution(double* solution) {{{1*/ 289 void Matpar::InputUpdateFromSolution(double* solution){ 290 /*Nothing updated yet*/ 291 } 292 /*}}}*/ 293 222 294 /*Matpar management: */ 223 295 /*FUNCTION Matpar::GetBeta {{{1*/ … … 272 344 } 273 345 /*}}}1*/ 274 /*FUNCTION Matpar::InputUpdateFromVector(double* vector, int name, int type) {{{1*/ 275 void Matpar::InputUpdateFromVector(double* vector, int name, int type){ 276 /*Nothing updated yet*/ 277 } 278 /*}}}*/ 279 /*FUNCTION Matpar::InputUpdateFromVector(int* vector, int name, int type) {{{1*/ 280 void Matpar::InputUpdateFromVector(int* vector, int name, int type){ 281 /*Nothing updated yet*/ 282 } 283 /*}}}*/ 284 /*FUNCTION Matpar::InputUpdateFromVector(bool* vector, int name, int type) {{{1*/ 285 void Matpar::InputUpdateFromVector(bool* vector, int name, int type){ 286 /*Nothing updated yet*/ 287 } 288 /*}}}*/ 289 /*FUNCTION Matpar::InputUpdateFromConstant(double constant, int name) {{{1*/ 290 void Matpar::InputUpdateFromConstant(double constant, int name){ 291 /*Nothing updated yet*/ 292 } 293 /*}}}*/ 294 /*FUNCTION Matpar::InputUpdateFromConstant(int constant, int name) {{{1*/ 295 void Matpar::InputUpdateFromConstant(int constant, int name){ 296 /*Nothing updated yet*/ 297 } 298 /*}}}*/ 299 /*FUNCTION Matpar::InputUpdateFromConstant(bool constant, int name) {{{1*/ 300 void Matpar::InputUpdateFromConstant(bool constant, int name){ 301 /*Nothing updated yet*/ 302 } 303 /*}}}*/ 304 /*FUNCTION Matpar::InputUpdateFromSolution(double* solution) {{{1*/ 305 void Matpar::InputUpdateFromSolution(double* solution){ 306 /*Nothing updated yet*/ 307 } 308 /*}}}*/ 346 347 -
issm/trunk/src/m/solutions/SpawnCore.m
r4525 r4532 11 11 solution_type=femmodel.parameters.SolutionType; 12 12 13 13 14 displaystring(1,'%s%i',[' qmu iteration:'],counter); 14 15 15 16 %first update the inputs to the femmodel using the variables provided to us by dakota. 16 [femmodel.elements femmodel.loads]=InputUpdateFromDakota(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,femmodel.part,variables,variabledescriptors); 17 [femmodel.elements femmodel.loads femmodel.materials]=InputUpdateFromDakota(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,femmodel.part,variables,variabledescriptors); 18 Echo(femmodel.materials) 17 19 18 20 %now run the core solution … … 22 24 %now process the results to get response function values 23 25 responses=DakotaResponses(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,responsedescriptors); 26 27 format long 28 variables 29 responses -
issm/trunk/src/mex/DakotaResponses/DakotaResponses.cpp
r4525 r4532 65 65 delete parameters; 66 66 67 xfree((void**)&responses);68 67 for(i=0;i<numresponses;i++){ 69 68 char* string=responses_descriptors[i]; xfree((void**)&string); 70 69 } 71 70 xfree((void**)&responses_descriptors); 71 72 //xfree((void**)&responses); do not free responses! 72 73 73 74 /*end module: */ -
issm/trunk/src/mex/InputUpdateFromDakota/InputUpdateFromDakota.cpp
r4525 r4532 59 59 WriteData(ELEMENTS,elements); 60 60 WriteData(LOADS,loads); 61 WriteData(MATERIALS,materials); 61 62 62 63 /*Free ressources: */ -
issm/trunk/src/mex/InputUpdateFromDakota/InputUpdateFromDakota.h
r4491 r4532 31 31 #define ELEMENTS (mxArray**)&plhs[0] 32 32 #define LOADS (mxArray**)&plhs[1] 33 #define MATERIALS (mxArray**)&plhs[2] 33 34 34 35 /* serial arg counts: */ 35 36 #undef NLHS 36 #define NLHS 237 #define NLHS 3 37 38 #undef NRHS 38 39 #define NRHS 9 -
issm/trunk/test/Verification/test25_IceSheetIceFrontM2dDakota/Square.par
r4525 r4532 42 42 %Dakota options 43 43 md.variables.nuv=normal_uncertain.empty(); 44 md.variables.nuv(end+1)=normal_uncertain('RhoIce', 1,0.01);44 md.variables.nuv(end+1)=normal_uncertain('RhoIce',md.rho_ice,0.01); 45 45 md.variables.nuv(end+1)=normal_uncertain('DragCoefficient',1,0.01); 46 46
Note:
See TracChangeset
for help on using the changeset viewer.