Changeset 7312


Ignore:
Timestamp:
02/03/11 16:20:43 (14 years ago)
Author:
Eric.Larour
Message:

Reshuflled GroundingLineMigrationx module. Too many routines. Piled in GroundingLineMigrationxUtils

Location:
issm/trunk/src/c
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Makefile.am

    r7288 r7312  
    356356                                        ./modules/GroundingLineMigrationx/GroundingLineMigrationx.h\
    357357                                        ./modules/GroundingLineMigrationx/GroundingLineMigrationxLocal.h\
    358                                         ./modules/GroundingLineMigrationx/CreateElementOnIceShelf.cpp\
    359                                         ./modules/GroundingLineMigrationx/CreateElementTouchingIceShelf.cpp\
    360                                         ./modules/GroundingLineMigrationx/CreateElementOnGroundingLine.cpp\
    361                                         ./modules/GroundingLineMigrationx/UpdateShelfStatus.cpp\
     358                                        ./modules/GroundingLineMigrationx/GroundingLineMigrationxUtils.cpp\
    362359                                        ./modules/ModelProcessorx/ModelProcessorx.h\
    363360                                        ./modules/ModelProcessorx/ModelProcessorx.cpp\
     
    935932                                        ./modules/GroundingLineMigrationx/GroundingLineMigrationx.h\
    936933                                        ./modules/GroundingLineMigrationx/GroundingLineMigrationxLocal.h\
    937                                         ./modules/GroundingLineMigrationx/CreateElementOnIceShelf.cpp\
    938                                         ./modules/GroundingLineMigrationx/CreateElementTouchingIceShelf.cpp\
    939                                         ./modules/GroundingLineMigrationx/CreateElementOnGroundingLine.cpp\
    940                                         ./modules/GroundingLineMigrationx/UpdateShelfStatus.cpp\
     934                                        ./modules/GroundingLineMigrationx/GroundingLineMigrationxUtils.cpp\
    941935                                        ./modules/ModelProcessorx/ModelProcessorx.h\
    942936                                        ./modules/ModelProcessorx/ModelProcessorx.cpp\
     
    11801174                                        ./solutions/transient2d_core.cpp\
    11811175                                        ./solutions/transient3d_core.cpp\
     1176                                        ./solutions/groundinglinemigration2d_core.cpp\
    11821177                                        ./solutions/steadystate_core.cpp\
    11831178                                        ./solutions/steadystateconvergence.cpp\
  • issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationx.cpp

    r7288 r7312  
    55#include "./GroundingLineMigrationx.h"
    66#include "./GroundingLineMigrationxLocal.h"
     7
    78#include "../../shared/shared.h"
    89#include "../../include/include.h"
    910#include "../../toolkits/toolkits.h"
    1011#include "../../EnumDefinitions/EnumDefinitions.h"
     12#include "../../Container/Container.h"
    1113
    1214void GroundingLineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){
    1315
    14         int i,j;
    15         Element* element=NULL;
    16         double*  element_touching_iceshelf=NULL;
    17         int      nflipped;
    1816
     17        int migration_style;
     18       
    1919        _printf_(VerboseModule(),"   Migrating grounding line\n");
     20       
     21        /*retrieve parameters: */
     22        parameters->FindParam(&migration_style,GroundingLineMigrationEnum);
     23       
     24        /*call different migration modules, according to user wishes: */
     25        if(migration_style==AgressiveMigrationEnum) AgressiveMigration(elements,nodes, vertices,loads,materials, parameters);
     26        else if(migration_style==SoftMigrationEnum) AgressiveMigration(elements,nodes, vertices,loads,materials, parameters);
     27        else if(migration_style==NoneEnum)_printf_("%s\n","NoneEnum supplied for migration style, doing nothing!");
     28        else _error_("%s not supported yet!",EnumToString(migration_style));
    2029
    21         /*Loop until no more nodes and elements  change from grounded to floating: */
    22         nflipped=1; //arbitrary, get things started
    23 
    24         while(nflipped){
    25 
    26                 /*reset counter: */
    27                 nflipped=0;
    28 
    29                 /*Create  vector holding  all the elements that touch the ice shelf, by any node: */
    30                 element_touching_iceshelf=CreateElementTouchingIceShelf(elements);
    31 
    32                 /*Carry out grounding line migration for those elements: */
    33                 for(i=0;i<elements->Size();i++){
    34                         element=(Element*)elements->GetObjectByOffset(i);
    35                         if(element_touching_iceshelf[element->Sid()]) element->MigrateGroundingLine();
    36                 }
    37 
    38                 /*Now, update shelf flags in nodes and elements: */
    39                 nflipped=UpdateShelfStatus(elements,nodes,parameters,element_touching_iceshelf);
    40                 _printf_(VerboseModule(),"      number of migrated nodes: %i\n",nflipped);
    41 
    42                 /*avoid memory leaks: */
    43                 xfree((void**)&element_touching_iceshelf);
    44         }
    45                
    46        
    47         /*free ressouces: */
    48         xfree((void**)&element_touching_iceshelf);
    4930}
  • issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationxLocal.h

    r7288 r7312  
    1111
    1212/* local prototypes: */
     13
     14void AgressiveMigration(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
     15void SoftMigration(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
     16
    1317double* CreateElementOnIceShelf(Elements* elements);
    1418bool*   CreateElementOnGroundingLine(Elements* elements,double* element_on_iceshelf);
    1519double* CreateElementTouchingIceShelf(Elements* elements);
    16 int UpdateShelfStatus(Elements* elements,Nodes* nodes,Parameters* parameters,double* element_touching_iceshelf);
     20int     UpdateShelfStatus(Elements* elements,Nodes* nodes,Parameters* parameters,double* element_touching_iceshelf);
    1721
    1822#endif  /* _GROUNDINGLINEMIGRATIONXLOCAL_H */
Note: See TracChangeset for help on using the changeset viewer.