Ignore:
Timestamp:
08/05/10 08:19:48 (15 years ago)
Author:
Mathieu Morlighem
Message:

CM B2d now working for Pattyn

File:
1 edited

Legend:

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

    r4990 r4995  
    712712        else{
    713713
    714                 /*Depth Average B*/
    715                 this->InputDepthAverageAtBase(RheologyBEnum,RheologyB2dEnum,MaterialsEnum);
     714                /*Depth Average B and put it in inputs*/
     715                Penta* penta=GetBasalElement();
     716                penta->InputDepthAverageAtBase(RheologyBEnum,RheologyB2dEnum,MaterialsEnum);
     717                Input* B_input=penta->matice->inputs->GetInput(RheologyB2dEnum);
     718                Input* B_copy=(Input*)B_input->copy();
     719                this->matice->inputs->AddInput((Input*)B_copy);
    716720
    717721                tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face).
     
    721725                /*delete B average*/
    722726                this->matice->inputs->DeleteInput(RheologyB2dEnum);
     727                penta->matice->inputs->DeleteInput(RheologyB2dEnum);
    723728
    724729                return J;
     
    46614666}
    46624667/*}}}*/
     4668/*FUNCTION Penta::GetBasalElement{{{1*/
     4669Penta* Penta::GetBasalElement(void){
     4670
     4671        /*Output*/
     4672        Penta* penta=NULL;
     4673
     4674        /*Go through all elements till the bed is reached*/
     4675        penta=this;
     4676        for(;;){
     4677
     4678                /*Stop if we have reached the surface, else, take lower penta*/
     4679                if (penta->IsOnBed()) break;
     4680
     4681                /* get lower Penta*/
     4682                penta=penta->GetLowerElement();
     4683                ISSMASSERT(penta->Id()!=this->id);
     4684        }
     4685
     4686        /*return output*/
     4687        return penta;
     4688}
     4689/*}}}*/
     4690/*FUNCTION Penta::GetLowerElement{{{1*/
     4691Penta* Penta::GetLowerElement(void){
     4692
     4693        Penta* upper_penta=NULL;
     4694        upper_penta=(Penta*)neighbors[0]; //first one (0) under, second one (1) above
     4695        return upper_penta;
     4696
     4697}
     4698/*}}}*/
    46634699/*FUNCTION Penta::GetUpperElement{{{1*/
    46644700Penta* Penta::GetUpperElement(void){
     
    47084744        }
    47094745        else{
     4746                /*Gradient is computed on bed only (B2d)*/
     4747                if (!onbed) return;
     4748
    47104749                /*Depth Average B*/
    47114750                this->InputDepthAverageAtBase(RheologyBEnum,RheologyB2dEnum,MaterialsEnum);
     
    54715510}
    54725511/*}}}*/
     5512/*FUNCTION Penta::IsOnBed{{{1*/
     5513bool Penta::IsOnBed(void){
     5514
     5515        bool onbed;
     5516        inputs->GetParameterValue(&onbed,ElementOnBedEnum);
     5517        return onbed;
     5518
     5519}
     5520/*}}}*/
    54735521/*FUNCTION Penta::ReduceMatrixStokes {{{1*/
    54745522void Penta::ReduceMatrixStokes(double* Ke_reduced, double* Ke_temp){
Note: See TracChangeset for help on using the changeset viewer.