Changeset 762
- Timestamp:
- 06/04/09 11:52:05 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp
r465 r762 29 29 double* vx_obs=NULL; 30 30 double* vy_obs=NULL; 31 double* u_g_obs=NULL; 32 double* p_g=NULL; 31 33 32 34 /*Get parameters: */ … … 106 108 ModelFetchData((void**)&control_parameter,NULL,NULL,model_handle,model->control_type,"Matrix","Mat"); 107 109 108 if(vx_obs)for(i=0;i<model->numberofnodes;i++)vx_obs[i]=vx_obs[i]/model->yts; 109 if(vy_obs)for(i=0;i<model->numberofnodes;i++)vy_obs[i]=vy_obs[i]/model->yts; 110 u_g_obs=(double*)xcalloc(model->numberofnodes*2,sizeof(double)); 111 if(vx_obs)for(i=0;i<model->numberofnodes;i++)u_g_obs[2*i+0]=vx_obs[i]/model->yts; 112 if(vy_obs)for(i=0;i<model->numberofnodes;i++)u_g_obs[2*i+1]=vy_obs[i]/model->yts; 110 113 111 114 count++; 112 param= new Param(count,"vx_obs",DOUBLEVEC); 113 if(vx_obs) param->SetDoubleVec(vx_obs,model->numberofnodes); 114 else param->SetDoubleVec(vx_obs,0); 115 param= new Param(count,"velocity_observed",DOUBLEVEC); 116 param->SetDoubleVec(u_g_obs,2*model->numberofnodes,2); 115 117 parameters->AddObject(param); 118 119 p_g=(double*)xcalloc(model->numberofnodes*2,sizeof(double)); 120 for(i=0;i<model->numberofnodes;i++)p_g[2*i+0]=parameter[i]; 116 121 117 122 count++; 118 param= new Param(count,"vy_obs",DOUBLEVEC); 119 if(vy_obs) param->SetDoubleVec(vy_obs,model->numberofnodes); 120 else param->SetDoubleVec(vy_obs,0); 123 param= new Param(count,"parameter",DOUBLEVEC); 124 param->SetDoubleVec(p_g,model->numberofnodes,1); 121 125 parameters->AddObject(param); 122 123 count++;124 param= new Param(count,"control_parameter",DOUBLEVEC);125 if(control_parameter) param->SetDoubleVec(control_parameter,model->numberofnodes);126 else param->SetDoubleVec(control_parameter,0);127 parameters->AddObject(param);128 129 126 130 127 xfree((void**)&vx_obs); 131 128 xfree((void**)&vy_obs); 129 xfree((void**)&u_g_obs); 130 xfree((void**)&p_g); 132 131 xfree((void**)&control_parameter); 133 132
Note:
See TracChangeset
for help on using the changeset viewer.