Changeset 7333


Ignore:
Timestamp:
02/04/11 09:20:43 (14 years ago)
Author:
Eric.Larour
Message:

Yeeeeeeeeeeeeeeeeeeeeeeehhhhhhhhhhhhhhhhhhhhhhhhhhhhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... grounding line migration working in soft mode . . . pidou pidou pidou ... nannanananaanana

Location:
issm/trunk/src/c
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationxUtils.cpp

    r7323 r7333  
    4848        /*First, figure out which nodes that are on the ice sheet want to unground. Build a flags vector for this (size number of nodes: */
    4949        potential_sheet_ungrounding=PotentialSheetUngrounding(elements,nodes,parameters);
    50 
     50       
    5151        /*Now, propagate ice shelf into connex areas of the ice sheet that potentially want to unground: */
    5252        sheet_ungrounding=PropagateShelfIntoConnexIceSheet(elements,nodes,parameters,potential_sheet_ungrounding);
    53 
     53       
    5454        /*Now, use the sheet_ungrounding flags to unground the ice sheet (at the same time, take care of grounding elements of the ice shelf
    5555         * that want to: */
     
    136136                 * nodes have flipped from grounded to ungrounded: */
    137137                VecToMPISerial(&nodes_on_iceshelf,vec_nodes_on_iceshelf);
    138                
     138
    139139                for(i=0;i<elements->Size();i++){
    140140                        element=(Element*)elements->GetObjectByOffset(i);
    141141                        if(elements_touching_iceshelf[element->Sid()]){
    142                                 nflipped+=element->UpdatePotentialSheetUngrounding(potential_sheet_ungrounding,vec_nodes_on_iceshelf,nodes_on_iceshelf);
     142                                local_nflipped+=element->UpdatePotentialSheetUngrounding(potential_sheet_ungrounding,vec_nodes_on_iceshelf,nodes_on_iceshelf);
    143143                        }
    144144                }
    145145               
    146146                MPI_Allreduce(&local_nflipped,&nflipped,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
    147                 //_printf_(VerboseConvergence(),"   number of grounded vertices  connected to grounding line: %i\n",nflipped);
    148                 _printf_(1,"   number of grounded vertices  connected to grounding line: %i\n",nflipped);
     147                _printf_(VerboseConvergence(),"   number of grounded vertices  connected to grounding line: %i\n",nflipped);
    149148
    150149                /*Avoid leaks: */
    151150                xfree((void**)&nodes_on_iceshelf);
     151
     152                /*Assemble:*/
     153                VecAssemblyBegin(vec_nodes_on_iceshelf);
     154                VecAssemblyEnd(vec_nodes_on_iceshelf);
    152155        }
    153156
     
    162165}
    163166/*}}}*/
    164 
    165 
    166167bool*      CreateElementOnGroundingLine(Elements* elements,double* element_on_iceshelf){ //{{{1
    167168
     
    212213        for(i=0;i<elements->Size();i++){
    213214                element=(Element*)elements->GetObjectByOffset(i);
    214                 printf("%i\n",i);
    215215                VecSetValue(vec_element_on_iceshelf,element->Sid(),(int)element->IsOnShelf(),INSERT_VALUES);
    216216        }
     
    328328        for(i=0;i<nodes->Size();i++){
    329329                node=(Node*)nodes->GetObjectByOffset(i);
    330                 if(node->IsOnShelf())VecSetValue(nodes_on_iceshelf,node->Sid()+1,1,INSERT_VALUES);
     330                if(node->InAnalysis(analysis_type)){
     331                        if(node->IsOnShelf()){
     332                                VecSetValue(nodes_on_iceshelf,node->Sid(),1.0,INSERT_VALUES);
     333                        }
     334                }
    331335        }
    332336
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r7323 r7333  
    42974297}
    42984298/*}}}*/
    4299 /*FUNCTION Tria::IsNodeOnShelf {{{1*/
     4299/*FUNCTION Tria::IsNodeOnShelfFromFlags {{{1*/
    43004300bool   Tria::IsNodeOnShelfFromFlags(double* flags){
    43014301
     
    56795679                if (potential_sheet_ungrounding[nodes[i]->Sid()]){
    56805680                        VecSetValue(vec_nodes_on_iceshelf,nodes[i]->Sid(),1,INSERT_VALUES);
     5681               
     5682                        /*Figure out if we flipped: */
     5683                        if (potential_sheet_ungrounding[nodes[i]->Sid()] != nodes_on_iceshelf[nodes[i]->Sid()])nflipped++;
    56815684                }
    5682                 /*Figure out if we flipped: */
    5683                 if (potential_sheet_ungrounding[nodes[i]->Sid()] != nodes_on_iceshelf[nodes[i]->Sid()])nflipped++;
    56845685        }
    56855686        return nflipped;
  • issm/trunk/src/c/solutions/groundinglinemigration2d_core.cpp

    r7307 r7333  
    2121        femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
    2222
     23        /*activate formulation: */
     24        femmodel->SetCurrentConfiguration(PrognosticAnalysisEnum);
     25
    2326        _printf_(VerboseSolution(),"%s\n","   computing new grounding line position");
    2427        GroundingLineMigrationx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
Note: See TracChangeset for help on using the changeset viewer.