Changeset 9256


Ignore:
Timestamp:
08/10/11 15:23:52 (14 years ago)
Author:
Mathieu Morlighem
Message:

added prototype in header file

Location:
issm/trunk/src/c/objects/Elements
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r9255 r9256  
    23362336}
    23372337/*}}}*/
    2338 /*FUNCTION Tria::GetNodeIndex {{{1*/
    2339 int Tria::GetNodeIndex(Node* node){
    2340 
    2341         _assert_(nodes);
    2342         for(int i=0;i<NUMVERTICES;i++){
    2343                 if(node==nodes[i])
    2344                  return i;
    2345         }
    2346         _error_("Node provided not found among element nodes");
    2347 }
    2348 /*}}}*/
    2349 /*FUNCTION Tria::GetParameterListOnVertices(double* pvalue,int enumtype) {{{1*/
    2350 void Tria::GetParameterListOnVertices(double* pvalue,int enumtype){
    2351 
    2352         /*Intermediaries*/
    2353         double     value[NUMVERTICES];
    2354         GaussTria *gauss              = NULL;
    2355 
    2356         /*Recover input*/
    2357         Input* input=inputs->GetInput(enumtype);
    2358         if (!input) _error_("Input %s not found in element",EnumToStringx(enumtype));
    2359 
    2360         /*Checks in debugging mode*/
    2361         _assert_(pvalue);
    2362 
    2363         /* Start looping on the number of vertices: */
    2364         gauss=new GaussTria();
    2365         for (int iv=0;iv<NUMVERTICES;iv++){
    2366                 gauss->GaussVertex(iv);
    2367                 input->GetParameterValue(&pvalue[iv],gauss);
    2368         }
    2369 
    2370         /*clean-up*/
    2371         delete gauss;
    2372 }
    2373 /*}}}*/
    2374 /*FUNCTION Tria::GetParameterListOnVertices(double* pvalue,int enumtype,double defaultvalue) {{{1*/
    2375 void Tria::GetParameterListOnVertices(double* pvalue,int enumtype,double defaultvalue){
    2376 
    2377         double     value[NUMVERTICES];
    2378         GaussTria *gauss = NULL;
    2379         Input     *input = inputs->GetInput(enumtype);
    2380 
    2381         /*Checks in debugging mode*/
    2382         _assert_(pvalue);
    2383 
    2384         /* Start looping on the number of vertices: */
    2385         if (input){
    2386                 gauss=new GaussTria();
    2387                 for (int iv=0;iv<NUMVERTICES;iv++){
    2388                         gauss->GaussVertex(iv);
    2389                         input->GetParameterValue(&pvalue[iv],gauss);
    2390                 }
    2391         }
    2392         else{
    2393                 for (int iv=0;iv<NUMVERTICES;iv++) pvalue[iv]=defaultvalue;
    2394         }
    2395 
    2396         /*clean-up*/
    2397         delete gauss;
    2398 }
    2399 /*}}}*/
    2400 /*FUNCTION Tria::GetParameterListOnVertices(double* pvalue,int enumtype,double defaultvalue,int index) TO BE REMOVED{{{1*/
    2401 void Tria::GetParameterListOnVertices(double* pvalue,int enumtype,double defaultvalue,int index){
    2402 
    2403         double     value[NUMVERTICES];
    2404         GaussTria *gauss = NULL;
    2405         Input     *input = inputs->GetInput(enumtype);
    2406 
    2407         /*Checks in debugging mode*/
    2408         _assert_(pvalue);
    2409 
    2410         /* Start looping on the number of vertices: */
    2411         if (input){
    2412                 gauss=new GaussTria();
    2413                 for (int iv=0;iv<NUMVERTICES;iv++){
    2414                         gauss->GaussVertex(iv);
    2415                         input->GetParameterValue(&pvalue[iv],gauss,index);
    2416                 }
    2417         }
    2418         else{
    2419                 for (int iv=0;iv<NUMVERTICES;iv++) pvalue[iv]=defaultvalue;
    2420         }
    2421 
    2422         /*clean-up*/
    2423         delete gauss;
    2424 }
    2425 /*}}}*/
    2426 /*FUNCTION Tria::GetParameterValue(double* pvalue,Node* node,int enumtype) {{{1*/
    2427 void Tria::GetParameterValue(double* pvalue,Node* node,int enumtype){
    2428 
    2429         Input* input=inputs->GetInput(enumtype);
    2430         if(!input) _error_("No input of type %s found in tria",EnumToStringx(enumtype));
    2431 
    2432         GaussTria* gauss=new GaussTria();
    2433         gauss->GaussVertex(this->GetNodeIndex(node));
    2434 
    2435         input->GetParameterValue(pvalue,gauss);
    2436         delete gauss;
    2437 }
    2438 /*}}}*/
    2439 /*FUNCTION Tria::GetSidList {{{1*/
    2440 void  Tria::GetSidList(int* sidlist){
    2441 
    2442         int i;
    2443         for(i=0;i<NUMVERTICES;i++) sidlist[i]=nodes[i]->GetSidList();
    2444 
    2445 }
    2446 /*}}}*/
    2447 /*FUNCTION Tria::GetSolutionFromInputs{{{1*/
    2448 void  Tria::GetSolutionFromInputs(Vec solution){
    2449 
    2450         /*retrive parameters: */
    2451         int analysis_type;
    2452         parameters->FindParam(&analysis_type,AnalysisTypeEnum);
    2453 
    2454         /*Just branch to the correct InputUpdateFromSolution generator, according to the type of analysis we are carrying out: */
    2455         if (analysis_type==DiagnosticHorizAnalysisEnum)
    2456          GetSolutionFromInputsDiagnosticHoriz(solution);
    2457         else if (analysis_type==DiagnosticHutterAnalysisEnum)
    2458          GetSolutionFromInputsDiagnosticHutter(solution);
    2459         else if (analysis_type==HydrologyAnalysisEnum)
    2460          GetSolutionFromInputsHydrology(solution);
    2461         else
    2462          _error_("analysis: %s not supported yet",EnumToStringx(analysis_type));
    2463 
    2464 }
    2465 /*}}}*/
    2466 /*FUNCTION Tria::GetSolutionFromInputsDiagnosticHoriz{{{1*/
    2467 void  Tria::GetSolutionFromInputsDiagnosticHoriz(Vec solution){
    2468 
    2469         const int    numdof=NDOF2*NUMVERTICES;
    2470 
    2471         int          i;
    2472         int*         doflist=NULL;
    2473         double       vx,vy;
    2474         double       values[numdof];
    2475         GaussTria*   gauss=NULL;
    2476 
    2477         /*Get dof list: */
    2478         GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
    2479 
    2480         /*Get inputs*/
    2481         Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
    2482         Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
    2483 
    2484         /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
    2485         /*P1 element only for now*/
    2486         gauss=new GaussTria();
    2487         for(i=0;i<NUMVERTICES;i++){
    2488 
    2489                 gauss->GaussVertex(i);
    2490 
    2491                 /*Recover vx and vy*/
    2492                 vx_input->GetParameterValue(&vx,gauss);
    2493                 vy_input->GetParameterValue(&vy,gauss);
    2494                 values[i*NDOF2+0]=vx;
    2495                 values[i*NDOF2+1]=vy;
    2496         }
    2497 
    2498         VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);
    2499 
    2500         /*Free ressources:*/
    2501         delete gauss;
    2502         xfree((void**)&doflist);
    2503 }
    2504 /*}}}*/
    2505 /*FUNCTION Tria::GetSolutionFromInputsDiagnosticHutter{{{1*/
    2506 void  Tria::GetSolutionFromInputsDiagnosticHutter(Vec solution){
    2507 
    2508         const int    numdof=NDOF2*NUMVERTICES;
    2509 
    2510         int i,dummy;
    2511         int*         doflist=NULL;
    2512         double       vx,vy;
    2513         double       values[numdof];
    2514         GaussTria*   gauss=NULL;
    2515 
    2516         /*Get dof list: */
    2517         GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
    2518 
    2519         /*Get inputs*/
    2520         Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
    2521         Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
    2522 
    2523         /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
    2524         /*P1 element only for now*/
    2525         gauss=new GaussTria();
    2526         for(i=0;i<NUMVERTICES;i++){
    2527 
    2528                 gauss->GaussVertex(i);
    2529 
    2530                 /*Recover vx and vy*/
    2531                 vx_input->GetParameterValue(&vx,gauss);
    2532                 vy_input->GetParameterValue(&vy,gauss);
    2533                 values[i*NDOF2+0]=vx;
    2534                 values[i*NDOF2+1]=vy;
    2535         }
    2536 
    2537         VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);
    2538 
    2539         /*Free ressources:*/
    2540         delete gauss;
    2541         xfree((void**)&doflist);
    2542 }
    2543 /*}}}*/
    2544 /*FUNCTION Tria::GetSolutionFromInputsHydrology{{{1*/
    2545 void  Tria::GetSolutionFromInputsHydrology(Vec solution){
    2546 
    2547         const int    numdof=NDOF1*NUMVERTICES;
    2548 
    2549         int i,dummy;
    2550         int*         doflist=NULL;
    2551         double       watercolumn;
    2552         double       values[numdof];
    2553         GaussTria*   gauss=NULL;
    2554 
    2555         /*Get dof list: */
    2556         GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
    2557 
    2558         /*Get inputs*/
    2559         Input* watercolumn_input=inputs->GetInput(WatercolumnEnum); _assert_(watercolumn_input);
    2560 
    2561         /*Ok, we have watercolumn values, fill in watercolumn array: */
    2562         /*P1 element only for now*/
    2563         gauss=new GaussTria();
    2564         for(i=0;i<NUMVERTICES;i++){
    2565 
    2566                 gauss->GaussVertex(i);
    2567 
    2568                 /*Recover watercolumn*/
    2569                 watercolumn_input->GetParameterValue(&watercolumn,gauss);
    2570                 values[i]=watercolumn;
    2571         }
    2572 
    2573         VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);
    2574 
    2575         /*Free ressources:*/
    2576         delete gauss;
    2577         xfree((void**)&doflist);
    2578 }
    2579 /*}}}*/
    2580 /*FUNCTION Tria::GetStrainRate2d(double* epsilon,double* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input){{{1*/
    2581 void Tria::GetStrainRate2d(double* epsilon,double* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input){
    2582         /*Compute the 2d Strain Rate (3 components):
    2583          * epsilon=[exx eyy exy] */
    2584 
    2585         int i;
    2586         double epsilonvx[3];
    2587         double epsilonvy[3];
    2588 
    2589         /*Check that both inputs have been found*/
    2590         if (!vx_input || !vy_input){
    2591                 _error_("Input missing. Here are the input pointers we have for vx: %p, vy: %p\n",vx_input,vy_input);
    2592         }
    2593 
    2594         /*Get strain rate assuming that epsilon has been allocated*/
    2595         vx_input->GetVxStrainRate2d(epsilonvx,xyz_list,gauss);
    2596         vy_input->GetVyStrainRate2d(epsilonvy,xyz_list,gauss);
    2597 
    2598         /*Sum all contributions*/
    2599         for(i=0;i<3;i++) epsilon[i]=epsilonvx[i]+epsilonvy[i];
    2600 }
    2601 /*}}}*/
    2602 /*FUNCTION Tria::GetVectorFromInputs{{{1*/
    2603 void  Tria::GetVectorFromInputs(Vec vector,int input_enum){
    2604 
    2605         int doflist1[NUMVERTICES];
    2606 
    2607         /*Get out if this is not an element input*/
    2608         if (!IsInput(input_enum)) return;
    2609 
    2610         /*Prepare index list*/
    2611         this->GetDofList1(&doflist1[0]);
    2612 
    2613         /*Get input (either in element or material)*/
    2614         Input* input=inputs->GetInput(input_enum);
    2615         if(!input) _error_("Input %s not found in element",EnumToStringx(input_enum));
    2616 
    2617         /*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
    2618         input->GetVectorFromInputs(vector,&doflist1[0]);
    2619 }
    2620 /*}}}*/
    26212338/*FUNCTION Tria::GetHydrologyK {{{1*/
    26222339void Tria::GetHydrologyK(double* K,double* xyz_list,GaussTria* gauss){
     
    26892406        v[0]=pow(w,2)/(12 * mu_water)*(rho_ice*g*dsdx+(rho_water-rho_ice)*g*dbdx);
    26902407        v[1]=pow(w,2)/(12 * mu_water)*(rho_ice*g*dsdy+(rho_water-rho_ice)*g*dbdy);
     2408}
     2409/*}}}*/
     2410/*FUNCTION Tria::GetNodeIndex {{{1*/
     2411int Tria::GetNodeIndex(Node* node){
     2412
     2413        _assert_(nodes);
     2414        for(int i=0;i<NUMVERTICES;i++){
     2415                if(node==nodes[i])
     2416                 return i;
     2417        }
     2418        _error_("Node provided not found among element nodes");
     2419}
     2420/*}}}*/
     2421/*FUNCTION Tria::GetParameterListOnVertices(double* pvalue,int enumtype) {{{1*/
     2422void Tria::GetParameterListOnVertices(double* pvalue,int enumtype){
     2423
     2424        /*Intermediaries*/
     2425        double     value[NUMVERTICES];
     2426        GaussTria *gauss              = NULL;
     2427
     2428        /*Recover input*/
     2429        Input* input=inputs->GetInput(enumtype);
     2430        if (!input) _error_("Input %s not found in element",EnumToStringx(enumtype));
     2431
     2432        /*Checks in debugging mode*/
     2433        _assert_(pvalue);
     2434
     2435        /* Start looping on the number of vertices: */
     2436        gauss=new GaussTria();
     2437        for (int iv=0;iv<NUMVERTICES;iv++){
     2438                gauss->GaussVertex(iv);
     2439                input->GetParameterValue(&pvalue[iv],gauss);
     2440        }
     2441
     2442        /*clean-up*/
     2443        delete gauss;
     2444}
     2445/*}}}*/
     2446/*FUNCTION Tria::GetParameterListOnVertices(double* pvalue,int enumtype,double defaultvalue) {{{1*/
     2447void Tria::GetParameterListOnVertices(double* pvalue,int enumtype,double defaultvalue){
     2448
     2449        double     value[NUMVERTICES];
     2450        GaussTria *gauss = NULL;
     2451        Input     *input = inputs->GetInput(enumtype);
     2452
     2453        /*Checks in debugging mode*/
     2454        _assert_(pvalue);
     2455
     2456        /* Start looping on the number of vertices: */
     2457        if (input){
     2458                gauss=new GaussTria();
     2459                for (int iv=0;iv<NUMVERTICES;iv++){
     2460                        gauss->GaussVertex(iv);
     2461                        input->GetParameterValue(&pvalue[iv],gauss);
     2462                }
     2463        }
     2464        else{
     2465                for (int iv=0;iv<NUMVERTICES;iv++) pvalue[iv]=defaultvalue;
     2466        }
     2467
     2468        /*clean-up*/
     2469        delete gauss;
     2470}
     2471/*}}}*/
     2472/*FUNCTION Tria::GetParameterListOnVertices(double* pvalue,int enumtype,double defaultvalue,int index) TO BE REMOVED{{{1*/
     2473void Tria::GetParameterListOnVertices(double* pvalue,int enumtype,double defaultvalue,int index){
     2474
     2475        double     value[NUMVERTICES];
     2476        GaussTria *gauss = NULL;
     2477        Input     *input = inputs->GetInput(enumtype);
     2478
     2479        /*Checks in debugging mode*/
     2480        _assert_(pvalue);
     2481
     2482        /* Start looping on the number of vertices: */
     2483        if (input){
     2484                gauss=new GaussTria();
     2485                for (int iv=0;iv<NUMVERTICES;iv++){
     2486                        gauss->GaussVertex(iv);
     2487                        input->GetParameterValue(&pvalue[iv],gauss,index);
     2488                }
     2489        }
     2490        else{
     2491                for (int iv=0;iv<NUMVERTICES;iv++) pvalue[iv]=defaultvalue;
     2492        }
     2493
     2494        /*clean-up*/
     2495        delete gauss;
     2496}
     2497/*}}}*/
     2498/*FUNCTION Tria::GetParameterValue(double* pvalue,Node* node,int enumtype) {{{1*/
     2499void Tria::GetParameterValue(double* pvalue,Node* node,int enumtype){
     2500
     2501        Input* input=inputs->GetInput(enumtype);
     2502        if(!input) _error_("No input of type %s found in tria",EnumToStringx(enumtype));
     2503
     2504        GaussTria* gauss=new GaussTria();
     2505        gauss->GaussVertex(this->GetNodeIndex(node));
     2506
     2507        input->GetParameterValue(pvalue,gauss);
     2508        delete gauss;
     2509}
     2510/*}}}*/
     2511/*FUNCTION Tria::GetSidList {{{1*/
     2512void  Tria::GetSidList(int* sidlist){
     2513
     2514        int i;
     2515        for(i=0;i<NUMVERTICES;i++) sidlist[i]=nodes[i]->GetSidList();
     2516
     2517}
     2518/*}}}*/
     2519/*FUNCTION Tria::GetSolutionFromInputs{{{1*/
     2520void  Tria::GetSolutionFromInputs(Vec solution){
     2521
     2522        /*retrive parameters: */
     2523        int analysis_type;
     2524        parameters->FindParam(&analysis_type,AnalysisTypeEnum);
     2525
     2526        /*Just branch to the correct InputUpdateFromSolution generator, according to the type of analysis we are carrying out: */
     2527        if (analysis_type==DiagnosticHorizAnalysisEnum)
     2528         GetSolutionFromInputsDiagnosticHoriz(solution);
     2529        else if (analysis_type==DiagnosticHutterAnalysisEnum)
     2530         GetSolutionFromInputsDiagnosticHutter(solution);
     2531        else if (analysis_type==HydrologyAnalysisEnum)
     2532         GetSolutionFromInputsHydrology(solution);
     2533        else
     2534         _error_("analysis: %s not supported yet",EnumToStringx(analysis_type));
     2535
     2536}
     2537/*}}}*/
     2538/*FUNCTION Tria::GetSolutionFromInputsDiagnosticHoriz{{{1*/
     2539void  Tria::GetSolutionFromInputsDiagnosticHoriz(Vec solution){
     2540
     2541        const int    numdof=NDOF2*NUMVERTICES;
     2542
     2543        int          i;
     2544        int*         doflist=NULL;
     2545        double       vx,vy;
     2546        double       values[numdof];
     2547        GaussTria*   gauss=NULL;
     2548
     2549        /*Get dof list: */
     2550        GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
     2551
     2552        /*Get inputs*/
     2553        Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
     2554        Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
     2555
     2556        /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
     2557        /*P1 element only for now*/
     2558        gauss=new GaussTria();
     2559        for(i=0;i<NUMVERTICES;i++){
     2560
     2561                gauss->GaussVertex(i);
     2562
     2563                /*Recover vx and vy*/
     2564                vx_input->GetParameterValue(&vx,gauss);
     2565                vy_input->GetParameterValue(&vy,gauss);
     2566                values[i*NDOF2+0]=vx;
     2567                values[i*NDOF2+1]=vy;
     2568        }
     2569
     2570        VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);
     2571
     2572        /*Free ressources:*/
     2573        delete gauss;
     2574        xfree((void**)&doflist);
     2575}
     2576/*}}}*/
     2577/*FUNCTION Tria::GetSolutionFromInputsDiagnosticHutter{{{1*/
     2578void  Tria::GetSolutionFromInputsDiagnosticHutter(Vec solution){
     2579
     2580        const int    numdof=NDOF2*NUMVERTICES;
     2581
     2582        int i,dummy;
     2583        int*         doflist=NULL;
     2584        double       vx,vy;
     2585        double       values[numdof];
     2586        GaussTria*   gauss=NULL;
     2587
     2588        /*Get dof list: */
     2589        GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
     2590
     2591        /*Get inputs*/
     2592        Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
     2593        Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
     2594
     2595        /*Ok, we have vx and vy in values, fill in vx and vy arrays: */
     2596        /*P1 element only for now*/
     2597        gauss=new GaussTria();
     2598        for(i=0;i<NUMVERTICES;i++){
     2599
     2600                gauss->GaussVertex(i);
     2601
     2602                /*Recover vx and vy*/
     2603                vx_input->GetParameterValue(&vx,gauss);
     2604                vy_input->GetParameterValue(&vy,gauss);
     2605                values[i*NDOF2+0]=vx;
     2606                values[i*NDOF2+1]=vy;
     2607        }
     2608
     2609        VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);
     2610
     2611        /*Free ressources:*/
     2612        delete gauss;
     2613        xfree((void**)&doflist);
     2614}
     2615/*}}}*/
     2616/*FUNCTION Tria::GetSolutionFromInputsHydrology{{{1*/
     2617void  Tria::GetSolutionFromInputsHydrology(Vec solution){
     2618
     2619        const int    numdof=NDOF1*NUMVERTICES;
     2620
     2621        int i,dummy;
     2622        int*         doflist=NULL;
     2623        double       watercolumn;
     2624        double       values[numdof];
     2625        GaussTria*   gauss=NULL;
     2626
     2627        /*Get dof list: */
     2628        GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
     2629
     2630        /*Get inputs*/
     2631        Input* watercolumn_input=inputs->GetInput(WatercolumnEnum); _assert_(watercolumn_input);
     2632
     2633        /*Ok, we have watercolumn values, fill in watercolumn array: */
     2634        /*P1 element only for now*/
     2635        gauss=new GaussTria();
     2636        for(i=0;i<NUMVERTICES;i++){
     2637
     2638                gauss->GaussVertex(i);
     2639
     2640                /*Recover watercolumn*/
     2641                watercolumn_input->GetParameterValue(&watercolumn,gauss);
     2642                values[i]=watercolumn;
     2643        }
     2644
     2645        VecSetValues(solution,numdof,doflist,(const double*)values,INSERT_VALUES);
     2646
     2647        /*Free ressources:*/
     2648        delete gauss;
     2649        xfree((void**)&doflist);
     2650}
     2651/*}}}*/
     2652/*FUNCTION Tria::GetStrainRate2d(double* epsilon,double* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input){{{1*/
     2653void Tria::GetStrainRate2d(double* epsilon,double* xyz_list, GaussTria* gauss, Input* vx_input, Input* vy_input){
     2654        /*Compute the 2d Strain Rate (3 components):
     2655         * epsilon=[exx eyy exy] */
     2656
     2657        int i;
     2658        double epsilonvx[3];
     2659        double epsilonvy[3];
     2660
     2661        /*Check that both inputs have been found*/
     2662        if (!vx_input || !vy_input){
     2663                _error_("Input missing. Here are the input pointers we have for vx: %p, vy: %p\n",vx_input,vy_input);
     2664        }
     2665
     2666        /*Get strain rate assuming that epsilon has been allocated*/
     2667        vx_input->GetVxStrainRate2d(epsilonvx,xyz_list,gauss);
     2668        vy_input->GetVyStrainRate2d(epsilonvy,xyz_list,gauss);
     2669
     2670        /*Sum all contributions*/
     2671        for(i=0;i<3;i++) epsilon[i]=epsilonvx[i]+epsilonvy[i];
     2672}
     2673/*}}}*/
     2674/*FUNCTION Tria::GetVectorFromInputs{{{1*/
     2675void  Tria::GetVectorFromInputs(Vec vector,int input_enum){
     2676
     2677        int doflist1[NUMVERTICES];
     2678
     2679        /*Get out if this is not an element input*/
     2680        if (!IsInput(input_enum)) return;
     2681
     2682        /*Prepare index list*/
     2683        this->GetDofList1(&doflist1[0]);
     2684
     2685        /*Get input (either in element or material)*/
     2686        Input* input=inputs->GetInput(input_enum);
     2687        if(!input) _error_("Input %s not found in element",EnumToStringx(input_enum));
     2688
     2689        /*We found the enum.  Use its values to fill into the vector, using the vertices ids: */
     2690        input->GetVectorFromInputs(vector,&doflist1[0]);
    26912691}
    26922692/*}}}*/
  • issm/trunk/src/c/objects/Elements/Tria.h

    r9218 r9256  
    181181                int     GetElementType(void);
    182182                void      GetDofList(int** pdoflist,int approximation_enum,int setenum);
     183                void    GetHydrologyWaterVelocity(double* v, GaussTria* gauss);
    183184                void      GetDofList1(int* doflist);
    184185                void    GetSidList(int* sidlist);
Note: See TracChangeset for help on using the changeset viewer.