Changeset 9012


Ignore:
Timestamp:
07/16/11 01:32:36 (14 years ago)
Author:
Eric.Larour
Message:

Fixed bugs in RheologyBbarx.

Location:
issm/trunk/src/c
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/modules/RheologyBbarx/RheologyBbarx.cpp

    r9010 r9012  
    2121        int index;
    2222        double rheology_bbar;
    23 
     23        Element* element=NULL;
    2424
    2525        /*retrieve element we are interested in: */
     
    2828        /*now, go through our elements, and retrieve the one with this id: index: */
    2929        for(i=0;i<elements->Size();i++){
    30                 Element* element=(Element*)elements->GetObjectByOffset(i);
     30                element=(Element*)elements->GetObjectByOffset(i);
    3131                if (element->Id()==index){
    3232                        found=1;
     
    4040        if(!sumfound)_error_("%s%i%s","could not find material with id",index," to compute RheologyBbar");
    4141
    42 
    43         _error_("element->RheologyBbarx not implemented yet!");
    44 
    4542        /*Ok, we found the material, compute Bbar: */
    4643        if(my_rank==cpu_found){
    47                 //rheology_bbar=element->RheologyBbarx();
     44                rheology_bbar=element->RheologyBbarx();
    4845        }
    4946
    5047        /*Broadcast and plug into response: */
     48        MPI_Allreduce ( &cpu_found,&cpu_found,1,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
    5149        MPI_Bcast(&rheology_bbar,1,MPI_DOUBLE,cpu_found,MPI_COMM_WORLD);
     50
    5251        *prheology_bbar=rheology_bbar;
    5352}
  • issm/trunk/src/c/objects/Elements/Element.h

    r8967 r9012  
    9494                virtual void   UpdateShelfFlags(double* new_shelf_nodes)=0;
    9595                virtual int    UpdatePotentialSheetUngrounding(double* potential_sheet_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf)=0;
     96                virtual double RheologyBbarx(void)=0;
    9697
    9798                /*Implementation: */
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r9009 r9012  
    70327032        /*Affect value to the reduced matrix */
    70337033        for(i=0;i<24;i++) *(Pe_reduced+i)=Pi[i]-Pright[i];
     7034}
     7035/*}}}*/
     7036/*FUNCTION Penta::RheologyBbarx{{{1*/
     7037double Penta::RheologyBbarx(void){
     7038
     7039        double Bbar;
     7040        Penta* base=NULL;
     7041       
     7042        /*We here compute the vertically averaged Bbar. To do so, we go to the
     7043         * base element under this one, and call this->InputDepthAverageAtBase:*/
     7044               
     7045        base=this;
     7046
     7047        if(!base->IsOnBed()){
     7048
     7049                for(;;){
     7050                        base=base->verticalneighbors[0];
     7051                        if(base->IsOnBed())break;
     7052                }
     7053        }
     7054
     7055        /*We have found the base under this. Call InputDepthAverageAtBase on it: */
     7056        base->InputDepthAverageAtBase(RheologyBEnum,RheologyBbarEnum,MaterialsEnum);
     7057
     7058        /*Ok, base->matice now has the Bbar. Ask Bbar from this enum: */
     7059        Bbar=base->matice->GetBbar();
     7060
     7061        return Bbar;
    70347062}
    70357063/*}}}*/
  • issm/trunk/src/c/objects/Elements/Penta.h

    r8967 r9012  
    142142                double TimeAdapt();
    143143                int*   GetHorizontalNeighboorSids(void);
     144                double RheologyBbarx(void);
    144145                /*}}}*/
    145146                /*Penta specific routines:{{{1*/
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r9010 r9012  
    46284628}
    46294629/*}}}*/
     4630/*FUNCTION Tria::RheologyBbarx{{{1*/
     4631double Tria::RheologyBbarx(void){
     4632
     4633        return this->matice->GetBbar();
     4634
     4635}
     4636/*}}}*/
    46304637/*FUNCTION Tria::RheologyBbarAbsGradient{{{1*/
    46314638double Tria::RheologyBbarAbsGradient(bool process_units,int weight_index){
  • issm/trunk/src/c/objects/Elements/Tria.h

    r8967 r9012  
    146146                double TimeAdapt();
    147147                int*   GetHorizontalNeighboorSids(void);
     148                double RheologyBbarx(void);
    148149                /*}}}*/
    149150                /*Tria specific routines:{{{1*/
Note: See TracChangeset for help on using the changeset viewer.