Changeset 16400
- Timestamp:
- 10/11/13 15:07:56 (11 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/DependentObject.cpp
r16314 r16400 15 15 /*FUNCTION DependentObject::DependentObject(){{{*/ 16 16 DependentObject::DependentObject(){ 17 this->name=N oneEnum;17 this->name=NulL; 18 18 this->type=0; 19 19 this->index=-1; … … 23 23 DependentObject::DependentObject(int in_name, int in_type,int in_index){ 24 24 25 this->name= in_name;25 this->name=xNew<char>(strlen(in_name)+1); xMemCpy<char>(this->name,in_name,strlen(in_name)+1); 26 26 this->type=in_type; 27 27 this->index=in_index; … … 33 33 /*FUNCTION DependentObject::~DependentObject() {{{*/ 34 34 DependentObject::~DependentObject(){ //destructor 35 xDelete<char>(this->name); 35 36 } 36 37 /*}}}*/ … … 41 42 42 43 _printf_("DependentObject:\n"); 43 _printf_(" name: " << EnumToStringx(this->name)<< "\n");44 _printf_(" name: " << this->name << "\n"); 44 45 if(this->type==0) 45 46 _printf_(" type: scalar\n"); … … 88 89 void DependentObject::Responsex(IssmDouble* poutput_value,FemModel* femmodel){ 89 90 90 if(this->name==MassFluxEnum){ 91 92 /*to identify the mass flux that will be computed, we need the index of the profile: */ 93 femmodel->parameters->SetParam(this->index,IndexEnum); 91 /*Is this some special type of response for which we need to go in the output definitions? :*/ 92 if (StringToEnumx(this->name,false)==-1){ 93 *poutput_value=OutputDefinitionsResponsex(femmodel,this->name); 94 94 } 95 96 femmodel->Responsex(poutput_value,this->name); 95 else femmodel->Responsex(poutput_value,this->name); 97 96 98 97 } -
issm/trunk-jpl/src/c/classes/DependentObject.h
r15067 r16400 17 17 public: 18 18 19 intname;19 char* name; 20 20 int type; /*0: scalar, 1: vertex*/ 21 21 int index; /*0: scalar, 1: vertex*/ … … 23 23 /*DependentObject constructors, destructors {{{*/ 24 24 DependentObject(); 25 DependentObject( intname, int type,int index);25 DependentObject(char* name, int type,int index); 26 26 ~DependentObject(); 27 27 /*}}}*/ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp
r16252 r16400 15 15 int num_dependent_objects; 16 16 int num_dep=0; 17 int*names=NULL;17 char** names=NULL; 18 18 int* types=NULL; 19 19 int dummy; … … 71 71 72 72 if(num_dependent_objects){ 73 iomodel->FetchData(&names,&dummy, &dummy,AutodiffDependentObjectNamesEnum);73 iomodel->FetchData(&names,&dummy,AutodiffDependentObjectNamesEnum); 74 74 iomodel->FetchData(&types,&dummy,&dummy,AutodiffDependentObjectTypesEnum); 75 75 iomodel->FetchData(&indices,&dummy,&dummy,AutodiffDependentObjectIndicesEnum); -
issm/trunk-jpl/src/m/classes/autodiff.m
r16304 r16400 101 101 102 102 if(num_dependent_objects), 103 names= zeros(num_dependent_objects,1);103 names={}; 104 104 types=zeros(num_dependent_objects,1); 105 105 indices=zeros(num_dependent_objects,1); … … 108 108 dep=obj.dependents{i}; 109 109 110 names (i)=StringToEnum(dep.name);110 names{i}=dep.name; 111 111 types(i)=dep.typetoscalar(); 112 112 indices(i)=dep.index; 113 113 end 114 WriteData(fid,'data',names,'enum',AutodiffDependentObjectNamesEnum(),'format',' IntMat','mattype',3);114 WriteData(fid,'data',names,'enum',AutodiffDependentObjectNamesEnum(),'format','StringArray'); 115 115 WriteData(fid,'data',types,'enum',AutodiffDependentObjectTypesEnum(),'format','IntMat','mattype',3); 116 116 WriteData(fid,'data',indices,'enum',AutodiffDependentObjectIndicesEnum(),'format','IntMat','mattype',3); -
issm/trunk-jpl/src/m/classes/autodiff.py
r16304 r16400 103 103 104 104 if num_dependent_objects: 105 names= numpy.zeros(num_dependent_objects)105 names=[] 106 106 types=numpy.zeros(num_dependent_objects) 107 107 indices=numpy.zeros(num_dependent_objects) 108 108 109 109 for i,dep in enumerate(self.dependents): 110 names[i]= StringToEnum(dep.name)[0]110 names[i]=dep.name 111 111 types[i]=dep.typetoscalar() 112 112 indices[i]=dep.index 113 113 114 WriteData(fid,'data',names,'enum',AutodiffDependentObjectNamesEnum(),'format',' IntMat','mattype',3)114 WriteData(fid,'data',names,'enum',AutodiffDependentObjectNamesEnum(),'format','StringArray') 115 115 WriteData(fid,'data',types,'enum',AutodiffDependentObjectTypesEnum(),'format','IntMat','mattype',3) 116 116 WriteData(fid,'data',indices,'enum',AutodiffDependentObjectIndicesEnum(),'format','IntMat','mattype',3)
Note:
See TracChangeset
for help on using the changeset viewer.