Changeset 27019
- Timestamp:
- 05/23/22 09:03:56 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
r27017 r27019 652 652 femmodel->parameters->FindParam(&calvinglaw,CalvingLawEnum); 653 653 654 if(calvinglaw==CalvingMinthicknessEnum){ 654 /*Apply minimum thickness criterion*/ 655 if(calvinglaw==CalvingMinthicknessEnum || calvinglaw==CalvingVonmisesEnum || calvinglaw==CalvingParameterizationEnum){ 655 656 656 657 IssmDouble mig_max = femmodel->parameters->FindParam(MigrationMaxEnum); … … 691 692 692 693 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) 694 695 } 695 696 else{ … … 714 715 femmodel->DistanceToFieldValue(MaskIceLevelsetEnum,0,DistanceToCalvingfrontEnum); 715 716 716 if(calvinglaw==CalvingVonmisesEnum){ 717 718 /*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){ 717 if(calvinglaw==CalvingHabEnum){ 796 718 797 719 /*Intermediaries*/
Note:
See TracChangeset
for help on using the changeset viewer.