Ignore:
Timestamp:
07/22/13 11:18:34 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: minor cosmetics

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r15517 r15535  
    15551555
    15561556        /*Step1: Get and Extrude original input: */
    1557         if (object_type==ElementEnum){
     1557        if(object_type==ElementEnum){
    15581558                num_inputs=1;
    15591559                base_inputs=xNew<Input*>(num_inputs);
    15601560                base_inputs[0]=(Input*)this->inputs->GetInput(enum_type);
    15611561        }
    1562         else if (object_type==MaterialsEnum){
     1562        else if(object_type==MaterialsEnum){
    15631563                num_inputs=1;
    15641564                base_inputs=xNew<Input*>(num_inputs);
     
    96459645void  Penta::MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding){
    96469646
    9647         int     i,migration_style;
    9648         bool    floatingelement = false;
    9649         bool    groundedelement = false;
    9650         IssmDouble  bed_hydro,yts,gl_melting_rate;
    9651         IssmDouble  rho_water,rho_ice,density;
    9652         IssmDouble  melting[NUMVERTICES],phi[NUMVERTICES];
    9653         IssmDouble  h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],ba[NUMVERTICES];
     9647        int        i,migration_style;
     9648        bool       floatingelement = false;
     9649        bool       groundedelement = false;
     9650        IssmDouble bed_hydro,yts,gl_melting_rate;
     9651        IssmDouble rho_water,rho_ice,density;
     9652        IssmDouble h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],r[NUMVERTICES];
     9653        IssmDouble melting[NUMVERTICES],phi[NUMVERTICES];
     9654        bool       grounded[NUMVERTICES],floating[NUMVERTICES];
    96549655
    96559656        if(!IsOnBed()) return;
     
    96629663        GetInputListOnVertices(&s[0],SurfaceEnum);
    96639664        GetInputListOnVertices(&b[0],BedEnum);
    9664         GetInputListOnVertices(&ba[0],BathymetryEnum);
     9665        GetInputListOnVertices(&r[0],BathymetryEnum);
    96659666        if(migration_style==SubelementMigrationEnum) GetInputListOnVertices(&phi[0],GLlevelsetEnum);
    9666         rho_water=matpar->GetRhoWater();
    9667         rho_ice=matpar->GetRhoIce();
    9668         density=rho_ice/rho_water;
     9667        rho_water = matpar->GetRhoWater();
     9668        rho_ice   = matpar->GetRhoIce();
     9669        density   = rho_ice/rho_water;
    96699670
    96709671        /*go through vertices, and update inputs, considering them to be PentaVertex type: */
     
    96729673                /*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
    96739674                if(reCast<bool,IssmDouble>(old_floating_ice[nodes[i]->Sid()])){
    9674                         if(b[i]<=ba[i]){
    9675                                 b[i]=ba[i];
    9676                                 s[i]=b[i]+h[i];
     9675                        if(b[i]<=r[i]){
     9676                                b[i]        = r[i];
     9677                                s[i]        = b[i]+h[i];
     9678                                floating[i] = false;
     9679                                grounded[i] = true;
    96779680                                nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,false));
    96789681                                nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,true));
     
    96839686                else{
    96849687                        bed_hydro=-density*h[i];
    9685                         if (bed_hydro>ba[i]){
     9688                        if(bed_hydro>r[i]){
    96869689                                /*Unground only if the element is connected to the ice shelf*/
    96879690                                if(migration_style==AgressiveMigrationEnum || migration_style==SubelementMigrationEnum){
    9688                                         s[i]=(1-density)*h[i];
    9689                                         b[i]=-density*h[i];
     9691                                        s[i]        = (1-density)*h[i];
     9692                                        b[i]        = -density*h[i];
     9693                                        floating[i] = true;
     9694                                        grounded[i] = false;
    96909695                                        nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
    96919696                                        nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
    96929697                                }
    96939698                                else if(migration_style==SoftMigrationEnum && reCast<int,IssmDouble>(sheet_ungrounding[nodes[i]->Sid()])){
    9694                                         s[i]=(1-density)*h[i];
    9695                                         b[i]=-density*h[i];
     9699                                        s[i]        = (1-density)*h[i];
     9700                                        b[i]        = -density*h[i];
     9701                                        floating[i] = true;
     9702                                        grounded[i] = false;
    96969703                                        nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
    96979704                                        nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
     
    97369743        /*Recalculate phi*/
    97379744        if(migration_style==SubelementMigrationEnum){
    9738                 for(i=0;i<NUMVERTICES;i++) phi[i]=h[i]+ba[i]/density;
     9745                for(i=0;i<NUMVERTICES;i++) phi[i]=h[i]+r[i]/density;
    97399746                this->inputs->AddInput(new PentaInput(GLlevelsetEnum,&phi[0],P1Enum));
    97409747                this->InputExtrude(GLlevelsetEnum,ElementEnum);
     
    97529759void  Penta::PotentialUngrounding(Vector<IssmDouble>* potential_ungrounding){
    97539760
    9754         int     i;
    9755         IssmDouble  h[NUMVERTICES],ba[NUMVERTICES];
     9761        IssmDouble  h[NUMVERTICES],r[NUMVERTICES];
    97569762        IssmDouble  bed_hydro;
    97579763        IssmDouble  rho_water,rho_ice,density;
     
    97629768        density=rho_ice/rho_water;
    97639769        GetInputListOnVertices(&h[0],ThicknessEnum);
    9764         GetInputListOnVertices(&ba[0],BathymetryEnum);
     9770        GetInputListOnVertices(&r[0],BathymetryEnum);
    97659771
    97669772        /*go through vertices, and figure out which ones are on the ice sheet, and want to unground: */
    9767         for(i=0;i<NUMVERTICES;i++){
     9773        for(int i=0;i<NUMVERTICES;i++){
    97689774                /*Find if grounded vertices want to start floating*/
    97699775                if (!nodes[i]->IsFloating()){
    97709776                        bed_hydro=-density*h[i];
    9771                         if (bed_hydro>ba[i]){
     9777                        if(bed_hydro>r[i]){
    97729778                                /*Vertex that could potentially unground, flag it*/
    97739779                                potential_ungrounding->SetValue(nodes[i]->Sid(),1,INS_VAL);
Note: See TracChangeset for help on using the changeset viewer.