Ignore:
Timestamp:
01/19/23 03:50:29 (2 years ago)
Author:
bdef
Message:

BUG: fix to the split between layers of moulin input for DoCo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Loads/Moulin.cpp

    r26144 r27518  
    104104/*}}}*/
    105105void    Moulin::Echo(void){/*{{{*/
    106         this->DeepEcho();
     106
     107        _printf_("Moulin:\n");
     108        _printf_("   id: " << id << "\n");
     109        hnode->Echo();
     110        hvertex->Echo();
     111        helement->Echo();
     112        _printf_("   parameters\n");
     113        parameters->Echo();
     114        //this->DeepEcho();
    107115}
    108116/*}}}*/
     
    143151void  Moulin::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/
    144152
    145         /*Take care of hooking up all objects for this load, ie links the objects in the hooks to their respective 
     153        /*Take care of hooking up all objects for this load, ie links the objects in the hooks to their respective
    146154         * datasets, using internal ids and offsets hidden in hooks: */
    147155        hnode->configure(nodesin);
     
    204212                        break;
    205213                case HydrologyDCInefficientAnalysisEnum:
    206                         pe = CreatePVectorHydrologyDCInefficient();
     214                        pe = this->CreatePVectorHydrologyDCInefficient();
    207215                        break;
    208216                case HydrologyDCEfficientAnalysisEnum:
    209                         pe = CreatePVectorHydrologyDCEfficient();
     217                        pe = this->CreatePVectorHydrologyDCEfficient();
    210218                        break;
    211219                default:
     
    427435         * mesh), don't add the moulin input a second time*/
    428436        if(node->IsClone()) return NULL;
    429         bool isefficientlayer;
     437        bool isefficientlayer, active_element;
    430438        IssmDouble moulin_load,dt;
    431439        IssmDouble epl_active;
    432 
    433440        /*Initialize Element matrix*/
    434441        ElementVector* pe=new ElementVector(&node,1,this->parameters);
     
    437444        parameters->FindParam(&dt,TimesteppingTimeStepEnum);
    438445        parameters->FindParam(&isefficientlayer,HydrologydcIsefficientlayerEnum);
    439         // Test version input in EPL when active
     446
     447        //Test version input in EPL when active
    440448        if(isefficientlayer){
    441                 this->element->GetInputValue(&epl_active,node,HydrologydcMaskEplactiveNodeEnum);
    442                 if(reCast<bool>(epl_active)){
    443                         pe->values[0]=moulin_load*0.0;
     449                this->element->GetInputValue(&active_element,HydrologydcMaskEplactiveEltEnum);
     450                if(!active_element){
     451                        /* this->element->GetInputValue(&epl_active,node,HydrologydcMaskEplactiveNodeEnum); */
     452                        /* if(reCast<bool>(epl_active))pe->values[0]=0.0; */
     453                        /* else { */
     454                        pe->values[0]=moulin_load*dt;
     455                        /*      if (moulin_load>0)_printf_("MoulinInput in Sed is "<<pe->values[0]<<"\n"); */
     456                        /*      if (moulin_load>0)pe->Echo(); */
     457                        /* } */
     458                        //if (node->Sid()==4)_printf_("MoulinInput in Sed is "<<moulin_load*dt<<"\n");
    444459                }
    445                 else{
    446                         pe->values[0]=moulin_load*dt;
    447                 }
    448         }
    449         else{
    450                 pe->values[0]=moulin_load*dt;
    451         }
     460                else pe->values[0]=0.0;
     461        }
     462        else pe->values[0]=moulin_load*dt;
     463
     464        //Test only input in sed
     465        /* pe->values[0]=moulin_load*dt; */
     466
    452467        /*Clean up and return*/
    453468        return pe;
     
    458473        /*If this node is not the master node (belongs to another partition of the
    459474         * mesh), don't add the moulin input a second time*/
     475
    460476        if(node->IsClone()) return NULL;
    461         if(!this->node->IsActive()) return NULL;
    462         IssmDouble moulin_load,dt;
    463477        ElementVector* pe=new ElementVector(&node,1,this->parameters);
    464478
    465         this->element->GetInputValue(&moulin_load,node,HydrologydcBasalMoulinInputEnum);
    466         parameters->FindParam(&dt,TimesteppingTimeStepEnum);
    467 
    468         pe->values[0]=moulin_load*dt;
    469         /*Clean up and return*/
     479        //Test Input in epl if active
     480        /* IssmDouble epl_active; */
     481        /* this->element->GetInputValue(&epl_active,node,HydrologydcMaskEplactiveNodeEnum); */
     482        /* //if(node->Sid()==4)_printf_("Activity is "<<epl_active<<" \n"); */
     483        /* if(reCast<bool>(epl_active)){ */
     484        /*      IssmDouble moulin_load,dt; */
     485        /*      this->element->GetInputValue(&moulin_load,node,HydrologydcBasalMoulinInputEnum); */
     486        /*      parameters->FindParam(&dt,TimesteppingTimeStepEnum); */
     487        /*      pe->values[0]=moulin_load*dt; */
     488        /*      if (moulin_load>0)_printf_("MoulinInput in Epl is "<<pe->values[1]<<"\n"); */
     489
     490        /* } */
     491        /*      else{ */
     492        /*              pe->values[0]=0.0; */
     493        /* } */
     494        // Test element only test
     495        bool active_element;
     496        this->element->GetInputValue(&active_element,HydrologydcMaskEplactiveEltEnum);
     497        if(active_element){
     498                IssmDouble moulin_load,dt;
     499                this->element->GetInputValue(&moulin_load,node,HydrologydcBasalMoulinInputEnum);
     500                parameters->FindParam(&dt,TimesteppingTimeStepEnum);
     501                pe->values[0]=moulin_load*dt;
     502        }
     503        else pe->values[0]=0.0;
     504
     505
     506        //Test only input is sed
     507        /* pe->values[0]=0.0; */
     508
     509        //Clean up and return
    470510        return pe;
    471511}
Note: See TracChangeset for help on using the changeset viewer.