Changeset 3696
- Timestamp:
- Oct 4, 2006, 5:38:07 PM (18 years ago)
- Location:
- anuga_core/source
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/shallow_water_ext.c
r3689 r3696 630 630 *ymom_vertex_values, 631 631 *elevation_vertex_values; 632 PyObject *domain, *Tmp _w, *Tmp_w_dry, *Tmp_uh, *Tmp_uh_dry, *Tmp_vh, *Tmp_vh_dry;632 PyObject *domain, *Tmp; 633 633 //Local variables 634 634 double a, b;//gradient vector, not stored but used to calculate vertex values from centroids … … 639 639 double hc, h0, h1, h2; 640 640 double beta_w, beta_w_dry, beta_uh, beta_uh_dry, beta_vh, beta_vh_dry, beta_tmp; 641 double minimum_allowed_height; 641 642 //provisional jumps from centroids to v'tices and safety factor re limiting 642 643 //by which these jumps are limited … … 661 662 662 663 //get the safety factor beta_w, set in the config.py file. This is used in the limiting process 663 Tmp _w= PyObject_GetAttrString(domain, "beta_w");664 if (!Tmp _w)665 return NULL; 666 beta_w = PyFloat_AsDouble(Tmp _w);667 Py_DECREF(Tmp _w);664 Tmp = PyObject_GetAttrString(domain, "beta_w"); 665 if (!Tmp) 666 return NULL; 667 beta_w = PyFloat_AsDouble(Tmp); 668 Py_DECREF(Tmp); 668 669 669 Tmp _w_dry= PyObject_GetAttrString(domain, "beta_w_dry");670 if (!Tmp _w_dry)671 return NULL; 672 beta_w_dry = PyFloat_AsDouble(Tmp _w_dry);673 Py_DECREF(Tmp _w_dry);670 Tmp = PyObject_GetAttrString(domain, "beta_w_dry"); 671 if (!Tmp) 672 return NULL; 673 beta_w_dry = PyFloat_AsDouble(Tmp); 674 Py_DECREF(Tmp); 674 675 675 Tmp _uh= PyObject_GetAttrString(domain, "beta_uh");676 if (!Tmp _uh)677 return NULL; 678 beta_uh = PyFloat_AsDouble(Tmp _uh);679 Py_DECREF(Tmp _uh);676 Tmp = PyObject_GetAttrString(domain, "beta_uh"); 677 if (!Tmp) 678 return NULL; 679 beta_uh = PyFloat_AsDouble(Tmp); 680 Py_DECREF(Tmp); 680 681 681 Tmp _uh_dry= PyObject_GetAttrString(domain, "beta_uh_dry");682 if (!Tmp _uh_dry)683 return NULL; 684 beta_uh_dry = PyFloat_AsDouble(Tmp _uh_dry);685 Py_DECREF(Tmp _uh_dry);686 687 Tmp _vh= PyObject_GetAttrString(domain, "beta_vh");688 if (!Tmp _vh)689 return NULL; 690 beta_vh = PyFloat_AsDouble(Tmp _vh);691 Py_DECREF(Tmp _vh);682 Tmp = PyObject_GetAttrString(domain, "beta_uh_dry"); 683 if (!Tmp) 684 return NULL; 685 beta_uh_dry = PyFloat_AsDouble(Tmp); 686 Py_DECREF(Tmp); 687 688 Tmp = PyObject_GetAttrString(domain, "beta_vh"); 689 if (!Tmp) 690 return NULL; 691 beta_vh = PyFloat_AsDouble(Tmp); 692 Py_DECREF(Tmp); 692 693 693 Tmp_vh_dry = PyObject_GetAttrString(domain, "beta_vh_dry"); 694 if (!Tmp_vh_dry) 695 return NULL; 696 beta_vh_dry = PyFloat_AsDouble(Tmp_vh_dry); 697 Py_DECREF(Tmp_vh_dry); 694 Tmp = PyObject_GetAttrString(domain, "beta_vh_dry"); 695 if (!Tmp) 696 return NULL; 697 beta_vh_dry = PyFloat_AsDouble(Tmp); 698 Py_DECREF(Tmp); 699 700 Tmp = PyObject_GetAttrString(domain, "minimum_allowed_height"); 701 if (!Tmp) 702 return NULL; 703 minimum_allowed_height = PyFloat_AsDouble(Tmp); 704 Py_DECREF(Tmp); 698 705 699 706 number_of_elements = stage_centroid_values -> dimensions[0]; … … 779 786 hmin = qmin; 780 787 beta_tmp = beta_w; 781 if (hmin< 0.001)788 if (hmin<minimum_allowed_height) 782 789 beta_tmp = beta_w_dry; 783 790 limit_gradient(dqv,qmin,qmax,beta_tmp);//the gradient will be limited … … 804 811 find_qmin_and_qmax(dq0,dq1,dq2,&qmin,&qmax); 805 812 beta_tmp = beta_uh; 806 if (hmin< 0.001)813 if (hmin<minimum_allowed_height) 807 814 beta_tmp = beta_uh_dry; 808 815 limit_gradient(dqv,qmin,qmax,beta_tmp);//the gradient will be limited … … 829 836 find_qmin_and_qmax(dq0,dq1,dq2,&qmin,&qmax); 830 837 beta_tmp = beta_vh; 831 if (hmin< 0.001)838 if (hmin<minimum_allowed_height) 832 839 beta_tmp = beta_vh_dry; 833 840 limit_gradient(dqv,qmin,qmax,beta_tmp);//the gradient will be limited -
anuga_core/source/anuga_parallel/run_parallel_sw_rectangle.py
r3678 r3696 117 117 domain.beta_vh_dry = 0.2 118 118 119 domain.beta_w = 0.9 120 domain.beta_w_dry = 0.9 121 domain.beta_uh = 0.9 122 domain.beta_uh_dry = 0.9 123 domain.beta_vh = 0.9 124 domain.beta_vh_dry = 0.9 125 119 126 yieldstep = 0.005 120 127 finaltime = 1.0
Note: See TracChangeset
for help on using the changeset viewer.