Changeset 10372


Ignore:
Timestamp:
10/31/11 11:18:53 (13 years ago)
Author:
seroussi
Message:

more useless routines

Location:
issm/trunk/src/c/objects/Elements
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Elements/Element.h

    r10355 r10372  
    6969                virtual void   PotentialSheetUngrounding(Vec potential_sheet_ungrounding)=0;
    7070                virtual void   MigrateGroundingline()=0;
    71                 virtual int    UpdateShelfStatus(Vec new_shelf_nodes)=0;
    72                 virtual void   UpdateShelfFlags(double* new_shelf_nodes)=0;
    7371                virtual int    UpdatePotentialSheetUngrounding(double* potential_sheet_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf)=0;
    7472
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r10355 r10372  
    25942594}
    25952595/*}}}*/
    2596 /*FUNCTION Penta::UpdateShelfStatus{{{1*/
    2597 int Penta::UpdateShelfStatus(Vec new_shelf_nodes){
    2598         _error_("Not implemented yet");
    2599 }
    2600 /*}}}*/
    2601 /*FUNCTION Penta::UpdateShelfFlags{{{1*/
    2602 void Penta::UpdateShelfFlags(double* new_shelf_nodes){
    2603         _error_("Not implemented yet");
    2604 }
    2605 /*}}}*/
    26062596/*FUNCTION Penta::UpdatePotentialSheetUngrounding{{{1*/
    26072597int Penta::UpdatePotentialSheetUngrounding(double* potential_sheet_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf){
  • issm/trunk/src/c/objects/Elements/Penta.h

    r10355 r10372  
    114114                double SurfaceArea(void);
    115115                void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
    116                 int    UpdateShelfStatus(Vec new_shelf_nodes);
    117                 void   UpdateShelfFlags(double* new_shelf_nodes);
    118116                int    UpdatePotentialSheetUngrounding(double* potential_sheet_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf);
    119117                double TimeAdapt();
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r10371 r10372  
    24272427        //this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
    24282428        this->parameters=NULL;
    2429 }
    2430 /*}}}*/
    2431 /*FUNCTION Tria::UpdateShelfStatus{{{1*/
    2432 int  Tria::UpdateShelfStatus(Vec new_shelf_nodes){
    2433 
    2434         int     i;
    2435 
    2436         double  h[3];
    2437         double  s[3];
    2438         double  b[3];
    2439         double  ba[3];
    2440         Input  *surface_input  = NULL;
    2441         Input  *bed_input      = NULL;
    2442         double  rho_water;
    2443         double  rho_ice;
    2444         double  density;
    2445         bool    elementonshelf = false;
    2446         int     flipped=0;
    2447         int     shelfstatus[3];
    2448 
    2449 
    2450         /*Recover info at the vertices: */
    2451         surface_input   =inputs->GetInput(SurfaceEnum);   _assert_(surface_input);
    2452         bed_input   =inputs->GetInput(BedEnum);   _assert_(bed_input);
    2453         if((surface_input->ObjectEnum()!=TriaVertexInputEnum) | (bed_input->ObjectEnum()!=TriaVertexInputEnum))_error_(" not supported yet for bed and surface interpolations not P1!");
    2454 
    2455         GetInputListOnVertices(&h[0],ThicknessEnum);
    2456         GetInputListOnVertices(&s[0],SurfaceEnum);
    2457         GetInputListOnVertices(&b[0],BedEnum);
    2458         GetInputListOnVertices(&ba[0],BathymetryEnum);
    2459 
    2460         /*material parameters: */
    2461         rho_water=matpar->GetRhoWater();
    2462         rho_ice=matpar->GetRhoIce();
    2463         density=rho_ice/rho_water;
    2464 
    2465         /*Initialize current status of nodes: */
    2466         for(i=0;i<3;i++){
    2467                 shelfstatus[i]=nodes[i]->IsFloating();
    2468                 if((nodes[i]->Sid()+1)==36) printf("UpdateShelfStatus: El %i Node %i shelf status %i\n",this->Id(),nodes[i]->Sid()+1,shelfstatus[i]);
    2469         }
    2470        
    2471         /*go through vertices, and figure out if they are grounded or not, then update their status: */
    2472         flipped=0;
    2473         for(i=0;i<3;i++){
    2474                 if(b[i]<=ba[i]){ //the = will lead to oscillations.
    2475                         nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,false));
    2476                         nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,true));
    2477                         if(shelfstatus[i]){
    2478                                 flipped++;
    2479                                 if((nodes[i]->Sid()+1)==36)printf("UpdateShelfStatus: El %i Node %i grounding %g %g %g\n",this->Id(),nodes[i]->Sid()+1,b[i],ba[i],s[i]);
    2480                         }
    2481                         VecSetValue(new_shelf_nodes,nodes[i]->Sid(),0,INSERT_VALUES);
    2482                 }
    2483                 else{
    2484                         nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,true));
    2485                         nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,false));
    2486                         if(!shelfstatus[i]){
    2487                                 flipped++;
    2488                                 if((nodes[i]->Sid()+1)==36)printf("UpdateShelfStatus: El %i Node %i floating %g %g %g\n",this->Id(),nodes[i]->Sid()+1,b[i],ba[i],s[i]);
    2489                         }
    2490                         VecSetValue(new_shelf_nodes,nodes[i]->Sid(),1,INSERT_VALUES);
    2491                 }
    2492         }
    2493 
    2494         /*Now, update  shelf status of element. An element can only be on shelf if all its nodes are on shelf: */
    2495         elementonshelf=false;
    2496         for(i=0;i<3;i++){
    2497                 if(nodes[i]->IsFloating()){
    2498                         elementonshelf=true;
    2499                         break;
    2500                 }
    2501         }
    2502     this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,elementonshelf));
    2503 
    2504          return flipped;
    2505 }
    2506 /*}}}*/
    2507 /*FUNCTION Tria::UpdateShelfFlags{{{1*/
    2508 void Tria::UpdateShelfFlags(double* new_shelf_nodes){
    2509 
    2510         /*go through vertices, and update the status of MaskVertexonfloatingiceEnum and MaskVertexongroundediceEnum flags: */
    2511         bool flag;
    2512         int  i;
    2513         double  h[3];
    2514         double  s[3];
    2515         double  b[3];
    2516         double  ba[3];
    2517 
    2518         GetInputListOnVertices(&h[0],ThicknessEnum);
    2519         GetInputListOnVertices(&s[0],SurfaceEnum);
    2520         GetInputListOnVertices(&b[0],BedEnum);
    2521         GetInputListOnVertices(&ba[0],BathymetryEnum);
    2522 
    2523         for(i=0;i<3;i++){
    2524                 flag=(bool)new_shelf_nodes[nodes[i]->Sid()];
    2525                 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexonfloatingiceEnum,flag));
    2526                 nodes[i]->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,!flag));
    2527         }
    25282429}
    25292430/*}}}*/
  • issm/trunk/src/c/objects/Elements/Tria.h

    r10371 r10372  
    113113                double SurfaceArea(void);
    114114                void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
    115                 int    UpdateShelfStatus(Vec new_shelf_nodes);
    116115                int    UpdatePotentialSheetUngrounding(double* vertices_potentially_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf);
    117                 void   UpdateShelfFlags(double* new_shelf_nodes);
    118116                double TimeAdapt();
    119117                int*   GetHorizontalNeighboorSids(void);
Note: See TracChangeset for help on using the changeset viewer.