Changeset 7287


Ignore:
Timestamp:
02/02/11 18:45:18 (14 years ago)
Author:
Eric.Larour
Message:

Temporary commit for grounding line migration

Location:
issm/trunk/src/c/modules/GroundingLineMigrationx
Files:
1 added
4 edited

Legend:

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

    r7078 r7287  
    2222        for(i=0;i<elements->Size();i++){
    2323                element=(Element*)elements->GetObjectByOffset(i);
     24                printf("%i\n",i);
    2425                VecSetValue(vec_element_on_iceshelf,element->Sid(),(int)element->IsOnShelf(),INSERT_VALUES);
    2526        }
  • issm/trunk/src/c/modules/GroundingLineMigrationx/CreateElementTouchingIceShelf.cpp

    r7078 r7287  
    2222        for(i=0;i<elements->Size();i++){
    2323                element=(Element*)elements->GetObjectByOffset(i);
    24                 VecSetValue(vec_element_touching_iceshelf,element->Sid(),(int)element->IsNodeOnShelf(),INSERT_VALUES);
     24                VecSetValue(vec_element_touching_iceshelf,element->Sid(),element->IsNodeOnShelf()?1.0:0.0,INSERT_VALUES);
    2525        }
    2626
  • issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationx.cpp

    r7078 r7287  
    1818        _printf_(VerboseModule(),"   Migrating grounding line\n");
    1919
    20         /*Create  vector holding  all the elements that touch the ice shelf: */
    21         element_touching_iceshelf=CreateElementTouchingIceShelf(elements);
     20        /*Loop until no more nodes and elements  change from grounded to floating: */
     21        nflipped=1; //arbitrary, get things started
     22        while(nflipped){
    2223
    23         /*Carry out grounding line migration for those elements: */
    24         for(i=0;i<elements->Size();i++){
    25                 if (element_touching_iceshelf[i]){
     24                /*reset counter: */
     25                nflipped=0;
     26
     27                /*Create  vector holding  all the elements that touch the ice shelf, by any node: */
     28                element_touching_iceshelf=CreateElementTouchingIceShelf(elements);
     29
     30                /*Carry out grounding line migration for those elements: */
     31                for(i=0;i<elements->Size();i++){
    2632                        element=(Element*)elements->GetObjectByOffset(i);
    27                         element->MigrateGroundingLine();
     33                        if(element_touching_iceshelf[element->Sid()]) element->MigrateGroundingLine();
    2834                }
     35
     36                /*Now, update shelf flags in nodes and elements: */
     37                nflipped=UpdateShelfStatus(elements,nodes,parameters,element_touching_iceshelf);
     38                _printf_(VerboseModule(),"      number of migrated nodes: %i\n",nflipped);
     39
     40                /*avoid memory leaks: */
     41                xfree((void**)&element_touching_iceshelf);
    2942        }
    30 
    31         /*Now, update shelf flags in nodes and elements. We could not do this before,
    32          *because we would end up with discontinuous bed and surface otherwise: */
    33         for(i=0;i<elements->Size();i++){
    34                 element=(Element*)elements->GetObjectByOffset(i);
    35                 element->UpdateShelfStatus();
    36         }
    37 
     43               
     44       
    3845        /*free ressouces: */
    3946        xfree((void**)&element_touching_iceshelf);
  • issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationxLocal.h

    r7078 r7287  
    1212bool*   CreateElementOnGroundingLine(Elements* elements,double* element_on_iceshelf);
    1313double* CreateElementTouchingIceShelf(Elements* elements);
     14int UpdateShelfStatus(Elements* elements,Nodes* nodes,Parameters* parameters);
     15int UpdateShelfStatus(Elements* elements,Nodes* nodes,Parameters* parameters,double* element_touching_iceshelf);
    1416
    1517#endif  /* _GROUNDINGLINEMIGRATIONXLOCAL_H */
Note: See TracChangeset for help on using the changeset viewer.