Changeset 713
- Timestamp:
- 06/02/09 13:30:30 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/ModelProcessorx/Melting/CreateParametersMelting.cpp
r503 r713 20 20 int i; 21 21 22 double* vx=NULL; 23 double* vy=NULL; 24 double* vz=NULL; 22 double* melting=NULL; 25 23 26 24 /*recover parameters : */ … … 29 27 count=parameters->Size(); 30 28 31 /* Now, is the flag macayaealpattyn on? otherwise, do nothing:*/32 if (!model->ismacayealpattyn)return;29 /* get initial melting if transient*/ 30 if(strcmp(model->sub_analysis_type,"transient")==0){ 33 31 34 /*Get vx and vy: */ 35 ModelFetchData((void**)&vx,NULL,NULL,model_handle,"vx","Matrix","Mat"); 36 ModelFetchData((void**)&vy,NULL,NULL,model_handle,"vy","Matrix","Mat"); 37 ModelFetchData((void**)&vz,NULL,NULL,model_handle,"vz","Matrix","Mat"); 32 /*Get melting: */ 33 ModelFetchData((void**)&melting,NULL,NULL,model_handle,"melting","Matrix","Mat"); 34 if(melting) { 35 for(i=0;i<model->numberofnodes;i++)melting[i]=melting[i]/model->yts; //m/s instead of m/yr 36 } 37 else{ 38 for(i=0;i<model->numberofnodes;i++)melting[i]=0; 39 } 38 40 39 if(vx) for(i=0;i<model->numberofnodes;i++)vx[i]=vx[i]/model->yts; 40 if(vy) for(i=0;i<model->numberofnodes;i++)vy[i]=vy[i]/model->yts; 41 if(vz) for(i=0;i<model->numberofnodes;i++)vz[i]=vz[i]/model->yts; 41 count++; 42 param= new Param(count,"melting",DOUBLEVEC); 43 if(melting) param->SetDoubleVec(melting,model->numberofnodes); 44 else param->SetDoubleVec(melting,0); 45 parameters->AddObject(param); 42 46 43 count++; 44 param= new Param(count,"vx",DOUBLEVEC); 45 if(vx) param->SetDoubleVec(vx,model->numberofnodes); 46 else param->SetDoubleVec(vx,0); 47 parameters->AddObject(param); 48 49 count++; 50 param= new Param(count,"vy",DOUBLEVEC); 51 if(vy) param->SetDoubleVec(vy,model->numberofnodes); 52 else param->SetDoubleVec(vy,0); 53 parameters->AddObject(param); 54 55 count++; 56 param= new Param(count,"vz",DOUBLEVEC); 57 if(vz) param->SetDoubleVec(vz,model->numberofnodes); 58 else param->SetDoubleVec(vz,0); 59 parameters->AddObject(param); 60 61 xfree((void**)&vx); 62 xfree((void**)&vy); 63 xfree((void**)&vz); 47 /*Free melting: */ 48 xfree((void**)&melting); 49 } 64 50 65 51 /*Assign output pointer: */ 66 52 *pparameters=parameters; 67 53 } 68 69 -
issm/trunk/src/c/ModelProcessorx/Thermal/CreateParametersThermal.cpp
r548 r713 25 25 double* pressure=NULL; 26 26 double* temperature=NULL; 27 double* melting=NULL;28 27 29 28 /*recover parameters : */ … … 75 74 xfree((void**)&pressure); 76 75 77 /* get initial temperature and meltingif transient*/76 /* get initial temperature if transient*/ 78 77 if(strcmp(model->sub_analysis_type,"transient")==0){ 79 78 80 79 /*Get melting and temperature: */ 81 ModelFetchData((void**)&melting,NULL,NULL,model_handle,"melting","Matrix","Mat");82 if(melting) for(i=0;i<model->numberofnodes;i++)melting[i]=melting[i]/model->yts; //m/s instead of m/yr83 80 ModelFetchData((void**)&temperature,NULL,NULL,model_handle,"temperature","Matrix","Mat"); 84 85 count++;86 param= new Param(count,"melting",DOUBLEVEC);87 if(melting) param->SetDoubleVec(melting,model->numberofnodes);88 else param->SetDoubleVec(melting,0);89 parameters->AddObject(param);90 81 91 82 count++; … … 95 86 parameters->AddObject(param); 96 87 97 /*Free melting and temperature: */ 98 xfree((void**)&melting); 88 /*Free temperature: */ 99 89 xfree((void**)&temperature); 100 90 } -
issm/trunk/src/c/ProcessParamsx/ProcessParamsx.cpp
r613 r713 178 178 179 179 parameters->FindParam((void*)&temperature,"temperature"); 180 parameters->FindParam((void*)&melting,"melting"); 181 182 /*Now, from temperature and melting, build t_g and m_g, correctly partitioned: */ 180 181 /*Now, from temperature , build t_g , correctly partitioned: */ 183 182 t_g=(double*)xcalloc(numberofnodes,sizeof(double)); 184 m_g=(double*)xcalloc(numberofnodes,sizeof(double));185 183 186 184 for(i=0;i<numberofnodes;i++){ 187 185 t_g[(int)(partition[i])]=temperature[i]; 188 m_g[(int)(partition[i])]=melting[i];189 186 } 190 187 … … 195 192 parameters->AddObject(param); 196 193 197 count++;198 param= new Param(count,"m_g",DOUBLEVEC);199 param->SetDoubleVec(m_g,numberofnodes);200 parameters->AddObject(param);201 202 194 /*erase old parameter: */ 203 195 param=(Param*)parameters->FindParamObject("temperature"); 204 196 parameters->DeleteObject((Object*)param); 205 206 param=(Param*)parameters->FindParamObject("melting"); 207 parameters->DeleteObject((Object*)param); 208 } 197 } 198 } 199 200 if(analysis_type==MeltingAnalysisEnum() && sub_analysis_type==TransientAnalysisEnum()){ 201 202 parameters->FindParam((void*)&melting,"melting"); 203 204 /*Now, from melting , build m_g , correctly partitioned: */ 205 m_g=(double*)xcalloc(numberofnodes,sizeof(double)); 206 207 for(i=0;i<numberofnodes;i++){ 208 m_g[(int)(partition[i])]=melting[i]; 209 } 210 211 /*Now, create new parameter: */ 212 count++; 213 param= new Param(count,"m_g",DOUBLEVEC); 214 param->SetDoubleVec(m_g,numberofnodes); 215 parameters->AddObject(param); 216 217 /*erase old parameter: */ 218 param=(Param*)parameters->FindParamObject("melting"); 219 parameters->DeleteObject((Object*)param); 209 220 } 210 221 -
issm/trunk/src/c/parallel/prognostic.cpp
r692 r713 27 27 char* qmuerrname=NULL; 28 28 int numberofnodes; 29 int waitonlock=0;29 int waitonlock=0; 30 30 31 31 FemModel fem; 32 32 33 Vec h_g=NULL;34 Vec u_g=NULL;33 Vec h_g=NULL; 34 Vec u_g=NULL; 35 35 double* u_g_serial=NULL; 36 36 double* h_g_initial=NULL; … … 43 43 DataSet* results=NULL; 44 44 45 46 45 ParameterInputs* inputs=NULL; 47 Param* param=NULL;46 Param* param=NULL; 48 47 49 48 MODULEBOOT(); -
issm/trunk/src/c/parallel/thermal_core.cpp
r654 r713 29 29 Vec* m_g=NULL; 30 30 double* time=NULL; 31 double* t_g_serial=NULL; 32 double* m_g_serial=NULL; 31 33 32 34 /*flags: */ 33 int 34 int 35 int 36 int 37 double 38 double 35 int debug=0; 36 int numberofdofspernode; 37 int numberofnodes; 38 int nsteps; 39 double dt; 40 double ndt; 39 41 40 42 int sub_analysis_type; 41 43 double melting_offset; 42 44 43 Param* 45 Param* param=NULL; 44 46 45 47 /*recover fem models: */ … … 82 84 83 85 //initialize temperature and melting 84 fem_t->parameters->FindParam((void*)&t_g[0],"t_g"); 85 fem_m->parameters->FindParam((void*)&m_g[0],"m_g"); 86 fem_t->parameters->FindParam((void*)&t_g_serial,"t_g"); 87 t_g[0]=SerialToVec(t_g_serial,numberofnodes); 88 xfree((void**)&t_g_serial); 89 fem_m->parameters->FindParam((void*)&m_g_serial,"m_g"); 90 m_g[0]=SerialToVec(m_g_serial,numberofnodes); 91 xfree((void**)&m_g_serial); 86 92 87 93 //erase temperature and melting embedded in parameters … … 123 129 } 124 130 } 125 126 131 } -
issm/trunk/src/c/parallel/thermal_core_nonlinear.cpp
r654 r713 53 53 count=1; 54 54 converged=0; 55 55 56 for(;;){ 56 57
Note:
See TracChangeset
for help on using the changeset viewer.