Changeset 1717


Ignore:
Timestamp:
08/17/09 10:53:04 (16 years ago)
Author:
Eric.Larour
Message:

transfervel: transfer results from md.results to md.vx, md.vy
Riftfront, Icefront, TriMeshProcessRifts: new enums for water, ice and air.

Location:
issm/trunk/src
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Icefront.cpp

    r1628 r1717  
    366366        /*Recover material and fill parameters: */
    367367        matpar=(Matpar*)element->GetMatPar();
    368         fill=element->GetShelf();
     368        if (element->GetShelf())fill=WaterEnum();
     369        else fill=AirEnum();
    369370
    370371        //check that the element is onbed (collapsed formulation) otherwise:pe=0
     
    493494        /*Recover material and fill parameters: */
    494495        matpar=(Matpar*)element->GetMatPar();
    495         fill=element->GetShelf();
     496        if (element->GetShelf())fill=WaterEnum();
     497        else fill=AirEnum();
    496498
    497499        /* Set pe_g to 0: */
     
    655657        /*Recover material and fill parameters: */
    656658        matpar=(Matpar*)element->GetMatPar();
    657         fill=element->GetShelf();
     659        if (element->GetShelf())fill=WaterEnum();
     660        else fill=AirEnum();
    658661
    659662        /* Set pe_g to 0: */
     
    865868                bed=b1*(1+segment_gauss_coord[ig])/2+b2*(1-segment_gauss_coord[ig])/2;
    866869
    867                 if (fill==1){
     870                if (fill==WaterEnum()){
    868871                        //icefront ends in water:
    869872                        ice_pressure=1.0/2.0*gravity*rho_ice*pow(thickness,2);
     
    875878                        water_pressure=1.0/2.0*gravity*rho_water*(pow(surface_under_water,2) - pow(base_under_water,2));
    876879                }
    877                 else if (fill==0){
     880                else if (fill==AirEnum()){
    878881                        ice_pressure=1.0/2.0*gravity*rho_ice*pow(thickness,2);
    879882                        air_pressure=0;
     
    11291132
    11301133                        //Now deal with water pressure:
    1131                         if(fill==1){ //icefront ends in water
     1134                        if(fill==WaterEnum()){ //icefront ends in water
    11321135                                water_level_above_g_tria=min(0,z_g[i]);//0 if the gaussian point is above water level
    11331136                                water_pressure_tria=rho_water*gravity*water_level_above_g_tria;
    11341137                        }
    1135                         else if(fill==0){
     1138                        else if(fill==AirEnum()){
    11361139                                water_pressure_tria=0;
    11371140                        }
     
    13781381
    13791382                        //Now deal with water pressure:
    1380                         if(fill==1){ //icefront ends in water
     1383                        if(fill==WaterEnum()){ //icefront ends in water
    13811384                                water_level_above_g_tria=min(0,z_g[i]);//0 if the gaussian point is above water level
    13821385                                water_pressure_tria=rho_water*gravity*water_level_above_g_tria;
    13831386                        }
    1384                         else if(fill==0){
     1387                        else if(fill==AirEnum()){
    13851388                                water_pressure_tria=0;
    13861389                        }
  • issm/trunk/src/c/objects/Riftfront.cpp

    r1628 r1717  
    2323}
    2424
    25 Riftfront::Riftfront(char riftfront_type[RIFTFRONTSTRING],int riftfront_id, int riftfront_node_ids[MAX_RIFTFRONT_GRIDS], int riftfront_mparid, double riftfront_h[MAX_RIFTFRONT_GRIDS],double riftfront_b[MAX_RIFTFRONT_GRIDS],double riftfront_s[MAX_RIFTFRONT_GRIDS],double riftfront_normal[2],double riftfront_length,int riftfront_fill,double riftfront_friction, double riftfront_penalty_offset, bool riftfront_penalty_lock, bool riftfront_active,int riftfront_counter,bool riftfront_prestable,bool riftfront_shelf){
     25Riftfront::Riftfront(char riftfront_type[RIFTFRONTSTRING],int riftfront_id, int riftfront_node_ids[MAX_RIFTFRONT_GRIDS], int riftfront_mparid, double riftfront_h[MAX_RIFTFRONT_GRIDS],double riftfront_b[MAX_RIFTFRONT_GRIDS],double riftfront_s[MAX_RIFTFRONT_GRIDS],double riftfront_normal[2],double riftfront_length,int riftfront_fill,double riftfront_friction, double riftfront_penalty_offset, int riftfront_penalty_lock, bool riftfront_active,int riftfront_counter,bool riftfront_prestable,bool riftfront_shelf){
    2626
    2727        int i;
     
    445445
    446446                /*Ok, now compute the pressure (in norm) that is being applied to the flanks, depending on the type of fill: */
    447                 if(fill==WATERFILL){
     447                if(fill==WaterEnum()){
    448448                        if(shelf){
    449449                                /*We are on an ice shelf, hydrostatic equilibrium is used to determine the pressure for water fill: */
     
    455455                        }
    456456                }
    457                 else if(fill==AIRFILL){
     457                else if(fill==AirEnum()){
    458458                        pressure=rho_ice*gravity*pow(thickness,(double)2)/(double)2;   //icefront on an ice sheet, pressure imbalance ice vs air.
    459459                }
    460                 else if(fill==ICEFILL){ //icefront finding itself against another icefront (pressure imbalance is fully compensated, ice vs ice)
     460                else if(fill==IceEnum()){ //icefront finding itself against another icefront (pressure imbalance is fully compensated, ice vs ice)
    461461                        pressure=0;
    462462                }
     
    590590        /*Activate or deactivate penalties: */
    591591        if(penetration<0){
     592                printf("riftfront %i is penetrating\n",this->GetId());
    592593                /*There is penetration, we need to active the penalty so this penetration will be NULL: */
    593594                activate=1;
  • issm/trunk/src/c/objects/Riftfront.h

    r1628 r1717  
    1414#define MAX_RIFTFRONT_GRIDS 2 //max number of grids on a rift flank, only 2 because 2d for now.
    1515#define RIFTFRONTSTRING 20 //max string length
    16 
    17 /*Types of rift filling: */
    18 #define WATERFILL 1
    19 #define AIRFILL 2
    20 #define ICEFILL 3
    2116
    2217class Element;
     
    4944
    5045                double      penalty_offset;
    51                 bool        penalty_lock;
     46                int         penalty_lock;
    5247
    5348                /*computational: */
     
    6055
    6156                Riftfront();
    62                 Riftfront(char type[RIFTFRONTSTRING],int id, int node_ids[MAX_RIFTFRONT_GRIDS], int mparid, double h[MAX_RIFTFRONT_GRIDS],double b[MAX_RIFTFRONT_GRIDS],double s[MAX_RIFTFRONT_GRIDS],double normal[2],double length,int fill,double friction, double penalty_offset, bool penalty_lock,bool active,int counter,bool prestable,bool shelf);
     57                Riftfront(char type[RIFTFRONTSTRING],int id, int node_ids[MAX_RIFTFRONT_GRIDS], int mparid, double h[MAX_RIFTFRONT_GRIDS],double b[MAX_RIFTFRONT_GRIDS],double s[MAX_RIFTFRONT_GRIDS],double normal[2],double length,int fill,double friction, double penalty_offset, int penalty_lock,bool active,int counter,bool prestable,bool shelf);
    6358                ~Riftfront();
    6459
  • issm/trunk/src/m/classes/public/presolve.m

    r1631 r1717  
    66
    77%first, deal with rifts.
    8 if isnan(md.rifts),
     8if isempty(md.rifts) | isnans(md.rifts),
    99        md.numrifts=0;
    1010else
  • issm/trunk/src/mex/TriMeshProcessRifts/TriMeshProcessRifts.cpp

    r1 r1717  
    285285                        /*Friction and fill: set to 0 both */
    286286                        mxSetField(pmxa_array,i,"friction",mxCreateDoubleScalar(0));
    287                         mxSetField(pmxa_array,i,"fill",mxCreateDoubleScalar(1)); //default is water
     287                        mxSetField(pmxa_array,i,"fill",mxCreateDoubleScalar(WaterEnum())); //default is water
    288288
    289289
Note: See TracChangeset for help on using the changeset viewer.