Changeset 10309


Ignore:
Timestamp:
10/26/11 08:52:51 (13 years ago)
Author:
seroussi
Message:

start to reorganize grounding lines

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

Legend:

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

    r10300 r10309  
    55#include "./GroundinglineMigrationx.h"
    66#include "./GroundinglineMigrationxLocal.h"
    7 
    87#include "../../shared/shared.h"
    98#include "../../io/io.h"
    109#include "../../include/include.h"
    11 #include "../../io/io.h"
    1210#include "../../toolkits/toolkits.h"
    1311#include "../../EnumDefinitions/EnumDefinitions.h"
     
    1614void GroundinglineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){
    1715
    18         int migration_style;
     16        int i, migration_style;
     17        Element* element=NULL;
    1918       
    2019        _printf_(VerboseModule(),"   Migrating grounding line\n");
     
    2423
    2524        /*call different migration modules, according to user wishes: */
    26         if(migration_style==AgressiveMigrationEnum) AgressiveMigration(elements,nodes, vertices,loads,materials, parameters);
    27         else if(migration_style==SoftMigrationEnum) SoftMigration(elements,nodes, vertices,loads,materials, parameters);
     25        if(migration_style==AgressiveMigrationEnum){
     26                /*Migrate grounding line : */
     27                for(i=0;i<elements->Size();i++){
     28                        element=(Element*)elements->GetObjectByOffset(i);
     29                        element->AgressiveMigration();
     30                }
     31
     32                /*Synchronise mask: */
     33                for(i=0;i<elements->Size();i++){
     34                        element=(Element*)elements->GetObjectByOffset(i);
     35                        element->ShelfSync();
     36                }
     37        }
     38        else if(migration_style==SoftMigrationEnum){
     39
     40                /*Create flag for nodes above the hydrostatic equilibrium: */
     41                double* potential_sheet_ungrounding=PotentialSheetUngrounding(elements,nodes,parameters);
     42
     43                /*propagate ice shelf into connex areas of the ice sheet that potentially want to unground: */
     44                double* sheet_ungrounding=PropagateShelfIntoConnexIceSheet(elements,nodes,parameters,potential_sheet_ungrounding);
     45
     46                /*Now, use the sheet_ungrounding flags to unground the ice sheet (at the same time, take care of grounding elements of the ice shelf
     47                 * that want to: */
     48                for(i=0;i<elements->Size();i++){
     49                        element=(Element*)elements->GetObjectByOffset(i);
     50                        element->SoftMigration(sheet_ungrounding);
     51                }
     52
     53                /*Synchronise mask*/
     54                for(i=0;i<elements->Size();i++){
     55                        element=(Element*)elements->GetObjectByOffset(i);
     56                        element->ShelfSync();
     57                }
     58
     59                /*free ressouces: */
     60                xfree((void**)&potential_sheet_ungrounding);
     61                xfree((void**)&sheet_ungrounding);
     62        }
    2863        else if(migration_style==NoneEnum) _printf_(true,"%s\n","NoneEnum supplied for migration style, doing nothing!");
    2964        else _error_("%s not supported yet!",EnumToStringx(migration_style));
  • issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationxLocal.h

    r10300 r10309  
    1111
    1212/* local prototypes: */
    13 void       AgressiveMigration(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
    14 void       SoftMigration(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
    1513double*    PotentialSheetUngrounding(Elements* elements,Nodes* nodes,Parameters* parameters);
    1614double*    PropagateShelfIntoConnexIceSheet(Elements* elements,Nodes* nodes,Parameters* parameters,double* potential_sheet_ungrounding);
  • issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationxUtils.cpp

    r10300 r10309  
    1212#include "../../EnumDefinitions/EnumDefinitions.h"
    1313
    14 /*FUNCTION AgressiveMigration{{{1*/
    15 void AgressiveMigration(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){
    16         /*Here, whatever nodes inside the ice sheet want to unground, we allow -> instantaneous transmission of water through the bedrock: */
    17 
    18         int i;
    19         Element* element=NULL;
    20 
    21         _printf_(VerboseModule(),"   Migrating grounding line\n");
    22 
    23         /*Carry out grounding line migration for those elements: */
    24         for(i=0;i<elements->Size();i++){
    25                 element=(Element*)elements->GetObjectByOffset(i);
    26                 element->AgressiveMigration();
    27         }
    28 
    29         /*Synchronize shelf status: */
    30         for(i=0;i<elements->Size();i++){
    31                 element=(Element*)elements->GetObjectByOffset(i);
    32                 element->ShelfSync();
    33         }
    34 
    35 }
    36 /*}}}*/
    37 /*FUNCTION SoftMigration {{{1*/
    38 void       SoftMigration(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){
    39 
    40         /*intermediary: */
    41         int     i;
    42         double* potential_sheet_ungrounding=NULL;
    43         double* sheet_ungrounding=NULL;
    44         Element* element=NULL;
    45        
    46         _printf_(VerboseModule(),"   Migrating grounding line\n");
    47 
    48         /*First, figure out which nodes that are on the ice sheet want to unground. Build a flags vector for this (size number of nodes: */
    49         potential_sheet_ungrounding=PotentialSheetUngrounding(elements,nodes,parameters);
    50        
    51         /*Now, propagate ice shelf into connex areas of the ice sheet that potentially want to unground: */
    52         sheet_ungrounding=PropagateShelfIntoConnexIceSheet(elements,nodes,parameters,potential_sheet_ungrounding);
    53        
    54         /*Now, use the sheet_ungrounding flags to unground the ice sheet (at the same time, take care of grounding elements of the ice shelf
    55          * that want to: */
    56         for(i=0;i<elements->Size();i++){
    57                 element=(Element*)elements->GetObjectByOffset(i);
    58                 element->SoftMigration(sheet_ungrounding);
    59         }
    60        
    61         /*Synchronize shelf status: */
    62         for(i=0;i<elements->Size();i++){
    63                 element=(Element*)elements->GetObjectByOffset(i);
    64                 element->ShelfSync();
    65         }
    66 
    67         /*free ressouces: */
    68         xfree((void**)&potential_sheet_ungrounding);
    69         xfree((void**)&sheet_ungrounding);
    70 
    71 }
    72 /*}}}*/
    7314/*FUNCTION PotentialSheetUngrounding {{{1*/
    7415double*    PotentialSheetUngrounding(Elements* elements,Nodes* nodes,Parameters* parameters){
     
    168109}
    169110/*}}}*/
    170 /*FUNCTION CreateElementOnGroundingnine {{{1*/
     111/*FUNCTION CreateElementOnGroundingline {{{1*/
    171112bool*      CreateElementOnGroundingline(Elements* elements,double* element_on_iceshelf){
    172113
    173         int      i;
    174         int      j;
     114        int      i,j;
    175115        Element *element       = NULL;
    176116        bool    *element_on_gl = NULL;
     
    330270        Node*   node=NULL;
    331271
    332 
    333272        /*First, initialize nodes_on_iceshelf, which will track which nodes have changed status: */
    334273        numnods=nodes->NumberOfNodes(configuration_type);
Note: See TracChangeset for help on using the changeset viewer.