Changeset 13483
- Timestamp:
- 09/28/12 17:21:21 (12 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 3 added
- 1 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
r13461 r13483 17 17 AutodiffDependentObjectNamesEnum, 18 18 AutodiffDependentObjectTypesEnum, 19 AutodiffDependentObjectIndicesEnum, 19 20 AutodiffDependentObjectsEnum, 20 21 AutodiffNumIndependentsEnum, … … 156 157 PrognosticRequestedOutputsEnum, 157 158 QmuIsdakotaEnum, 158 QmuMassFluxSegmentsEnum, 159 MassFluxSegmentsEnum, 160 MassFluxSegmentsPresentEnum, 159 161 QmuNumberofpartitionsEnum, 160 162 QmuNumberofresponsesEnum, -
issm/trunk-jpl/src/c/classes/objects/DependentObject.cpp
r13426 r13483 16 16 #include "../../Container/Container.h" 17 17 #include "../../include/include.h" 18 #include "../../modules/Responsex/Responsex.h" 18 19 19 20 /*DependentObject constructors and destructor*/ … … 22 23 this->name=NoneEnum; 23 24 this->type=0; 25 this->index=-1; 24 26 } 25 27 /*}}}*/ 26 /*FUNCTION DependentObject::DependentObject(int in_name, int in_type ){{{*/27 DependentObject::DependentObject(int in_name, int in_type ){28 /*FUNCTION DependentObject::DependentObject(int in_name, int in_type, int in_index){{{*/ 29 DependentObject::DependentObject(int in_name, int in_type,int in_index){ 28 30 29 31 this->name=in_name; 30 32 this->type=in_type; 33 this->index=in_index; 31 34 if(in_type!=0 && in_type!=1)_error_("cannot create an DependentObject of type " << in_type); 32 35 if(in_type==1)_error_("not implemented yet!"); … … 52 55 else 53 56 _error_(" unknown type: " << this->type); 57 if(this->index>=0) _printLine_(" index: " << this->index); 54 58 } 55 59 /*}}}*/ … … 78 82 /*FUNCTION DependentObject::copy{{{*/ 79 83 Object* DependentObject::copy(void) { 80 return new DependentObject(name,type );84 return new DependentObject(name,type,index); 81 85 } /*}}}*/ 82 86 … … 95 99 } 96 100 /*}}}*/ 101 /*FUNCTION DependentObject::Responsex{{{*/ 102 void DependentObject::Responsex(IssmDouble* poutput_value,Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters){ 103 104 if(this->name==MassFluxEnum){ 105 106 /*to identify the mass flux that will be computed, we need the index of the profile: */ 107 parameters->SetParam(this->index,IndexEnum); 108 } 109 110 ::Responsex(poutput_value,elements,nodes,vertices,loads,materials,parameters,this->name,false,0); 111 112 } 113 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/DependentObject.h
r13426 r13483 10 10 #include "../../shared/shared.h" 11 11 /*}}}*/ 12 13 class Elements; 14 class Nodes; 15 class Vertices; 16 class Loads; 17 class Materials; 18 class Parameters; 12 19 13 20 class DependentObject: public Object{ … … 17 24 int name; 18 25 int type; /*0: scalar, 1: vertex*/ 26 int index; /*0: scalar, 1: vertex*/ 19 27 20 28 /*DependentObject constructors, destructors {{{*/ 21 29 DependentObject(); 22 DependentObject(int name, int type );30 DependentObject(int name, int type,int index); 23 31 ~DependentObject(); 24 32 /*}}}*/ … … 34 42 /*DependentObject methods: */ 35 43 int NumDependents(void); 44 void Responsex(IssmDouble* poutput_value,Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters); 36 45 37 46 }; -
issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
r13461 r13483 22 22 case AutodiffDependentObjectNamesEnum : return "AutodiffDependentObjectNames"; 23 23 case AutodiffDependentObjectTypesEnum : return "AutodiffDependentObjectTypes"; 24 case AutodiffDependentObjectIndicesEnum : return "AutodiffDependentObjectIndices"; 24 25 case AutodiffDependentObjectsEnum : return "AutodiffDependentObjects"; 25 26 case AutodiffNumIndependentsEnum : return "AutodiffNumIndependents"; … … 161 162 case PrognosticRequestedOutputsEnum : return "PrognosticRequestedOutputs"; 162 163 case QmuIsdakotaEnum : return "QmuIsdakota"; 163 case QmuMassFluxSegmentsEnum : return "QmuMassFluxSegments"; 164 case MassFluxSegmentsEnum : return "MassFluxSegments"; 165 case MassFluxSegmentsPresentEnum : return "MassFluxSegmentsPresent"; 164 166 case QmuNumberofpartitionsEnum : return "QmuNumberofpartitions"; 165 167 case QmuNumberofresponsesEnum : return "QmuNumberofresponses"; -
issm/trunk-jpl/src/c/modules/MassFluxx/MassFluxx.cpp
r13412 r13483 15 15 Element *element = NULL; 16 16 int element_id; 17 bool ispresent=false; 17 18 18 19 /*output: */ … … 32 33 33 34 /*First, figure out which segment to compute our mass flux on. Start with retrieving qmu_mass_flux_segments: */ 34 parameters->FindParam(&array,&M,&mdims_array,&ndims_array,QmuMassFluxSegmentsEnum); 35 parameters->FindParam(&ispresent,MassFluxSegmentsPresentEnum); 36 if(!ispresent)_error_("no mass flux segments available!"); 37 38 parameters->FindParam(&array,&M,&mdims_array,&ndims_array,MassFluxSegmentsEnum); 35 39 36 40 /*Retrieve index of segments being used for MassFlux computation: */ … … 40 44 segments=array[counter-1]; //matlab to "C" indexing 41 45 num_segments=mdims_array[counter-1]; 42 46 43 47 /*Go through segments, and then elements, and figure out which elements belong to a segment. 44 48 * When we find one, use the element to compute the mass flux on the segment: */ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp
r13461 r13483 61 61 iomodel->FetchData(&names,&dummy,&dummy,AutodiffDependentObjectNamesEnum); 62 62 iomodel->FetchData(&types,&dummy,&dummy,AutodiffDependentObjectTypesEnum); 63 iomodel->FetchData(&indices,&dummy,&dummy,AutodiffDependentObjectIndicesEnum); 63 64 64 65 for(i=0;i<num_dependent_objects;i++){ 65 DependentObject* dep=new DependentObject(names[i],types[i] );66 DependentObject* dep=new DependentObject(names[i],types[i],indices[i]); 66 67 dependent_objects->AddObject(dep); 67 68 num_dep+=dep->NumDependents(); … … 77 78 delete dependent_objects; 78 79 /*}}}*/ 79 80 80 /*Deal with independents: {{{*/ 81 81 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
r13438 r13483 21 21 void CreateParameters(Parameters** pparameters,IoModel* iomodel,char* rootpath,const int solution_type,int analysis_type,int analysis_counter){ 22 22 23 int i ;23 int i,j,m,k; 24 24 int numoutputs; 25 25 Parameters *parameters = NULL; 26 26 IssmDouble *requestedoutputs = NULL; 27 27 bool isdelta18o; 28 29 /*parameters for mass flux: {{{*/ 30 int mass_flux_num_profiles=0; 31 bool mass_flux_present=false; 32 IssmDouble** array=NULL; 33 int* mdims_array=NULL; 34 int* ndims_array=NULL; 35 IssmDouble* temp_matrix=NULL; 36 int temp_m,temp_n; 37 IssmDouble* matrix=NULL; 38 int count; 39 /*}}}*/ 28 40 29 41 if(*pparameters)return; //do not create parameters twice! … … 142 154 if(numoutputs)parameters->AddObject(new IntVecParam(PrognosticRequestedOutputsEnum,requestedoutputs,numoutputs)); 143 155 iomodel->DeleteData(requestedoutputs,PrognosticRequestedOutputsEnum); 156 157 158 /*Deal with mass flux segments: {{{*/ 159 iomodel->FetchData(&mass_flux_present,MassFluxSegmentsPresentEnum); 160 parameters->AddObject(new BoolParam(MassFluxSegmentsPresentEnum,mass_flux_present)); 161 162 if(mass_flux_present){ 163 164 /*Fetch the mass flux segments necessary to compute the mass fluxes. Build a DoubleMatArrayParam object out of them: */ 165 iomodel->FetchData(&array,&mdims_array,&ndims_array,&mass_flux_num_profiles,MassFluxSegmentsEnum); 166 if(mass_flux_num_profiles==0)_error_("mass_flux_num_profiles is 0, when MassFlux computations were requested!"); 167 168 /*Go through segments, and extract those that belong to this cpu: */ 169 for(i=0;i<mass_flux_num_profiles;i++){ 170 temp_matrix=array[i]; 171 temp_m=mdims_array[i]; 172 temp_n=ndims_array[i]; 173 174 m=0; 175 for(j=0;j<temp_m;j++){ 176 if ( iomodel->my_elements[reCast<int>(*(temp_matrix+5*j+4))-1] )m++; 177 } 178 if(m){ 179 matrix=xNewZeroInit<IssmDouble>(5*m); 180 count=0; 181 for(j=0;j<temp_m;j++){ 182 if (iomodel->my_elements[reCast<int>(*(temp_matrix+5*j+4))-1]){ 183 for(k=0;k<5;k++)*(matrix+5*count+k)=*(temp_matrix+5*j+k); 184 count++; 185 } 186 } 187 } 188 else{ 189 matrix=NULL; 190 } 191 192 /*Assign: */ 193 array[i]=matrix; 194 mdims_array[i]=m; 195 ndims_array[i]=5; 196 197 /*Free temporary matrix: */ 198 xDelete<IssmDouble>(temp_matrix); 199 } 200 201 /*Ok, we have an array of segments, different on every cpu. Create a DoubleMatArrayParam object with it: */ 202 parameters->AddObject(new DoubleMatArrayParam(MassFluxSegmentsEnum,array,mass_flux_num_profiles,mdims_array,ndims_array)); 203 204 /*Free data: */ 205 for(i=0;i<mass_flux_num_profiles;i++){ 206 IssmDouble* matrix=array[i]; 207 xDelete<IssmDouble>(matrix); 208 } 209 xDelete<int>(mdims_array); 210 xDelete<int>(ndims_array); 211 xDelete<IssmDouble*>(array); 212 } 213 /*}}}*/ 144 214 145 215 /*Before returning, create parameters in case we are running Qmu or control types runs: */ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp
r13277 r13483 39 39 char tag[50]; 40 40 41 /*parameters for mass flux: */ 42 bool qmu_mass_flux_present=false; 43 int qmu_mass_flux_num_profiles=0; 44 double** array=NULL; 45 int* mdims_array=NULL; 46 int* ndims_array=NULL; 47 48 double* matrix=NULL; 49 double* temp_matrix=NULL; 41 50 42 int M; 51 int temp_m,temp_n;52 43 int m,n; 53 int count;54 44 bool dakota_analysis=false; 55 45 char* name=NULL; … … 140 130 } 141 131 /*}}}*/ 142 /*Deal with data needed to compute qmu responses: {{{*/143 for(i=0;i<numresponsedescriptors;i++){144 145 if(strncmp(responsedescriptors[i],"indexed_MassFlux",16)==0){146 qmu_mass_flux_present=true;147 }148 }149 150 151 if(qmu_mass_flux_present){152 153 /*Fetch the mass flux segments necessary to compute the mass fluxes. Build a DoubleMatArrayParam object out of them: */154 iomodel->FetchData(&array,&mdims_array,&ndims_array,&qmu_mass_flux_num_profiles,QmuMassFluxSegmentsEnum);155 if(qmu_mass_flux_num_profiles==0)_error_("qmu_mass_flux_num_profiles is 0, when MassFlux computations were requested!");156 157 /*Go through segments, and extract those that belong to this cpu: */158 for(i=0;i<qmu_mass_flux_num_profiles;i++){159 temp_matrix=array[i];160 temp_m=mdims_array[i];161 temp_n=ndims_array[i];162 163 m=0;164 for(j=0;j<temp_m;j++){165 if ( iomodel->my_elements[(int)(*(temp_matrix+5*j+4))-1])m++;166 }167 if(m){168 matrix=xNewZeroInit<double>(5*m);169 count=0;170 for(j=0;j<temp_m;j++){171 if (iomodel->my_elements[(int)*(temp_matrix+5*j+4)-1]){172 for(k=0;k<5;k++)*(matrix+5*count+k)=*(temp_matrix+5*j+k);173 count++;174 }175 }176 }177 else{178 matrix=NULL;179 }180 181 /*Assign: */182 array[i]=matrix;183 mdims_array[i]=m;184 ndims_array[i]=5;185 186 /*Free temporary matrix: */187 xDelete<double>(temp_matrix);188 }189 190 /*Ok, we have an array of segments, different on every cpu. Create a DoubleMatArrayParam object with it: */191 parameters->AddObject(new DoubleMatArrayParam(QmuMassFluxSegmentsEnum,array,qmu_mass_flux_num_profiles,mdims_array,ndims_array));192 193 /*Free data: */194 for(i=0;i<qmu_mass_flux_num_profiles;i++){195 double* matrix=array[i];196 xDelete<double>(matrix);197 }198 xDelete<int>(mdims_array);199 xDelete<int>(ndims_array);200 xDelete<double*>(array);201 }202 /*}}}*/203 132 /*Free data: {{{*/ 204 133 for(i=0;i<numresponsedescriptors;i++){ -
issm/trunk-jpl/src/c/modules/RequestedDependentsx/RequestedDependentsx.cpp
r13432 r13483 34 34 for(i=0;i<dependent_objects->Size();i++){ 35 35 DependentObject* dep=(DependentObject*)dependent_objects->GetObjectByOffset(i); 36 Responsex(&output_value,elements,nodes,vertices,loads,materials,parameters,dep->name,false,0);36 dep->Responsex(&output_value,elements,nodes,vertices,loads,materials,parameters); 37 37 output_value>>=dependents[i]; 38 38 } -
issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
r13461 r13483 23 23 else if (strcmp(name,"AutodiffDependentObjectNames")==0) return AutodiffDependentObjectNamesEnum; 24 24 else if (strcmp(name,"AutodiffDependentObjectTypes")==0) return AutodiffDependentObjectTypesEnum; 25 else if (strcmp(name,"AutodiffDependentObjectIndices")==0) return AutodiffDependentObjectIndicesEnum; 25 26 else if (strcmp(name,"AutodiffDependentObjects")==0) return AutodiffDependentObjectsEnum; 26 27 else if (strcmp(name,"AutodiffNumIndependents")==0) return AutodiffNumIndependentsEnum; … … 137 138 else if (strcmp(name,"MeshElementonbed")==0) return MeshElementonbedEnum; 138 139 else if (strcmp(name,"MeshElementonsurface")==0) return MeshElementonsurfaceEnum; 139 else if (strcmp(name,"MeshElements2d")==0) return MeshElements2dEnum;140 140 else stage=2; 141 141 } 142 142 if(stage==2){ 143 if (strcmp(name,"MeshElements")==0) return MeshElementsEnum; 143 if (strcmp(name,"MeshElements2d")==0) return MeshElements2dEnum; 144 else if (strcmp(name,"MeshElements")==0) return MeshElementsEnum; 144 145 else if (strcmp(name,"MeshLowerelements")==0) return MeshLowerelementsEnum; 145 146 else if (strcmp(name,"MeshNumberofedges")==0) return MeshNumberofedgesEnum; … … 165 166 else if (strcmp(name,"PrognosticRequestedOutputs")==0) return PrognosticRequestedOutputsEnum; 166 167 else if (strcmp(name,"QmuIsdakota")==0) return QmuIsdakotaEnum; 167 else if (strcmp(name,"QmuMassFluxSegments")==0) return QmuMassFluxSegmentsEnum; 168 else if (strcmp(name,"MassFluxSegments")==0) return MassFluxSegmentsEnum; 169 else if (strcmp(name,"MassFluxSegmentsPresent")==0) return MassFluxSegmentsPresentEnum; 168 170 else if (strcmp(name,"QmuNumberofpartitions")==0) return QmuNumberofpartitionsEnum; 169 171 else if (strcmp(name,"QmuNumberofresponses")==0) return QmuNumberofresponsesEnum; … … 259 261 else if (strcmp(name,"ThermalAnalysis")==0) return ThermalAnalysisEnum; 260 262 else if (strcmp(name,"ThermalSolution")==0) return ThermalSolutionEnum; 261 else if (strcmp(name,"TransientSolution")==0) return TransientSolutionEnum;262 else if (strcmp(name,"Approximation")==0) return ApproximationEnum;263 263 else stage=3; 264 264 } 265 265 if(stage==3){ 266 if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum; 266 if (strcmp(name,"TransientSolution")==0) return TransientSolutionEnum; 267 else if (strcmp(name,"Approximation")==0) return ApproximationEnum; 268 else if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum; 267 269 else if (strcmp(name,"HutterApproximation")==0) return HutterApproximationEnum; 268 270 else if (strcmp(name,"MacAyealApproximation")==0) return MacAyealApproximationEnum; … … 382 384 else if (strcmp(name,"SurfaceSlopeY")==0) return SurfaceSlopeYEnum; 383 385 else if (strcmp(name,"Temperature")==0) return TemperatureEnum; 384 else if (strcmp(name,"TemperatureOld")==0) return TemperatureOldEnum;385 else if (strcmp(name,"TemperaturePicard")==0) return TemperaturePicardEnum;386 386 else stage=4; 387 387 } 388 388 if(stage==4){ 389 if (strcmp(name,"TemperatureSurface")==0) return TemperatureSurfaceEnum; 389 if (strcmp(name,"TemperatureOld")==0) return TemperatureOldEnum; 390 else if (strcmp(name,"TemperaturePicard")==0) return TemperaturePicardEnum; 391 else if (strcmp(name,"TemperatureSurface")==0) return TemperatureSurfaceEnum; 390 392 else if (strcmp(name,"TemperatureBasal")==0) return TemperatureBasalEnum; 391 393 else if (strcmp(name,"ThicknessAbsMisfit")==0) return ThicknessAbsMisfitEnum; … … 505 507 else if (strcmp(name,"XY")==0) return XYEnum; 506 508 else if (strcmp(name,"XYZP")==0) return XYZPEnum; 507 else if (strcmp(name,"Option")==0) return OptionEnum;508 else if (strcmp(name,"GenericOption")==0) return GenericOptionEnum;509 509 else stage=5; 510 510 } 511 511 if(stage==5){ 512 if (strcmp(name,"OptionCell")==0) return OptionCellEnum; 512 if (strcmp(name,"Option")==0) return OptionEnum; 513 else if (strcmp(name,"GenericOption")==0) return GenericOptionEnum; 514 else if (strcmp(name,"OptionCell")==0) return OptionCellEnum; 513 515 else if (strcmp(name,"OptionChar")==0) return OptionCharEnum; 514 516 else if (strcmp(name,"OptionStruct")==0) return OptionStructEnum; -
issm/trunk-jpl/src/m/classes/autodiff.m
r13461 r13483 58 58 if ~obj.isautodiff, return; end 59 59 60 %process dependent variables 60 %process dependent variables {{{ 61 61 num_dependent_objects=numel(obj.dependents); 62 62 WriteData(fid,'data',num_dependent_objects,'enum',AutodiffNumDependentObjectsEnum(),'format','Integer'); … … 65 65 names=zeros(num_dependent_objects,1); 66 66 types=zeros(num_dependent_objects,1); 67 indices=zeros(num_dependent_objects,1); 67 68 68 69 for i=1:num_dependent_objects, … … 71 72 names(i)=StringToEnum(dep.name); 72 73 types(i)=dep.typetoscalar(); 74 indices(i)=dep.index; 73 75 end 74 76 WriteData(fid,'data',names,'enum',AutodiffDependentObjectNamesEnum(),'format','IntMat','mattype',3); 75 77 WriteData(fid,'data',types,'enum',AutodiffDependentObjectTypesEnum(),'format','IntMat','mattype',3); 78 WriteData(fid,'data',indices,'enum',AutodiffDependentObjectIndicesEnum(),'format','IntMat','mattype',3); 76 79 end 77 78 79 %process independent variables 80 %}}} 81 %process independent variables {{{ 80 82 num_independent_objects=numel(obj.independents); 81 83 WriteData(fid,'data',num_independent_objects,'enum',AutodiffNumIndependentObjectsEnum(),'format','Integer'); … … 94 96 WriteData(fid,'data',types,'enum',AutodiffIndependentObjectTypesEnum(),'format','IntMat','mattype',3); 95 97 end 96 97 %if driver is fos_forward, build index: 98 %}}} 99 %if driver is fos_forward, build index: {{{ 98 100 if strcmpi(obj.driver,'fos_forward'), 99 101 index=0; … … 115 117 WriteData(fid,'data',index,'enum',AutodiffFosForwardIndexEnum(),'format','Integer'); 116 118 end 117 %if driver is fov_forward, build indices: 119 %}}} 120 %if driver is fov_forward, build indices: {{{ 118 121 if strcmpi(obj.driver,'fov_forward'), 119 122 indices=0; … … 136 139 WriteData(fid,'data',indices,'enum',AutodiffFovForwardIndicesEnum,'format','IntMat','mattype',3); 137 140 end 141 %}}} 142 %deal with mass fluxes: {{{ 143 mass_flux_segments=cell(0,1); 144 for i=1:num_dependent_objects, 145 dep=obj.dependents{i}; 146 if strcmpi(dep.name,'MassFlux'), 147 mass_flux_segments{end+1,1}=dep.segments; 148 end 149 end 150 if ~isempty(mass_flux_segments), 151 WriteData(fid,'data',mass_flux_segments,'enum',MassFluxSegmentsEnum,'format','MatArray'); 152 flag=true; 153 WriteData(fid,'data',flag,'enum',MassFluxSegmentsPresentEnum,'format','Boolean'); 154 end 155 %}}} 138 156 139 157 end % }}} -
issm/trunk-jpl/src/m/classes/dependent.m
r13429 r13483 8 8 name = ''; 9 9 type = ''; 10 exp = ''; 11 segments = []; 12 index = -1; 10 13 end 11 14 methods … … 14 17 %use provided options to change fields 15 18 options=pairoptions(varargin{:}); 19 20 obj.name=getfieldvalue(options,'name',''); 21 obj.type=getfieldvalue(options,'type',''); 22 obj.exp=getfieldvalue(options,'exp',''); 23 obj.segments=getfieldvalue(options,'segments',[]); 24 obj.index=getfieldvalue(options,'index',-1); 16 25 17 %OK get other fields 18 obj=AssignObjectFields(pairoptions(varargin{:}),obj); 19 26 %if name is mass flux: 27 if strcmpi(obj.name,'MassFlux'), 28 %make sure that we supplied a file and that it exists! 29 if exist(obj.exp)~=2, 30 error('dependent checkconsistency: specified ''exp'' file does not exist!'); 31 end 32 %process the file and retrieve segments 33 mesh=getfieldvalue(options,'mesh'); 34 obj.segments=MeshProfileIntersection(mesh.elements,mesh.x,mesh.y,obj.exp); 35 end 20 36 end 21 37 %}}} 22 38 function obj = setdefaultparameters(obj) % {{{ 23 %do nothing 24 39 %do nothing 25 40 end % }}} 26 41 function md = checkconsistency(obj,md,solution,analyses) % {{{ 27 42 %do nothing for now 43 if strcmpi(obj.name,'MassFlux'), 44 if isempty(obj.segments), 45 error('dependent checkconsistency error: need segments to compute this dependent response'); 46 end 47 if obj.index<=0, 48 error('dependent checkconsistency error: index for segments should be >=1'); 49 end 50 end 28 51 29 52 end % }}} … … 33 56 fielddisplay(obj,'name','variable name (must match corresponding Enum)'); 34 57 fielddisplay(obj,'type','type of variable (''vertex'' or ''scalar'')'); 58 if ~isempty(obj.exp), 59 fielddisplay(obj,'exp','file needed to compute dependent variable'); 60 fielddisplay(obj,'segments','mass flux segments'); 61 end 35 62 36 63 end % }}} -
issm/trunk-jpl/src/m/classes/qmu.m
r13030 r13483 148 148 WriteData(fid,'object',obj,'fieldname','variabledescriptors','format','StringArray'); 149 149 WriteData(fid,'object',obj,'fieldname','responsedescriptors','format','StringArray'); 150 WriteData(fid,'object',obj,'fieldname','mass_flux_segments','format','MatArray'); 150 WriteData(fid,'data',obj.mass_flux_segments,'enum',MassFluxSegmentsEnum,'format','MatArray'); 151 if ~isempty(mass_flux_segments), 152 flag=true; 153 WriteData(fid,'data',flag,'enum',MassFluxSegmentsPrsentEnum,'format','Boolean'); 154 end 151 155 end % }}} 152 156 end -
issm/trunk-jpl/src/m/enum/EnumDefinitions.py
r13461 r13483 59 59 return StringToEnum('AutodiffDependentObjectTypes')[0] 60 60 61 def AutodiffDependentObjectIndicesEnum(): 62 """ 63 AUTODIFFDEPENDENTOBJECTINDICESENUM - Enum of AutodiffDependentObjectIndices 64 65 Usage: 66 macro=AutodiffDependentObjectIndicesEnum() 67 """ 68 69 return StringToEnum('AutodiffDependentObjectIndices')[0] 70 61 71 def AutodiffDependentObjectsEnum(): 62 72 """ … … 1449 1459 return StringToEnum('QmuIsdakota')[0] 1450 1460 1451 def QmuMassFluxSegmentsEnum(): 1452 """ 1453 QMUMASSFLUXSEGMENTSENUM - Enum of QmuMassFluxSegments 1454 1455 Usage: 1456 macro=QmuMassFluxSegmentsEnum() 1457 """ 1458 1459 return StringToEnum('QmuMassFluxSegments')[0] 1461 def MassFluxSegmentsEnum(): 1462 """ 1463 MASSFLUXSEGMENTSENUM - Enum of MassFluxSegments 1464 1465 Usage: 1466 macro=MassFluxSegmentsEnum() 1467 """ 1468 1469 return StringToEnum('MassFluxSegments')[0] 1470 1471 def MassFluxSegmentsPresentEnum(): 1472 """ 1473 MASSFLUXSEGMENTSPRESENTENUM - Enum of MassFluxSegmentsPresent 1474 1475 Usage: 1476 macro=MassFluxSegmentsPresentEnum() 1477 """ 1478 1479 return StringToEnum('MassFluxSegmentsPresent')[0] 1460 1480 1461 1481 def QmuNumberofpartitionsEnum(): … … 4887 4907 """ 4888 4908 4889 return 48 74890 4909 return 489 4910 -
issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
r13461 r13483 9 9 % macro=MaximumNumberOfEnums() 10 10 11 macro=48 7;11 macro=489; -
issm/trunk-jpl/test/NightlyRun/ad.m
r13473 r13483 1 md=triangle(model,'../Exp/Square.exp', 50000);1 md=triangle(model,'../Exp/Square.exp',100000); 2 2 md=setmask(md,'all',''); 3 3 md=parameterize(md,'../Par/SquareShelfConstrained.par'); … … 15 15 dependent('name','IceVolume','type','scalar')... 16 16 dependent('name','MaxVel','type','scalar')... 17 dependent('name','MassFlux','type','scalar','exp','../Exp/MassFlux1.exp','mesh',md.mesh,'index',1)... 18 dependent('name','MassFlux','type','scalar','exp','../Exp/MassFlux2.exp','mesh',md.mesh,'index',2)... 17 19 }; 20 18 21 %md.autodiff.driver='fos_forward'; 19 22 md.autodiff.driver='fov_forward'; 20 23 21 24 md=solve(md,TransientSolutionEnum); 25 26 %plot 27 nods=md.mesh.numberofvertices; 28 jac=md.results.TransientSolution(1).AutodiffJacobian; 29 plotmodel(md,'data',jac(1:nods),'data',jac(nods+1:2*nods),'data',jac(2*nods+1:3*nods),'data',jac(3*nods+1:4*nods));
Note:
See TracChangeset
for help on using the changeset viewer.