Ignore:
Timestamp:
10/31/11 14:39:39 (13 years ago)
Author:
seroussi
Message:

removed shelf sync

File:
1 edited

Legend:

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

    r10376 r10377  
    1313void GroundinglineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){
    1414
    15         int      i, migration_style;
     15        int      i, migration_style,analysis_type;
    1616        double*  vertices_potentially_ungrounding = NULL;
    1717        double*  vertices_ungrounding             = NULL;
     18        double*  old_floatingice                  = NULL;
    1819        Element* element                          = NULL;
    1920       
     
    2223        /*retrieve parameters: */
    2324        parameters->FindParam(&migration_style,GroundinglineMigrationEnum);
     25        parameters->FindParam(&analysis_type,AnalysisTypeEnum);
     26
    2427        if(migration_style==NoneEnum) return;
    2528        if(migration_style!=AgressiveMigrationEnum && migration_style!=SoftMigrationEnum) _error_("%s not supported yet!",EnumToStringx(migration_style));
     
    3336        }
    3437
     38        /*Create vector with vertices initially floating*/
     39        old_floatingice=CreateNodesOnIceShelf(nodes,analysis_type);
     40
    3541        /*Migrate grounding line : */
    3642        for(i=0;i<elements->Size();i++){
    3743                element=(Element*)elements->GetObjectByOffset(i);
    38                 element->MigrateGroundingLine(vertices_ungrounding);
    39         }
    40 
    41         /*Synchronise mask: */
    42         for(i=0;i<elements->Size();i++){
    43                 element=(Element*)elements->GetObjectByOffset(i);
    44                 element->ShelfSync();
     44                element->MigrateGroundingLine(old_floatingice,vertices_ungrounding);
    4545        }
    4646
     
    4848        xfree((void**)&vertices_potentially_ungrounding);
    4949        xfree((void**)&vertices_ungrounding);
     50        xfree((void**)&old_floatingice);
    5051}
    5152/*FUNCTION PotentialSheetUngrounding {{{1*/
     
    6768        }
    6869
    69         /*Assemble vector: */
     70        /*Assemble vector and serialize */
    7071        VecAssemblyBegin(vec_vertices_potentially_ungrounding);
    7172        VecAssemblyEnd(vec_vertices_potentially_ungrounding);
    72 
    73         /*Serialize vector: */
    7473        VecToMPISerial(&vertices_potentially_ungrounding,vec_vertices_potentially_ungrounding);
    7574
     
    162161}
    163162/*}}}*/
     163/*FUNCTION CreateNodesOnIceShelf {{{1*/
     164double* CreateNodesOnIceShelf(Nodes* nodes,int configuration_type){
     165
     166        int     i,numnods;
     167        double* nodes_on_floatingice  = NULL;
     168        Vec     vec_nodes_on_iceshelf = NULL;
     169        Node*   node                  = NULL;
     170
     171        /*First, initialize nodes_on_iceshelf, which will track which nodes have changed status: */
     172        numnods=nodes->NumberOfNodes(configuration_type);
     173        vec_nodes_on_iceshelf=NewVec(numnods);
     174
     175        /*Loop through nodes, and fill vec_nodes_on_iceshelf: */
     176        for(i=0;i<nodes->Size();i++){
     177                node=(Node*)nodes->GetObjectByOffset(i);
     178                if(node->InAnalysis(configuration_type)){
     179                        if(node->IsFloating()){
     180                                VecSetValue(vec_nodes_on_iceshelf,node->Sid(),1.0,INSERT_VALUES);
     181                        }
     182                }
     183        }
     184
     185        /*Assemble vector: */
     186        VecAssemblyBegin(vec_nodes_on_iceshelf);
     187        VecAssemblyEnd(vec_nodes_on_iceshelf);
     188        VecToMPISerial(&nodes_on_floatingice,vec_nodes_on_iceshelf);
     189
     190        /*Free ressources*/
     191        VecFree(&vec_nodes_on_iceshelf);
     192
     193        return nodes_on_floatingice;
     194}
     195/*%}}}*/
Note: See TracChangeset for help on using the changeset viewer.