source: issm/oecreview/Archive/26740-27031/ISSM-27018-27019.diff@ 27032

Last change on this file since 27032 was 27032, checked in by Mathieu Morlighem, 3 years ago

CHG: added 26740-27031

File size: 4.5 KB
  • ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp

     
    651651        IssmDouble newlevelset[6];
    652652        femmodel->parameters->FindParam(&calvinglaw,CalvingLawEnum);
    653653
    654         if(calvinglaw==CalvingMinthicknessEnum){
     654        /*Apply minimum thickness criterion*/
     655        if(calvinglaw==CalvingMinthicknessEnum || calvinglaw==CalvingVonmisesEnum || calvinglaw==CalvingParameterizationEnum){
    655656
    656657                IssmDouble mig_max = femmodel->parameters->FindParam(MigrationMaxEnum);
    657658                IssmDouble dt      = femmodel->parameters->FindParam(TimesteppingTimeStepEnum);
     
    690691                                dis_input->GetInputValue(&distance,gauss);
    691692
    692693                                if(thickness<min_thickness && bed<sealevel && fabs(distance)<mig_max*dt && levelset<0){
    693                                         newlevelset[in] = +400.; //Arbitrary > 0 number
     694                                        newlevelset[in] = +400.; //Arbitrary > 0 number (i.e. deactivate this node)
    694695                                }
    695696                                else{
    696697                                        newlevelset[in] = levelset;
     
    713714   InputDuplicatex(femmodel,MaskIceLevelsetEnum,DistanceToCalvingfrontEnum);
    714715   femmodel->DistanceToFieldValue(MaskIceLevelsetEnum,0,DistanceToCalvingfrontEnum);
    715716
    716         if(calvinglaw==CalvingVonmisesEnum){
     717   if(calvinglaw==CalvingHabEnum){
    717718
    718719                /*Intermediaries*/
    719                 IssmDouble thickness,bed,sealevel,distance,levelset;
    720                 IssmDouble min_thickness = femmodel->parameters->FindParam(CalvingMinthicknessEnum);
    721 
    722                 /*Loop over all elements of this partition*/
    723                 for(Object* & object : femmodel->elements->objects){
    724                         Element* element  = xDynamicCast<Element*>(object);
    725 
    726                         int      numnodes     = element->GetNumberOfNodes();
    727                         Gauss*   gauss        = element->NewGauss();
    728 
    729                         Input *H_input        = element->GetInput(ThicknessEnum);              _assert_(H_input);
    730                         Input *b_input        = element->GetInput(BedEnum);                    _assert_(b_input);
    731                         Input *sl_input       = element->GetInput(SealevelEnum);               _assert_(sl_input);
    732                         Input *dis_input      = element->GetInput(DistanceToCalvingfrontEnum); _assert_(dis_input);
    733                         Input *levelset_input = element->GetInput(MaskIceLevelsetEnum);        _assert_(levelset_input);
    734 
    735                         /*Potentially constrain nodes of this element*/
    736                         for(int in=0;in<numnodes;in++){
    737                                 gauss->GaussNode(element->GetElementType(),in);
    738                                 Node* node=element->GetNode(in);
    739                                 if(!node->IsActive()) continue;
    740 
    741                                 H_input->GetInputValue(&thickness,gauss);
    742                                 b_input->GetInputValue(&bed,gauss);
    743                                 sl_input->GetInputValue(&sealevel,gauss);
    744                                 dis_input->GetInputValue(&distance,gauss);
    745                                 levelset_input->GetInputValue(&levelset,gauss);
    746                                 if(thickness<min_thickness && bed<sealevel && fabs(distance)<mig_max*dt && levelset<0){
    747                                         node->ApplyConstraint(0,+1.);
    748                                 }
    749                                 else{
    750                                         /* no ice, set no spc */
    751                                         node->DofInFSet(0);
    752                                 }
    753                         }
    754                         delete gauss;
    755                 }
    756         }
    757         else if(calvinglaw==CalvingParameterizationEnum){
    758 
    759       /*Intermediaries*/
    760       IssmDouble thickness,bed,sealevel,distance;
    761       IssmDouble min_thickness = femmodel->parameters->FindParam(CalvingMinthicknessEnum);
    762 
    763                 /*Loop over all elements of this partition*/
    764                 for(Object* & object : femmodel->elements->objects){
    765                         Element* element  = xDynamicCast<Element*>(object);
    766 
    767                         int      numnodes = element->GetNumberOfNodes();
    768                         Gauss*   gauss    = element->NewGauss();
    769                         Input*   H_input  = element->GetInput(ThicknessEnum); _assert_(H_input);
    770                         Input*   b_input = element->GetInput(BedEnum); _assert_(b_input);
    771                         Input*   sl_input = element->GetInput(SealevelEnum); _assert_(sl_input);
    772                         Input*   dis_input           = element->GetInput(DistanceToCalvingfrontEnum); _assert_(dis_input);
    773 
    774                         /*Potentially constrain nodes of this element*/
    775                         for(int in=0;in<numnodes;in++){
    776                                 gauss->GaussNode(element->GetElementType(),in);
    777                                 Node* node=element->GetNode(in);
    778                                 if(!node->IsActive()) continue;
    779 
    780                                 H_input->GetInputValue(&thickness,gauss);
    781                                 b_input->GetInputValue(&bed,gauss);
    782                                 sl_input->GetInputValue(&sealevel,gauss);
    783                                 dis_input->GetInputValue(&distance,gauss);
    784                                 if(thickness<min_thickness && bed<sealevel && fabs(distance)<mig_max*dt){
    785                                         node->ApplyConstraint(0,+1.);
    786                                 }
    787                                 else {
    788                                         /* no ice, set no spc */
    789                                         node->DofInFSet(0);
    790                                 }
    791                         }
    792                         delete gauss;
    793                 }
    794         }
    795    else if(calvinglaw==CalvingHabEnum){
    796 
    797                 /*Intermediaries*/
    798720                IssmDouble  thickness,water_depth,distance,hab_fraction;
    799721
    800722                /*Loop over all elements of this partition*/
Note: See TracBrowser for help on using the repository browser.