Changeset 17579


Ignore:
Timestamp:
03/27/14 15:59:05 (11 years ago)
Author:
Mathieu Morlighem
Message:

NEW: added FS contact method for GL (not implemented yet)

Location:
issm/trunk-jpl/src
Files:
9 edited

Legend:

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

    r17536 r17579  
    295295
    296296                virtual void   MigrateGroundingLine(IssmDouble* sheet_ungrounding)=0;
     297                virtual void   FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating)=0;
    297298                virtual void   PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding)=0;
    298299                virtual int    UpdatePotentialUngrounding(IssmDouble* potential_sheet_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf)=0;
  • issm/trunk-jpl/src/c/classes/Elements/Penta.h

    r17536 r17579  
    6060                void   ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
    6161                int    FiniteElement(void);
     62                void   FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating){_error_("not implemented yet");};
    6263                void   SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
    6364                void   Delta18oParameterization(void);
  • issm/trunk-jpl/src/c/classes/Elements/Seg.h

    r17536 r17579  
    6060                void        Delta18oParameterization(void){_error_("not implemented yet");};
    6161                void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){_error_("not implemented yet");};
     62                void        FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating){_error_("not implemented yet");};
    6263                int         FiniteElement(void);
    6364                Element*    GetUpperElement(void){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/classes/Elements/Tetra.h

    r17536 r17579  
    6363                void        FaceOnBedIndices(int* pindex1,int* pindex2,int* pindex3);
    6464                void        FaceOnSurfaceIndices(int* pindex1,int* pindex2,int* pindex3);
     65                void        FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating){_error_("not implemented yet");};
    6566                int         FiniteElement(void);
    6667                Element*    GetUpperElement(void){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/classes/Elements/Tria.h

    r17536 r17579  
    5959                void        Delta18oParameterization(void);
    6060                void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
     61                void        FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating){_error_("not implemented yet");};
    6162                int         FiniteElement(void);
    6263                Element*    GetUpperElement(void){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp

    r16510 r17579  
    2323        if(migration_style==NoneEnum) return;
    2424
    25         if(migration_style!=AgressiveMigrationEnum  &&
    26                 migration_style!=SoftMigrationEnum       &&
    27                 migration_style!=SubelementMigrationEnum &&
    28                 migration_style!=SubelementMigration2Enum)
    29          _error_("Grounding line migration "<<EnumToStringx(migration_style) << " not supported yet!");
    30 
    3125        /*Set toolkit to default*/
    3226        ToolkitsOptionsFromAnalysis(parameters,DefaultAnalysisEnum);
    3327
    34         if(migration_style==SoftMigrationEnum){
    35                 /*Create flag for grounded vertices above the hydrostatic equilibrium: */
    36                 vertices_potentially_ungrounding=PotentialUngrounding(elements,vertices,parameters);
    37 
    38                 /*propagate ice shelf into connex areas of the ice sheet that potentially want to unground: */
    39                 phi_ungrounding=PropagateFloatingiceToGroundedNeighbors(elements,nodes,vertices,parameters,vertices_potentially_ungrounding);
     28        switch(migration_style){
     29                case SoftMigrationEnum:
     30                        /*Create flag for grounded vertices above the hydrostatic equilibrium: */
     31                        vertices_potentially_ungrounding=PotentialUngrounding(elements,vertices,parameters);
     32                        /*propagate ice shelf into connex areas of the ice sheet that potentially want to unground: */
     33                        phi_ungrounding=PropagateFloatingiceToGroundedNeighbors(elements,nodes,vertices,parameters,vertices_potentially_ungrounding);
     34                        break;
     35                case ContactEnum:
     36                        phi_ungrounding=ContactFSLevelset(elements,vertices);
     37                        break;
     38                case AgressiveMigrationEnum:
     39                case SubelementMigrationEnum:
     40                case SubelementMigration2Enum:
     41                        /*Nothing additional to do here, MigrateGroundingLine takes care of everything*/
     42                        break;
     43                default:
     44                        _error_("Grounding line migration "<<EnumToStringx(migration_style) << " not supported yet!");
    4045        }
    4146
     
    5156}
    5257
     58/*FUNCTION ContactFSLevelset{{{*/
     59IssmDouble*    ContactFSLevelset(Elements* elements,Vertices* vertices){
     60
     61        Vector<IssmDouble>* vertexgrounded = NULL;
     62        Vector<IssmDouble>* vertexfloating = NULL;
     63        IssmDouble*  serial_vertexgrounded = NULL;
     64        IssmDouble*  serial_vertexfloating = NULL;
     65        IssmDouble*  phi                   = NULL;
     66
     67        /*Initialize vector with number of vertices*/
     68        int numberofvertices=vertices->NumberOfVertices();
     69        vertexgrounded=new Vector<IssmDouble>(numberofvertices);
     70        vertexfloating=new Vector<IssmDouble>(numberofvertices);
     71        phi           =xNew<IssmDouble>(numberofvertices);
     72
     73        /*Fill vector vertices_potentially_floating: */
     74        for(int i=0;i<elements->Size();i++){
     75                Element* element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
     76                element->FSContactMigration(vertexgrounded,vertexfloating);
     77        }
     78
     79        /*Assemble vector and serialize */
     80        vertexgrounded->Assemble();
     81        vertexfloating->Assemble();
     82        serial_vertexgrounded=vertexgrounded->ToMPISerial();
     83        serial_vertexfloating=vertexfloating->ToMPISerial();
     84
     85        for(int i=0;i<numberofvertices;i++){
     86                if(serial_vertexgrounded[i]==1. && serial_vertexfloating[i]==1.){
     87                        phi[i]=0.;
     88                }
     89                else if(serial_vertexgrounded[i]==1.){
     90                        phi[i]=1.;
     91                }
     92                else if(serial_vertexfloating[i]==1.){
     93                        phi[i]=-1.;
     94                }
     95                else{
     96                        _error_("not supported");
     97                }
     98        }
     99
     100        /*free ressouces and return: */
     101        delete vertexgrounded;
     102        delete vertexfloating;
     103        xDelete<IssmDouble>(serial_vertexgrounded);
     104        xDelete<IssmDouble>(serial_vertexfloating);
     105
     106        return phi;
     107}
     108/*}}}*/
    53109/*FUNCTION PotentialUngrounding {{{*/
    54110IssmDouble*    PotentialUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters){
  • issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h

    r15965 r17579  
    1313/* local prototypes: */
    1414void         GroundinglineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
     15IssmDouble*  ContactFSLevelset(Elements* elements,Vertices* vertices);
    1516IssmDouble*  PotentialUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters);
    1617IssmDouble*  PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,IssmDouble* vertices_potentially_ungrounding);
  • issm/trunk-jpl/src/m/classes/groundingline.m

    r17037 r17579  
    2929                function md = checkconsistency(obj,md,solution,analyses) % {{{
    3030
    31                         md = checkfield(md,'fieldname','groundingline.migration','values',{'None' 'AgressiveMigration' 'SoftMigration' 'SubelementMigration','SubelementMigration2'});
     31                        md = checkfield(md,'fieldname','groundingline.migration','values',{'None' 'AgressiveMigration' 'SoftMigration' 'SubelementMigration','SubelementMigration2' 'Contact'});
    3232
    3333                        if ~strcmp(obj.migration,'None'),
  • issm/trunk-jpl/src/m/classes/groundingline.py

    r17480 r17579  
    4242        def checkconsistency(self,md,solution,analyses):    # {{{
    4343
    44                 md = checkfield(md,'fieldname','groundingline.migration','values',['None','AgressiveMigration','SoftMigration','SubelementMigration','SubelementMigration2'])
     44                md = checkfield(md,'fieldname','groundingline.migration','values',['None','AgressiveMigration','SoftMigration','SubelementMigration','SubelementMigration2' 'Contact'])
    4545
    4646                if not m.strcmp(self.migration,'None'):
Note: See TracChangeset for help on using the changeset viewer.