Changeset 13461
- Timestamp:
- 09/27/12 09:26:29 (13 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
r13438 r13461 27 27 AutodiffDriverEnum, 28 28 AutodiffFosForwardIndexEnum, 29 AutodiffFovForwardIndicesEnum, 29 30 BalancethicknessSpcthicknessEnum, 30 31 BalancethicknessStabilizationEnum, -
issm/trunk-jpl/src/c/modules/AutodiffDriversx/AutodiffDriversx.cpp
r13458 r13461 14 14 15 15 16 /*diverse: */ 16 17 int i; 17 18 int dummy; 19 18 20 bool isautodiff = false; 19 21 int num_dependents; 20 22 int num_independents; 23 char* driver=NULL; 24 25 /*state variables: */ 21 26 IssmDouble *axp = NULL; 22 27 double *xp = NULL; 23 int anIndepIndex; 24 unsigned int * indepIndices = NULL; 25 int tangentDirNum = 2; // <----------- set this via config 26 27 28 28 29 /*AD mode on?: */ 29 30 parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum); … … 33 34 #ifdef _HAVE_ADOLC_ 34 35 36 if(VerboseAutodiff())_pprintLine_(" start AD driver"); 37 38 /*preliminary checks: */ 35 39 parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum); 36 40 parameters->FindParam(&num_independents,AutodiffNumIndependentsEnum); 37 38 41 if(!(num_dependents*num_independents)) return; 39 40 if (tangentDirNum<1 || tangentDirNum>num_independents) { 41 _error_("tangentDirNum should be in [1,num_independents]"); // <------------ fix this error message to relate to config 42 } 43 42 44 43 /*retrieve state variable: */ 45 44 parameters->FindParam(&axp,&dummy,AutodiffXpEnum); … … 54 53 ext_diff_fct *anEDF_for_solverx_p=dynamic_cast<GenericParam<Adolc_edf> * >(parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p; 55 54 56 /*set the forward method function pointers: */ 57 anEDF_for_solverx_p->zos_forward=EDF_for_solverx; 58 anEDF_for_solverx_p->fos_forward=EDF_fos_forward_for_solverx; 59 anEDF_for_solverx_p->fov_forward=EDF_fov_forward_for_solverx; 60 anEDF_for_solverx_p->fos_reverse=EDF_fos_reverse_for_solverx; 61 // anEDF_for_solverx_p->fov_reverse=EDF_fov_reverse_for_solverx; 55 /*Branch according to AD driver: */ 56 parameters->FindParam(&driver,AutodiffDriverEnum); 57 58 if (strcmp(driver,"fos_forward")==0){ 59 60 int anIndepIndex; 61 double *tangentDir=NULL; 62 double *jacTimesTangentDir=NULL; 63 double *theOutput=NULL; 64 65 /*retrieve direction index: */ 66 parameters->FindParam(&anIndepIndex,AutodiffFosForwardIndexEnum); 67 68 tangentDir=xNewZeroInit<double>(num_independents); 69 tangentDir[anIndepIndex]=1.0; 62 70 63 /*allocate the space for the parameters to invoke the forward methods:*/ 64 anEDF_for_solverx_p->dp_x=xNew<double>(anEDF_for_solverx_p->max_n); 65 anEDF_for_solverx_p->dp_X=xNew<double>(anEDF_for_solverx_p->max_n); 66 anEDF_for_solverx_p->dpp_X=xNew<double>(anEDF_for_solverx_p->max_n, tangentDirNum); 67 anEDF_for_solverx_p->dp_y=xNew<double>(anEDF_for_solverx_p->max_m); 68 anEDF_for_solverx_p->dp_Y=xNew<double>(anEDF_for_solverx_p->max_m); 69 anEDF_for_solverx_p->dpp_Y=xNew<double>(anEDF_for_solverx_p->max_m, tangentDirNum); 70 /*allocate the space for the parameters to invoke the reverse methods:*/ 71 anEDF_for_solverx_p->dp_U=xNew<double>(anEDF_for_solverx_p->max_m); 72 anEDF_for_solverx_p->dpp_U=xNew<double>(num_dependents,anEDF_for_solverx_p->max_m); 73 anEDF_for_solverx_p->dp_Z=xNew<double>(anEDF_for_solverx_p->max_n); 74 anEDF_for_solverx_p->dpp_Z=xNew<double>(num_dependents,anEDF_for_solverx_p->max_n); 75 76 /* Call AD driver:*/ 77 if (tangentDirNum==1) { 78 // single direction: 79 double *tangentDir=xNewZeroInit<double>(num_independents); 80 parameters->FindParam(&anIndepIndex,AutodiffFosForwardIndexEnum); 81 tangentDir[anIndepIndex]=1.0; 82 double *jacTimesTangentDir=xNew<double>(num_dependents); 83 double *theOutput=xNew<double>(num_dependents); 84 if (fos_forward(1,num_dependents,num_independents, 0, xp, tangentDir, theOutput, jacTimesTangentDir )) 85 _error_("fos_forward returned non-zero error code"); 86 results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,jacTimesTangentDir,num_dependents,1,1,0.0)); 87 xDelete(theOutput); 88 xDelete(jacTimesTangentDir); 89 xDelete(tangentDir); 71 jacTimesTangentDir=xNew<double>(num_dependents); 72 theOutput=xNew<double>(num_dependents); 73 74 /*set the forward method function pointers: */ 75 anEDF_for_solverx_p->zos_forward=EDF_for_solverx; 76 anEDF_for_solverx_p->fos_forward=EDF_fos_forward_for_solverx; 77 anEDF_for_solverx_p->fos_reverse=EDF_fos_reverse_for_solverx; 78 79 /*allocate the space for the parameters to invoke the forward methods:*/ 80 anEDF_for_solverx_p->dp_x=xNew<double>(anEDF_for_solverx_p->max_n); 81 anEDF_for_solverx_p->dp_X=xNew<double>(anEDF_for_solverx_p->max_n); 82 anEDF_for_solverx_p->dpp_X=xNew<double>(anEDF_for_solverx_p->max_n, 1); 83 anEDF_for_solverx_p->dp_y=xNew<double>(anEDF_for_solverx_p->max_m); 84 anEDF_for_solverx_p->dp_Y=xNew<double>(anEDF_for_solverx_p->max_m); 85 anEDF_for_solverx_p->dpp_Y=xNew<double>(anEDF_for_solverx_p->max_m, 1); 86 87 /*allocate the space for the parameters to invoke the reverse methods:*/ 88 anEDF_for_solverx_p->dp_U=xNew<double>(anEDF_for_solverx_p->max_m); 89 anEDF_for_solverx_p->dpp_U=xNew<double>(num_dependents,anEDF_for_solverx_p->max_m); 90 anEDF_for_solverx_p->dp_Z=xNew<double>(anEDF_for_solverx_p->max_n); 91 anEDF_for_solverx_p->dpp_Z=xNew<double>(num_dependents,anEDF_for_solverx_p->max_n); 92 93 /*call driver: */ 94 if (fos_forward(1,num_dependents,num_independents, 0, xp, tangentDir, theOutput, jacTimesTangentDir )) _error_("fos_forward returned non-zero error code"); 95 96 /*add to results*/ 97 results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,jacTimesTangentDir,num_dependents,1,1,0.0)); 98 99 /*free ressources :*/ 100 xDelete(theOutput); 101 xDelete(jacTimesTangentDir); 102 xDelete(tangentDir); 90 103 } 91 else { 92 // full Jacobian or Jacobian projection: 93 double **jacTimesSeed=xNew<double>(num_dependents,tangentDirNum); 94 if (tangentDirNum<num_independents) { 95 double **seed=xNewZeroInit<double>(num_independents,tangentDirNum); 96 97 // <<<<<<< from here <<<<<<<<<<<< 98 unsigned int * indepIndices=xNew<unsigned int>(tangentDirNum); 99 for(int i =0; i< tangentDirNum;++i) { 100 indepIndices[i]=i; 101 } 102 // <<<<<<<< to here << get this vector of independent indices from the config - should be 0 based and ideally also unsigned 103 104 // collect indices in a set to prevent accidental duplicates as long as we don't do compression: 105 std::set<unsigned int> anIndexSet; 106 for (int i=0; i<tangentDirNum; ++i) { 107 // make sure the index is in range 108 if (indepIndices[i]>num_independents) { 109 _error_("indepIndices values must be in [0,num_independents-1]"); 110 } 111 if (anIndexSet.find(indepIndices[i])!=anIndexSet.end()) { 112 _error_("duplicate indepIndices values are not allowed until we implement Jacobian decompression"); 113 } 114 anIndexSet.insert(indepIndices[i]); 115 // now populate the seed matrix from the set of independent indices; 116 // simple setup with a single 1.0 per column and at most a single 1.0 per row 117 seed[indepIndices[i]][i]=1.0; 118 } 119 double *theOutput=xNew<double>(num_dependents); 120 if (fov_forward(1,num_dependents,num_independents, tangentDirNum, xp, seed, theOutput, jacTimesSeed )) { 121 _error_("fov_forward returned non-zero error code"); 122 } 123 xDelete(theOutput); 124 xDelete(indepIndices); 125 xDelete(seed); 126 } 127 else { 128 if (jacobian(1,num_dependents,num_independents,xp,jacTimesSeed)) { 129 _error_("jacobian returned non-zero error code"); 130 } 131 } 132 results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,*jacTimesSeed,num_dependents*tangentDirNum,1,1,0.0)); 133 xDelete(jacTimesSeed); 104 else if ((strcmp(driver,"fov_forward")==0) || (strcmp(driver,"fov_forward")==0)){ 105 106 int* indepIndices=NULL; 107 int tangentDirNum; 108 int dummy; 109 double **jacTimesSeed=NULL; 110 double **seed=NULL; 111 double *theOutput=NULL; 112 std::set<unsigned int> anIndexSet; 113 114 115 /*retrieve directions:*/ 116 if (strcmp(driver,"jacobian")==0){ 117 tangentDirNum=num_independents; 118 indepIndices=xNewZeroInit<int>(tangentDirNum); 119 for(i=0;i<num_independents;i++)indepIndices[i]=1; 120 } 121 else{ 122 parameters->FindParam(&indepIndices,&tangentDirNum,&dummy,AutodiffFovForwardIndicesEnum); 123 } 124 125 /*Some checks: */ 126 if (tangentDirNum<1 || tangentDirNum>num_independents) _error_("tangentDirNum should be in [1,num_independents]"); 127 128 /* full Jacobian or Jacobian projection:*/ 129 jacTimesSeed=xNew<double>(num_dependents,tangentDirNum); 130 131 /*set the forward method function pointers: */ 132 anEDF_for_solverx_p->zos_forward=EDF_for_solverx; 133 anEDF_for_solverx_p->fov_forward=EDF_fov_forward_for_solverx; 134 // anEDF_for_solverx_p->fov_reverse=EDF_fov_reverse_for_solverx; 135 136 /*allocate the space for the parameters to invoke the forward methods:*/ 137 anEDF_for_solverx_p->dp_x=xNew<double>(anEDF_for_solverx_p->max_n); 138 anEDF_for_solverx_p->dp_X=xNew<double>(anEDF_for_solverx_p->max_n); 139 anEDF_for_solverx_p->dpp_X=xNew<double>(anEDF_for_solverx_p->max_n, tangentDirNum); 140 anEDF_for_solverx_p->dp_y=xNew<double>(anEDF_for_solverx_p->max_m); 141 anEDF_for_solverx_p->dp_Y=xNew<double>(anEDF_for_solverx_p->max_m); 142 anEDF_for_solverx_p->dpp_Y=xNew<double>(anEDF_for_solverx_p->max_m, tangentDirNum); 143 144 /*allocate the space for the parameters to invoke the reverse methods:*/ 145 anEDF_for_solverx_p->dp_U=xNew<double>(anEDF_for_solverx_p->max_m); 146 anEDF_for_solverx_p->dpp_U=xNew<double>(num_dependents,anEDF_for_solverx_p->max_m); 147 anEDF_for_solverx_p->dp_Z=xNew<double>(anEDF_for_solverx_p->max_n); 148 anEDF_for_solverx_p->dpp_Z=xNew<double>(num_dependents,anEDF_for_solverx_p->max_n); 149 150 /*seed matrix: */ 151 seed=xNewZeroInit<double>(num_independents,tangentDirNum); 152 153 /*collect indices in a set to prevent accidental duplicates as long as we don't do compression:*/ 154 for (int i=0; i<tangentDirNum; ++i) { 155 /* make sure the index is in range*/ 156 if (indepIndices[i]>num_independents) { 157 _error_("indepIndices values must be in [0,num_independents-1]"); 158 } 159 if (anIndexSet.find(indepIndices[i])!=anIndexSet.end()) { 160 _error_("duplicate indepIndices values are not allowed until we implement Jacobian decompression"); 161 } 162 anIndexSet.insert(indepIndices[i]); 163 /* now populate the seed matrix from the set of independent indices; 164 * simple setup with a single 1.0 per column and at most a single 1.0 per row*/ 165 seed[indepIndices[i]][i]=1.0; 166 } 167 168 /*allocate output: */ 169 theOutput=xNew<double>(num_dependents); 170 171 /*call driver: */ 172 if (strcmp(driver,"fov_forward")==0){ 173 if (fov_forward(1,num_dependents,num_independents, tangentDirNum, xp, seed, theOutput, jacTimesSeed )) _error_("fov_forward returned non-zero error code"); 174 } 175 else{ 176 if (jacobian(1,num_dependents,num_independents,xp,jacTimesSeed)) _error_("jacobian returned non-zero error code"); 177 } 178 179 /*Free ressources: */ 180 xDelete(theOutput); 181 xDelete(indepIndices); 182 xDelete(seed); 183 184 /*add to results: */ 185 results->AddObject(new GenericExternalResult<IssmPDouble*>(results->Size()+1,AutodiffJacobianEnum,*jacTimesSeed,num_dependents*tangentDirNum,1,1,0.0)); 186 187 /*Free ressources: */ 188 xDelete(jacTimesSeed); 189 xDelete<int>(indepIndices); 134 190 } 191 else _error_("driver: " << driver << " not yet supported!"); 135 192 136 193 /* delete the allocated space for the parameters:*/ … … 149 206 xDelete(xp); 150 207 xDelete(axp); 208 209 if(VerboseAutodiff())_pprintLine_(" end AD driver"); 151 210 152 211 #else -
issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
r13438 r13461 32 32 case AutodiffDriverEnum : return "AutodiffDriver"; 33 33 case AutodiffFosForwardIndexEnum : return "AutodiffFosForwardIndex"; 34 case AutodiffFovForwardIndicesEnum : return "AutodiffFovForwardIndices"; 34 35 case BalancethicknessSpcthicknessEnum : return "BalancethicknessSpcthickness"; 35 36 case BalancethicknessStabilizationEnum : return "BalancethicknessStabilization"; -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp
r13432 r13461 22 22 int* types=NULL; 23 23 int dummy; 24 char* autodiff_driver=NULL; 25 int* indices=NULL; 26 int num_indices; 24 27 25 28 IssmDouble* xp=NULL; … … 37 40 38 41 /*retrieve driver: */ 42 iomodel->Constant(&autodiff_driver,AutodiffDriverEnum); 39 43 parameters->AddObject(iomodel->CopyConstantObject(AutodiffDriverEnum)); 40 parameters->AddObject(iomodel->CopyConstantObject(AutodiffFosForwardIndexEnum)); 44 45 if(strcmp(autodiff_driver,"fos_forward")==0){ 46 parameters->AddObject(iomodel->CopyConstantObject(AutodiffFosForwardIndexEnum)); 47 } 48 else if(strcmp(autodiff_driver,"fov_forward")==0){ 49 /*Retrieve list of indices: */ 50 iomodel->FetchData(&indices,&num_indices,&dummy,AutodiffFovForwardIndicesEnum); 51 parameters->AddObject(new IntMatParam(AutodiffFovForwardIndicesEnum,indices,num_indices,1)); 52 xDelete<int>(indices); 53 } 41 54 42 55 /*Deal with dependents first: {{{*/ … … 92 105 /*Assign output pointer: */ 93 106 *pparameters=parameters; 107 94 108 } 95 109 } -
issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
r13438 r13461 33 33 else if (strcmp(name,"AutodiffDriver")==0) return AutodiffDriverEnum; 34 34 else if (strcmp(name,"AutodiffFosForwardIndex")==0) return AutodiffFosForwardIndexEnum; 35 else if (strcmp(name,"AutodiffFovForwardIndices")==0) return AutodiffFovForwardIndicesEnum; 35 36 else if (strcmp(name,"BalancethicknessSpcthickness")==0) return BalancethicknessSpcthicknessEnum; 36 37 else if (strcmp(name,"BalancethicknessStabilization")==0) return BalancethicknessStabilizationEnum; … … 137 138 else if (strcmp(name,"MeshElementonsurface")==0) return MeshElementonsurfaceEnum; 138 139 else if (strcmp(name,"MeshElements2d")==0) return MeshElements2dEnum; 139 else if (strcmp(name,"MeshElements")==0) return MeshElementsEnum;140 140 else stage=2; 141 141 } 142 142 if(stage==2){ 143 if (strcmp(name,"MeshLowerelements")==0) return MeshLowerelementsEnum; 143 if (strcmp(name,"MeshElements")==0) return MeshElementsEnum; 144 else if (strcmp(name,"MeshLowerelements")==0) return MeshLowerelementsEnum; 144 145 else if (strcmp(name,"MeshNumberofedges")==0) return MeshNumberofedgesEnum; 145 146 else if (strcmp(name,"MeshNumberofelements2d")==0) return MeshNumberofelements2dEnum; … … 260 261 else if (strcmp(name,"TransientSolution")==0) return TransientSolutionEnum; 261 262 else if (strcmp(name,"Approximation")==0) return ApproximationEnum; 262 else if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum;263 263 else stage=3; 264 264 } 265 265 if(stage==3){ 266 if (strcmp(name,"HutterApproximation")==0) return HutterApproximationEnum; 266 if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum; 267 else if (strcmp(name,"HutterApproximation")==0) return HutterApproximationEnum; 267 268 else if (strcmp(name,"MacAyealApproximation")==0) return MacAyealApproximationEnum; 268 269 else if (strcmp(name,"MacAyealPattynApproximation")==0) return MacAyealPattynApproximationEnum; … … 383 384 else if (strcmp(name,"TemperatureOld")==0) return TemperatureOldEnum; 384 385 else if (strcmp(name,"TemperaturePicard")==0) return TemperaturePicardEnum; 385 else if (strcmp(name,"TemperatureSurface")==0) return TemperatureSurfaceEnum;386 386 else stage=4; 387 387 } 388 388 if(stage==4){ 389 if (strcmp(name,"TemperatureBasal")==0) return TemperatureBasalEnum; 389 if (strcmp(name,"TemperatureSurface")==0) return TemperatureSurfaceEnum; 390 else if (strcmp(name,"TemperatureBasal")==0) return TemperatureBasalEnum; 390 391 else if (strcmp(name,"ThicknessAbsMisfit")==0) return ThicknessAbsMisfitEnum; 391 392 else if (strcmp(name,"Type")==0) return TypeEnum; … … 506 507 else if (strcmp(name,"Option")==0) return OptionEnum; 507 508 else if (strcmp(name,"GenericOption")==0) return GenericOptionEnum; 508 else if (strcmp(name,"OptionCell")==0) return OptionCellEnum;509 509 else stage=5; 510 510 } 511 511 if(stage==5){ 512 if (strcmp(name,"OptionChar")==0) return OptionCharEnum; 512 if (strcmp(name,"OptionCell")==0) return OptionCellEnum; 513 else if (strcmp(name,"OptionChar")==0) return OptionCharEnum; 513 514 else if (strcmp(name,"OptionStruct")==0) return OptionStructEnum; 514 515 else if (strcmp(name,"OptionDouble")==0) return OptionDoubleEnum; -
issm/trunk-jpl/src/m/classes/autodiff.m
r13429 r13461 29 29 30 30 %Driver value: 31 md = checkfield(md,'autodiff.driver','values',{'fos_forward'}); 31 md = checkfield(md,'autodiff.driver','values',{'fos_forward','fov_forward'}); 32 33 %go through our dependents and independents and check consistency: 34 for i=1:numel(obj.dependents), 35 dep=obj.dependents{i}; 36 md=checkconsistency(dep,md,solution,analyses); 37 end 38 for i=1:numel(obj.independents), 39 indep=obj.independents{i}; 40 md=checkconsistency(indep,md,i,solution,analyses,obj.driver); 41 end 42 32 43 33 44 end % }}} … … 37 48 fielddisplay(obj,'dependents','list of dependent variables'); 38 49 fielddisplay(obj,'independents','list of independent variables'); 39 fielddisplay(obj,'driver','ADOLC driver ');50 fielddisplay(obj,'driver','ADOLC driver (''fos_forward'' or ''fov_forward'''); 40 51 end % }}} 41 52 function marshall(obj,fid) % {{{ … … 101 112 end 102 113 end 103 WriteData(fid,'data',index-1,'enum',AutodiffFosForwardIndexEnum(),'format','Integer'); %c-index numbering. 114 index=index-1; %get c-index numbering going 115 WriteData(fid,'data',index,'enum',AutodiffFosForwardIndexEnum(),'format','Integer'); 104 116 end 117 %if driver is fov_forward, build indices: 118 if strcmpi(obj.driver,'fov_forward'), 119 indices=0; 120 121 for i=1:num_independent_objects, 122 indep=obj.independents{i}; 123 if ~isempty(indep.fos_forward_index), 124 indices=indices+indep.fov_forward_indices; 125 break; 126 else 127 if strcmpi(indep.type,'scalar'), 128 indices=indices+1; 129 else 130 indices=indices+indep.nods; 131 end 132 end 133 end 134 indices=indices-1; %get c-indices numbering going 135 136 WriteData(fid,'data',indices,'enum',AutodiffFovForwardIndicesEnum,'format','IntMat','mattype',3); 137 end 138 105 139 end % }}} 106 140 end -
issm/trunk-jpl/src/m/classes/independent.m
r13429 r13461 9 9 type = ''; 10 10 fos_forward_index = NaN; 11 fov_forward_indices = []; 11 12 nods = 0; 12 13 end … … 26 27 27 28 end % }}} 28 function md = checkconsistency(obj,md, solution,analyses) % {{{29 function md = checkconsistency(obj,md,i,solution,analyses,driver) % {{{ 29 30 %do nothing for now 30 31 if ~isnan(obj.fos_forward_index), 32 if ~strcmpi(driver,'fos_forward'), 33 error('cannot declare an independent with a fos_forward_index when the driver is not fos_forward!'); 34 end 31 35 if obj.nods==0, 32 36 error('independent checkconsistency error: nods should be set to the size of the independent variable'); 33 37 end 34 38 end 39 40 if ~isempty(obj.fov_forward_indices), 41 if ~strcmpi(driver,'fov_forward'), 42 error('cannot declare an independent with fov_forward_indices when the driver is not fov_forward!'); 43 end 44 45 if obj.nods==0, 46 error('independent checkconsistency error: nods should be set to the size of the independent variable'); 47 end 48 md = checkfield(md,['autodiff.independents{' num2str(i) '}.fov_forward_indices'],'>=',1,'<=',obj.nods,'size',[NaN 1]); 49 end 50 35 51 36 52 end % }}} … … 43 59 fielddisplay(obj,'fos_forward_index','index for fos_foward driver of ADOLC'); 44 60 end 45 61 if ~isnan(obj.fov_forward_indices), 62 fielddisplay(obj,'fov_forward_indices','indices for fov_foward driver of ADOLC'); 63 end 46 64 end % }}} 47 65 function scalar=typetoscalar(obj) % {{{ -
issm/trunk-jpl/src/m/enum/EnumDefinitions.py
r13438 r13461 159 159 return StringToEnum('AutodiffFosForwardIndex')[0] 160 160 161 def AutodiffFovForwardIndicesEnum(): 162 """ 163 AUTODIFFFOVFORWARDINDICESENUM - Enum of AutodiffFovForwardIndices 164 165 Usage: 166 macro=AutodiffFovForwardIndicesEnum() 167 """ 168 169 return StringToEnum('AutodiffFovForwardIndices')[0] 170 161 171 def BalancethicknessSpcthicknessEnum(): 162 172 """ … … 4877 4887 """ 4878 4888 4879 return 48 64880 4889 return 487 4890 -
issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
r13438 r13461 9 9 % macro=MaximumNumberOfEnums() 10 10 11 macro=48 6;11 macro=487; -
issm/trunk-jpl/test/NightlyRun/ad.m
r13438 r13461 6 6 7 7 md.autodiff.isautodiff=true; 8 md.verbose.autodiff=true; 8 9 index=1; 9 10 md.autodiff.independents={... 10 independent('name','Thickness','type','vertex','nods',md.mesh.numberofvertices,'fos_forward_index',index) 11 independent('name','Thickness','type','vertex','nods',md.mesh.numberofvertices,'fov_forward_indices',(1:md.mesh.numberofvertices)') 12 %independent('name','Thickness','type','vertex','nods',md.mesh.numberofvertices,'fos_forward_index',index) 11 13 }; 12 14 13 15 md.autodiff.dependents={... 14 16 dependent('name','IceVolume','type','scalar')... 17 dependent('name','MaxVel','type','scalar')... 15 18 }; 16 md.autodiff.driver='fos_forward'; 19 %md.autodiff.driver='fos_forward'; 20 md.autodiff.driver='fov_forward'; 17 21 18 22 md=solve(md,TransientSolutionEnum);
Note:
See TracChangeset
for help on using the changeset viewer.