Changeset 10400


Ignore:
Timestamp:
11/01/11 11:12:50 (13 years ago)
Author:
seroussi
Message:

bad grounding line 3d, to be improved

Location:
issm/trunk/src/c
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp

    r10379 r10400  
    3434
    3535                /*propagate ice shelf into connex areas of the ice sheet that potentially want to unground: */
    36                 vertices_ungrounding=PropagateFloatingiceToGrounded(elements,nodes,vertices,parameters,vertices_potentially_ungrounding);
     36                vertices_ungrounding=PropagateFloatingiceToGroundedNeighbors(elements,nodes,vertices,parameters,vertices_potentially_ungrounding);
    3737        }
    3838
     
    110110}
    111111/*}}}*/
    112 /*FUNCTION PropagateFloatingiceToGrounded {{{1*/
    113 double*    PropagateFloatingiceToGrounded(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding){
     112/*FUNCTION PropagateFloatingiceToGroundedNeighbors {{{1*/
     113double*    PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding){
    114114
    115115        int      i,analysis_type;
     
    117117        int      nflipped,local_nflipped;
    118118        double*  nodes_on_floatingice                  = NULL;
    119         double*  elements_neighbouring_floatingce      = NULL;
    120         Vec      vec_elements_neighbouring_floatingice = NULL;
     119        double*  elements_neighboring_floatingce      = NULL;
     120        Vec      vec_elements_neighboring_floatingice = NULL;
    121121        Vec      vec_nodes_on_floatingice              = NULL;
    122122        Node*    node                                  = NULL;
     
    136136               
    137137                /*Vector of size number of elements*/
    138                 vec_elements_neighbouring_floatingice=NewVec(elements->NumberOfElements(),true);
     138                vec_elements_neighboring_floatingice=NewVec(elements->NumberOfElements(),true);
    139139
    140140                /*Figure out if any of the nodes of the element will be floating -> elements neighbouting the floating ice*/
    141141                for(i=0;i<elements->Size();i++){
    142142                        element=(Element*)elements->GetObjectByOffset(i);
    143                         VecSetValue(vec_elements_neighbouring_floatingice,element->Sid(),element->IsNodeOnShelfFromFlags(nodes_on_floatingice)?1.0:0.0,INSERT_VALUES);
     143                        VecSetValue(vec_elements_neighboring_floatingice,element->Sid(),element->IsNodeOnShelfFromFlags(nodes_on_floatingice)?1.0:0.0,INSERT_VALUES);
    144144                }
    145145
    146146                /*Assemble vector and serialize: */
    147                 VecAssemblyBegin(vec_elements_neighbouring_floatingice);
    148                 VecAssemblyEnd(vec_elements_neighbouring_floatingice);
    149                 VecToMPISerial(&elements_neighbouring_floatingce,vec_elements_neighbouring_floatingice);
     147                VecAssemblyBegin(vec_elements_neighboring_floatingice);
     148                VecAssemblyEnd(vec_elements_neighboring_floatingice);
     149                VecToMPISerial(&elements_neighboring_floatingce,vec_elements_neighboring_floatingice);
    150150
    151                 /*Go through elements_neighbouring_floatingce, and update vector of the nodes that will start floating*/
     151                /*Go through elements_neighboring_floatingce, and update vector of the nodes that will start floating*/
    152152                local_nflipped=0;
    153153                for(i=0;i<elements->Size();i++){
    154154                        element=(Element*)elements->GetObjectByOffset(i);
    155                         if(elements_neighbouring_floatingce[element->Sid()]){
     155                        if(elements_neighboring_floatingce[element->Sid()]){
    156156                                local_nflipped+=element->UpdatePotentialSheetUngrounding(vertices_potentially_ungrounding,vec_nodes_on_floatingice,nodes_on_floatingice);
    157157                        }
     
    164164
    165165                /*Avoid leaks: */
    166                 xfree((void**)&elements_neighbouring_floatingce);
     166                xfree((void**)&elements_neighboring_floatingce);
    167167                xfree((void**)&nodes_on_floatingice);
    168168
    169169                /*Assemble and serialize:*/
    170                 VecFree(&vec_elements_neighbouring_floatingice);
     170                VecFree(&vec_elements_neighboring_floatingice);
    171171                VecToMPISerial(&nodes_on_floatingice,vec_nodes_on_floatingice);
    172172        }
     
    174174        /*Free ressources:*/
    175175        VecFree(&vec_nodes_on_floatingice);
    176         xfree((void**)&elements_neighbouring_floatingce);
     176        xfree((void**)&elements_neighboring_floatingce);
    177177
    178178        return nodes_on_floatingice;
  • issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h

    r10378 r10400  
    1616Vec        CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type);
    1717double*    PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters);
    18 double*    PropagateFloatingiceToGrounded(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding);
     18double*    PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding);
    1919#endif  /* _GROUNDINGLINEMIGRATIONX_H */
  • issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp

    r9874 r10400  
    2626        char       *outputfilename          = NULL;
    2727        char        cpu_outputfilename[100];        //easier to convert an integer with sprintf
    28         bool        io_gather,results_on_vertices;
     28        bool        io_gather;
    2929        int         solutiontype;
    3030        Results    *results                 = NULL;
    31         bool        dakota_analysis            = false;
     31        bool        dakota_analysis         = false;
    3232       
    3333        #ifdef _SERIAL_
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r10391 r10400  
    20382038/*FUNCTION Penta::MigrateGroundingLine{{{1*/
    20392039void  Penta::MigrateGroundingLine(double* old_floating_ice,double* sheet_ungrounding){
    2040         _error_("not supported yet!");
     2040
     2041        int     i,migration_style,unground;
     2042        bool    elementonshelf = false;
     2043        double  bed_hydro,yts,gl_melting_rate;
     2044        double  rho_water,rho_ice,density;
     2045        double  melting[NUMVERTICES];
     2046        double  h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],ba[NUMVERTICES];
     2047
     2048        /*Recover info at the vertices: */
     2049        parameters->FindParam(&migration_style,GroundinglineMigrationEnum);
     2050        parameters->FindParam(&yts,ConstantsYtsEnum);
     2051        GetInputListOnVertices(&h[0],ThicknessEnum);
     2052        GetInputListOnVertices(&s[0],SurfaceEnum);
     2053        GetInputListOnVertices(&b[0],BedEnum);
     2054        GetInputListOnVertices(&ba[0],BathymetryEnum);
     2055        rho_water=matpar->GetRhoWater();
     2056        rho_ice=matpar->GetRhoIce();
     2057        density=rho_ice/rho_water;
     2058       
     2059        /*go through vertices, and update inputs, considering them to be PentaVertex type: */
     2060        for(i=0;i<NUMVERTICES;i++){
     2061                /*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
     2062                if(old_floating_ice[nodes[i]->Sid()]){
     2063                        if(b[i]<=ba[i]){
     2064                                b[i]=ba[i];
     2065                                s[i]=b[i]+h[i];
     2066                                nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,false));
     2067                                nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,true));
     2068                        }
     2069                }
     2070                /*Ice sheet: if hydrostatic bed above bathymetry, ice sheet starts to unground, elso do nothing */
     2071                /*Change only if AgressiveMigration or if the ice sheet is in contact with the ocean*/
     2072                else{
     2073                        bed_hydro=-density*h[i];
     2074                        if (bed_hydro>ba[i]){
     2075                                /*Unground only if the element is connected to the ice shelf*/
     2076                                if(migration_style==AgressiveMigrationEnum){
     2077                                        s[i]=(1-density)*h[i];
     2078                                        b[i]=-density*h[i];
     2079                                        nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
     2080                                        nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
     2081                                }
     2082                                else if(migration_style==SoftMigrationEnum && sheet_ungrounding[nodes[i]->Sid()]){
     2083                                        s[i]=(1-density)*h[i];
     2084                                        b[i]=-density*h[i];
     2085                                        nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
     2086                                        nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
     2087                                }
     2088                        }
     2089                }
     2090        }
     2091
     2092        /*If at least one vertex is now floating, the element is now floating*/
     2093        for(i=0;i<NUMVERTICES;i++){
     2094                if(nodes[i]->IsFloating()){
     2095                        elementonshelf=true;
     2096                        break;
     2097                }
     2098        }
     2099       
     2100   /*Add basal melting rate if element just ungrounded*/
     2101        if(!this->IsFloating() && elementonshelf==true){
     2102                for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts;
     2103                this->inputs->AddInput(new PentaVertexInput(BasalforcingsMeltingRateEnum,&melting[0]));
     2104        }
     2105
     2106        /*Update inputs*/
     2107   this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,elementonshelf));
     2108
     2109        /*Update inputs*/   
     2110        this->inputs->AddInput(new PentaVertexInput(SurfaceEnum,&s[0]));
     2111        this->inputs->AddInput(new PentaVertexInput(BedEnum,&b[0]));
    20412112}
    20422113/*}}}*/
     
    21002171
    21012172        int     i;
    2102         int     numrows  = 0;
    2103         int     numnodes = 0;
    2104         int     temp_numnodes=0;
     2173        int     numrows       = 0;
     2174        int     numnodes      = 0;
     2175        int     temp_numnodes = 0;
    21052176
    21062177        /*Go through all the results objects, and update the counters: */
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r10381 r10400  
    20352035
    20362036        int     i;
    2037         int     numrows     = 0;
    2038         int     numnodes    = 0;
    2039         int     temp_numnodes    = 0;
     2037        int     numrows       = 0;
     2038        int     numnodes      = 0;
     2039        int     temp_numnodes = 0;
    20402040
    20412041        /*Go through all the results objects, and update the counters: */
  • issm/trunk/src/c/objects/Patch.h

    r6851 r10400  
    2525
    2626/*Headers:*/
    27 /*{{{1*/
    28 /*}}}*/
    29 
    3027class Patch{
    3128
     
    4744
    4845};
    49 
    5046#endif //ifndef _PATCH_H_
  • issm/trunk/src/c/solutions/transient_core.cpp

    r10300 r10400  
    9797
    9898                if(isgroundingline){
    99                         if(dim==3) _error_("Grounding line migration not implemented in 3d");
     99                //      if(dim==3) _error_("Grounding line migration not implemented in 3d");
    100100                        _printf_(VerboseSolution(),"   computing new grounding line position\n");
    101101                        #ifdef _HAVE_GROUNDINGLINE_
Note: See TracChangeset for help on using the changeset viewer.