Changeset 14361


Ignore:
Timestamp:
02/21/13 12:15:07 (12 years ago)
Author:
seroussi
Message:

HCG working on GL

Location:
issm/trunk-jpl/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp

    r12832 r14361  
    1515
    1616void    UpdateElementsTransient(Elements* elements, Parameters* parameters,IoModel* iomodel,int analysis_counter,int analysis_type){
     17
     18        int         isgl,migration_style;
     19        int         i,numberofvertices;
     20        IssmDouble  rho_ice,rho_water;
     21        IssmDouble *phi   = NULL;
     22
     23        /*Fetch data needed*/
     24        iomodel->Constant(&isgl,TransientIsgroundinglineEnum);
     25        iomodel->Constant(&migration_style,GroundinglineMigrationEnum);
     26
     27        if(isgl==1 && migration_style==SubelementMigrationEnum){
     28
     29                /*get parameters and constants: */
     30                parameters->FindParam(&rho_ice,MaterialsRhoIceEnum);
     31                parameters->FindParam(&rho_water,MaterialsRhoWaterEnum);
     32                iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
     33                iomodel->FetchData(2,ThicknessEnum,BathymetryEnum);
     34
     35                /*Create phi vector */
     36                phi=xNew<IssmDouble>(numberofvertices);
     37                for (i=0;i<numberofvertices;i++){
     38                        if(iomodel->my_vertices[i]){
     39                                phi[i] = iomodel->Data(ThicknessEnum)[i] + rho_water/rho_ice * iomodel->Data(BathymetryEnum)[i];
     40                        }
     41                }
     42
     43                /*Update elements: */
     44                for(i=0;i<elements->Size();i++){
     45                        Element* element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
     46                        element->InputUpdateFromVector(phi,GLlevelsetEnum,VertexEnum);
     47                }
     48
     49                /*Free ressources:*/
     50                xDelete<IssmDouble>(phi);
     51        }
    1752}
  • issm/trunk-jpl/src/m/classes/groundingline.m

    r13646 r14361  
    2929                function md = checkconsistency(obj,md,solution,analyses) % {{{
    3030
    31                         md = checkfield(md,'groundingline.migration','values',{'None' 'AgressiveMigration' 'SoftMigration'});
     31                        md = checkfield(md,'groundingline.migration','values',{'None' 'AgressiveMigration' 'SoftMigration' 'SubelementMigration'});
     32
    3233
    3334                        if ~strcmp(obj.migration,'None'),
     
    4243                                if any(md.geometry.bathymetry(pos)-md.geometry.bed(pos)>10^-9),
    4344                                        md = checkmessage(md,['bathymetry superior to bed on floating ice!']);
     45                                end
     46                                if strcmp(obj.migration,'SubelementMigration') & md.mesh.dimension==3,
     47                                        md = checkmessage(md,['SubelementMigration only implemented in 2d!']);
    4448                                end
    4549                        end
  • issm/trunk-jpl/src/m/classes/groundingline.py

    r14141 r14361  
    4848        def checkconsistency(self,md,solution,analyses):    # {{{
    4949
    50                 md = checkfield(md,'groundingline.migration','values',['None','AgressiveMigration','SoftMigration'])
     50                md = checkfield(md,'groundingline.migration','values',['None','AgressiveMigration','SoftMigration','SubelementMigration'])
    5151
    5252                if not strcmp(self.migration,'None'):
     
    5959                        if any(md.geometry.bathymetry[pos]-md.geometry.bed[pos]>10**-9):
    6060                                md.checkmessage("bathymetry superior to bed on floating ice!")
     61                        if strcmp(self.migration,'SubelementMigration'):
     62                                if md.mesh.dimension==3:
     63                                        md.checkmessage("SubelementMigration only implemented in 2d!")
    6164
    6265                return md
Note: See TracChangeset for help on using the changeset viewer.