Changeset 10364


Ignore:
Timestamp:
10/31/11 10:29:35 (13 years ago)
Author:
seroussi
Message:

some cleaning

Location:
issm/trunk/src/c/modules/GroundinglineMigrationx
Files:
3 edited

Legend:

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

    r10356 r10364  
    2727
    2828        if(migration_style==SoftMigrationEnum){
    29                 /*Create flag for nodes above the hydrostatic equilibrium: */
     29                /*Create flag for grounded vertices above the hydrostatic equilibrium: */
    3030                vertices_potentially_ungrounding=PotentialSheetUngrounding(elements,vertices,parameters);
    3131
    3232                /*propagate ice shelf into connex areas of the ice sheet that potentially want to unground: */
    33                 vertices_ungrounding=PropagateShelfIntoConnexIceSheet(elements,nodes,parameters,vertices_potentially_ungrounding);
     33                vertices_ungrounding=PropagateShelfIntoConnexIceSheet(elements,nodes,vertices,parameters,vertices_potentially_ungrounding);
    3434        }
    3535
  • issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationxLocal.h

    r10356 r10364  
    1212
    1313/* local prototypes: */
    14 double*    PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters);
    15 double*    PropagateShelfIntoConnexIceSheet(Elements* elements,Nodes* nodes,Parameters* parameters,double* vertices_potentially_ungrounding);
    1614bool*      CreateElementOnGroundingline(Elements* elements,double* element_on_iceshelf);
    1715double*    CreateElementOnIceShelf(Elements* elements);
    18 double*    CreateElementTouchingIceShelf(Elements* elements,Vec vec_nodes_on_iceshelf);
    19 Vec        CreateNodesOnIceShelf(Nodes* nodes,int analysis_type);
     16double*    CreateElementTouchingIceShelf(Elements* elements,double* nodes_on_iceshelf);
     17Vec        CreateNodesOnIceShelf(Nodes* nodes,Vertices* vertices,int analysis_type);
     18double*    PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters);
     19double*    PropagateShelfIntoConnexIceSheet(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding);
    2020
    2121int        UpdateShelfStatus(Elements* elements,Nodes* nodes,Parameters* parameters,double* element_touching_iceshelf);
  • issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationxUtils.cpp

    r10359 r10364  
    7575/*}}}*/
    7676/*FUNCTION CreateElementTouchingIceShelf {{{1*/
    77 double*    CreateElementTouchingIceShelf(Elements* elements,Vec vec_nodes_on_iceshelf){
     77double*    CreateElementTouchingIceShelf(Elements* elements,double* nodes_on_iceshelf){
    7878
    7979        int      i;
    80         double  *nodes_on_iceshelf             = NULL;
    8180        double  *element_touching_iceshelf     = NULL;
    8281        Element *element                       = NULL;
    8382        Vec      vec_element_touching_iceshelf = NULL;
    8483
    85         /*serialize: */
    86         VecToMPISerial(&nodes_on_iceshelf,vec_nodes_on_iceshelf);
    87 
    8884        /*Create  vector holding  all the elements IsFloating flags: */
    8985        vec_element_touching_iceshelf=NewVec(elements->NumberOfElements(),true);
     
    104100        /*free ressouces: */
    105101        VecFree(&vec_element_touching_iceshelf);
    106         xfree((void**)&nodes_on_iceshelf);
    107102
    108103        return element_touching_iceshelf;
     
    110105/*}}}*/
    111106/*FUNCTION CreateNodesOnIceShelf {{{1*/
    112 Vec CreateNodesOnIceShelf(Nodes* nodes,int configuration_type){
    113 
    114         int     i,numnods;
     107Vec CreateNodesOnIceShelf(Nodes* nodes,Vertices* vertices,int configuration_type){
     108
     109        int     i,numberofvertices;
    115110        Vec     nodes_on_iceshelf = NULL;
    116111        Node*   node              = NULL;
    117112
    118113        /*First, initialize nodes_on_iceshelf, which will track which nodes have changed status: */
    119         numnods=nodes->NumberOfNodes(configuration_type);
    120         nodes_on_iceshelf=NewVec(numnods);
     114        numberofvertices=vertices->NumberOfVertices();
     115        nodes_on_iceshelf=NewVec(numberofvertices);
    121116
    122117        /*Loop through nodes, and fill nodes_on_iceshelf: */
     
    168163/*}}}*/
    169164/*FUNCTION PropagateShelfIntoConnexIceSheet {{{1*/
    170 double*    PropagateShelfIntoConnexIceSheet(Elements* elements,Nodes* nodes,Parameters* parameters,double* vertices_potentially_ungrounding){
     165double*    PropagateShelfIntoConnexIceSheet(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding){
    171166
    172167        int      i,analysis_type;
     
    180175        parameters->FindParam(&analysis_type,AnalysisTypeEnum);
    181176
    182         /*recover vec_nodes_on_iceshelf: */
    183         vec_nodes_on_iceshelf=CreateNodesOnIceShelf(nodes,analysis_type);
     177        /*recover vec_nodes_on_iceshelf and serialize: */
     178        vec_nodes_on_iceshelf=CreateNodesOnIceShelf(nodes,vertices,analysis_type);
     179        VecToMPISerial(&nodes_on_iceshelf,vec_nodes_on_iceshelf);
    184180
    185181        nflipped=1; //bootstrap
     
    187183               
    188184                /*get a list of potential elements that have nodes on ice shelf: */
    189                 elements_touching_iceshelf=CreateElementTouchingIceShelf(elements,vec_nodes_on_iceshelf);
    190 
    191                 /*now,  go through elements_touching_iceshelf, and if they have nodes inside potential_sheet_ungrounding,
    192                  * flag it: */
     185                elements_touching_iceshelf=CreateElementTouchingIceShelf(elements,nodes_on_iceshelf);
     186
     187                /*Go through elements_touching_iceshelf, and flag their nodes that can unground inside potential_sheet_ungrounding*/
    193188                local_nflipped=0;
    194 
    195                 /*serialize vec_nodes_on_iceshelf, needed by element's UpdatePotentialSheetUngrounding routine, to figure out if
    196                  * nodes have flipped from grounded to ungrounded: */
    197                 VecToMPISerial(&nodes_on_iceshelf,vec_nodes_on_iceshelf);
    198 
    199189                for(i=0;i<elements->Size();i++){
    200190                        element=(Element*)elements->GetObjectByOffset(i);
     
    208198
    209199                /*Avoid leaks: */
     200                xfree((void**)&elements_touching_iceshelf);
    210201                xfree((void**)&nodes_on_iceshelf);
    211                 xfree((void**)&elements_touching_iceshelf);
    212 
    213                 /*Assemble:*/
     202
     203                /*Assemble and serialize:*/
    214204                VecAssemblyBegin(vec_nodes_on_iceshelf);
    215205                VecAssemblyEnd(vec_nodes_on_iceshelf);
    216         }
    217 
    218         /*Serialize: */
    219         VecToMPISerial(&nodes_on_iceshelf,vec_nodes_on_iceshelf);
     206                VecToMPISerial(&nodes_on_iceshelf,vec_nodes_on_iceshelf);
     207        }
    220208
    221209        /*Free ressources:*/
Note: See TracChangeset for help on using the changeset viewer.