Changeset 9817


Ignore:
Timestamp:
09/16/11 08:23:21 (14 years ago)
Author:
Eric.Larour
Message:

Conditional response functionality from elements

Location:
issm/trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/ad/Makefile.am

    r9813 r9817  
    260260                                        ./modules/NodesDofx/NodesDofx.h\
    261261                                        ./modules/NodesDofx/NodesDofx.cpp\
    262                                         ./modules/NodalValuex/NodalValuex.h\
    263                                         ./modules/NodalValuex/NodalValuex.cpp\
    264262                                        ./modules/VerticesDofx/VerticesDofx.h\
    265263                                        ./modules/VerticesDofx/VerticesDofx.cpp\
     
    533531                                          ./modules/MassFluxx/MassFluxx.cpp\
    534532                                          ./modules/MassFluxx/MassFluxx.h\
     533                                          ./modules/NodalValuex/NodalValuex.h\
     534                                          ./modules/NodalValuex/NodalValuex.cpp\
    535535                                          ./modules/SurfaceAreax/SurfaceAreax.h\
    536536                                          ./modules/SurfaceAreax/SurfaceAreax.cpp\
  • issm/trunk/src/c/objects/Elements/Element.h

    r9775 r9817  
    4040                virtual void   GetParameterListOnVertices(double* pvalue,int enumtype,double defaultvalue)=0;
    4141                virtual void   GetParameterValue(double* pvalue,Node* node,int enumtype)=0;
     42               
     43                virtual double SurfaceArea(void)=0;
     44                virtual void   InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum)=0;
     45                virtual void   ComputeBasalStress(Vec sigma_b)=0;
     46                virtual void   ComputeStrainRate(Vec eps)=0;
     47                virtual void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes)=0;
     48                virtual void   PatchFill(int* pcount, Patch* patch)=0;
     49                virtual void   DeleteResults(void)=0;
     50                virtual void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type)=0;
     51                virtual void   InputToResult(int enum_type,int step,double time)=0;
     52                virtual void   InputDuplicate(int original_enum,int new_enum)=0;
     53                virtual void   InputCreate(double scalar,int name,int code)=0;
     54                virtual void   InputCreate(double* vector, int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code)=0;
     55                virtual void   ProcessResultsUnits(void)=0;
     56                virtual void   RequestedOutput(int output_enum,int step,double time)=0;
     57               
     58                virtual void   InputScale(int enum_type,double scale_factor)=0;
     59                virtual void   GetVectorFromInputs(Vec vector,int NameEnum)=0;
     60                virtual void   InputArtificialNoise(int enum_type,double min,double max)=0;
     61                virtual bool   InputConvergence(double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums)=0;
     62                virtual void   AverageOntoPartition(Vec partition_contributions,Vec partition_areas,double* vertex_response,double* qmu_part)=0;
     63                virtual int*   GetHorizontalNeighboorSids(void)=0;
     64                virtual double TimeAdapt()=0;
     65                virtual void   AgressiveMigration()=0;
     66                virtual void   SoftMigration(double* sheet_ungrounding)=0;
     67                virtual void   ShelfSync()=0;
     68                virtual void   PotentialSheetUngrounding(Vec potential_sheet_ungrounding)=0;
     69                virtual void   MigrateGroundingLine()=0;
     70                virtual int    UpdateShelfStatus(Vec new_shelf_nodes)=0;
     71                virtual void   UpdateShelfFlags(double* new_shelf_nodes)=0;
     72                virtual int    UpdatePotentialSheetUngrounding(double* potential_sheet_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf)=0;
     73
     74                #ifdef _HAVE_RESPONSES_
     75                virtual void   MinVel(double* pminvel, bool process_units)=0;
     76                virtual void   MaxVel(double* pmaxvel, bool process_units)=0;
     77                virtual void   MinVx(double* pminvx, bool process_units)=0;
     78                virtual void   MaxVx(double* pmaxvx, bool process_units)=0;
     79                virtual void   MaxAbsVx(double* pmaxabsvx, bool process_units)=0;
     80                virtual void   MinVy(double* pminvy, bool process_units)=0;
     81                virtual void   MaxVy(double* pmaxvy, bool process_units)=0;
     82                virtual void   MaxAbsVy(double* pmaxabsvy, bool process_units)=0;
     83                virtual void   MinVz(double* pminvz, bool process_units)=0;
     84                virtual void   MaxVz(double* pmaxvz, bool process_units)=0;
     85                virtual void   MaxAbsVz(double* pmaxabsvz, bool process_units)=0;
     86                virtual double MassFlux(double* segment,bool process_units)=0;
     87                virtual double RheologyBbarx(void)=0;
     88                virtual int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units)=0;
     89                #endif
     90
    4291                #ifdef _HAVE_CONTROL_
    4392                virtual void   Gradj(Vec gradient,int control_type)=0;
     
    56105                virtual void   InputControlUpdate(double scalar,bool save_parameter)=0;
    57106                #endif
    58                 virtual double SurfaceArea(void)=0;
    59                 virtual void   InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum)=0;
    60                 virtual void   ComputeBasalStress(Vec sigma_b)=0;
    61                 virtual void   ComputeStrainRate(Vec eps)=0;
    62                 virtual double MassFlux(double* segment,bool process_units)=0;
    63                 virtual void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes)=0;
    64                 virtual void   PatchFill(int* pcount, Patch* patch)=0;
    65                 virtual void   DeleteResults(void)=0;
    66                 virtual void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type)=0;
    67                 virtual void   InputToResult(int enum_type,int step,double time)=0;
    68                 virtual void   InputDuplicate(int original_enum,int new_enum)=0;
    69                 virtual void   InputCreate(double scalar,int name,int code)=0;
    70                 virtual void   InputCreate(double* vector, int index,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code)=0;
    71                 virtual void   ProcessResultsUnits(void)=0;
    72                 virtual void   RequestedOutput(int output_enum,int step,double time)=0;
    73                 virtual void   MinVel(double* pminvel, bool process_units)=0;
    74                 virtual void   MaxVel(double* pmaxvel, bool process_units)=0;
    75                 virtual void   MinVx(double* pminvx, bool process_units)=0;
    76                 virtual void   MaxVx(double* pmaxvx, bool process_units)=0;
    77                 virtual void   MaxAbsVx(double* pmaxabsvx, bool process_units)=0;
    78                 virtual void   MinVy(double* pminvy, bool process_units)=0;
    79                 virtual void   MaxVy(double* pmaxvy, bool process_units)=0;
    80                 virtual void   MaxAbsVy(double* pmaxabsvy, bool process_units)=0;
    81                 virtual void   MinVz(double* pminvz, bool process_units)=0;
    82                 virtual void   MaxVz(double* pmaxvz, bool process_units)=0;
    83                 virtual void   MaxAbsVz(double* pmaxabsvz, bool process_units)=0;
    84                 virtual void   InputScale(int enum_type,double scale_factor)=0;
    85                 virtual void   GetVectorFromInputs(Vec vector,int NameEnum)=0;
    86                 virtual void   InputArtificialNoise(int enum_type,double min,double max)=0;
    87                 virtual bool   InputConvergence(double* eps, int* enums,int num_enums,int* criterionenums,double* criterionvalues,int num_criterionenums)=0;
    88                 virtual void   AverageOntoPartition(Vec partition_contributions,Vec partition_areas,double* vertex_response,double* qmu_part)=0;
    89                 virtual int*   GetHorizontalNeighboorSids(void)=0;
    90                 virtual double TimeAdapt()=0;
    91                 virtual void   AgressiveMigration()=0;
    92                 virtual void   SoftMigration(double* sheet_ungrounding)=0;
    93                 virtual void   ShelfSync()=0;
    94                 virtual void   PotentialSheetUngrounding(Vec potential_sheet_ungrounding)=0;
    95                 virtual void   MigrateGroundingLine()=0;
    96                 virtual int    UpdateShelfStatus(Vec new_shelf_nodes)=0;
    97                 virtual void   UpdateShelfFlags(double* new_shelf_nodes)=0;
    98                 virtual int    UpdatePotentialSheetUngrounding(double* potential_sheet_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf)=0;
    99                 virtual double RheologyBbarx(void)=0;
    100                 virtual int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units)=0;
    101 
    102                 /*Implementation: */
    103 
    104107};
    105108#endif
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r9777 r9817  
    20012001}
    20022002/*}}}*/
    2003 /*FUNCTION Penta::MassFlux {{{1*/
    2004 double Penta::MassFlux( double* segment,bool process_units){
    2005         _error_(" not supported yet!");
    2006 }
    2007 /*}}}*/
    2008 /*FUNCTION Penta::MaxAbsVx{{{1*/
    2009 void  Penta::MaxAbsVx(double* pmaxabsvx, bool process_units){
    2010 
    2011         /*Get maximum:*/
    2012         double maxabsvx=this->inputs->MaxAbs(VxEnum);
    2013 
    2014         /*process units if requested: */
    2015         if(process_units) maxabsvx=UnitConversion(maxabsvx,IuToExtEnum,VxEnum);
    2016 
    2017         /*Assign output pointers:*/
    2018         *pmaxabsvx=maxabsvx;
    2019 }
    2020 /*}}}*/
    2021 /*FUNCTION Penta::MaxAbsVy{{{1*/
    2022 void  Penta::MaxAbsVy(double* pmaxabsvy, bool process_units){
    2023 
    2024         /*Get maximum:*/
    2025         double maxabsvy=this->inputs->MaxAbs(VyEnum);
    2026 
    2027         /*process units if requested: */
    2028         if(process_units) maxabsvy=UnitConversion(maxabsvy,IuToExtEnum,VyEnum);
    2029 
    2030         /*Assign output pointers:*/
    2031         *pmaxabsvy=maxabsvy;
    2032 }
    2033 /*}}}*/
    2034 /*FUNCTION Penta::MaxAbsVz{{{1*/
    2035 void  Penta::MaxAbsVz(double* pmaxabsvz, bool process_units){
    2036 
    2037         /*Get maximum:*/
    2038         double maxabsvz=this->inputs->MaxAbs(VzEnum);
    2039 
    2040         /*process units if requested: */
    2041         if(process_units) maxabsvz=UnitConversion(maxabsvz,IuToExtEnum,VyEnum);
    2042 
    2043         /*Assign output pointers:*/
    2044         *pmaxabsvz=maxabsvz;
    2045 }
    2046 /*}}}*/
    2047 /*FUNCTION Penta::MaxVel{{{1*/
    2048 void  Penta::MaxVel(double* pmaxvel, bool process_units){
    2049 
    2050         /*Get maximum:*/
    2051         double maxvel=this->inputs->Max(VelEnum);
    2052 
    2053         /*process units if requested: */
    2054         if(process_units) maxvel=UnitConversion(maxvel,IuToExtEnum,VelEnum);
    2055 
    2056         /*Assign output pointers:*/
    2057         *pmaxvel=maxvel;
    2058 
    2059 }
    2060 /*}}}*/
    2061 /*FUNCTION Penta::MaxVx{{{1*/
    2062 void  Penta::MaxVx(double* pmaxvx, bool process_units){
    2063 
    2064         /*Get maximum:*/
    2065         double maxvx=this->inputs->Max(VxEnum);
    2066 
    2067         /*process units if requested: */
    2068         if(process_units) maxvx=UnitConversion(maxvx,IuToExtEnum,VxEnum);
    2069 
    2070         /*Assign output pointers:*/
    2071         *pmaxvx=maxvx;
    2072 }
    2073 /*}}}*/
    2074 /*FUNCTION Penta::MaxVy{{{1*/
    2075 void  Penta::MaxVy(double* pmaxvy, bool process_units){
    2076 
    2077         /*Get maximum:*/
    2078         double maxvy=this->inputs->Max(VyEnum);
    2079 
    2080         /*process units if requested: */
    2081         if(process_units) maxvy=UnitConversion(maxvy,IuToExtEnum,VyEnum);
    2082 
    2083         /*Assign output pointers:*/
    2084         *pmaxvy=maxvy;
    2085 }
    2086 /*}}}*/
    2087 /*FUNCTION Penta::MaxVz{{{1*/
    2088 void  Penta::MaxVz(double* pmaxvz, bool process_units){
    2089 
    2090         /*Get maximum:*/
    2091         double maxvz=this->inputs->Max(VzEnum);
    2092 
    2093         /*process units if requested: */
    2094         if(process_units) maxvz=UnitConversion(maxvz,IuToExtEnum,VzEnum);
    2095 
    2096         /*Assign output pointers:*/
    2097         *pmaxvz=maxvz;
    2098 }
    2099 /*}}}*/
    21002003/*FUNCTION Penta::MigrateGroundingLine{{{1*/
    21012004void  Penta::MigrateGroundingLine(void){
     
    21252028}
    21262029/*}}}*/
    2127 /*FUNCTION Penta::MinVel{{{1*/
    2128 void  Penta::MinVel(double* pminvel, bool process_units){
    2129 
    2130         /*Get minimum:*/
    2131         double minvel=this->inputs->Min(VelEnum);
    2132 
    2133         /*process units if requested: */
    2134         if(process_units) minvel=UnitConversion(minvel,IuToExtEnum,VelEnum);
    2135 
    2136         /*Assign output pointers:*/
    2137         *pminvel=minvel;
    2138 }
    2139 /*}}}*/
    2140 /*FUNCTION Penta::MinVx{{{1*/
    2141 void  Penta::MinVx(double* pminvx, bool process_units){
    2142 
    2143         /*Get minimum:*/
    2144         double minvx=this->inputs->Min(VxEnum);
    2145 
    2146         /*process units if requested: */
    2147         if(process_units) minvx=UnitConversion(minvx,IuToExtEnum,VxEnum);
    2148 
    2149         /*Assign output pointers:*/
    2150         *pminvx=minvx;
    2151 }
    2152 /*}}}*/
    2153 /*FUNCTION Penta::MinVy{{{1*/
    2154 void  Penta::MinVy(double* pminvy, bool process_units){
    2155 
    2156         /*Get minimum:*/
    2157         double minvy=this->inputs->Min(VyEnum);
    2158 
    2159         /*process units if requested: */
    2160         if(process_units) minvy=UnitConversion(minvy,IuToExtEnum,VyEnum);
    2161 
    2162         /*Assign output pointers:*/
    2163         *pminvy=minvy;
    2164 }
    2165 /*}}}*/
    2166 /*FUNCTION Penta::MinVz{{{1*/
    2167 void  Penta::MinVz(double* pminvz, bool process_units){
    2168 
    2169         /*Get minimum:*/
    2170         double minvz=this->inputs->Min(VzEnum);
    2171 
    2172         /*process units if requested: */
    2173         if(process_units) minvz=UnitConversion(minvz,IuToExtEnum,VzEnum);
    2174 
    2175         /*Assign output pointers:*/
    2176         *pminvz=minvz;
    2177 }
    2178 /*}}}*/
    21792030/*FUNCTION Penta::MyRank {{{1*/
    21802031int    Penta::MyRank(void){
    21812032        extern int my_rank;
    21822033        return my_rank;
    2183 }
    2184 /*}}}*/
    2185 /*FUNCTION Penta::NodalValue {{{1*/
    2186 int    Penta::NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units){
    2187 
    2188         int i;
    2189         int found=0;
    2190         double value;
    2191         Input* data=NULL;
    2192         GaussPenta* gauss=NULL;
    2193 
    2194         /*First, serarch the input: */
    2195         data=inputs->GetInput(natureofdataenum);
    2196 
    2197         /*figure out if we have the vertex id: */
    2198         found=0;
    2199         for(i=0;i<NUMVERTICES;i++){
    2200                 if(index==nodes[i]->GetVertexId()){
    2201                         /*Do we have natureofdataenum in our inputs? :*/
    2202                         if(data){
    2203                                 /*ok, we are good. retrieve value of input at vertex :*/
    2204                                 gauss=new GaussPenta(); gauss->GaussVertex(i);
    2205                                 data->GetParameterValue(&value,gauss);
    2206                                 found=1;
    2207                                 break;
    2208                         }
    2209                 }
    2210         }
    2211 
    2212         if(found)*pvalue=value;
    2213         return found;
    22142034}
    22152035/*}}}*/
     
    23972217        }
    23982218
    2399 }
    2400 /*}}}*/
    2401 /*FUNCTION Penta::RheologyBbarx{{{1*/
    2402 double Penta::RheologyBbarx(void){
    2403 
    2404         double Bbar;
    2405         Penta* base=NULL;
    2406        
    2407         /*We here compute the vertically averaged Bbar. To do so, we go to the
    2408          * base element under this one, and call this->InputDepthAverageAtBase:*/
    2409                
    2410         base=this;
    2411 
    2412         if(!base->IsOnBed()){
    2413 
    2414                 for(;;){
    2415                         base=base->verticalneighbors[0];
    2416                         if(base->IsOnBed())break;
    2417                 }
    2418         }
    2419 
    2420         /*We have found the base under this. Call InputDepthAverageAtBase on it: */
    2421         base->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
    2422 
    2423         /*Ok, base->matice now has the Bbar. Ask Bbar from this enum: */
    2424         Bbar=base->matice->GetBbar();
    2425 
    2426         return Bbar;
    24272219}
    24282220/*}}}*/
     
    28212613/*}}}*/
    28222614
     2615#ifdef _HAVE_RESPONSES_
     2616/*FUNCTION Penta::RheologyBbarx{{{1*/
     2617double Penta::RheologyBbarx(void){
     2618
     2619        double Bbar;
     2620        Penta* base=NULL;
     2621       
     2622        /*We here compute the vertically averaged Bbar. To do so, we go to the
     2623         * base element under this one, and call this->InputDepthAverageAtBase:*/
     2624               
     2625        base=this;
     2626
     2627        if(!base->IsOnBed()){
     2628
     2629                for(;;){
     2630                        base=base->verticalneighbors[0];
     2631                        if(base->IsOnBed())break;
     2632                }
     2633        }
     2634
     2635        /*We have found the base under this. Call InputDepthAverageAtBase on it: */
     2636        base->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
     2637
     2638        /*Ok, base->matice now has the Bbar. Ask Bbar from this enum: */
     2639        Bbar=base->matice->GetBbar();
     2640
     2641        return Bbar;
     2642}
     2643/*}}}*/
     2644/*FUNCTION Penta::NodalValue {{{1*/
     2645int    Penta::NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units){
     2646
     2647        int i;
     2648        int found=0;
     2649        double value;
     2650        Input* data=NULL;
     2651        GaussPenta* gauss=NULL;
     2652
     2653        /*First, serarch the input: */
     2654        data=inputs->GetInput(natureofdataenum);
     2655
     2656        /*figure out if we have the vertex id: */
     2657        found=0;
     2658        for(i=0;i<NUMVERTICES;i++){
     2659                if(index==nodes[i]->GetVertexId()){
     2660                        /*Do we have natureofdataenum in our inputs? :*/
     2661                        if(data){
     2662                                /*ok, we are good. retrieve value of input at vertex :*/
     2663                                gauss=new GaussPenta(); gauss->GaussVertex(i);
     2664                                data->GetParameterValue(&value,gauss);
     2665                                found=1;
     2666                                break;
     2667                        }
     2668                }
     2669        }
     2670
     2671        if(found)*pvalue=value;
     2672        return found;
     2673}
     2674/*}}}*/
     2675/*FUNCTION Penta::MinVel{{{1*/
     2676void  Penta::MinVel(double* pminvel, bool process_units){
     2677
     2678        /*Get minimum:*/
     2679        double minvel=this->inputs->Min(VelEnum);
     2680
     2681        /*process units if requested: */
     2682        if(process_units) minvel=UnitConversion(minvel,IuToExtEnum,VelEnum);
     2683
     2684        /*Assign output pointers:*/
     2685        *pminvel=minvel;
     2686}
     2687/*}}}*/
     2688/*FUNCTION Penta::MinVx{{{1*/
     2689void  Penta::MinVx(double* pminvx, bool process_units){
     2690
     2691        /*Get minimum:*/
     2692        double minvx=this->inputs->Min(VxEnum);
     2693
     2694        /*process units if requested: */
     2695        if(process_units) minvx=UnitConversion(minvx,IuToExtEnum,VxEnum);
     2696
     2697        /*Assign output pointers:*/
     2698        *pminvx=minvx;
     2699}
     2700/*}}}*/
     2701/*FUNCTION Penta::MinVy{{{1*/
     2702void  Penta::MinVy(double* pminvy, bool process_units){
     2703
     2704        /*Get minimum:*/
     2705        double minvy=this->inputs->Min(VyEnum);
     2706
     2707        /*process units if requested: */
     2708        if(process_units) minvy=UnitConversion(minvy,IuToExtEnum,VyEnum);
     2709
     2710        /*Assign output pointers:*/
     2711        *pminvy=minvy;
     2712}
     2713/*}}}*/
     2714/*FUNCTION Penta::MinVz{{{1*/
     2715void  Penta::MinVz(double* pminvz, bool process_units){
     2716
     2717        /*Get minimum:*/
     2718        double minvz=this->inputs->Min(VzEnum);
     2719
     2720        /*process units if requested: */
     2721        if(process_units) minvz=UnitConversion(minvz,IuToExtEnum,VzEnum);
     2722
     2723        /*Assign output pointers:*/
     2724        *pminvz=minvz;
     2725}
     2726/*}}}*/
     2727/*FUNCTION Penta::MassFlux {{{1*/
     2728double Penta::MassFlux( double* segment,bool process_units){
     2729        _error_(" not supported yet!");
     2730}
     2731/*}}}*/
     2732/*FUNCTION Penta::MaxAbsVx{{{1*/
     2733void  Penta::MaxAbsVx(double* pmaxabsvx, bool process_units){
     2734
     2735        /*Get maximum:*/
     2736        double maxabsvx=this->inputs->MaxAbs(VxEnum);
     2737
     2738        /*process units if requested: */
     2739        if(process_units) maxabsvx=UnitConversion(maxabsvx,IuToExtEnum,VxEnum);
     2740
     2741        /*Assign output pointers:*/
     2742        *pmaxabsvx=maxabsvx;
     2743}
     2744/*}}}*/
     2745/*FUNCTION Penta::MaxAbsVy{{{1*/
     2746void  Penta::MaxAbsVy(double* pmaxabsvy, bool process_units){
     2747
     2748        /*Get maximum:*/
     2749        double maxabsvy=this->inputs->MaxAbs(VyEnum);
     2750
     2751        /*process units if requested: */
     2752        if(process_units) maxabsvy=UnitConversion(maxabsvy,IuToExtEnum,VyEnum);
     2753
     2754        /*Assign output pointers:*/
     2755        *pmaxabsvy=maxabsvy;
     2756}
     2757/*}}}*/
     2758/*FUNCTION Penta::MaxAbsVz{{{1*/
     2759void  Penta::MaxAbsVz(double* pmaxabsvz, bool process_units){
     2760
     2761        /*Get maximum:*/
     2762        double maxabsvz=this->inputs->MaxAbs(VzEnum);
     2763
     2764        /*process units if requested: */
     2765        if(process_units) maxabsvz=UnitConversion(maxabsvz,IuToExtEnum,VyEnum);
     2766
     2767        /*Assign output pointers:*/
     2768        *pmaxabsvz=maxabsvz;
     2769}
     2770/*}}}*/
     2771/*FUNCTION Penta::MaxVel{{{1*/
     2772void  Penta::MaxVel(double* pmaxvel, bool process_units){
     2773
     2774        /*Get maximum:*/
     2775        double maxvel=this->inputs->Max(VelEnum);
     2776
     2777        /*process units if requested: */
     2778        if(process_units) maxvel=UnitConversion(maxvel,IuToExtEnum,VelEnum);
     2779
     2780        /*Assign output pointers:*/
     2781        *pmaxvel=maxvel;
     2782
     2783}
     2784/*}}}*/
     2785/*FUNCTION Penta::MaxVx{{{1*/
     2786void  Penta::MaxVx(double* pmaxvx, bool process_units){
     2787
     2788        /*Get maximum:*/
     2789        double maxvx=this->inputs->Max(VxEnum);
     2790
     2791        /*process units if requested: */
     2792        if(process_units) maxvx=UnitConversion(maxvx,IuToExtEnum,VxEnum);
     2793
     2794        /*Assign output pointers:*/
     2795        *pmaxvx=maxvx;
     2796}
     2797/*}}}*/
     2798/*FUNCTION Penta::MaxVy{{{1*/
     2799void  Penta::MaxVy(double* pmaxvy, bool process_units){
     2800
     2801        /*Get maximum:*/
     2802        double maxvy=this->inputs->Max(VyEnum);
     2803
     2804        /*process units if requested: */
     2805        if(process_units) maxvy=UnitConversion(maxvy,IuToExtEnum,VyEnum);
     2806
     2807        /*Assign output pointers:*/
     2808        *pmaxvy=maxvy;
     2809}
     2810/*}}}*/
     2811/*FUNCTION Penta::MaxVz{{{1*/
     2812void  Penta::MaxVz(double* pmaxvz, bool process_units){
     2813
     2814        /*Get maximum:*/
     2815        double maxvz=this->inputs->Max(VzEnum);
     2816
     2817        /*process units if requested: */
     2818        if(process_units) maxvz=UnitConversion(maxvz,IuToExtEnum,VzEnum);
     2819
     2820        /*Assign output pointers:*/
     2821        *pmaxvz=maxvz;
     2822}
     2823/*}}}*/
     2824#endif
     2825
    28232826#ifdef _HAVE_THERMAL_
    28242827/*FUNCTION Penta::CreateKMatrixEnthalpy {{{1*/
  • issm/trunk/src/c/objects/Elements/Penta.h

    r9777 r9817  
    102102               
    103103                void   InputToResult(int enum_type,int step,double time);
    104                 double MassFlux(double* segment,bool process_units);
    105                 void   MaxAbsVx(double* pmaxabsvx, bool process_units);
    106                 void   MaxAbsVy(double* pmaxabsvy, bool process_units);
    107                 void   MaxAbsVz(double* pmaxabsvz, bool process_units);
    108                 void   MaxVel(double* pmaxvel, bool process_units);
    109                 void   MaxVx(double* pmaxvx, bool process_units);
    110                 void   MaxVy(double* pmaxvy, bool process_units);
    111                 void   MaxVz(double* pmaxvz, bool process_units);
    112104                void   AgressiveMigration();
    113105                void   SoftMigration(double* sheet_ungrounding);
     
    116108                void   RequestedOutput(int output_enum,int step,double time);
    117109                void   MigrateGroundingLine();
    118                 void   MinVel(double* pminvel, bool process_units);
    119                 void   MinVx(double* pminvx, bool process_units);
    120                 void   MinVy(double* pminvy, bool process_units);
    121                 void   MinVz(double* pminvz, bool process_units);
    122110                void   PatchFill(int* pcount, Patch* patch);
    123111                void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
     
    130118                double TimeAdapt();
    131119                int*   GetHorizontalNeighboorSids(void);
     120                void   ViscousHeatingCreateInput(void);
     121
     122                 #ifdef _HAVE_RESPONSES_
     123                void   MinVel(double* pminvel, bool process_units);
     124                void   MinVx(double* pminvx, bool process_units);
     125                void   MinVy(double* pminvy, bool process_units);
     126                void   MinVz(double* pminvz, bool process_units);
    132127                double RheologyBbarx(void);
    133                 void   ViscousHeatingCreateInput(void);
    134128                int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units);
     129                double MassFlux(double* segment,bool process_units);
     130                void   MaxAbsVx(double* pmaxabsvx, bool process_units);
     131                void   MaxAbsVy(double* pmaxabsvy, bool process_units);
     132                void   MaxAbsVz(double* pmaxabsvz, bool process_units);
     133                void   MaxVel(double* pmaxvel, bool process_units);
     134                void   MaxVx(double* pmaxvx, bool process_units);
     135                void   MaxVy(double* pmaxvy, bool process_units);
     136                void   MaxVz(double* pmaxvz, bool process_units);
     137                #endif
    135138
    136139                #ifdef _HAVE_CONTROL_
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r9777 r9817  
    19261926}
    19271927/*}}}*/
    1928 /*FUNCTION Tria::MassFlux {{{1*/
    1929 double Tria::MassFlux( double* segment,bool process_units){
    1930 
    1931         const int    numdofs=2;
    1932 
    1933         int        i;
    1934         double     mass_flux=0;
    1935         double     xyz_list[NUMVERTICES][3];
    1936         double     normal[2];
    1937         double     length,rho_ice;
    1938         double     x1,y1,x2,y2,h1,h2;
    1939         double     vx1,vx2,vy1,vy2;
    1940         GaussTria* gauss_1=NULL;
    1941         GaussTria* gauss_2=NULL;
    1942 
    1943         /*Get material parameters :*/
    1944         rho_ice=matpar->GetRhoIce();
    1945 
    1946         /*First off, check that this segment belongs to this element: */
    1947         if ((int)*(segment+4)!=this->id)_error_("%s%i%s%i","error message: segment with id ",(int)*(segment+4)," does not belong to element with id:",this->id);
    1948 
    1949         /*Recover segment node locations: */
    1950         x1=*(segment+0); y1=*(segment+1); x2=*(segment+2); y2=*(segment+3);
    1951 
    1952         /*Get xyz list: */
    1953         GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
    1954 
    1955         /*get area coordinates of 0 and 1 locations: */
    1956         gauss_1=new GaussTria();
    1957         gauss_1->GaussFromCoords(x1,y1,&xyz_list[0][0]);
    1958         gauss_2=new GaussTria();
    1959         gauss_2->GaussFromCoords(x2,y2,&xyz_list[0][0]);
    1960 
    1961         normal[0]=cos(atan2(x1-x2,y2-y1));
    1962         normal[1]=sin(atan2(x1-x2,y2-y1));
    1963 
    1964         length=sqrt(pow(x2-x1,2.0)+pow(y2-y1,2));
    1965 
    1966         Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
    1967         Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
    1968         Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
    1969 
    1970         thickness_input->GetParameterValue(&h1, gauss_1);
    1971         thickness_input->GetParameterValue(&h2, gauss_2);
    1972         vx_input->GetParameterValue(&vx1,gauss_1);
    1973         vx_input->GetParameterValue(&vx2,gauss_2);
    1974         vy_input->GetParameterValue(&vy1,gauss_1);
    1975         vy_input->GetParameterValue(&vy2,gauss_2);
    1976 
    1977         mass_flux= rho_ice*length*( 
    1978                                 (ONETHIRD*(h1-h2)*(vx1-vx2)+0.5*h2*(vx1-vx2)+0.5*(h1-h2)*vx2+h2*vx2)*normal[0]+
    1979                                 (ONETHIRD*(h1-h2)*(vy1-vy2)+0.5*h2*(vy1-vy2)+0.5*(h1-h2)*vy2+h2*vy2)*normal[1]
    1980                                 );
    1981 
    1982         /*Process units: */
    1983         mass_flux=UnitConversion(mass_flux,IuToExtEnum,MassFluxEnum);
    1984 
    1985         /*clean up and return:*/
    1986         delete gauss_1;
    1987         delete gauss_2;
    1988         return mass_flux;
    1989 }
    1990 /*}}}*/
    1991 /*FUNCTION Tria::MaxAbsVx{{{1*/
    1992 void  Tria::MaxAbsVx(double* pmaxabsvx, bool process_units){
    1993 
    1994         /*Get maximum:*/
    1995         double maxabsvx=this->inputs->MaxAbs(VxEnum);
    1996 
    1997         /*process units if requested: */
    1998         if(process_units) maxabsvx=UnitConversion(maxabsvx,IuToExtEnum,VxEnum);
    1999 
    2000         /*Assign output pointers:*/
    2001         *pmaxabsvx=maxabsvx;
    2002 }
    2003 /*}}}*/
    2004 /*FUNCTION Tria::MaxAbsVy{{{1*/
    2005 void  Tria::MaxAbsVy(double* pmaxabsvy, bool process_units){
    2006 
    2007         /*Get maximum:*/
    2008         double maxabsvy=this->inputs->MaxAbs(VyEnum);
    2009 
    2010         /*process units if requested: */
    2011         if(process_units) maxabsvy=UnitConversion(maxabsvy,IuToExtEnum,VyEnum);
    2012 
    2013         /*Assign output pointers:*/
    2014         *pmaxabsvy=maxabsvy;
    2015 }
    2016 /*}}}*/
    2017 /*FUNCTION Tria::MaxAbsVz{{{1*/
    2018 void  Tria::MaxAbsVz(double* pmaxabsvz, bool process_units){
    2019 
    2020         /*Get maximum:*/
    2021         double maxabsvz=this->inputs->MaxAbs(VzEnum);
    2022 
    2023         /*process units if requested: */
    2024         if(process_units) maxabsvz=UnitConversion(maxabsvz,IuToExtEnum,VyEnum);
    2025 
    2026         /*Assign output pointers:*/
    2027         *pmaxabsvz=maxabsvz;
    2028 }
    2029 /*}}}*/
    2030 /*FUNCTION Tria::MaxVel{{{1*/
    2031 void  Tria::MaxVel(double* pmaxvel, bool process_units){
    2032 
    2033         /*Get maximum:*/
    2034         double maxvel=this->inputs->Max(VelEnum);
    2035 
    2036         /*process units if requested: */
    2037         if(process_units) maxvel=UnitConversion(maxvel,IuToExtEnum,VelEnum);
    2038 
    2039         /*Assign output pointers:*/
    2040         *pmaxvel=maxvel;
    2041 }
    2042 /*}}}*/
    2043 /*FUNCTION Tria::MaxVx{{{1*/
    2044 void  Tria::MaxVx(double* pmaxvx, bool process_units){
    2045 
    2046         /*Get maximum:*/
    2047         double maxvx=this->inputs->Max(VxEnum);
    2048 
    2049         /*process units if requested: */
    2050         if(process_units) maxvx=UnitConversion(maxvx,IuToExtEnum,VxEnum);
    2051 
    2052         /*Assign output pointers:*/
    2053         *pmaxvx=maxvx;
    2054 }
    2055 /*}}}*/
    2056 /*FUNCTION Tria::MaxVy{{{1*/
    2057 void  Tria::MaxVy(double* pmaxvy, bool process_units){
    2058 
    2059         /*Get maximum:*/
    2060         double maxvy=this->inputs->Max(VyEnum);
    2061 
    2062         /*process units if requested: */
    2063         if(process_units) maxvy=UnitConversion(maxvy,IuToExtEnum,VyEnum);
    2064 
    2065         /*Assign output pointers:*/
    2066         *pmaxvy=maxvy;
    2067 
    2068 }
    2069 /*}}}*/
    2070 /*FUNCTION Tria::MaxVz{{{1*/
    2071 void  Tria::MaxVz(double* pmaxvz, bool process_units){
    2072 
    2073         /*Get maximum:*/
    2074         double maxvz=this->inputs->Max(VzEnum);
    2075 
    2076         /*process units if requested: */
    2077         if(process_units) maxvz=UnitConversion(maxvz,IuToExtEnum,VzEnum);
    2078 
    2079         /*Assign output pointers:*/
    2080         *pmaxvz=maxvz;
    2081 }
    2082 /*}}}*/
    20831928/*FUNCTION Tria::MigrateGroundingLine{{{1*/
    20841929void  Tria::MigrateGroundingLine(void){
     
    21562001}
    21572002/*}}}*/
    2158 /*FUNCTION Tria::MinVel{{{1*/
    2159 void  Tria::MinVel(double* pminvel, bool process_units){
    2160 
    2161         /*Get minimum:*/
    2162         double minvel=this->inputs->Min(VelEnum);
    2163 
    2164         /*process units if requested: */
    2165         if(process_units) minvel=UnitConversion(minvel,IuToExtEnum,VelEnum);
    2166 
    2167         /*Assign output pointers:*/
    2168         *pminvel=minvel;
    2169 }
    2170 /*}}}*/
    2171 /*FUNCTION Tria::MinVx{{{1*/
    2172 void  Tria::MinVx(double* pminvx, bool process_units){
    2173 
    2174         /*Get minimum:*/
    2175         double minvx=this->inputs->Min(VxEnum);
    2176 
    2177         /*process units if requested: */
    2178         if(process_units) minvx=UnitConversion(minvx,IuToExtEnum,VxEnum);
    2179 
    2180         /*Assign output pointers:*/
    2181         *pminvx=minvx;
    2182 }
    2183 /*}}}*/
    2184 /*FUNCTION Tria::MinVy{{{1*/
    2185 void  Tria::MinVy(double* pminvy, bool process_units){
    2186 
    2187         /*Get minimum:*/
    2188         double minvy=this->inputs->Min(VyEnum);
    2189 
    2190         /*process units if requested: */
    2191         if(process_units) minvy=UnitConversion(minvy,IuToExtEnum,VyEnum);
    2192 
    2193         /*Assign output pointers:*/
    2194         *pminvy=minvy;
    2195 }
    2196 /*}}}*/
    2197 /*FUNCTION Tria::MinVz{{{1*/
    2198 void  Tria::MinVz(double* pminvz, bool process_units){
    2199 
    2200         /*Get minimum:*/
    2201         double minvz=this->inputs->Min(VzEnum);
    2202 
    2203         /*process units if requested: */
    2204         if(process_units) minvz=UnitConversion(minvz,IuToExtEnum,VzEnum);
    2205 
    2206         /*Assign output pointers:*/
    2207         *pminvz=minvz;
    2208 }
    2209 /*}}}*/
    22102003/*FUNCTION Tria::MyRank {{{1*/
    22112004int    Tria::MyRank(void){
    22122005        extern int my_rank;
    22132006        return my_rank;
    2214 }
    2215 /*}}}*/
    2216 /*FUNCTION Tria::NodalValue {{{1*/
    2217 int    Tria::NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units){
    2218 
    2219         int i;
    2220         int found=0;
    2221         double value;
    2222         Input* data=NULL;
    2223         GaussTria *gauss                            = NULL;
    2224 
    2225         /*First, serarch the input: */
    2226         data=inputs->GetInput(natureofdataenum);
    2227 
    2228         /*figure out if we have the vertex id: */
    2229         found=0;
    2230         for(i=0;i<NUMVERTICES;i++){
    2231                 if(index==nodes[i]->GetVertexId()){
    2232                         /*Do we have natureofdataenum in our inputs? :*/
    2233                         if(data){
    2234                                 /*ok, we are good. retrieve value of input at vertex :*/
    2235                                 gauss=new GaussTria(); gauss->GaussVertex(i);
    2236                                 data->GetParameterValue(&value,gauss);
    2237                                 found=1;
    2238                                 break;
    2239                         }
    2240                 }
    2241         }
    2242 
    2243         if(found)*pvalue=value;
    2244         return found;
    22452007}
    22462008/*}}}*/
     
    23462108                elementresult->ProcessUnits(this->parameters);
    23472109        }
    2348 }
    2349 /*}}}*/
    2350 /*FUNCTION Tria::RheologyBbarx{{{1*/
    2351 double Tria::RheologyBbarx(void){
    2352 
    2353         return this->matice->GetBbar();
    2354 
    23552110}
    23562111/*}}}*/
     
    25982353
    25992354        /*Get for Vx and Vy, the max of abs value: */
     2355        #ifdef _HAVE_RESPONSES_
    26002356        this->MaxAbsVx(&maxabsvx,false);
    26012357        this->MaxAbsVy(&maxabsvy,false);
     2358        #else
     2359                _error_("ISSM was not compiled with responses compiled in, exiting!");
     2360        #endif
    26022361
    26032362        /* Get node coordinates and dof list: */
     
    28482607}
    28492608/*}}}*/
     2609
     2610#ifdef _HAVE_RESPONSES_
     2611/*FUNCTION Tria::MassFlux {{{1*/
     2612double Tria::MassFlux( double* segment,bool process_units){
     2613
     2614        const int    numdofs=2;
     2615
     2616        int        i;
     2617        double     mass_flux=0;
     2618        double     xyz_list[NUMVERTICES][3];
     2619        double     normal[2];
     2620        double     length,rho_ice;
     2621        double     x1,y1,x2,y2,h1,h2;
     2622        double     vx1,vx2,vy1,vy2;
     2623        GaussTria* gauss_1=NULL;
     2624        GaussTria* gauss_2=NULL;
     2625
     2626        /*Get material parameters :*/
     2627        rho_ice=matpar->GetRhoIce();
     2628
     2629        /*First off, check that this segment belongs to this element: */
     2630        if ((int)*(segment+4)!=this->id)_error_("%s%i%s%i","error message: segment with id ",(int)*(segment+4)," does not belong to element with id:",this->id);
     2631
     2632        /*Recover segment node locations: */
     2633        x1=*(segment+0); y1=*(segment+1); x2=*(segment+2); y2=*(segment+3);
     2634
     2635        /*Get xyz list: */
     2636        GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
     2637
     2638        /*get area coordinates of 0 and 1 locations: */
     2639        gauss_1=new GaussTria();
     2640        gauss_1->GaussFromCoords(x1,y1,&xyz_list[0][0]);
     2641        gauss_2=new GaussTria();
     2642        gauss_2->GaussFromCoords(x2,y2,&xyz_list[0][0]);
     2643
     2644        normal[0]=cos(atan2(x1-x2,y2-y1));
     2645        normal[1]=sin(atan2(x1-x2,y2-y1));
     2646
     2647        length=sqrt(pow(x2-x1,2.0)+pow(y2-y1,2));
     2648
     2649        Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
     2650        Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
     2651        Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
     2652
     2653        thickness_input->GetParameterValue(&h1, gauss_1);
     2654        thickness_input->GetParameterValue(&h2, gauss_2);
     2655        vx_input->GetParameterValue(&vx1,gauss_1);
     2656        vx_input->GetParameterValue(&vx2,gauss_2);
     2657        vy_input->GetParameterValue(&vy1,gauss_1);
     2658        vy_input->GetParameterValue(&vy2,gauss_2);
     2659
     2660        mass_flux= rho_ice*length*( 
     2661                                (ONETHIRD*(h1-h2)*(vx1-vx2)+0.5*h2*(vx1-vx2)+0.5*(h1-h2)*vx2+h2*vx2)*normal[0]+
     2662                                (ONETHIRD*(h1-h2)*(vy1-vy2)+0.5*h2*(vy1-vy2)+0.5*(h1-h2)*vy2+h2*vy2)*normal[1]
     2663                                );
     2664
     2665        /*Process units: */
     2666        mass_flux=UnitConversion(mass_flux,IuToExtEnum,MassFluxEnum);
     2667
     2668        /*clean up and return:*/
     2669        delete gauss_1;
     2670        delete gauss_2;
     2671        return mass_flux;
     2672}
     2673/*}}}*/
     2674/*FUNCTION Tria::MaxAbsVx{{{1*/
     2675void  Tria::MaxAbsVx(double* pmaxabsvx, bool process_units){
     2676
     2677        /*Get maximum:*/
     2678        double maxabsvx=this->inputs->MaxAbs(VxEnum);
     2679
     2680        /*process units if requested: */
     2681        if(process_units) maxabsvx=UnitConversion(maxabsvx,IuToExtEnum,VxEnum);
     2682
     2683        /*Assign output pointers:*/
     2684        *pmaxabsvx=maxabsvx;
     2685}
     2686/*}}}*/
     2687/*FUNCTION Tria::MaxAbsVy{{{1*/
     2688void  Tria::MaxAbsVy(double* pmaxabsvy, bool process_units){
     2689
     2690        /*Get maximum:*/
     2691        double maxabsvy=this->inputs->MaxAbs(VyEnum);
     2692
     2693        /*process units if requested: */
     2694        if(process_units) maxabsvy=UnitConversion(maxabsvy,IuToExtEnum,VyEnum);
     2695
     2696        /*Assign output pointers:*/
     2697        *pmaxabsvy=maxabsvy;
     2698}
     2699/*}}}*/
     2700/*FUNCTION Tria::MaxAbsVz{{{1*/
     2701void  Tria::MaxAbsVz(double* pmaxabsvz, bool process_units){
     2702
     2703        /*Get maximum:*/
     2704        double maxabsvz=this->inputs->MaxAbs(VzEnum);
     2705
     2706        /*process units if requested: */
     2707        if(process_units) maxabsvz=UnitConversion(maxabsvz,IuToExtEnum,VyEnum);
     2708
     2709        /*Assign output pointers:*/
     2710        *pmaxabsvz=maxabsvz;
     2711}
     2712/*}}}*/
     2713/*FUNCTION Tria::MaxVel{{{1*/
     2714void  Tria::MaxVel(double* pmaxvel, bool process_units){
     2715
     2716        /*Get maximum:*/
     2717        double maxvel=this->inputs->Max(VelEnum);
     2718
     2719        /*process units if requested: */
     2720        if(process_units) maxvel=UnitConversion(maxvel,IuToExtEnum,VelEnum);
     2721
     2722        /*Assign output pointers:*/
     2723        *pmaxvel=maxvel;
     2724}
     2725/*}}}*/
     2726/*FUNCTION Tria::MaxVx{{{1*/
     2727void  Tria::MaxVx(double* pmaxvx, bool process_units){
     2728
     2729        /*Get maximum:*/
     2730        double maxvx=this->inputs->Max(VxEnum);
     2731
     2732        /*process units if requested: */
     2733        if(process_units) maxvx=UnitConversion(maxvx,IuToExtEnum,VxEnum);
     2734
     2735        /*Assign output pointers:*/
     2736        *pmaxvx=maxvx;
     2737}
     2738/*}}}*/
     2739/*FUNCTION Tria::MaxVy{{{1*/
     2740void  Tria::MaxVy(double* pmaxvy, bool process_units){
     2741
     2742        /*Get maximum:*/
     2743        double maxvy=this->inputs->Max(VyEnum);
     2744
     2745        /*process units if requested: */
     2746        if(process_units) maxvy=UnitConversion(maxvy,IuToExtEnum,VyEnum);
     2747
     2748        /*Assign output pointers:*/
     2749        *pmaxvy=maxvy;
     2750
     2751}
     2752/*}}}*/
     2753/*FUNCTION Tria::MaxVz{{{1*/
     2754void  Tria::MaxVz(double* pmaxvz, bool process_units){
     2755
     2756        /*Get maximum:*/
     2757        double maxvz=this->inputs->Max(VzEnum);
     2758
     2759        /*process units if requested: */
     2760        if(process_units) maxvz=UnitConversion(maxvz,IuToExtEnum,VzEnum);
     2761
     2762        /*Assign output pointers:*/
     2763        *pmaxvz=maxvz;
     2764}
     2765/*}}}*/
     2766/*FUNCTION Tria::MinVel{{{1*/
     2767void  Tria::MinVel(double* pminvel, bool process_units){
     2768
     2769        /*Get minimum:*/
     2770        double minvel=this->inputs->Min(VelEnum);
     2771
     2772        /*process units if requested: */
     2773        if(process_units) minvel=UnitConversion(minvel,IuToExtEnum,VelEnum);
     2774
     2775        /*Assign output pointers:*/
     2776        *pminvel=minvel;
     2777}
     2778/*}}}*/
     2779/*FUNCTION Tria::MinVx{{{1*/
     2780void  Tria::MinVx(double* pminvx, bool process_units){
     2781
     2782        /*Get minimum:*/
     2783        double minvx=this->inputs->Min(VxEnum);
     2784
     2785        /*process units if requested: */
     2786        if(process_units) minvx=UnitConversion(minvx,IuToExtEnum,VxEnum);
     2787
     2788        /*Assign output pointers:*/
     2789        *pminvx=minvx;
     2790}
     2791/*}}}*/
     2792/*FUNCTION Tria::MinVy{{{1*/
     2793void  Tria::MinVy(double* pminvy, bool process_units){
     2794
     2795        /*Get minimum:*/
     2796        double minvy=this->inputs->Min(VyEnum);
     2797
     2798        /*process units if requested: */
     2799        if(process_units) minvy=UnitConversion(minvy,IuToExtEnum,VyEnum);
     2800
     2801        /*Assign output pointers:*/
     2802        *pminvy=minvy;
     2803}
     2804/*}}}*/
     2805/*FUNCTION Tria::MinVz{{{1*/
     2806void  Tria::MinVz(double* pminvz, bool process_units){
     2807
     2808        /*Get minimum:*/
     2809        double minvz=this->inputs->Min(VzEnum);
     2810
     2811        /*process units if requested: */
     2812        if(process_units) minvz=UnitConversion(minvz,IuToExtEnum,VzEnum);
     2813
     2814        /*Assign output pointers:*/
     2815        *pminvz=minvz;
     2816}
     2817/*}}}*/
     2818/*FUNCTION Tria::NodalValue {{{1*/
     2819int    Tria::NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units){
     2820
     2821        int i;
     2822        int found=0;
     2823        double value;
     2824        Input* data=NULL;
     2825        GaussTria *gauss                            = NULL;
     2826
     2827        /*First, serarch the input: */
     2828        data=inputs->GetInput(natureofdataenum);
     2829
     2830        /*figure out if we have the vertex id: */
     2831        found=0;
     2832        for(i=0;i<NUMVERTICES;i++){
     2833                if(index==nodes[i]->GetVertexId()){
     2834                        /*Do we have natureofdataenum in our inputs? :*/
     2835                        if(data){
     2836                                /*ok, we are good. retrieve value of input at vertex :*/
     2837                                gauss=new GaussTria(); gauss->GaussVertex(i);
     2838                                data->GetParameterValue(&value,gauss);
     2839                                found=1;
     2840                                break;
     2841                        }
     2842                }
     2843        }
     2844
     2845        if(found)*pvalue=value;
     2846        return found;
     2847}
     2848/*}}}*/
     2849/*FUNCTION Tria::RheologyBbarx{{{1*/
     2850double Tria::RheologyBbarx(void){
     2851
     2852        return this->matice->GetBbar();
     2853
     2854}
     2855/*}}}*/
     2856#endif
    28502857
    28512858#ifdef _HAVE_DIAGNOSTIC_
  • issm/trunk/src/c/objects/Elements/Tria.h

    r9777 r9817  
    102102                void   DeleteResults(void);
    103103                void   MaterialUpdateFromTemperature(void){_error_("not implemented yet");};
    104                 double MassFlux(double* segment,bool process_units);
    105                 void   MaxAbsVx(double* pmaxabsvx, bool process_units);
    106                 void   MaxAbsVy(double* pmaxabsvy, bool process_units);
    107                 void   MaxAbsVz(double* pmaxabsvz, bool process_units);
    108                 void   MaxVel(double* pmaxvel, bool process_units);
    109                 void   MaxVx(double* pmaxvx, bool process_units);
    110                 void   MaxVy(double* pmaxvy, bool process_units);
    111                 void   MaxVz(double* pmaxvz, bool process_units);
     104               
    112105                void   AgressiveMigration();
    113106                void   SoftMigration(double* sheet_ungrounding);
     
    115108                void   PotentialSheetUngrounding(Vec potential_sheet_ungrounding);
    116109                void   MigrateGroundingLine();
    117                 void   MinVel(double* pminvel, bool process_units);
    118                 void   MinVx(double* pminvx, bool process_units);
    119                 void   MinVy(double* pminvy, bool process_units);
    120                 void   MinVz(double* pminvz, bool process_units);
     110               
    121111                void   RequestedOutput(int output_enum,int step,double time);
    122112                void   PatchFill(int* pcount, Patch* patch);
     
    130120                double TimeAdapt();
    131121                int*   GetHorizontalNeighboorSids(void);
     122
     123                #ifdef _HAVE_RESPONSES_
     124                void   MinVel(double* pminvel, bool process_units);
     125                void   MinVx(double* pminvx, bool process_units);
     126                void   MinVy(double* pminvy, bool process_units);
     127                void   MinVz(double* pminvz, bool process_units);
    132128                double RheologyBbarx(void);
    133129                int    NodalValue(double* pvalue, int index, int natureofdataenum,bool process_units);
     130                double MassFlux(double* segment,bool process_units);
     131                void   MaxAbsVx(double* pmaxabsvx, bool process_units);
     132                void   MaxAbsVy(double* pmaxabsvy, bool process_units);
     133                void   MaxAbsVz(double* pmaxabsvz, bool process_units);
     134                void   MaxVel(double* pmaxvel, bool process_units);
     135                void   MaxVx(double* pmaxvx, bool process_units);
     136                void   MaxVy(double* pmaxvy, bool process_units);
     137                void   MaxVz(double* pmaxvz, bool process_units);
     138                #endif
    134139
    135140
Note: See TracChangeset for help on using the changeset viewer.