浏览代码

Use cell array in r.gwflow to store the boundary conditions

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41642 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 15 年之前
父节点
当前提交
ee493a8b5c
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      lib/gpde/N_gwflow.c
  2. 2 2
      raster/r.gwflow/main.c

+ 2 - 2
lib/gpde/N_gwflow.c

@@ -154,7 +154,7 @@ N_gwflow_data2d *N_alloc_gwflow_data2d(int cols, int rows, int river,
 
 
     data->phead = N_alloc_array_2d(cols, rows, 1, DCELL_TYPE);
     data->phead = N_alloc_array_2d(cols, rows, 1, DCELL_TYPE);
     data->phead_start = N_alloc_array_2d(cols, rows, 1, DCELL_TYPE);
     data->phead_start = N_alloc_array_2d(cols, rows, 1, DCELL_TYPE);
-    data->status = N_alloc_array_2d(cols, rows, 1, DCELL_TYPE);
+    data->status = N_alloc_array_2d(cols, rows, 1, CELL_TYPE);
     data->hc_x = N_alloc_array_2d(cols, rows, 1, DCELL_TYPE);
     data->hc_x = N_alloc_array_2d(cols, rows, 1, DCELL_TYPE);
     data->hc_y = N_alloc_array_2d(cols, rows, 1, DCELL_TYPE);
     data->hc_y = N_alloc_array_2d(cols, rows, 1, DCELL_TYPE);
     data->q = N_alloc_array_2d(cols, rows, 1, DCELL_TYPE);
     data->q = N_alloc_array_2d(cols, rows, 1, DCELL_TYPE);
@@ -672,7 +672,7 @@ N_gwflow_2d_calc_water_budget(N_gwflow_data2d * data, N_geom_data * geom, N_arra
     for (y = 0; y < rows; y++) {
     for (y = 0; y < rows; y++) {
 	G_percent(y, rows - 1, 10);
 	G_percent(y, rows - 1, 10);
 	for (x = 0; x < cols; x++) {
 	for (x = 0; x < cols; x++) {
-	    stat = (int)N_get_array_2d_d_value(data->status, x, y);
+	    stat = N_get_array_2d_c_value(data->status, x, y);
 
 
             val = 0.0;
             val = 0.0;
 
 

+ 2 - 2
raster/r.gwflow/main.c

@@ -333,7 +333,7 @@ int main(int argc, char *argv[])
     /* Set the inactive values to zero, to assure a no flow boundary */
     /* Set the inactive values to zero, to assure a no flow boundary */
     for (y = 0; y < geom->rows; y++) {
     for (y = 0; y < geom->rows; y++) {
 	for (x = 0; x < geom->cols; x++) {
 	for (x = 0; x < geom->cols; x++) {
-	    stat = (int)N_get_array_2d_d_value(data->status, x, y);
+	    stat = N_get_array_2d_c_value(data->status, x, y);
 	    if (stat == N_CELL_INACTIVE) {	/*only inactive cells */
 	    if (stat == N_CELL_INACTIVE) {	/*only inactive cells */
 		N_put_array_2d_d_value(data->hc_x, x, y, 0);
 		N_put_array_2d_d_value(data->hc_x, x, y, 0);
 		N_put_array_2d_d_value(data->hc_y, x, y, 0);
 		N_put_array_2d_d_value(data->hc_y, x, y, 0);
@@ -478,7 +478,7 @@ copy_result(N_array_2d * status, N_array_2d * phead_start, double *result,
     for (y = 0; y < rows; y++) {
     for (y = 0; y < rows; y++) {
 	G_percent(y, rows - 1, 10);
 	G_percent(y, rows - 1, 10);
 	for (x = 0; x < cols; x++) {
 	for (x = 0; x < cols; x++) {
-	    stat = (int)N_get_array_2d_d_value(status, x, y);
+	    stat = N_get_array_2d_c_value(status, x, y);
 	    if (stat == N_CELL_ACTIVE) {	/*only active cells */
 	    if (stat == N_CELL_ACTIVE) {	/*only active cells */
 		d1 = result[count];
 		d1 = result[count];
 		val = (DCELL) d1;
 		val = (DCELL) d1;