Changeset 17144


Ignore:
Timestamp:
01/17/14 16:31:39 (11 years ago)
Author:
jbondzio
Message:

ADD: setting spcs on ice domain for extrapolation

Location:
issm/trunk-jpl/src/c/analyses
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp

    r17139 r17144  
    5656
    5757        if(VerboseSolution()) _printf0_("extrapolation: call computational core:\n");
     58        UpdateConstraints(femmodel->elements);
    5859        solutionsequence_linear(femmodel);
    5960
     
    230231
    231232}/*}}}*/
    232 
     233void ExtrapolationAnalysis::UpdateConstraints(Elements* elements){/*{{{*/
     234
     235        for(int i=0;i<elements->Size();i++){
     236                Element* element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
     237                this->SetConstraintsOnIce(element);
     238        }
     239
     240}/*}}}*/
     241void ExtrapolationAnalysis::SetConstraintsOnIce(Element* element){/*{{{*/
     242
     243        int numnodes=element->GetNumberOfNodes();       
     244
     245        /* Intermediaries */
     246        int extvar_enum;
     247        IssmDouble phi,value;
     248        Node* node = NULL;
     249
     250        /* Get further parameters */
     251        element->FindParam(&extvar_enum, ExtrapolationVariableEnum);
     252       
     253        Input* levelset_input=element->GetInput(MaskIceLevelsetEnum); _assert_(levelset_input);
     254        Input* extvar_input=element->GetInput(extvar_enum); _assert_(extvar_input);
     255       
     256        GaussPenta* gauss=new GaussPenta();
     257        for(int in=0;in<numnodes;in++){
     258                gauss->GaussNode(element->GetElementType(),in);
     259                node=element->GetNode(in);
     260                levelset_input->GetInputValue(&phi,gauss);
     261                extvar_input->GetInputValue(&value,gauss);
     262                if(phi<=0.){
     263                        /* if ice, set dirichlet BC */
     264                        node->ApplyConstraint(1,value);
     265                }
     266                else {
     267                        /* no ice, set no spc */
     268                        node->DofInFSet(0);
     269                }
     270        }
     271        delete gauss;
     272}/*}}}*/
  • issm/trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h

    r17139 r17144  
    3030        void GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
    3131        void GetBprime(IssmDouble* Bprime,Element* element,IssmDouble* xyz_list,Gauss* gauss);
    32 
     32        void UpdateConstraints(Elements* elements);
     33        void SetConstraintsOnIce(Element* element);
    3334};
    3435#endif
Note: See TracChangeset for help on using the changeset viewer.