Changeset 1762
- Timestamp:
- 08/18/09 15:52:22 (16 years ago)
- Location:
- issm/trunk/src/c/ModelProcessorx
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
r786 r1762 37 37 int grid1,grid2; 38 38 39 double* dirichletvalues_diag=NULL; 40 double* gridondirichlet_diag=NULL; 39 double* spcvelocity=NULL; 41 40 double* gridonhutter=NULL; 42 41 … … 48 47 49 48 /*Fetch data: */ 50 ModelFetchData((void**)&gridondirichlet_diag,NULL,NULL,model_handle,"gridondirichlet_diag","Matrix","Mat"); 51 ModelFetchData((void**)&dirichletvalues_diag,NULL,NULL,model_handle,"dirichletvalues_diag","Matrix","Mat"); 49 ModelFetchData((void**)&spcvelocity,NULL,NULL,model_handle,"spcvelocity","Matrix","Mat"); 52 50 ModelFetchData((void**)&gridonhutter,NULL,NULL,model_handle,"gridonhutter","Matrix","Mat"); 53 51 … … 61 59 #endif 62 60 63 if ((int) gridondirichlet_diag[i] | (int)gridonhutter[i]){61 if ((int)spcvelocity[6*i+0] | (int)gridonhutter[i]){ 64 62 65 /*This grid needs to be spc'd to vx_obs and vy_obs:*/63 /*This grid needs to be spc'd to vx_obs:*/ 66 64 67 65 spc_sid=count; 68 66 spc_node=i+1; 69 67 spc_dof=1; //we enforce first x translation degree of freedom 70 spc_value=*( dirichletvalues_diag+2*i+0)/model->yts;68 spc_value=*(spcvelocity+6*i+3)/model->yts; 71 69 72 70 spc = new Spc(spc_sid,spc_node,spc_dof,spc_value); 73 71 constraints->AddObject(spc); 74 72 count++; 73 } 74 75 if ((int)spcvelocity[6*i+1] | (int)gridonhutter[i]){ 76 77 /*This grid needs to be spc'd to vy_obs:*/ 75 78 76 79 spc_sid=count; 77 80 spc_node=i+1; 78 81 spc_dof=2; //we enforce first y translation degree of freedom 79 spc_value=*( dirichletvalues_diag+2*i+1)/model->yts;82 spc_value=*(spcvelocity+6*i+4)/model->yts; 80 83 81 84 spc = new Spc(spc_sid,spc_node,spc_dof,spc_value); … … 136 139 137 140 /*Free data: */ 138 xfree((void**)&gridondirichlet_diag); 139 xfree((void**)&dirichletvalues_diag); 141 xfree((void**)&spcvelocity); 140 142 xfree((void**)&gridonhutter); 141 143 -
issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
r1651 r1762 75 75 /*Create pressure loads as boundary conditions. Pay attention to the partitioning if we are running in parallel (the grids 76 76 * referenced by a certain load must belong to the cluster node): */ 77 ModelFetchData((void**)&model-> segmentonneumann_diag,&model->numberofsegs_diag,NULL,model_handle,"segmentonneumann_diag","Matrix","Mat");77 ModelFetchData((void**)&model->pressureload,&model->numberofpressureloads,NULL,model_handle,"pressureload","Matrix","Mat"); 78 78 ModelFetchData((void**)&model->elements_type,NULL,NULL,model_handle,"elements_type","Matrix","Mat"); 79 79 ModelFetchData((void**)&model->thickness,NULL,NULL,model_handle,"thickness","Matrix","Mat"); … … 81 81 82 82 /*First load data:*/ 83 for (i=0;i<model->numberof segs_diag;i++){83 for (i=0;i<model->numberofpressureloads;i++){ 84 84 85 85 if (strcmp(model->meshtype,"2d")==0){ … … 93 93 94 94 95 element=(int)(*(model-> segmentonneumann_diag+segment_width*i+segment_width-1)-1); //element is in the last column95 element=(int)(*(model->pressureload+segment_width*i+segment_width-1)-1); //element is in the last column 96 96 97 97 #ifdef _PARALLEL_ … … 105 105 icefront_mparid=model->numberofelements+1; //matlab indexing 106 106 icefront_sid=i+1; //matlab indexing 107 icefront_eid=(int)*(model-> segmentonneumann_diag+segment_width*i+segment_width-1); //matlab indexing107 icefront_eid=(int)*(model->pressureload+segment_width*i+segment_width-1); //matlab indexing 108 108 icefront_element_type=element_type; 109 109 110 i1=(int)*(model-> segmentonneumann_diag+segment_width*i+0);111 i2=(int)*(model-> segmentonneumann_diag+segment_width*i+1);110 i1=(int)*(model->pressureload+segment_width*i+0); 111 i2=(int)*(model->pressureload+segment_width*i+1); 112 112 113 113 icefront_node_ids[0]=i1; … … 125 125 else if ((int)*(model->elements_type+2*element+0)==PattynFormulationEnum()){ //this is a real 3d element, icefront will be 3d. 126 126 strcpy(icefront_type,"quad"); 127 i3=(int)*(model-> segmentonneumann_diag+segment_width*i+2);128 i4=(int)*(model-> segmentonneumann_diag+segment_width*i+3);127 i3=(int)*(model->pressureload+segment_width*i+2); 128 i4=(int)*(model->pressureload+segment_width*i+3); 129 129 icefront_node_ids[2]=i3; 130 130 icefront_node_ids[3]=i4; … … 146 146 } 147 147 /*Free data: */ 148 xfree((void**)&model-> segmentonneumann_diag);148 xfree((void**)&model->pressureload); 149 149 xfree((void**)&model->elements_type); 150 150 xfree((void**)&model->thickness); -
issm/trunk/src/c/ModelProcessorx/Model.cpp
r1666 r1762 88 88 model->numberofsegs_diag=0; 89 89 model->numberofsegs_diag_stokes=0; 90 model->segmentonneumann_diag=NULL; 91 model->segmentonneumann_diag_stokes=NULL; 92 model-> neumannvalues_diag=NULL; 93 model-> gridondirichlet_diag=NULL; 94 model-> dirichletvalues_diag=NULL; 95 //prognostic 96 model-> segmentonneumann_prog=NULL; 97 model-> neumannvalues_prog=NULL; 98 model-> gridondirichlet_prog=NULL; 99 model-> dirichletvalues_prog=NULL; 100 //prognostic2 101 model-> segmentonneumann_prog2=NULL; 102 model-> neumannvalues_prog2=NULL; 103 //thermal 104 model-> gridondirichlet_thermal=NULL; 105 model-> dirichletvalues_thermal=NULL; 106 model-> geothermalflux=NULL; 90 model->pressureload=NULL; 91 model->pressureload_stokes=NULL; 92 model-> spcvelocity=NULL; 93 model-> spctemperature=NULL; 94 model-> spcthickness=NULL; 107 95 108 96 /*!materials: */ … … 239 227 xfree((void**)&model->gridonicesheet); 240 228 xfree((void**)&model->gridoniceshelf); 241 xfree((void**)&model->segmentonneumann_diag); 242 xfree((void**)&model->segmentonneumann_diag_stokes); 243 xfree((void**)&model->neumannvalues_diag); 244 xfree((void**)&model->gridondirichlet_diag); 245 xfree((void**)&model->dirichletvalues_diag); 246 xfree((void**)&model->segmentonneumann_prog); 247 xfree((void**)&model->neumannvalues_prog); 248 xfree((void**)&model->gridondirichlet_prog); 249 xfree((void**)&model->dirichletvalues_prog); 250 xfree((void**)&model->segmentonneumann_prog2); 251 xfree((void**)&model->neumannvalues_prog2); 252 xfree((void**)&model->gridondirichlet_thermal); 253 xfree((void**)&model->dirichletvalues_thermal); 229 xfree((void**)&model->pressureload); 230 xfree((void**)&model->pressureload_stokes); 231 xfree((void**)&model->spcvelocity); 232 xfree((void**)&model->spcthickness); 233 xfree((void**)&model->spctemperature); 254 234 xfree((void**)&model->geothermalflux); 255 235 xfree((void**)&model->melting); -
issm/trunk/src/c/ModelProcessorx/Model.h
r1666 r1762 84 84 85 85 /*boundary conditions: */ 86 //diagnostic 87 int numberofsegs_diag; 88 int numberofsegs_diag_stokes; 89 double* segmentonneumann_diag; 90 double* neumannvalues_diag; 91 double* gridondirichlet_diag; 92 double* dirichletvalues_diag; 93 double* segmentonneumann_diag_stokes; 94 95 //prognostic 96 double* segmentonneumann_prog; 97 double* neumannvalues_prog; 98 double* gridondirichlet_prog; 99 double* dirichletvalues_prog; 100 //prognostic2 101 double* segmentonneumann_prog2; 102 double* neumannvalues_prog2; 103 //thermal 104 double* gridondirichlet_thermal; 105 double* dirichletvalues_thermal; 86 int numberofpressureloads; 87 int numberofpressureloads_stokes; 88 double* pressureload; 89 double* pressureload_stokes; 90 double* spcvelocity; 91 double* spctemperature; 92 double* spcthickness; 106 93 double* geothermalflux; 107 94
Note:
See TracChangeset
for help on using the changeset viewer.