Changeset 17515


Ignore:
Timestamp:
03/21/14 09:32:05 (11 years ago)
Author:
Mathieu Morlighem
Message:

NEW: working on FS Tetra:

Location:
issm/trunk-jpl/src/c/classes/Elements
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp

    r17513 r17515  
    339339                return false;
    340340        }
     341}
     342/*}}}*/
     343/*FUNCTION Tetra::HasNodeOnBed           THIS ONE{{{*/
     344bool Tetra::HasNodeOnBed(){
     345
     346        IssmDouble values[NUMVERTICES];
     347        IssmDouble sum;
     348
     349        /*Retrieve all inputs and parameters*/
     350        GetInputListOnVertices(&values[0],MeshVertexonbedEnum);
     351        sum = values[0]+values[1]+values[2]+values[3];
     352
     353        return sum>0.;
    341354}
    342355/*}}}*/
     
    682695}
    683696/*}}}*/
     697/*FUNCTION Tetra::ResetFSBasalBoundaryCondition {{{*/
     698void  Tetra::ResetFSBasalBoundaryCondition(void){
     699
     700        int numnodes = this->GetNumberOfNodes();
     701
     702        int          approximation;
     703        IssmDouble*  vertexonbed= NULL;
     704        IssmDouble   slopex,slopey,groundedice;
     705        IssmDouble   xz_plane[6];
     706
     707        /*For FS only: we want the CS to be tangential to the bedrock*/
     708        inputs->GetInputValue(&approximation,ApproximationEnum);
     709        if(IsFloating() || !HasNodeOnBed() ||  approximation!=FSApproximationEnum) return;
     710
     711        //printf("element number %i \n",this->id);
     712        /*Get inputs*/
     713        Input* slopex_input=inputs->GetInput(BedSlopeXEnum); _assert_(slopex_input);
     714        Input* slopey_input=inputs->GetInput(BedSlopeYEnum); _assert_(slopey_input);
     715        Input* groundedicelevelset_input=inputs->GetInput(MaskGroundediceLevelsetEnum); _assert_(groundedicelevelset_input);
     716        vertexonbed = xNew<IssmDouble>(numnodes);
     717        this->GetInputListOnNodesVelocity(&vertexonbed[0],MeshVertexonbedEnum);
     718
     719        /*Loop over basal nodes and update their CS*/
     720        GaussTetra* gauss = new GaussTetra();
     721        for(int i=0;i<this->NumberofNodesVelocity();i++){
     722
     723                if(vertexonbed[i]==1){
     724                        gauss->GaussNode(this->VelocityInterpolation(),i);
     725
     726                        slopex_input->GetInputValue(&slopex,gauss);
     727                        slopey_input->GetInputValue(&slopey,gauss);
     728                        groundedicelevelset_input->GetInputValue(&groundedice,gauss);
     729
     730                        /*New X axis          New Z axis*/
     731                        xz_plane[0]=1.;       xz_plane[3]=-slopex; 
     732                        xz_plane[1]=0.;       xz_plane[4]=-slopey; 
     733                        xz_plane[2]=slopex;   xz_plane[5]=1.;         
     734
     735                        if(groundedice>0){
     736                                if(this->nodes[i]->GetApproximation()==FSvelocityEnum){
     737                                        this->nodes[i]->DofInSSet(2); //vz
     738                                }
     739                                else _error_("Flow equation approximation"<<EnumToStringx(this->nodes[i]->GetApproximation())<<" not supported yet");
     740                        }
     741                        else{
     742                                if(this->nodes[i]->GetApproximation()==FSvelocityEnum){
     743                                        this->nodes[i]->DofInFSet(2); //vz
     744                                }
     745                                else _error_("Flow equation approximation"<<EnumToStringx(this->nodes[i]->GetApproximation())<<" not supported yet");
     746                        }
     747
     748                        XZvectorsToCoordinateSystem(&this->nodes[i]->coord_system[0][0],&xz_plane[0]);
     749                }
     750        }
     751
     752        /*cleanup*/
     753        xDelete<IssmDouble>(vertexonbed);
     754        delete gauss;
     755}
     756/*}}}*/
    684757/*FUNCTION Tetra::SetCurrentConfiguration {{{*/
    685758void  Tetra::SetCurrentConfiguration(Elements* elementsin, Loads* loadsin, Nodes* nodesin, Materials* materialsin, Parameters* parametersin){
     
    913986}
    914987/*}}}*/
     988/*FUNCTION Tetra::VelocityInterpolation{{{*/
     989int Tetra::VelocityInterpolation(void){
     990        return TetraRef::VelocityInterpolation();
     991}
     992/*}}}*/
     993/*FUNCTION Tetra::PressureInterpolation{{{*/
     994int Tetra::PressureInterpolation(void){
     995        return TetraRef::PressureInterpolation();
     996}
     997/*}}}*/
    915998/*FUNCTION Tetra::ZeroLevelsetCoordinates{{{*/
    916999void Tetra::ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum){
  • issm/trunk-jpl/src/c/classes/Elements/Tetra.h

    r17513 r17515  
    8888                bool        HasFaceOnBed();
    8989                bool        HasFaceOnSurface();
     90                bool        HasNodeOnBed();
    9091                int         Sid();
    9192                bool        IsOnBed();
     
    117118                IssmDouble  StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
    118119                IssmDouble  PureIceEnthalpy(IssmDouble pressure){_error_("not implemented yet");};
    119                 int         PressureInterpolation(void){_error_("not implemented yet");};
     120                int         PressureInterpolation(void);
    120121                void        ValueP1OnGauss(IssmDouble* pvalue,IssmDouble* values,Gauss* gauss){_error_("not implemented yet");};
    121122                void        ValueP1DerivativesOnGauss(IssmDouble* dvalue,IssmDouble* values,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
    122                 int         VelocityInterpolation(void){_error_("not implemented yet");};
     123                int         VelocityInterpolation(void);
    123124                void        GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating){_error_("not implemented yet");};
    124125                IssmDouble  GetGroundedPortion(IssmDouble* xyz_list){_error_("not implemented yet");};
     
    154155                int         NodalValue(IssmDouble* pvalue, int index, int natureofdataenum){_error_("not implemented yet");};
    155156                void        PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm){_error_("not implemented yet");};
    156                 void        ResetFSBasalBoundaryCondition(void){_error_("not implemented yet");};
     157                void        ResetFSBasalBoundaryCondition(void);
    157158                void        ReduceMatrices(ElementMatrix* Ke,ElementVector* pe);
    158159                void        SetTemporaryElementType(int element_type_in){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/classes/Elements/TetraRef.cpp

    r17493 r17515  
    545545                case P1bubblecondensedEnum: return NUMNODESP1b;
    546546                case P2Enum:                return NUMNODESP2;
     547                case P1P1Enum:              return NUMNODESP1*2;
     548                case P1P1GLSEnum:           return NUMNODESP1*2;
     549                case MINIcondensedEnum:     return NUMNODESP1b+NUMNODESP1;
     550                case MINIEnum:              return NUMNODESP1b+NUMNODESP1;
     551                case TaylorHoodEnum:        return NUMNODESP2+NUMNODESP1;
    547552                default: _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
    548553        }
Note: See TracChangeset for help on using the changeset viewer.