Changeset 3791
- Timestamp:
- 05/17/10 17:02:57 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 8 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Makefile.am
r3775 r3791 66 66 ./objects/Elements/Tria.h\ 67 67 ./objects/Elements/Tria.cpp\ 68 ./objects/Elements/TriaHook.h\ 69 ./objects/Elements/TriaHook.cpp\ 68 70 ./objects/Inputs/Input.h\ 69 71 ./objects/Inputs/TriaVertexInput.h\ … … 377 379 ./FieldDepthAveragex/FieldDepthAveragex.cpp\ 378 380 ./FieldDepthAveragex/FieldDepthAveragex.h\ 381 ./DepthAverageInputx/DepthAverageInputx.cpp\ 382 ./DepthAverageInputx/DepthAverageInputx.h\ 379 383 ./FieldExtrudex/FieldExtrudex.cpp\ 380 384 ./FieldExtrudex/FieldExtrudex.h\ 385 ./ExtrudeInputx/ExtrudeInputx.cpp\ 386 ./ExtrudeInputx/ExtrudeInputx.h\ 381 387 ./OutputRiftsx/OutputRiftsx.h\ 382 388 ./OutputRiftsx/OutputRiftsx.cpp\ … … 499 505 ./objects/Elements/Tria.h\ 500 506 ./objects/Elements/Tria.cpp\ 507 ./objects/Elements/TriaHook.h\ 508 ./objects/Elements/TriaHook.cpp\ 501 509 ./objects/Inputs/Input.h\ 502 510 ./objects/Inputs/TriaVertexInput.h\ … … 800 808 ./FieldDepthAveragex/FieldDepthAveragex.cpp\ 801 809 ./FieldDepthAveragex/FieldDepthAveragex.h\ 810 ./DepthAverageInputx/DepthAverageInputx.cpp\ 811 ./DepthAverageInputx/DepthAverageInputx.h\ 802 812 ./FieldExtrudex/FieldExtrudex.cpp\ 803 813 ./FieldExtrudex/FieldExtrudex.h\ 814 ./ExtrudeInputx/ExtrudeInputx.cpp\ 815 ./ExtrudeInputx/ExtrudeInputx.h\ 804 816 ./OutputRiftsx/OutputRiftsx.h\ 805 817 ./OutputRiftsx/OutputRiftsx.cpp\ -
issm/trunk/src/c/modules.h
r3773 r3791 59 59 #include "./BamgConvertMeshx/BamgConvertMeshx.h" 60 60 #include "./SplitSolutionVectorx/SplitSolutionVectorx.h" 61 #include "./DepthAverageInputx/DepthAverageInputx.h" 62 #include "./ExtrudeInputx/ExtrudeInputx.h" 61 63 #endif -
issm/trunk/src/c/objects/Elements/Penta.cpp
r3784 r3791 352 352 tria_parameters=this->parameters; 353 353 tria_inputs=(Inputs*)this->inputs->Spawn(indices,3); 354 355 tria=new Tria(this->id,tria_hnodes,tria_hmatice,tria_hmatpar,tria_parameters,tria_inputs); 354 355 tria=new Tria(); 356 tria->id=this->id; 357 tria->inputs=tria_inputs; 358 tria->parameters=tria_parameters; 359 360 /*now deal with hooks and objects: */ 361 tria->hnodes.copy(tria_hnodes); 362 tria->hmatice.copy(tria_hmatice); 363 tria->hmatpar.copy(tria_hmatpar); 364 365 /*recover objects: */ 366 tria->nodes=(Node**)tria->hnodes.deliverp(); 367 tria->matice=(Matice*)tria->hmatice.delivers(); 368 tria->matpar=(Matpar*)tria->hmatpar.delivers(); 356 369 357 370 delete tria_hnodes; -
issm/trunk/src/c/objects/Elements/Tria.cpp
r3784 r3791 23 23 /*FUNCTION Tria::Tria(){{{1*/ 24 24 Tria::Tria(){ 25 this->nodes=NULL; 26 this->matice=NULL; 27 this->matpar=NULL; 25 28 this->inputs=NULL; 26 29 this->parameters=NULL; 27 30 } 28 31 /*}}}*/ 29 /*FUNCTION Tria::Tria(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, Parameters* parameters, Inputs* tria_inputs) {{{1*/ 30 Tria::Tria(int tria_id,Hook* tria_hnodes, Hook* tria_hmatice, Hook* tria_hmatpar, Parameters* tria_parameters, Inputs* tria_inputs): 31 hnodes(tria_hnodes), 32 hmatice(tria_hmatice), 33 hmatpar(tria_hmatpar) 34 { 35 36 /*all the initialization has been done by the initializer, just fill in the id: */ 37 this->id=tria_id; 38 if(tria_inputs){ 39 this->inputs=(Inputs*)tria_inputs->Copy(); 40 } 41 else{ 42 this->inputs=new Inputs(); 43 } 44 /*point parameters: */ 45 this->parameters=tria_parameters; 32 /*FUNCTION Tria::~Tria(){{{1*/ 33 Tria::~Tria(){ 34 delete inputs; 35 this->parameters=NULL; 46 36 } 47 37 /*}}}*/ … … 76 66 tria_matpar_id=iomodel->numberofelements+1; //refers to the constant material parameters object 77 67 78 this-> hnodes.Init(tria_node_ids,3);79 this-> hmatice.Init(&tria_matice_id,1);80 this-> hmatpar.Init(&tria_matpar_id,1);68 this->InitHookNodes(tria_node_ids); 69 this->InitHookMatice(tria_matice_id); 70 this->InitHookMatpar(tria_matpar_id); 81 71 82 72 //intialize inputs, and add as many inputs per element as requested: … … 187 177 } 188 178 /*}}}*/ 189 /*FUNCTION Tria::~Tria(){{{1*/ 190 Tria::~Tria(){ 191 delete inputs; 192 this->parameters=NULL; 179 /*FUNCTION Tria::copy {{{1*/ 180 Object* Tria::copy() { 181 182 Tria* tria=NULL; 183 184 tria=new Tria(); 185 186 /*copy fields: */ 187 tria->id=this->id; 188 if(this->inputs){ 189 tria->inputs=(Inputs*)this->inputs->Copy(); 190 } 191 else{ 192 tria->inputs=new Inputs(); 193 } 194 /*point parameters: */ 195 tria->parameters=this->parameters; 196 197 /*now deal with hooks and objects: */ 198 tria->hnodes.copy(&this->hnodes); 199 tria->hmatice.copy(&this->hmatice); 200 tria->hmatpar.copy(&this->hmatpar); 201 202 /*recover objects: */ 203 tria->nodes=(Node**)tria->hnodes.deliverp(); 204 tria->matice=(Matice*)tria->hmatice.delivers(); 205 tria->matpar=(Matpar*)tria->hmatpar.delivers(); 206 207 return tria; 193 208 } 194 209 /*}}}*/ … … 200 215 /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 201 216 * datasets, using internal ids and offsets hidden in hooks: */ 202 hnodes.configure(nodesin); 203 hmatice.configure(materialsin); 204 hmatpar.configure(materialsin); 217 this->hnodes.configure(nodesin); 218 this->hmatice.configure(materialsin); 219 this->hmatpar.configure(materialsin); 220 221 /*Now, go pick up the objects inside the hooks: */ 222 this->nodes=(Node**)this->hnodes.deliverp(); 223 this->matice=(Matice*)this->hmatice.delivers(); 224 this->matpar=(Matpar*)this->hmatpar.delivers(); 205 225 206 226 /*point parameters to real dataset: */ … … 208 228 209 229 } 210 /*}}}*/211 /*FUNCTION Tria::copy {{{1*/212 Object* Tria::copy() {213 214 return new Tria(this->id,&this->hnodes,&this->hmatice,&this->hmatpar,this->parameters,this->inputs);215 216 }217 218 230 /*}}}*/ 219 231 /*FUNCTION Tria::Demarshall {{{1*/ … … 235 247 hmatice.Demarshall(&marshalled_dataset); 236 248 hmatpar.Demarshall(&marshalled_dataset); 249 250 /*pointers are garbabe, until configuration is carried out: */ 251 nodes=NULL; 252 matice=NULL; 253 matpar=NULL; 237 254 238 255 /*demarshall inputs: */ … … 253 270 printf("Tria:\n"); 254 271 printf(" id: %i\n",id); 255 hnodes.DeepEcho(); 256 hmatice.DeepEcho(); 257 hmatpar.DeepEcho(); 272 nodes[0]->DeepEcho(); 273 nodes[1]->DeepEcho(); 274 nodes[2]->DeepEcho(); 275 matice->DeepEcho(); 276 matpar->DeepEcho(); 258 277 printf(" parameters\n"); 259 278 parameters->DeepEcho(); … … 267 286 268 287 void Tria::Echo(void){ 269 270 printf("Tria:\n"); 271 printf(" id: %i\n",id); 272 hnodes.Echo(); 273 hmatice.Echo(); 274 hmatpar.Echo(); 275 printf(" parameters\n"); 276 parameters->Echo(); 277 printf(" inputs\n"); 278 inputs->Echo(); 288 this->DeepEcho(); 279 289 } 280 290 /*}}}*/ … … 341 351 double B_average; 342 352 double new_h[3]; 343 344 /*dynamic objects pointed to by hooks: */345 Node** nodes=NULL;346 Matpar* matpar=NULL;347 Matice* matice=NULL;348 349 /*recover objects from hooks: */350 nodes=(Node**)hnodes.deliverp();351 matpar=(Matpar*)hmatpar.delivers();352 matice=(Matice*)hmatice.delivers();353 353 354 354 /*Update internal data if inputs holds new values: */ … … 500 500 double value; 501 501 502 /*dynamic objects pointed to by hooks: */503 Node** nodes=NULL;504 Matpar* matpar=NULL;505 Matice* matice=NULL;506 507 /*recover objects from hooks: */508 nodes=(Node**)hnodes.deliverp();509 matpar=(Matpar*)hmatpar.delivers();510 matice=(Matice*)hmatice.delivers();511 512 502 /*plug local pressure values into global pressure vector: */ 513 503 ISSMERROR("Not Implemented yet"); … … 527 517 double gauss[numvertices][numvertices]={{1,0,0},{0,1,0},{0,0,1}}; 528 518 529 /*dynamic objects pointed to by hooks: */530 Node** nodes=NULL;531 Matpar* matpar=NULL;532 Matice* matice=NULL;533 534 /*recover objects from hooks: */535 nodes=(Node**)hnodes.deliverp();536 matpar=(Matpar*)hmatpar.delivers();537 matice=(Matice*)hmatice.delivers();538 539 519 /*Get dof list on which we will plug the pressure values: */ 540 520 GetDofList1(&doflist[0]); … … 563 543 int doflist[numgrids]; 564 544 double value; 565 566 /*dynamic objects pointed to by hooks: */567 Node** nodes= NULL;568 Matpar* matpar =NULL;569 Matice* matice= NULL;570 571 /*recover objects from hooks: */572 nodes=(Node**)hnodes.deliverp();573 matpar=(Matpar*)hmatpar.delivers();574 matice=(Matice*)hmatice.delivers();575 545 576 546 /*plug local pressure values into global pressure vector: */ … … 619 589 double Jdet; 620 590 621 /*dynamic objects pointed to by hooks: */622 Node** nodes=NULL;623 Matpar* matpar=NULL;624 Matice* matice=NULL;625 626 591 /*inputs: */ 627 592 bool onwater; … … 634 599 /*If on water, return 0: */ 635 600 if(onwater)return 0; 636 637 /*recover objects from hooks: */638 nodes=(Node**)hnodes.deliverp();639 matpar=(Matpar*)hmatpar.delivers();640 matice=(Matice*)hmatice.delivers();641 601 642 602 /*retrieve some parameters: */ … … 794 754 int found=0; 795 755 796 /*dynamic objects pointed to by hooks: */797 Node** nodes=NULL;798 Matpar* matpar=NULL;799 Matice* matice=NULL;800 801 756 /*parameters: */ 802 757 double artdiff; 803 804 805 /*recover objects from hooks: */806 nodes=(Node**)hnodes.deliverp();807 matpar=(Matpar*)hmatpar.delivers();808 matice=(Matice*)hmatice.delivers();809 758 810 759 /* Get node coordinates and dof list: */ … … 952 901 int dofs[1]={0}; 953 902 int found; 954 955 /*dynamic objects pointed to by hooks: */956 Node** nodes=NULL;957 Matpar* matpar=NULL;958 Matice* matice=NULL;959 960 961 /*recover objects from hooks: */962 nodes=(Node**) hnodes.deliverp();963 matpar=(Matpar*)hmatpar.delivers();964 matice=(Matice*)hmatice.delivers();965 903 966 904 /* Get node coordinates and dof list: */ … … 1074 1012 double artdiff; 1075 1013 1076 /*dynamic objects pointed to by hooks: */1077 Node** nodes=NULL;1078 Matpar* matpar=NULL;1079 Matice* matice=NULL;1080 1081 /*recover objects from hooks: */1082 nodes=(Node**)hnodes.deliverp();1083 matpar=(Matpar*)hmatpar.delivers();1084 matice=(Matice*)hmatice.delivers();1085 1086 1014 /*Recover velocity: */ 1087 1015 inputs->GetParameterValues(&vx_list[0],&gaussgrids[0][0],3,VxAverageEnum); … … 1252 1180 int dofs[2]={0,1}; 1253 1181 1254 /*dynamic objects pointed to by hooks: */1255 Node** nodes=NULL;1256 Matpar* matpar=NULL;1257 Matice* matice=NULL;1258 1259 1182 /*inputs: */ 1260 1183 bool onwater,shelf; … … 1269 1192 /*First, if we are on water, return empty matrix: */ 1270 1193 if(onwater) return; 1271 1272 /*recover objects from hooks: */1273 nodes =(Node**) hnodes.deliverp();1274 matpar=(Matpar*)hmatpar.delivers();1275 matice=(Matice*)hmatice.delivers();1276 1194 1277 1195 /* Get node coordinates and dof list: */ … … 1402 1320 bool shelf; 1403 1321 int drag_type; 1404 1405 /*dynamic objects pointed to by hooks: */1406 Node** nodes=NULL;1407 Matpar* matpar=NULL;1408 Matice* matice=NULL;1409 1410 1411 /*recover objects from hooks: */1412 nodes=(Node**)hnodes.deliverp();1413 matpar=(Matpar*)hmatpar.delivers();1414 matice=(Matice*)hmatice.delivers();1415 1322 1416 1323 /*retrieve inputs :*/ … … 1562 1469 double Ke_gg_gaussian[numdof][numdof]; //stiffness matrix evaluated at the gaussian point. 1563 1470 1564 /*dynamic objects pointed to by hooks: */1565 Node** nodes=NULL;1566 Matpar* matpar=NULL;1567 Matice* matice=NULL;1568 1569 /*recover objects from hooks: */1570 nodes=(Node**)hnodes.deliverp();1571 matpar=(Matpar*)hmatpar.delivers();1572 matice=(Matice*)hmatice.delivers();1573 1574 1471 /* Get node coordinates and dof list: */ 1575 1472 GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids); … … 1682 1579 double tLD[3]; 1683 1580 double Ke_gaussian[numdof][numdof]={0.0}; 1684 1685 /*dynamic objects pointed to by hooks: */1686 Node** nodes=NULL;1687 Matpar* matpar=NULL;1688 Matice* matice=NULL;1689 1690 /*recover objects from hooks: */1691 nodes=(Node**)hnodes.deliverp();1692 matpar=(Matpar*)hmatpar.delivers();1693 matice=(Matice*)hmatice.delivers();1694 1581 1695 1582 /*Recover constants of ice */ … … 1796 1683 double artdiff; 1797 1684 1798 /*dynamic objects pointed to by hooks: */1799 Node** nodes=NULL;1800 Matpar* matpar=NULL;1801 Matice* matice=NULL;1802 1803 /*recover objects from hooks: */1804 nodes=(Node**)hnodes.deliverp();1805 matpar=(Matpar*)hmatpar.delivers();1806 matice=(Matice*)hmatice.delivers();1807 1808 1685 /*retrieve some parameters: */ 1809 1686 this->parameters->FindParam(&dt,DtEnum); … … 1972 1849 double dt; 1973 1850 1974 /*dynamic objects pointed to by hooks: */1975 Node** nodes=NULL;1976 Matpar* matpar=NULL;1977 Matice* matice=NULL;1978 1979 /*recover objects from hooks: */1980 nodes=(Node**) hnodes.deliverp();1981 matpar=(Matpar*)hmatpar.delivers();1982 matice=(Matice*)hmatice.delivers();1983 1984 1851 /*retrieve some parameters: */ 1985 1852 this->parameters->FindParam(&dt,DtEnum); … … 2087 1954 double Jdet; 2088 1955 2089 /*dynamic objects pointed to by hooks: */2090 Node** nodes=NULL;2091 Matpar* matpar=NULL;2092 Matice* matice=NULL;2093 2094 /*recover objects from hooks: */2095 nodes=(Node**)hnodes.deliverp();2096 matpar=(Matpar*)hmatpar.delivers();2097 matice=(Matice*)hmatice.delivers();2098 2099 1956 /* Get node coordinates and dof list: */ 2100 1957 GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids); … … 2179 2036 /*parameters: */ 2180 2037 double dt; 2181 2182 /*dynamic objects pointed to by hooks: */2183 Node** nodes=NULL;2184 Matpar* matpar=NULL;2185 Matice* matice=NULL;2186 2187 /*recover objects from hooks: */2188 nodes=(Node**)hnodes.deliverp();2189 matpar=(Matpar*)hmatpar.delivers();2190 matice=(Matice*)hmatice.delivers();2191 2038 2192 2039 /*retrieve some parameters: */ … … 2327 2174 double melting_g; 2328 2175 2329 /*dynamic objects pointed to by hooks: */2330 Node** nodes=NULL;2331 Matpar* matpar=NULL;2332 Matice* matice=NULL;2333 2334 /*recover objects from hooks: */2335 nodes=(Node**)hnodes.deliverp();2336 matpar=(Matpar*)hmatpar.delivers();2337 matice=(Matice*)hmatice.delivers();2338 2339 2176 /* Get node coordinates and dof list: */ 2340 2177 GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids); … … 2412 2249 double dhdt_g; 2413 2250 2414 /*dynamic objects pointed to by hooks: */2415 Node** nodes=NULL;2416 Matpar* matpar=NULL;2417 Matice* matice=NULL;2418 2419 /*recover objects from hooks: */2420 nodes=(Node**) hnodes.deliverp();2421 matpar=(Matpar*)hmatpar.delivers();2422 matice=(Matice*)hmatice.delivers();2423 2424 2251 /* Get node coordinates and dof list: */ 2425 2252 GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids); … … 2497 2324 double melting_g; 2498 2325 2499 /*dynamic objects pointed to by hooks: */2500 Node** nodes=NULL;2501 Matpar* matpar=NULL;2502 Matice* matice=NULL;2503 2504 /*recover objects from hooks: */2505 nodes=(Node**)hnodes.deliverp();2506 matpar=(Matpar*)hmatpar.delivers();2507 matice=(Matice*)hmatice.delivers();2508 2509 2326 /* Get node coordinates and dof list: */ 2510 2327 GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids); … … 2589 2406 double dbdx,dbdy; 2590 2407 2591 /*dynamic objects pointed to by hooks: */2592 Node** nodes=NULL;2593 Matpar* matpar=NULL;2594 Matice* matice=NULL;2595 2596 /*recover objects from hooks: */2597 nodes=(Node**)hnodes.deliverp();2598 matpar=(Matpar*)hmatpar.delivers();2599 matice=(Matice*)hmatice.delivers();2600 2601 2408 /* Get node coordinates and dof list: */ 2602 2409 GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids); … … 2696 2503 double thickness; 2697 2504 2698 /*dynamic objects pointed to by hooks: */2699 Node** nodes=NULL;2700 Matpar* matpar=NULL;2701 Matice* matice=NULL;2702 2703 2505 /*inputs: */ 2704 2506 bool onwater; … … 2711 2513 /*First, if we are on water, return empty vector: */ 2712 2514 if(onwater)return; 2713 2714 /*recover objects from hooks: */2715 nodes=(Node**)hnodes.deliverp();2716 matpar=(Matpar*)hmatpar.delivers();2717 matice=(Matice*)hmatice.delivers();2718 2515 2719 2516 /* Get node coordinates and dof list: */ … … 2821 2618 double dt; 2822 2619 2823 /*dynamic objects pointed to by hooks: */2824 Node** nodes=NULL;2825 Matpar* matpar=NULL;2826 Matice* matice=NULL;2827 2828 /*recover objects from hooks: */2829 nodes=(Node**)hnodes.deliverp();2830 matpar=(Matpar*)hmatpar.delivers();2831 matice=(Matice*)hmatice.delivers();2832 2833 2620 /*retrieve some parameters: */ 2834 2621 this->parameters->FindParam(&dt,DtEnum); … … 2910 2697 double dt; 2911 2698 2912 /*dynamic objects pointed to by hooks: */2913 Node** nodes=NULL;2914 Matpar* matpar=NULL;2915 Matice* matice=NULL;2916 2917 /*recover objects from hooks: */2918 nodes=(Node**)hnodes.deliverp();2919 matpar=(Matpar*)hmatpar.delivers();2920 matice=(Matice*)hmatice.delivers();2921 2922 2699 /*retrieve some parameters: */ 2923 2700 this->parameters->FindParam(&dt,DtEnum); … … 2998 2775 double pe_g_gaussian[numdof]; 2999 2776 double slope[2]; 3000 3001 /*dynamic objects pointed to by hooks: */3002 Node** nodes=NULL;3003 Matpar* matpar=NULL;3004 Matice* matice=NULL;3005 3006 /*recover objects from hooks: */3007 nodes=(Node**)hnodes.deliverp();3008 matpar=(Matpar*)hmatpar.delivers();3009 matice=(Matice*)hmatice.delivers();3010 2777 3011 2778 /* Get node coordinates and dof list: */ … … 3105 2872 double scalar_ocean; 3106 2873 3107 /*dynamic objects pointed to by hooks: */3108 Node** nodes=NULL;3109 Matpar* matpar=NULL;3110 Matice* matice=NULL;3111 3112 /*recover objects from hooks: */3113 nodes=(Node**)hnodes.deliverp();3114 matpar=(Matpar*)hmatpar.delivers();3115 matice=(Matice*)hmatice.delivers();3116 3117 2874 /* Get node coordinates and dof list: */ 3118 2875 GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids); … … 3222 2979 double scalar; 3223 2980 3224 3225 /*dynamic objects pointed to by hooks: */3226 Node** nodes=NULL;3227 Matpar* matpar=NULL;3228 Matice* matice=NULL;3229 3230 /*recover objects from hooks: */3231 nodes=(Node**)hnodes.deliverp();3232 matpar=(Matpar*)hmatpar.delivers();3233 matice=(Matice*)hmatice.delivers();3234 2981 3235 2982 /*retrieve inputs :*/ … … 3383 3130 double S=0; 3384 3131 double fit=-1; 3385 3386 /*dynamic objects pointed to by hooks: */3387 Node** nodes=NULL;3388 Matpar* matpar=NULL;3389 Matice* matice=NULL;3390 3391 /*recover objects from hooks: */3392 nodes=(Node**)hnodes.deliverp();3393 matpar=(Matpar*)hmatpar.delivers();3394 matice=(Matice*)hmatice.delivers();3395 3132 3396 3133 /*retrieve some parameters: */ … … 3594 3331 double x1,y1,x2,y2,x3,y3; 3595 3332 3596 /*dynamic objects pointed to by hooks: */3597 Node** nodes=NULL;3598 3599 /*recover objects from hooks: */3600 nodes=(Node**)hnodes.deliverp();3601 3602 3333 /*Get xyz list: */ 3603 3334 GetVerticesCoordinates(&xyz_list[0][0], nodes, numgrids); … … 3616 3347 double xyz_list[numgrids][3]; 3617 3348 double x1,y1,x2,y2,x3,y3; 3618 3619 /*dynamic objects pointed to by hooks: */3620 Node** nodes=NULL;3621 3622 /*recover objects from hooks: */3623 nodes=(Node**)hnodes.deliverp();3624 3349 3625 3350 /*Get area: */ … … 3800 3525 int numberofdofspernode; 3801 3526 3802 /*dynamic objects pointed to by hooks: */3803 Node** nodes=NULL;3804 3805 /*recover objects from hooks: */3806 nodes=(Node**)hnodes.deliverp();3807 3808 3527 for(i=0;i<3;i++){ 3809 3528 nodes[i]->GetDofList(&doflist_per_node[0],&numberofdofspernode); … … 3821 3540 void Tria::GetDofList1(int* doflist){ 3822 3541 3823 /*dynamic objects pointed to by hooks: */3824 Node** nodes=NULL;3825 3826 /*recover objects from hooks: */3827 nodes=(Node**)hnodes.deliverp();3828 3829 3542 int i; 3830 3543 for(i=0;i<3;i++){ … … 3980 3693 void* Tria::GetMatPar(){ 3981 3694 3982 /*dynamic objects pointed to by hooks: */3983 Matpar* matpar=NULL;3984 3985 /*recover objects from hooks: */3986 matpar=(Matpar*)hmatpar.delivers();3987 3988 3695 return matpar; 3989 3696 } … … 4066 3773 Node** pnodes=NULL; 4067 3774 4068 /*dynamic objects pointed to by hooks: */4069 Node** nodes=NULL;4070 4071 3775 /*recover nodes: */ 4072 3776 pnodes=(Node**)vpnodes; 4073 3777 4074 /*recover objects from hooks: */4075 nodes=(Node**)hnodes.deliverp();4076 4077 3778 for(i=0;i<3;i++){ 4078 3779 pnodes[i]=nodes[i]; … … 4254 3955 double cm_maxdmp_slope; 4255 3956 4256 /*dynamic objects pointed to by hooks: */4257 Node** nodes=NULL;4258 Matpar* matpar=NULL;4259 Matice* matice=NULL;4260 4261 /*recover objects from hooks: */4262 nodes=(Node**)hnodes.deliverp();4263 matpar=(Matpar*)hmatpar.delivers();4264 matice=(Matice*)hmatice.delivers();4265 4266 3957 /*retrieve some parameters: */ 4267 3958 this->parameters->FindParam(&cm_noisedmp,CmNoiseDmpEnum); … … 4418 4109 double cm_maxdmp_value; 4419 4110 double cm_maxdmp_slope; 4420 4421 /*dynamic objects pointed to by hooks: */4422 Node** nodes=NULL;4423 Matpar* matpar=NULL;4424 Matice* matice=NULL;4425 4426 /*recover objects from hooks: */4427 nodes=(Node**)hnodes.deliverp();4428 matpar=(Matpar*)hmatpar.delivers();4429 matice=(Matice*)hmatice.delivers();4430 4111 4431 4112 /*retrieve inputs :*/ … … 4630 4311 double cm_maxdmp_slope; 4631 4312 4632 /*dynamic objects pointed to by hooks: */4633 Node** nodes=NULL;4634 Matpar* matpar=NULL;4635 Matice* matice=NULL;4636 4637 4313 /*retrieve inputs :*/ 4638 4314 inputs->GetParameterValue(&shelf,ElementOnIceShelfEnum); … … 4648 4324 /*Get out if shelf*/ 4649 4325 if(shelf)return; 4650 4651 /*recover objects from hooks: */4652 nodes=(Node**)hnodes.deliverp();4653 matpar=(Matpar*)hmatpar.delivers();4654 matice=(Matice*)hmatice.delivers();4655 4326 4656 4327 /* Get node coordinates and dof list: */ … … 4808 4479 double rho_ice; 4809 4480 4810 /*dynamic objects pointed to by hooks: */4811 Node** nodes=NULL;4812 Matpar* matpar=NULL;4813 4814 /*recover objects from hooks: */4815 nodes=(Node**)hnodes.deliverp();4816 matpar=(Matpar*)hmatpar.delivers();4817 4818 4481 /*Get material parameters :*/ 4819 4482 rho_ice=matpar->GetRhoIce(); … … 4910 4573 double fit=-1; 4911 4574 4912 /*dynamic objects pointed to by hooks: */4913 Node** nodes=NULL;4914 Matpar* matpar=NULL;4915 Matice* matice=NULL;4916 4917 4575 /*inputs: */ 4918 4576 bool onwater; … … 4925 4583 /*If on water, return 0: */ 4926 4584 if(onwater)return 0; 4927 4928 /*recover objects from hooks: */4929 nodes=(Node**)hnodes.deliverp();4930 matpar=(Matpar*)hmatpar.delivers();4931 matice=(Matice*)hmatice.delivers();4932 4585 4933 4586 /* Get node coordinates and dof list: */ … … 5119 4772 double normal[3]; 5120 4773 5121 /*dynamic objects pointed to by hooks: */5122 Node** nodes=NULL;5123 5124 4774 /*inputs: */ 5125 4775 bool onwater; … … 5133 4783 if(fit!=3)return 0; 5134 4784 5135 /*recover objects from hooks: */5136 nodes=(Node**)hnodes.deliverp();5137 5138 4785 /*If on water, return 0: */ 5139 4786 if(onwater)return 0; -
issm/trunk/src/c/objects/Elements/Tria.h
r3783 r3791 9 9 /*{{{1*/ 10 10 #include "./Element.h" 11 class Hook; 11 #include "./TriaHook.h" 12 12 class Parameters; 13 13 class Inputs; 14 14 class IoModel; 15 class Node; 16 class Matice; 17 class Matpar; 15 18 16 19 #include "../../include/include.h" … … 18 21 /*}}}*/ 19 22 20 class Tria: public Element {23 class Tria: public Element,public TriaHook{ 21 24 22 25 public: … … 24 27 int id; 25 28 26 Hook hnodes; //hook to 3 nodes27 Hook hmatice; //hook to 1 matice28 Hook hmatpar; //hook to 1 matpar29 Node** nodes; 30 Matice* matice; 31 Matpar* matpar; 29 32 30 33 Parameters* parameters; //pointer to solution parameters … … 33 36 /*FUNCTION constructors, destructors {{{1*/ 34 37 Tria(); 35 Tria(int tria_id, Hook* tria_hnodes, Hook* tria_hmatice, Hook* tria_hmatpar, Parameters* parameters, Inputs* tria_inputs);38 Tria(int tria_id,Node* tria_nodes, Matice* tria_matice, Matpar* tria_matpar, Parameters* parameters, Inputs* tria_inputs); 36 39 Tria(int tria_id,int i, IoModel* iomodel); 37 40 ~Tria(); -
issm/trunk/src/c/objects/Hook.cpp
r3784 r3791 66 66 /*FUNCTION Hook::Hook(Hook* input) {{{1*/ 67 67 Hook::Hook(Hook* input){ 68 69 int i; 70 Object** input_objects=NULL; 71 int* input_ids=NULL; 72 int* input_offsets=NULL; 73 74 /*get internals of input: */ 75 this->num=input->GetNum(); 76 input_objects=input->GetObjects(); 77 input_ids=input->Ids(); 78 input_offsets=input->GetOffsets(); 79 80 if(this->num){ 81 this->objects=(Object**)xmalloc(this->num*sizeof(Object*)); 82 this->ids=(int*)xmalloc(this->num*sizeof(int)); 83 this->offsets=(int*)xmalloc(this->num*sizeof(int)); 84 } 85 86 87 for(i=0;i<this->num;i++){ 88 this->objects[i]=input_objects[i]; 89 this->offsets[i]=input_offsets[i]; 90 this->ids[i]=input_ids[i]; 91 } 92 } 93 /*}}}*/ 94 /*FUNCTION Hook::Hook(Hook* input) {{{1*/ 95 void Hook::copy(Hook* input){ 68 96 69 97 int i; -
issm/trunk/src/c/objects/Hook.h
r3681 r3791 31 31 Hook(Object** objects, int* ids, int* offsets,int num); 32 32 Hook(Hook* hook); 33 void copy(Hook* hook); 33 34 ~Hook(); 34 35 void Marshall(char** pmarshalled_dataset); -
issm/trunk/src/c/parallel/prognostic_core.cpp
r3774 r3791 17 17 Result* result=NULL; 18 18 19 /*intermediary: */20 Vec u_g=NULL;21 22 19 /*solutions: */ 23 20 Vec h_g=NULL; … … 25 22 /*flags: */ 26 23 int verbose=0; 27 int numberofdofspernode;28 int numberofnodes;29 int dofs[2]={1,1};30 24 31 25 /*fem prognostic model: */ … … 38 32 //first recover parameters common to all solutions 39 33 model->FindParam(&verbose,VerboseEnum); 40 model->FindParam(&numberofnodes,NumberOfNodesEnum);41 model->FindParam(&numberofdofspernode,NumberOfDofsPerNodeEnum);42 34 43 35 _printf_("depth averaging velocity...\n"); 44 //u_g=inputs->Get("velocity",&dofs[0],2); 45 ISSMERROR("not supported yet!"); 46 FieldDepthAveragex( u_g, fem_p->elements,fem_p->nodes, fem_p->vertices,fem_p->loads, fem_p->materials,fem_p->parameters,"velocity"); 47 //inputs->Add("velocity_average",u_g,2,numberofnodes); 36 DepthAverageInputx(fem_p->elements,fem_p->nodes, fem_p->vertices,fem_p->loads, fem_p->materials,fem_p->parameters,VxEnum); 37 DepthAverageInputx(fem_p->elements,fem_p->nodes, fem_p->vertices,fem_p->loads, fem_p->materials,fem_p->parameters,VyEnum); 48 38 49 39 _printf_("call computational core:\n"); 50 40 diagnostic_core_linear(&h_g,fem_p,PrognosticAnalysisEnum,NoneAnalysisEnum); 41 42 _printf_("update inputs:\n"); 43 fem_p->UpdateInputsFromSolution(h_g,PrognosticAnalysisEnum,NoneAnalysisEnum); 51 44 52 45 _printf_("extrude computed thickness on all layers:\n"); 53 FieldExtrudex( h_g, fem_p->elements,fem_p->nodes, fem_p->vertices,fem_p->loads, fem_p->materials,fem_p->parameters,"thickness",0);54 55 /*Plug results into output dataset: */56 result=new Result(results->Size()+1,0,1,"h_g",h_g);46 ExtrudeInputx(fem_p->elements,fem_p->nodes, fem_p->vertices,fem_p->loads, fem_p->materials,fem_p->parameters,ThicknessEnum); 47 48 _printf_("extract result from extruded inputs: \n"); 49 InputToResult(&result,fem_p->elements,fem_p->nodes, fem_p->vertices,fem_p->loads, fem_p->materials,fem_p->parameters,ThicknessEnum,results->Size()+1,0,1); 57 50 results->AddObject(result); 58 51 59 52 /*Free ressources:*/ 60 VecFree(&u_g);61 53 VecFree(&h_g); 62 54 }
Note:
See TracChangeset
for help on using the changeset viewer.