Ignore:
Timestamp:
08/28/18 09:45:51 (7 years ago)
Author:
Mathieu Morlighem
Message:

merged trunk-jpl and trunk for revision 23187

Location:
issm/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk

  • issm/trunk/src

  • issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp

    r19105 r23189  
    1515        Element            *element                          = NULL;
    1616
    17 
    1817        /*retrieve parameters: */
    1918        parameters->FindParam(&migration_style,GroundinglineMigrationEnum);
     
    2120
    2221        if(migration_style==NoneEnum) return;
    23        
     22
    2423        if(VerboseModule()) _printf0_("   Migrating grounding line\n");
    2524
     
    3736                        phi_ungrounding=ContactFSLevelset(elements,vertices);
    3837                        break;
     38                case SubelementMigrationEnum:
    3939                case AggressiveMigrationEnum:
    40                 case SubelementMigrationEnum:
    41                 case SubelementMigration2Enum:
    4240                case GroundingOnlyEnum:
    4341                        /*Nothing additional to do here, MigrateGroundingLine takes care of everything*/
     
    6058IssmDouble*    ContactFSLevelset(Elements* elements,Vertices* vertices){ /*{{{*/
    6159
    62         Vector<IssmDouble>* vertexgrounded = NULL;
    63         Vector<IssmDouble>* vertexfloating = NULL;
    64         IssmDouble*  serial_vertexgrounded = NULL;
    65         IssmDouble*  serial_vertexfloating = NULL;
     60        Vector<IssmDouble>* vertex_sigmann = NULL;
     61        Vector<IssmDouble>* vertex_waterpressure = NULL;
     62        IssmDouble*  serial_vertex_sigmann = NULL;
     63        IssmDouble*  serial_vertex_waterpressure = NULL;
    6664        IssmDouble*  phi                   = NULL;
    6765
    6866        /*Initialize vector with number of vertices*/
    6967        int numberofvertices = vertices->NumberOfVertices();
    70         vertexgrounded = new Vector<IssmDouble>(numberofvertices);
    71         vertexfloating = new Vector<IssmDouble>(numberofvertices);
     68        vertex_sigmann = new Vector<IssmDouble>(numberofvertices);
     69        vertex_waterpressure = new Vector<IssmDouble>(numberofvertices);
    7270        phi            = xNew<IssmDouble>(numberofvertices);
    7371
     
    7573        for(int i=0;i<elements->Size();i++){
    7674                Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
    77                 element->FSContactMigration(vertexgrounded,vertexfloating);
     75                element->FSContactMigration(vertex_sigmann,vertex_waterpressure);
    7876        }
     77        /*Assemble vector and serialize */
     78        vertex_sigmann->Assemble();
     79        vertex_waterpressure->Assemble();
     80        serial_vertex_sigmann=vertex_sigmann->ToMPISerial();
     81        serial_vertex_waterpressure=vertex_waterpressure->ToMPISerial();
    7982
    80         /*Assemble vector and serialize */
    81         vertexgrounded->Assemble();
    82         vertexfloating->Assemble();
    83         serial_vertexgrounded=vertexgrounded->ToMPISerial();
    84         serial_vertexfloating=vertexfloating->ToMPISerial();
    8583        for(int i=0;i<numberofvertices;i++){
    86                         if (serial_vertexgrounded[i]==1. && serial_vertexfloating[i]==1.) phi[i]=0.;
    87                         else if (serial_vertexgrounded[i]==1) phi[i]=1;
    88                         else if (serial_vertexfloating[i]==1) phi[i]=-1;
    89                         else if (serial_vertexgrounded[i]>10) phi[i]=9999;
    90                         else phi[i]=-9999;
     84                if (serial_vertex_waterpressure[i] > serial_vertex_sigmann[i]) phi[i]=-1;
     85                else phi[i]=1;
    9186        }
    9287
    9388        /*free ressouces and return: */
    94         delete vertexgrounded;
    95         delete vertexfloating;
    96         xDelete<IssmDouble>(serial_vertexgrounded);
    97         xDelete<IssmDouble>(serial_vertexfloating);
     89        delete vertex_sigmann;
     90        delete vertex_waterpressure;
     91        xDelete<IssmDouble>(serial_vertex_sigmann);
     92        xDelete<IssmDouble>(serial_vertex_waterpressure);
    9893
    9994        return phi;
Note: See TracChangeset for help on using the changeset viewer.