Changeset 19764 for issm/trunk-jpl/src


Ignore:
Timestamp:
11/19/15 12:52:40 (9 years ago)
Author:
seroussi
Message:

NEW: added floating area output result

Location:
issm/trunk-jpl/src
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Element.h

    r19554 r19764  
    194194                virtual void       ElementSizes(IssmDouble* phx,IssmDouble* phy,IssmDouble* phz)=0;
    195195                virtual int        FiniteElement(void)=0;
     196                virtual IssmDouble FloatingArea(void)=0;
    196197                virtual void       FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating)=0;
    197198                virtual Element*   GetBasalElement(void)=0;
  • issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r19527 r19764  
    653653int        Penta::FiniteElement(void){/*{{{*/
    654654        return this->element_type;
     655}
     656/*}}}*/
     657IssmDouble Penta::FloatingArea(void){/*{{{*/
     658
     659        /*Intermediaries*/
     660        int         domaintype;
     661        IssmDouble  phi,base_area;
     662        IssmDouble  xyz_list[NUMVERTICES][3];
     663
     664        if(!IsIceInElement() || !IsOnBase())return 0.;
     665
     666        /*Get problem dimension*/
     667        this->FindParam(&domaintype,DomainTypeEnum);
     668        if(domaintype!=Domain3DEnum) _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
     669
     670        ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
     671        phi=this->GetGroundedPortion(&xyz_list[0][0]);
     672        base_area= 1./2.*fabs((xyz_list[0][0]-xyz_list[2][0])*(xyz_list[1][1]-xyz_list[0][1]) - (xyz_list[0][0]-xyz_list[1][0])*(xyz_list[2][1]-xyz_list[0][1]));
     673
     674        /*Clean up and return*/
     675        return (1-phi)*base_area;
    655676}
    656677/*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/Penta.h

    r19518 r19764  
    6262                void           ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
    6363                int            FiniteElement(void);
     64                IssmDouble     FloatingArea(void);
    6465                void           FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating);
    6566                void           GetAreaCoordinates(IssmDouble *area_coordinates,IssmDouble* xyz_zero,IssmDouble* xyz_list,int numpoints);
  • issm/trunk-jpl/src/c/classes/Elements/Seg.h

    r19518 r19764  
    5656                void        ElementResponse(IssmDouble* presponse,int response_enum){_error_("not implemented yet");};
    5757                void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){_error_("not implemented yet");};
     58                int         FiniteElement(void);
     59                IssmDouble  FloatingArea(void){_error_("not implemented yet");};
    5860                void        FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating){_error_("not implemented yet");};
    59                 int         FiniteElement(void);
    6061                Element*    GetBasalElement(void){_error_("not implemented yet");};
    6162                int         GetElementType(void){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/classes/Elements/Tetra.h

    r19518 r19764  
    6161                void        FaceOnSurfaceIndices(int* pindex1,int* pindex2,int* pindex3);
    6262                int         FiniteElement(void);
     63                IssmDouble  FloatingArea(void){_error_("not implemented yet");};
    6364                void        FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating){_error_("not implemented yet");};
    6465                Element*    GetBasalElement(void){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r19527 r19764  
    909909int        Tria::FiniteElement(void){/*{{{*/
    910910        return this->element_type;
     911}
     912/*}}}*/
     913IssmDouble Tria::FloatingArea(void){/*{{{*/
     914
     915        /*Intermediaries*/
     916        int         domaintype;
     917        IssmDouble  phi;
     918        IssmDouble *xyz_list  = NULL;
     919
     920        if(!IsIceInElement())return 0.;
     921
     922        /*Get problem dimension*/
     923        this->FindParam(&domaintype,DomainTypeEnum);
     924        if(domaintype!=Domain2DhorizontalEnum && domaintype!=Domain3DEnum) _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
     925
     926        this->GetVerticesCoordinates(&xyz_list);
     927        phi=this->GetGroundedPortion(xyz_list);
     928
     929        /*Clean up and return*/
     930        xDelete<IssmDouble>(xyz_list);
     931        return (1-phi)*this->GetArea();
    911932}
    912933/*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/Tria.h

    r19518 r19764  
    7373                void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
    7474                int         FiniteElement(void);
     75                IssmDouble  FloatingArea(void);
    7576                void        FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating);
    7677                Element*    GetBasalElement(void){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r19720 r19764  
    10091009                                        case IceVolumeAboveFloatationEnum: this->IceVolumeAboveFloatationx(&double_result); break;
    10101010                                        case GroundedAreaEnum:             this->GroundedAreax(&double_result);             break;
     1011                                        case FloatingAreaEnum:             this->FloatingAreax(&double_result);             break;
    10111012                                        case MinVelEnum:                   this->MinVelx(&double_result);                   break;
    10121013                                        case MaxVelEnum:                   this->MaxVelx(&double_result);                   break;
     
    16151616
    16161617}/*}}}*/
     1618void FemModel::FloatingAreax(IssmDouble* pV){/*{{{*/
     1619
     1620        IssmDouble local_floating_area= 0;
     1621        IssmDouble total_floating_area;
     1622
     1623        for(int i=0;i<this->elements->Size();i++){
     1624                Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
     1625                local_floating_area+=element->FloatingArea();
     1626        }
     1627        ISSM_MPI_Reduce(&local_floating_area,&total_floating_area,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
     1628        ISSM_MPI_Bcast(&total_floating_area,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
     1629
     1630        /*Assign output pointers: */
     1631        *pV=total_floating_area;
     1632
     1633}/*}}}*/
    16171634void FemModel::GetInputLocalMinMaxOnNodesx(IssmDouble** pmin,IssmDouble** pmax,IssmDouble* ug){/*{{{*/
    16181635
  • issm/trunk-jpl/src/c/classes/FemModel.h

    r19518 r19764  
    8282                void Divergencex(IssmDouble* pdiv);
    8383                void MaxDivergencex(IssmDouble* pdiv);
     84                void FloatingAreax(IssmDouble* pV);
    8485                void GroundedAreax(IssmDouble* pV);
    8586                void IceMassx(IssmDouble* pV);
  • issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h

    r19749 r19764  
    902902        MaxVzEnum,
    903903        MaxAbsVzEnum,
     904        FloatingAreaEnum,
    904905        GroundedAreaEnum,
    905906        IceMassEnum,
  • issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp

    r19749 r19764  
    880880                case MaxVzEnum : return "MaxVz";
    881881                case MaxAbsVzEnum : return "MaxAbsVz";
     882                case FloatingAreaEnum : return "FloatingArea";
    882883                case GroundedAreaEnum : return "GroundedArea";
    883884                case IceMassEnum : return "IceMass";
  • issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp

    r19749 r19764  
    901901              else if (strcmp(name,"MaxVz")==0) return MaxVzEnum;
    902902              else if (strcmp(name,"MaxAbsVz")==0) return MaxAbsVzEnum;
     903              else if (strcmp(name,"FloatingArea")==0) return FloatingAreaEnum;
    903904              else if (strcmp(name,"GroundedArea")==0) return GroundedAreaEnum;
    904905              else if (strcmp(name,"IceMass")==0) return IceMassEnum;
  • issm/trunk-jpl/src/m/enum/EnumDefinitions.py

    r19749 r19764  
    872872def MaxVzEnum(): return StringToEnum("MaxVz")[0]
    873873def MaxAbsVzEnum(): return StringToEnum("MaxAbsVz")[0]
     874def FloatingAreaEnum(): return StringToEnum("FloatingArea")[0]
    874875def GroundedAreaEnum(): return StringToEnum("GroundedArea")[0]
    875876def IceMassEnum(): return StringToEnum("IceMass")[0]
Note: See TracChangeset for help on using the changeset viewer.