Changeset 15535


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

CHG: minor cosmetics

Location:
issm/trunk-jpl/src/c/classes
Files:
3 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);
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r15525 r15535  
    71667166void  Tria::MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding){
    71677167
    7168         int     i,migration_style;
    7169         bool    floatingelement = false;
    7170         bool    groundedelement = false;
    7171         IssmDouble  bed_hydro,yts,gl_melting_rate;
    7172         IssmDouble  rho_water,rho_ice,density;
    7173         IssmDouble  melting[NUMVERTICES],phi[NUMVERTICES];;
    7174         IssmDouble  h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],ba[NUMVERTICES];
     7168        int        i,migration_style;
     7169        bool       floatingelement = false;
     7170        bool       groundedelement = false;
     7171        IssmDouble bed_hydro,yts,gl_melting_rate;
     7172        IssmDouble rho_water,rho_ice,density;
     7173        IssmDouble melting[NUMVERTICES],phi[NUMVERTICES];;
     7174        IssmDouble h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],r[NUMVERTICES];
     7175        bool       grounded[NUMVERTICES],floating[NUMVERTICES];
    71757176
    71767177        /*Recover info at the vertices: */
     
    71817182        GetInputListOnVertices(&s[0],SurfaceEnum);
    71827183        GetInputListOnVertices(&b[0],BedEnum);
    7183         GetInputListOnVertices(&ba[0],BathymetryEnum);
     7184        GetInputListOnVertices(&r[0],BathymetryEnum);
    71847185        if(migration_style==SubelementMigrationEnum || migration_style==SubelementMigration2Enum) GetInputListOnVertices(&phi[0],GLlevelsetEnum);
    7185         rho_water=matpar->GetRhoWater();
    7186         rho_ice=matpar->GetRhoIce();
    7187         density=rho_ice/rho_water;
     7186        rho_water = matpar->GetRhoWater();
     7187        rho_ice   = matpar->GetRhoIce();
     7188        density   = rho_ice/rho_water;
    71887189
    71897190        /*go through vertices, and update inputs, considering them to be TriaVertex type: */
     
    71917192                /*Ice shelf: if bed below bathymetry, impose it at the bathymetry and update surface, elso do nothing */
    71927193                if(reCast<bool>(old_floating_ice[nodes[i]->Sid()])){
    7193                         if(b[i]<=ba[i]){
    7194                                 b[i]=ba[i];
    7195                                 s[i]=b[i]+h[i];
     7194                        if(b[i]<=r[i]){
     7195                                b[i]        = r[i];
     7196                                s[i]        = b[i]+h[i];
     7197                                floating[i] = false;
     7198                                grounded[i] = true;
    71967199                                nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,false));
    71977200                                nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,true));
     
    72027205                else{
    72037206                        bed_hydro=-density*h[i];
    7204                         if (bed_hydro>ba[i]){
     7207                        if (bed_hydro>r[i]){
    72057208                                /*Unground only if the element is connected to the ice shelf*/
    72067209                                if(migration_style==AgressiveMigrationEnum || migration_style==SubelementMigrationEnum || migration_style==SubelementMigration2Enum){
    7207                                         s[i]=(1-density)*h[i];
    7208                                         b[i]=-density*h[i];
     7210                                        s[i]        = (1-density)*h[i];
     7211                                        b[i]        = -density*h[i];
     7212                                        floating[i] = true;
     7213                                        grounded[i] = false;
    72097214                                        nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
    72107215                                        nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
    72117216                                }
    72127217                                else if(migration_style==SoftMigrationEnum && reCast<bool>(sheet_ungrounding[nodes[i]->Sid()])){
    7213                                         s[i]=(1-density)*h[i];
    7214                                         b[i]=-density*h[i];
     7218                                        s[i]        = (1-density)*h[i];
     7219                                        b[i]        = -density*h[i];
     7220                                        floating[i] = true;
     7221                                        grounded[i] = false;
    72157222                                        nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
    72167223                                        nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
     
    72567263        /*Recalculate phi*/
    72577264        if(migration_style==SubelementMigrationEnum || migration_style==SubelementMigration2Enum){
    7258                 for(i=0;i<NUMVERTICES;i++) phi[i]=h[i]+ba[i]/density;
     7265                for(i=0;i<NUMVERTICES;i++) phi[i]=h[i]+r[i]/density;
    72597266                this->inputs->AddInput(new TriaInput(GLlevelsetEnum,&phi[0],P1Enum));
    72607267        }
     
    72647271void  Tria::PotentialUngrounding(Vector<IssmDouble>* potential_ungrounding){
    72657272
    7266         int     i;
    7267         IssmDouble  h[NUMVERTICES],ba[NUMVERTICES];
     7273        IssmDouble  h[NUMVERTICES],r[NUMVERTICES];
    72687274        IssmDouble  bed_hydro;
    72697275        IssmDouble  rho_water,rho_ice,density;
     
    72747280        density=rho_ice/rho_water;
    72757281        GetInputListOnVertices(&h[0],ThicknessEnum);
    7276         GetInputListOnVertices(&ba[0],BathymetryEnum);
     7282        GetInputListOnVertices(&r[0],BathymetryEnum);
    72777283
    72787284        /*go through vertices, and figure out which ones are grounded and want to unground: */
    7279         for(i=0;i<NUMVERTICES;i++){
     7285        for(int i=0;i<NUMVERTICES;i++){
    72807286                /*Find if grounded vertices want to start floating*/
    72817287                if (!nodes[i]->IsFloating()){
    72827288                        bed_hydro=-density*h[i];
    7283                         if (bed_hydro>ba[i]){
     7289                        if(bed_hydro>r[i]){
    72847290                                /*Vertex that could potentially unground, flag it*/
    72857291                                potential_ungrounding->SetValue(nodes[i]->Sid(),1,INS_VAL);
  • issm/trunk-jpl/src/c/classes/Node.h

    r15464 r15535  
    6565                /*}}}*/
    6666                /*Node numerical routines {{{*/
    67                 void   CreateNodalConstraints(Vector<IssmDouble>* ys);
    68                 void   SetCurrentConfiguration(DataSet* nodes,Vertices* vertices);
    69                 int    Sid(void);
     67                void  CreateNodalConstraints(Vector<IssmDouble>* ys);
     68                void  SetCurrentConfiguration(DataSet* nodes,Vertices* vertices);
     69                int   Sid(void);
    7070#ifdef _HAVE_DIAGNOSTIC_
    71                 void   GetCoordinateSystem(IssmDouble* coord_system_out);
     71                void  GetCoordinateSystem(IssmDouble* coord_system_out);
    7272#endif
    73                 bool   InAnalysis(int analysis_type);
    74                 int    GetApproximation();
    75                 int    GetNumberOfDofs(int approximation_enum,int setenum);
    76                 int    IsClone();
    77                 void   ApplyConstraint(int dof,IssmDouble value);
    78                 void   RelaxConstraint(int dof);
    79                 void   DofInSSet(int dof);
    80                 void   DofInFSet(int dof);
    81                 int    GetDof(int dofindex,int setenum);
    82                 void   CreateVecSets(Vector<IssmDouble>* pv_g,Vector<IssmDouble>* pv_f,Vector<IssmDouble>* pv_s);
    83                 void   GetDofList(int* poutdoflist,int approximation_enum,int setenum);
    84                 void   GetLocalDofList(int* poutdoflist,int approximation_enum,int setenum);
    85                 void   FreezeDof(int dof);
    86                 bool   IsActive(void);
    87                 void   Activate(void);
    88                 void   Deactivate(void);
    89                 int    IsFloating();
    90                 int    IsGrounded();
    91                 void   UpdateSpcs(IssmDouble* ys);
    92                 void   VecMerge(Vector<IssmDouble>* ug, IssmDouble* vector_serial,int setenum);
    93                 void   VecReduce(Vector<IssmDouble>* vector, IssmDouble* ug_serial,int setnum);
     73                bool  InAnalysis(int analysis_type);
     74                int   GetApproximation();
     75                int   GetNumberOfDofs(int approximation_enum,int setenum);
     76                int   IsClone();
     77                void  ApplyConstraint(int dof,IssmDouble value);
     78                void  RelaxConstraint(int dof);
     79                void  DofInSSet(int dof);
     80                void  DofInFSet(int dof);
     81                int   GetDof(int dofindex,int setenum);
     82                void  CreateVecSets(Vector<IssmDouble>* pv_g,Vector<IssmDouble>* pv_f,Vector<IssmDouble>* pv_s);
     83                void  GetDofList(int* poutdoflist,int approximation_enum,int setenum);
     84                void  GetLocalDofList(int* poutdoflist,int approximation_enum,int setenum);
     85                void  FreezeDof(int dof);
     86                bool  IsActive(void);
     87                void  Activate(void);
     88                void  Deactivate(void);
     89                void  UpdateSpcs(IssmDouble* ys);
     90                int   IsFloating();
     91                int   IsGrounded();
     92                void  VecMerge(Vector<IssmDouble>* ug, IssmDouble* vector_serial,int setenum);
     93                void  VecReduce(Vector<IssmDouble>* vector, IssmDouble* ug_serial,int setnum);
    9494                void  DistributeDofs(int* pdofcount,int setenum);
    9595                void  OffsetDofs(int dofcount,int setenum);
Note: See TracChangeset for help on using the changeset viewer.