Changeset 22586


Ignore:
Timestamp:
03/20/18 17:05:29 (7 years ago)
Author:
erobo
Message:

CHG: adolc/m1qn3 enabling so ind not double counted

Location:
issm/trunk-jpl/src/c/cores
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/cores/stressbalance_core.cpp

    r22438 r22586  
    1414
    1515        /*parameters: */
    16         bool       dakota_analysis;
     16        bool       dakota_analysis,control_analysis;
    1717        int        domaintype;
    1818        bool       isSIA,isSSA,isL1L2,isHO,isFS;
     
    3434        femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
    3535        femmodel->parameters->FindParam(&numoutputs,StressbalanceNumRequestedOutputsEnum);
     36        femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum);
    3637        if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,StressbalanceRequestedOutputsEnum);
    3738       
     
    7980                femmodel->RequestedOutputsx(&femmodel->results,requested_outputs,numoutputs);
    8081        }
    81 
    82         if(solution_type==StressbalanceSolutionEnum)femmodel->RequestedDependentsx();
     82       
     83        if(solution_type==StressbalanceSolutionEnum && !control_analysis)femmodel->RequestedDependentsx();
    8384
    8485        /*Free ressources:*/   
  • issm/trunk-jpl/src/c/cores/transient_core.cpp

    r22547 r22586  
    2020
    2121        /*parameters: */
    22         IssmDouble finaltime,dt,yts;
    23         bool       isstressbalance,ismasstransport,issmb,isFS,isthermal,isgroundingline,isgia,isslr,iscoupler,ismovingfront,isdamageevolution,ishydrology,isoceancoupling;
     22        IssmDouble finaltime,dt,yts,starttime;
     23        bool       isstressbalance,ismasstransport,issmb,isFS,isthermal,isgroundingline,isgia,isslr,iscoupler,ismovingfront,isdamageevolution,ishydrology,isoceancoupling,iscontrol,isautodiff;
    2424        bool       save_results,dakota_analysis;
    2525        int        timestepping;
     
    4444        femmodel->parameters->FindParam(&time,TimeEnum);
    4545        femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
     46        femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
    4647        femmodel->parameters->FindParam(&yts,ConstantsYtsEnum);
    4748        femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
     
    6263        femmodel->parameters->FindParam(&amr_frequency,TransientAmrFrequencyEnum);
    6364        femmodel->parameters->FindParam(&isFS,FlowequationIsFSEnum);
     65        femmodel->parameters->FindParam(&iscontrol,InversionIscontrolEnum);
     66        femmodel->parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum);
    6467        if(isgroundingline) femmodel->parameters->FindParam(&groundingline_migration,GroundinglineMigrationEnum);
    6568        femmodel->parameters->FindParam(&numoutputs,TransientNumRequestedOutputsEnum);
     
    118121        }
    119122
     123                IssmDouble  output_value;
     124                int         num_dependents;
     125                IssmPDouble *dependents;
     126                DataSet*    dependent_objects=NULL;
     127                IssmDouble  J=0.;
     128
     129        if(iscontrol && isautodiff){
     130
     131                femmodel->parameters->SetParam(starttime,TimeEnum);
     132                femmodel->parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
     133                femmodel->parameters->FindParam(&dependent_objects,AutodiffDependentObjectsEnum);
     134
     135                /*Go through our dependent variables, and compute the response:*/
     136                dependents=xNew<IssmPDouble>(num_dependents);
     137        }
     138
    120139        while(time < finaltime - (yts*DBL_EPSILON)){ //make sure we run up to finaltime.
    121140
     
    241260                        #endif
    242261                }
     262
     263                if (iscontrol && isautodiff) {
     264                        /*Go through our dependent variables, and compute the response:*/
     265                        for(int i=0;i<dependent_objects->Size();i++){
     266                                DependentObject* dep=(DependentObject*)dependent_objects->GetObjectByOffset(i);
     267                                 dep->Responsex(&output_value,femmodel);
     268                                 dep->AddValue(output_value);
     269                                }
     270                        }
    243271        }
    244272       
    245         femmodel->RequestedDependentsx();
     273        if(!iscontrol || !isautodiff) femmodel->RequestedDependentsx();
     274        femmodel->parameters->SetParam(dependent_objects,AutodiffDependentObjectsEnum);
    246275
    247276        /*Free ressources:*/   
Note: See TracChangeset for help on using the changeset viewer.