Changeset 22586
- Timestamp:
- 03/20/18 17:05:29 (7 years ago)
- 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 14 14 15 15 /*parameters: */ 16 bool dakota_analysis ;16 bool dakota_analysis,control_analysis; 17 17 int domaintype; 18 18 bool isSIA,isSSA,isL1L2,isHO,isFS; … … 34 34 femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum); 35 35 femmodel->parameters->FindParam(&numoutputs,StressbalanceNumRequestedOutputsEnum); 36 femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum); 36 37 if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,StressbalanceRequestedOutputsEnum); 37 38 … … 79 80 femmodel->RequestedOutputsx(&femmodel->results,requested_outputs,numoutputs); 80 81 } 81 82 if(solution_type==StressbalanceSolutionEnum )femmodel->RequestedDependentsx();82 83 if(solution_type==StressbalanceSolutionEnum && !control_analysis)femmodel->RequestedDependentsx(); 83 84 84 85 /*Free ressources:*/ -
issm/trunk-jpl/src/c/cores/transient_core.cpp
r22547 r22586 20 20 21 21 /*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; 24 24 bool save_results,dakota_analysis; 25 25 int timestepping; … … 44 44 femmodel->parameters->FindParam(&time,TimeEnum); 45 45 femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum); 46 femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum); 46 47 femmodel->parameters->FindParam(&yts,ConstantsYtsEnum); 47 48 femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum); … … 62 63 femmodel->parameters->FindParam(&amr_frequency,TransientAmrFrequencyEnum); 63 64 femmodel->parameters->FindParam(&isFS,FlowequationIsFSEnum); 65 femmodel->parameters->FindParam(&iscontrol,InversionIscontrolEnum); 66 femmodel->parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum); 64 67 if(isgroundingline) femmodel->parameters->FindParam(&groundingline_migration,GroundinglineMigrationEnum); 65 68 femmodel->parameters->FindParam(&numoutputs,TransientNumRequestedOutputsEnum); … … 118 121 } 119 122 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 120 139 while(time < finaltime - (yts*DBL_EPSILON)){ //make sure we run up to finaltime. 121 140 … … 241 260 #endif 242 261 } 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 } 243 271 } 244 272 245 femmodel->RequestedDependentsx(); 273 if(!iscontrol || !isautodiff) femmodel->RequestedDependentsx(); 274 femmodel->parameters->SetParam(dependent_objects,AutodiffDependentObjectsEnum); 246 275 247 276 /*Free ressources:*/
Note:
See TracChangeset
for help on using the changeset viewer.