[27032] | 1 | Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp (revision 27018)
|
---|
| 4 | +++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp (revision 27019)
|
---|
| 5 | @@ -651,7 +651,8 @@
|
---|
| 6 | IssmDouble newlevelset[6];
|
---|
| 7 | femmodel->parameters->FindParam(&calvinglaw,CalvingLawEnum);
|
---|
| 8 |
|
---|
| 9 | - if(calvinglaw==CalvingMinthicknessEnum){
|
---|
| 10 | + /*Apply minimum thickness criterion*/
|
---|
| 11 | + if(calvinglaw==CalvingMinthicknessEnum || calvinglaw==CalvingVonmisesEnum || calvinglaw==CalvingParameterizationEnum){
|
---|
| 12 |
|
---|
| 13 | IssmDouble mig_max = femmodel->parameters->FindParam(MigrationMaxEnum);
|
---|
| 14 | IssmDouble dt = femmodel->parameters->FindParam(TimesteppingTimeStepEnum);
|
---|
| 15 | @@ -690,7 +691,7 @@
|
---|
| 16 | dis_input->GetInputValue(&distance,gauss);
|
---|
| 17 |
|
---|
| 18 | if(thickness<min_thickness && bed<sealevel && fabs(distance)<mig_max*dt && levelset<0){
|
---|
| 19 | - newlevelset[in] = +400.; //Arbitrary > 0 number
|
---|
| 20 | + newlevelset[in] = +400.; //Arbitrary > 0 number (i.e. deactivate this node)
|
---|
| 21 | }
|
---|
| 22 | else{
|
---|
| 23 | newlevelset[in] = levelset;
|
---|
| 24 | @@ -713,88 +714,9 @@
|
---|
| 25 | InputDuplicatex(femmodel,MaskIceLevelsetEnum,DistanceToCalvingfrontEnum);
|
---|
| 26 | femmodel->DistanceToFieldValue(MaskIceLevelsetEnum,0,DistanceToCalvingfrontEnum);
|
---|
| 27 |
|
---|
| 28 | - if(calvinglaw==CalvingVonmisesEnum){
|
---|
| 29 | + if(calvinglaw==CalvingHabEnum){
|
---|
| 30 |
|
---|
| 31 | /*Intermediaries*/
|
---|
| 32 | - IssmDouble thickness,bed,sealevel,distance,levelset;
|
---|
| 33 | - IssmDouble min_thickness = femmodel->parameters->FindParam(CalvingMinthicknessEnum);
|
---|
| 34 | -
|
---|
| 35 | - /*Loop over all elements of this partition*/
|
---|
| 36 | - for(Object* & object : femmodel->elements->objects){
|
---|
| 37 | - Element* element = xDynamicCast<Element*>(object);
|
---|
| 38 | -
|
---|
| 39 | - int numnodes = element->GetNumberOfNodes();
|
---|
| 40 | - Gauss* gauss = element->NewGauss();
|
---|
| 41 | -
|
---|
| 42 | - Input *H_input = element->GetInput(ThicknessEnum); _assert_(H_input);
|
---|
| 43 | - Input *b_input = element->GetInput(BedEnum); _assert_(b_input);
|
---|
| 44 | - Input *sl_input = element->GetInput(SealevelEnum); _assert_(sl_input);
|
---|
| 45 | - Input *dis_input = element->GetInput(DistanceToCalvingfrontEnum); _assert_(dis_input);
|
---|
| 46 | - Input *levelset_input = element->GetInput(MaskIceLevelsetEnum); _assert_(levelset_input);
|
---|
| 47 | -
|
---|
| 48 | - /*Potentially constrain nodes of this element*/
|
---|
| 49 | - for(int in=0;in<numnodes;in++){
|
---|
| 50 | - gauss->GaussNode(element->GetElementType(),in);
|
---|
| 51 | - Node* node=element->GetNode(in);
|
---|
| 52 | - if(!node->IsActive()) continue;
|
---|
| 53 | -
|
---|
| 54 | - H_input->GetInputValue(&thickness,gauss);
|
---|
| 55 | - b_input->GetInputValue(&bed,gauss);
|
---|
| 56 | - sl_input->GetInputValue(&sealevel,gauss);
|
---|
| 57 | - dis_input->GetInputValue(&distance,gauss);
|
---|
| 58 | - levelset_input->GetInputValue(&levelset,gauss);
|
---|
| 59 | - if(thickness<min_thickness && bed<sealevel && fabs(distance)<mig_max*dt && levelset<0){
|
---|
| 60 | - node->ApplyConstraint(0,+1.);
|
---|
| 61 | - }
|
---|
| 62 | - else{
|
---|
| 63 | - /* no ice, set no spc */
|
---|
| 64 | - node->DofInFSet(0);
|
---|
| 65 | - }
|
---|
| 66 | - }
|
---|
| 67 | - delete gauss;
|
---|
| 68 | - }
|
---|
| 69 | - }
|
---|
| 70 | - else if(calvinglaw==CalvingParameterizationEnum){
|
---|
| 71 | -
|
---|
| 72 | - /*Intermediaries*/
|
---|
| 73 | - IssmDouble thickness,bed,sealevel,distance;
|
---|
| 74 | - IssmDouble min_thickness = femmodel->parameters->FindParam(CalvingMinthicknessEnum);
|
---|
| 75 | -
|
---|
| 76 | - /*Loop over all elements of this partition*/
|
---|
| 77 | - for(Object* & object : femmodel->elements->objects){
|
---|
| 78 | - Element* element = xDynamicCast<Element*>(object);
|
---|
| 79 | -
|
---|
| 80 | - int numnodes = element->GetNumberOfNodes();
|
---|
| 81 | - Gauss* gauss = element->NewGauss();
|
---|
| 82 | - Input* H_input = element->GetInput(ThicknessEnum); _assert_(H_input);
|
---|
| 83 | - Input* b_input = element->GetInput(BedEnum); _assert_(b_input);
|
---|
| 84 | - Input* sl_input = element->GetInput(SealevelEnum); _assert_(sl_input);
|
---|
| 85 | - Input* dis_input = element->GetInput(DistanceToCalvingfrontEnum); _assert_(dis_input);
|
---|
| 86 | -
|
---|
| 87 | - /*Potentially constrain nodes of this element*/
|
---|
| 88 | - for(int in=0;in<numnodes;in++){
|
---|
| 89 | - gauss->GaussNode(element->GetElementType(),in);
|
---|
| 90 | - Node* node=element->GetNode(in);
|
---|
| 91 | - if(!node->IsActive()) continue;
|
---|
| 92 | -
|
---|
| 93 | - H_input->GetInputValue(&thickness,gauss);
|
---|
| 94 | - b_input->GetInputValue(&bed,gauss);
|
---|
| 95 | - sl_input->GetInputValue(&sealevel,gauss);
|
---|
| 96 | - dis_input->GetInputValue(&distance,gauss);
|
---|
| 97 | - if(thickness<min_thickness && bed<sealevel && fabs(distance)<mig_max*dt){
|
---|
| 98 | - node->ApplyConstraint(0,+1.);
|
---|
| 99 | - }
|
---|
| 100 | - else {
|
---|
| 101 | - /* no ice, set no spc */
|
---|
| 102 | - node->DofInFSet(0);
|
---|
| 103 | - }
|
---|
| 104 | - }
|
---|
| 105 | - delete gauss;
|
---|
| 106 | - }
|
---|
| 107 | - }
|
---|
| 108 | - else if(calvinglaw==CalvingHabEnum){
|
---|
| 109 | -
|
---|
| 110 | - /*Intermediaries*/
|
---|
| 111 | IssmDouble thickness,water_depth,distance,hab_fraction;
|
---|
| 112 |
|
---|
| 113 | /*Loop over all elements of this partition*/
|
---|