Cython: swDE1_domain_ext.pyx

Generated by Cython 0.29.28

Yellow lines hint at Python interaction.
Click on a line that starts with a "`+`" to see the C code that Cython generated for it.

Raw output: swDE1_domain_ext.c

    +001: #cython: wraparound=False, boundscheck=False, cdivision=True, profile=False, nonecheck=False, overflowcheck=False, cdivision_warnings=False, unraisable_tracebacks=False

      __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     002: import cython

     003:

     004: # import both numpy and the Cython declarations for numpy

    +005: import numpy as np

      __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     006: cimport numpy as np

     007:

     008: cdef extern from "swDE1_domain.c" nogil:

     009: 	struct domain:

     010: 		long number_of_elements

     011: 		double epsilon

     012: 		double H0

     013: 		double g

     014: 		long optimise_dry_cells

     015: 		double evolve_max_timestep

     016: 		long extrapolate_velocity_second_order

     017: 		double minimum_allowed_height

     018: 		double maximum_allowed_speed

     019: 		long low_froude

     020: 		long timestep_fluxcalls

     021: 		double beta_w

     022: 		double beta_w_dry

     023: 		double beta_uh

     024: 		double beta_uh_dry

     025: 		double beta_vh

     026: 		double beta_vh_dry

     027: 		long max_flux_update_frequency

     028: 		long ncol_riverwall_hydraulic_properties

     029: 		long* neighbours

     030: 		long* neighbour_edges

     031: 		long* surrogate_neighbours

     032: 		double* normals

     033: 		double* edgelengths

     034: 		double* radii

     035: 		double* areas

     036: 		long* edge_flux_type

     037: 		long* tri_full_flag

     038: 		long* already_computed_flux

     039: 		double* max_speed

     040: 		double* vertex_coordinates

     041: 		double* edge_coordinates

     042: 		double* centroid_coordinates

     043: 		long* number_of_boundaries

     044: 		double* stage_edge_values

     045: 		double* xmom_edge_values

     046: 		double* ymom_edge_values

     047: 		double* bed_edge_values

     048: 		double* height_edge_values

     049: 		double* stage_centroid_values

     050: 		double* xmom_centroid_values

     051: 		double* ymom_centroid_values

     052: 		double* bed_centroid_values

     053: 		double* height_centroid_values

     054: 		double* stage_vertex_values

     055: 		double* xmom_vertex_values

     056: 		double* ymom_vertex_values

     057: 		double* bed_vertex_values

     058: 		double* height_vertex_values

     059: 		double* stage_boundary_values

     060: 		double* xmom_boundary_values

     061: 		double* ymom_boundary_values

     062: 		double* bed_boundary_values

     063: 		double* stage_explicit_update

     064: 		double* xmom_explicit_update

     065: 		double* ymom_explicit_update

     066: 		long* flux_update_frequency

     067: 		long* update_next_flux

     068: 		long* update_extrapolation

     069: 		double* edge_timestep

     070: 		double* edge_flux_work

     071: 		double* pressuregrad_work

     072: 		double* x_centroid_work

     073: 		double* y_centroid_work

     074: 		double* boundary_flux_sum

     075: 		long* allow_timestep_increase

     076: 		double* riverwall_elevation

     077: 		long* riverwall_rowIndex

     078: 		double* riverwall_hydraulic_properties

     079:

     080: 	struct edge:

     081: 		pass

     082:

     083: 	int _compute_flux_update_frequency(domain* D, double timestep)

     084: 	double _compute_fluxes_central(domain* D, double timestep)

     085: 	double _protect_new(domain* D)

     086: 	int _extrapolate_second_order_edge_sw(domain* D)

     087:

     088:

    +089: cdef int pointer_flag = 0

      __pyx_v_5anuga_13shallow_water_16swDE1_domain_ext_pointer_flag = 0;

    +090: cdef int parameter_flag = 0

      __pyx_v_5anuga_13shallow_water_16swDE1_domain_ext_parameter_flag = 0;

     091:

    +092: cdef inline get_python_domain_parameters(domain *D, object domain_object):

    static CYTHON_INLINE PyObject *__pyx_f_5anuga_13shallow_water_16swDE1_domain_ext_get_python_domain_parameters(struct domain *__pyx_v_D, PyObject *__pyx_v_domain_object) {
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("get_python_domain_parameters", 0);
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("anuga.shallow_water.swDE1_domain_ext.get_python_domain_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     093:

    +094: 	D.number_of_elements = domain_object.number_of_elements

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_number_of_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->number_of_elements = __pyx_t_2;

    +095: 	D.epsilon = domain_object.epsilon

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_epsilon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->epsilon = __pyx_t_3;

    +096: 	D.H0 = domain_object.H0

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_H0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->H0 = __pyx_t_3;

    +097: 	D.g = domain_object.g

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->g = __pyx_t_3;

    +098: 	D.optimise_dry_cells = domain_object.optimise_dry_cells

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_optimise_dry_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->optimise_dry_cells = __pyx_t_2;

    +099: 	D.evolve_max_timestep = domain_object.evolve_max_timestep

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_evolve_max_timestep); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->evolve_max_timestep = __pyx_t_3;

    +100: 	D.minimum_allowed_height = domain_object.minimum_allowed_height

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_minimum_allowed_height); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->minimum_allowed_height = __pyx_t_3;

    +101: 	D.maximum_allowed_speed = domain_object.maximum_allowed_speed

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_maximum_allowed_speed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->maximum_allowed_speed = __pyx_t_3;

    +102: 	D.timestep_fluxcalls = domain_object.timestep_fluxcalls

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_timestep_fluxcalls); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->timestep_fluxcalls = __pyx_t_2;

    +103: 	D.low_froude = domain_object.low_froude

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_low_froude); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->low_froude = __pyx_t_2;

    +104: 	D.extrapolate_velocity_second_order = domain_object.extrapolate_velocity_second_order

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_extrapolate_velocity_second_orde); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->extrapolate_velocity_second_order = __pyx_t_2;

    +105: 	D.beta_w = domain_object.beta_w

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_beta_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->beta_w = __pyx_t_3;

    +106: 	D.beta_w_dry = domain_object.beta_w_dry

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_beta_w_dry); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->beta_w_dry = __pyx_t_3;

    +107: 	D.beta_uh = domain_object.beta_uh

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_beta_uh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->beta_uh = __pyx_t_3;

    +108: 	D.beta_uh_dry = domain_object.beta_uh_dry

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_beta_uh_dry); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->beta_uh_dry = __pyx_t_3;

    +109: 	D.beta_vh = domain_object.beta_vh

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_beta_vh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->beta_vh = __pyx_t_3;

    +110: 	D.beta_vh_dry = domain_object.beta_vh_dry

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_beta_vh_dry); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->beta_vh_dry = __pyx_t_3;

    +111: 	D.max_flux_update_frequency = domain_object.max_flux_update_frequency

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_max_flux_update_frequency); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->max_flux_update_frequency = __pyx_t_2;

     112:

     113:

    +114: cdef inline get_python_domain_pointers(domain *D, object domain_object):

    static CYTHON_INLINE PyObject *__pyx_f_5anuga_13shallow_water_16swDE1_domain_ext_get_python_domain_pointers(struct domain *__pyx_v_D, PyObject *__pyx_v_domain_object) {
      __Pyx_memviewslice __pyx_v_neighbours = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_neighbour_edges = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_normals = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_edgelengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_radii = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_areas = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_edge_flux_type = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_tri_full_flag = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_already_computed_flux = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vertex_coordinates = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_edge_coordinates = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_centroid_coordinates = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_number_of_boundaries = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_surrogate_neighbours = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_max_speed = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_flux_update_frequency = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_update_next_flux = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_update_extrapolation = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_allow_timestep_increase = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_edge_timestep = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_edge_flux_work = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_pressuregrad_work = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_x_centroid_work = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_y_centroid_work = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_boundary_flux_sum = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_riverwall_elevation = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_riverwall_rowIndex = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_riverwall_hydraulic_properties = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_edge_values = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_centroid_values = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vertex_values = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_boundary_values = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_explicit_update = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_quantities = 0;
      PyObject *__pyx_v_riverwallData = 0;
      PyObject *__pyx_v_stage = NULL;
      PyObject *__pyx_v_xmomentum = NULL;
      PyObject *__pyx_v_ymomentum = NULL;
      PyObject *__pyx_v_elevation = NULL;
      PyObject *__pyx_v_height = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("get_python_domain_pointers", 0);
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __Pyx_AddTraceback("anuga.shallow_water.swDE1_domain_ext.get_python_domain_pointers", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_neighbours, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_neighbour_edges, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_normals, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_edgelengths, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_radii, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_areas, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_edge_flux_type, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_tri_full_flag, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_already_computed_flux, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vertex_coordinates, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_edge_coordinates, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_centroid_coordinates, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_number_of_boundaries, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_surrogate_neighbours, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_max_speed, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_flux_update_frequency, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_update_next_flux, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_update_extrapolation, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_allow_timestep_increase, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_edge_timestep, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_edge_flux_work, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_pressuregrad_work, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_x_centroid_work, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_y_centroid_work, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_boundary_flux_sum, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_riverwall_elevation, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_riverwall_rowIndex, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_riverwall_hydraulic_properties, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_edge_values, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_centroid_values, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vertex_values, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_boundary_values, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_explicit_update, 1);
      __Pyx_XDECREF(__pyx_v_quantities);
      __Pyx_XDECREF(__pyx_v_riverwallData);
      __Pyx_XDECREF(__pyx_v_stage);
      __Pyx_XDECREF(__pyx_v_xmomentum);
      __Pyx_XDECREF(__pyx_v_ymomentum);
      __Pyx_XDECREF(__pyx_v_elevation);
      __Pyx_XDECREF(__pyx_v_height);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     115:

     116: 	cdef long[:,::1]   neighbours

     117: 	cdef long[:,::1]   neighbour_edges

     118: 	cdef double[:,::1] normals

     119: 	cdef double[:,::1] edgelengths

     120: 	cdef double[::1]   radii

     121: 	cdef double[::1]   areas

     122: 	cdef long[::1]     edge_flux_type

     123: 	cdef long[::1]     tri_full_flag

     124: 	cdef long[:,::1]   already_computed_flux

     125: 	cdef double[:,::1] vertex_coordinates

     126: 	cdef double[:,::1] edge_coordinates

     127: 	cdef double[:,::1] centroid_coordinates

     128: 	cdef long[::1]     number_of_boundaries

     129: 	cdef long[:,::1]   surrogate_neighbours

     130: 	cdef double[::1]   max_speed

     131: 	cdef long[::1]     flux_update_frequency

     132: 	cdef long[::1]     update_next_flux

     133: 	cdef long[::1]     update_extrapolation

     134: 	cdef long[::1]     allow_timestep_increase

     135: 	cdef double[::1]   edge_timestep

     136: 	cdef double[::1]   edge_flux_work

     137: 	cdef double[::1]   pressuregrad_work

     138: 	cdef double[::1]   x_centroid_work

     139: 	cdef double[::1]   y_centroid_work

     140: 	cdef double[::1]   boundary_flux_sum

     141: 	cdef double[::1]   riverwall_elevation

     142: 	cdef long[::1]     riverwall_rowIndex

     143: 	cdef double[:,::1] riverwall_hydraulic_properties

     144: 	cdef double[:,::1] edge_values

     145: 	cdef double[::1]   centroid_values

     146: 	cdef double[:,::1] vertex_values

     147: 	cdef double[::1]   boundary_values

     148: 	cdef double[::1]   explicit_update

     149:

     150: 	cdef object quantities

     151: 	cdef object riverwallData

     152:

     153: 	#------------------------------------------------------

     154: 	# Domain structures

     155: 	#------------------------------------------------------

    +156: 	neighbours = domain_object.neighbours

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_neighbours); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 156, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_neighbours = __pyx_t_2;
      __pyx_t_2.memview = NULL;
      __pyx_t_2.data = NULL;

    +157: 	D.neighbours = &neighbours[0,0]

      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_v_D->neighbours = (&(*((long *) ( /* dim=1 */ ((char *) (((long *) ( /* dim=0 */ (__pyx_v_neighbours.data + __pyx_t_3 * __pyx_v_neighbours.strides[0]) )) + __pyx_t_4)) ))));

     158:

    +159: 	surrogate_neighbours = domain_object.surrogate_neighbours

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_surrogate_neighbours); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 159, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_surrogate_neighbours = __pyx_t_2;
      __pyx_t_2.memview = NULL;
      __pyx_t_2.data = NULL;

    +160: 	D.surrogate_neighbours = &surrogate_neighbours[0,0]

      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_v_D->surrogate_neighbours = (&(*((long *) ( /* dim=1 */ ((char *) (((long *) ( /* dim=0 */ (__pyx_v_surrogate_neighbours.data + __pyx_t_4 * __pyx_v_surrogate_neighbours.strides[0]) )) + __pyx_t_3)) ))));

     161:

    +162: 	neighbour_edges = domain_object.neighbour_edges

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_neighbour_edges); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 162, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_neighbour_edges = __pyx_t_2;
      __pyx_t_2.memview = NULL;
      __pyx_t_2.data = NULL;

    +163: 	D.neighbour_edges = &neighbour_edges[0,0]

      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_v_D->neighbour_edges = (&(*((long *) ( /* dim=1 */ ((char *) (((long *) ( /* dim=0 */ (__pyx_v_neighbour_edges.data + __pyx_t_3 * __pyx_v_neighbour_edges.strides[0]) )) + __pyx_t_4)) ))));

     164:

    +165: 	normals = domain_object.normals

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_normals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 165, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_normals = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +166: 	D.normals = &normals[0,0]

      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_v_D->normals = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_normals.data + __pyx_t_4 * __pyx_v_normals.strides[0]) )) + __pyx_t_3)) ))));

     167:

    +168: 	edgelengths = domain_object.edgelengths

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_edgelengths); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_edgelengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +169: 	D.edgelengths = &edgelengths[0,0]

      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_v_D->edgelengths = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_edgelengths.data + __pyx_t_3 * __pyx_v_edgelengths.strides[0]) )) + __pyx_t_4)) ))));

     170:

    +171: 	radii = domain_object.radii

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_radii); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_radii = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +172: 	D.radii = &radii[0]

      __pyx_t_4 = 0;
      __pyx_v_D->radii = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_radii.data) + __pyx_t_4)) ))));

     173:

    +174: 	areas = domain_object.areas

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_areas); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_areas = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +175: 	D.areas = &areas[0]

      __pyx_t_4 = 0;
      __pyx_v_D->areas = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_areas.data) + __pyx_t_4)) ))));

     176:

    +177: 	edge_flux_type = domain_object.edge_flux_type

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_edge_flux_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 177, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_edge_flux_type = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

    +178: 	D.edge_flux_type = &edge_flux_type[0]

      __pyx_t_4 = 0;
      __pyx_v_D->edge_flux_type = (&(*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_edge_flux_type.data) + __pyx_t_4)) ))));

     179:

    +180: 	tri_full_flag = domain_object.tri_full_flag

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_tri_full_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 180, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_tri_full_flag = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

    +181: 	D.tri_full_flag = &tri_full_flag[0]

      __pyx_t_4 = 0;
      __pyx_v_D->tri_full_flag = (&(*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_tri_full_flag.data) + __pyx_t_4)) ))));

     182:

    +183: 	already_computed_flux = domain_object.already_computed_flux

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_already_computed_flux); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 183, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_already_computed_flux = __pyx_t_2;
      __pyx_t_2.memview = NULL;
      __pyx_t_2.data = NULL;

    +184: 	D.already_computed_flux = &already_computed_flux[0,0]

      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_v_D->already_computed_flux = (&(*((long *) ( /* dim=1 */ ((char *) (((long *) ( /* dim=0 */ (__pyx_v_already_computed_flux.data + __pyx_t_4 * __pyx_v_already_computed_flux.strides[0]) )) + __pyx_t_3)) ))));

     185:

    +186: 	vertex_coordinates = domain_object.vertex_coordinates

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_vertex_coordinates); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 186, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_vertex_coordinates = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +187: 	D.vertex_coordinates = &vertex_coordinates[0,0]

      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_v_D->vertex_coordinates = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vertex_coordinates.data + __pyx_t_3 * __pyx_v_vertex_coordinates.strides[0]) )) + __pyx_t_4)) ))));

     188:

    +189: 	edge_coordinates = domain_object.edge_coordinates

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_edge_coordinates); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 189, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_edge_coordinates = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +190: 	D.edge_coordinates = &edge_coordinates[0,0]

      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_v_D->edge_coordinates = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_edge_coordinates.data + __pyx_t_4 * __pyx_v_edge_coordinates.strides[0]) )) + __pyx_t_3)) ))));

     191:

    +192: 	centroid_coordinates = domain_object.centroid_coordinates

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_centroid_coordinates); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 192, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_centroid_coordinates = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +193: 	D.centroid_coordinates = &centroid_coordinates[0,0]

      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_v_D->centroid_coordinates = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_centroid_coordinates.data + __pyx_t_3 * __pyx_v_centroid_coordinates.strides[0]) )) + __pyx_t_4)) ))));

     194:

    +195: 	max_speed = domain_object.max_speed

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_max_speed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 195, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_speed = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +196: 	D.max_speed = &max_speed[0]

      __pyx_t_4 = 0;
      __pyx_v_D->max_speed = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_max_speed.data) + __pyx_t_4)) ))));

     197:

    +198: 	number_of_boundaries = domain_object.number_of_boundaries

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_number_of_boundaries); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 198, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_number_of_boundaries = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

    +199: 	D.number_of_boundaries = &number_of_boundaries[0]

      __pyx_t_4 = 0;
      __pyx_v_D->number_of_boundaries = (&(*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_number_of_boundaries.data) + __pyx_t_4)) ))));

     200:

    +201: 	flux_update_frequency = domain_object.flux_update_frequency

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_flux_update_frequency); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_flux_update_frequency = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

    +202: 	D.flux_update_frequency = &flux_update_frequency[0]

      __pyx_t_4 = 0;
      __pyx_v_D->flux_update_frequency = (&(*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_flux_update_frequency.data) + __pyx_t_4)) ))));

     203:

    +204: 	update_next_flux = domain_object.update_next_flux

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_update_next_flux); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 204, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_update_next_flux = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

    +205: 	D.update_next_flux = &update_next_flux[0]

      __pyx_t_4 = 0;
      __pyx_v_D->update_next_flux = (&(*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_update_next_flux.data) + __pyx_t_4)) ))));

     206:

    +207: 	update_extrapolation = domain_object.update_extrapolation

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_update_extrapolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 207, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_update_extrapolation = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

    +208: 	D.update_extrapolation = &update_extrapolation[0]

      __pyx_t_4 = 0;
      __pyx_v_D->update_extrapolation = (&(*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_update_extrapolation.data) + __pyx_t_4)) ))));

     209:

    +210: 	allow_timestep_increase = domain_object.allow_timestep_increase

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_allow_timestep_increase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 210, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_allow_timestep_increase = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

    +211: 	D.allow_timestep_increase = &allow_timestep_increase[0]

      __pyx_t_4 = 0;
      __pyx_v_D->allow_timestep_increase = (&(*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_allow_timestep_increase.data) + __pyx_t_4)) ))));

     212:

    +213: 	edge_timestep = domain_object.edge_timestep

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_edge_timestep); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 213, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_edge_timestep = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +214: 	D.edge_timestep = &edge_timestep[0]

      __pyx_t_4 = 0;
      __pyx_v_D->edge_timestep = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_edge_timestep.data) + __pyx_t_4)) ))));

     215:

    +216: 	edge_flux_work = domain_object.edge_flux_work

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_edge_flux_work); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_edge_flux_work = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +217: 	D.edge_flux_work = &edge_flux_work[0]

      __pyx_t_4 = 0;
      __pyx_v_D->edge_flux_work = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_edge_flux_work.data) + __pyx_t_4)) ))));

     218:

    +219: 	pressuregrad_work = domain_object.pressuregrad_work

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_pressuregrad_work); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 219, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_pressuregrad_work = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +220: 	D.pressuregrad_work = &pressuregrad_work[0]

      __pyx_t_4 = 0;
      __pyx_v_D->pressuregrad_work = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_pressuregrad_work.data) + __pyx_t_4)) ))));

     221:

    +222: 	x_centroid_work = domain_object.x_centroid_work

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_x_centroid_work); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 222, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_x_centroid_work = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +223: 	D.x_centroid_work = &x_centroid_work[0]

      __pyx_t_4 = 0;
      __pyx_v_D->x_centroid_work = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_centroid_work.data) + __pyx_t_4)) ))));

     224:

    +225: 	y_centroid_work = domain_object.y_centroid_work

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_y_centroid_work); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 225, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_y_centroid_work = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +226: 	D.y_centroid_work = &y_centroid_work[0]

      __pyx_t_4 = 0;
      __pyx_v_D->y_centroid_work = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_centroid_work.data) + __pyx_t_4)) ))));

     227:

    +228: 	boundary_flux_sum = domain_object.boundary_flux_sum

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_boundary_flux_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_boundary_flux_sum = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +229: 	D.boundary_flux_sum = &boundary_flux_sum[0]

      __pyx_t_4 = 0;
      __pyx_v_D->boundary_flux_sum = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_boundary_flux_sum.data) + __pyx_t_4)) ))));

     230:

     231: 	#------------------------------------------------------

     232: 	# Quantity structures

     233: 	#------------------------------------------------------

    +234: 	quantities = domain_object.quantities

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_quantities); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_quantities = __pyx_t_1;
      __pyx_t_1 = 0;

    +235: 	stage = quantities["stage"]

      __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_quantities, __pyx_n_s_stage); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_stage = __pyx_t_1;
      __pyx_t_1 = 0;

    +236: 	xmomentum = quantities["xmomentum"]

      __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_quantities, __pyx_n_s_xmomentum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_xmomentum = __pyx_t_1;
      __pyx_t_1 = 0;

    +237: 	ymomentum = quantities["ymomentum"]

      __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_quantities, __pyx_n_s_ymomentum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_ymomentum = __pyx_t_1;
      __pyx_t_1 = 0;

    +238: 	elevation = quantities["elevation"]

      __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_quantities, __pyx_n_s_elevation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_elevation = __pyx_t_1;
      __pyx_t_1 = 0;

    +239: 	height = quantities["height"]

      __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_quantities, __pyx_n_s_height); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_height = __pyx_t_1;
      __pyx_t_1 = 0;

     240:

    +241: 	edge_values = stage.edge_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stage, __pyx_n_s_edge_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 241, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_edge_values = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +242: 	D.stage_edge_values = &edge_values[0,0]

      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_v_D->stage_edge_values = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_edge_values.data + __pyx_t_4 * __pyx_v_edge_values.strides[0]) )) + __pyx_t_3)) ))));

     243:

    +244: 	edge_values = xmomentum.edge_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_xmomentum, __pyx_n_s_edge_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 244, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_edge_values, 1);
      __pyx_v_edge_values = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +245: 	D.xmom_edge_values = &edge_values[0,0]

      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_v_D->xmom_edge_values = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_edge_values.data + __pyx_t_3 * __pyx_v_edge_values.strides[0]) )) + __pyx_t_4)) ))));

     246:

    +247: 	edge_values = ymomentum.edge_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ymomentum, __pyx_n_s_edge_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 247, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_edge_values, 1);
      __pyx_v_edge_values = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +248: 	D.ymom_edge_values = &edge_values[0,0]

      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_v_D->ymom_edge_values = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_edge_values.data + __pyx_t_4 * __pyx_v_edge_values.strides[0]) )) + __pyx_t_3)) ))));

     249:

    +250: 	edge_values = elevation.edge_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_elevation, __pyx_n_s_edge_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 250, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_edge_values, 1);
      __pyx_v_edge_values = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +251: 	D.bed_edge_values = &edge_values[0,0]

      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_v_D->bed_edge_values = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_edge_values.data + __pyx_t_3 * __pyx_v_edge_values.strides[0]) )) + __pyx_t_4)) ))));

     252:

    +253: 	edge_values = height.edge_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_height, __pyx_n_s_edge_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 253, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_edge_values, 1);
      __pyx_v_edge_values = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +254: 	D.height_edge_values = &edge_values[0,0]

      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_v_D->height_edge_values = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_edge_values.data + __pyx_t_4 * __pyx_v_edge_values.strides[0]) )) + __pyx_t_3)) ))));

     255:

    +256: 	centroid_values = stage.centroid_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stage, __pyx_n_s_centroid_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 256, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_centroid_values = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +257: 	D.stage_centroid_values = &centroid_values[0]

      __pyx_t_3 = 0;
      __pyx_v_D->stage_centroid_values = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_centroid_values.data) + __pyx_t_3)) ))));

     258:

    +259: 	centroid_values = xmomentum.centroid_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_xmomentum, __pyx_n_s_centroid_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 259, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_centroid_values, 1);
      __pyx_v_centroid_values = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +260: 	D.xmom_centroid_values = &centroid_values[0]

      __pyx_t_3 = 0;
      __pyx_v_D->xmom_centroid_values = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_centroid_values.data) + __pyx_t_3)) ))));

     261:

    +262: 	centroid_values = ymomentum.centroid_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ymomentum, __pyx_n_s_centroid_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_centroid_values, 1);
      __pyx_v_centroid_values = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +263: 	D.ymom_centroid_values = &centroid_values[0]

      __pyx_t_3 = 0;
      __pyx_v_D->ymom_centroid_values = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_centroid_values.data) + __pyx_t_3)) ))));

     264:

    +265: 	centroid_values = elevation.centroid_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_elevation, __pyx_n_s_centroid_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 265, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_centroid_values, 1);
      __pyx_v_centroid_values = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +266: 	D.bed_centroid_values = &centroid_values[0]

      __pyx_t_3 = 0;
      __pyx_v_D->bed_centroid_values = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_centroid_values.data) + __pyx_t_3)) ))));

     267:

    +268: 	centroid_values = height.centroid_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_height, __pyx_n_s_centroid_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 268, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_centroid_values, 1);
      __pyx_v_centroid_values = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +269: 	D.height_centroid_values = &centroid_values[0]

      __pyx_t_3 = 0;
      __pyx_v_D->height_centroid_values = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_centroid_values.data) + __pyx_t_3)) ))));

     270:

    +271: 	vertex_values = stage.vertex_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stage, __pyx_n_s_vertex_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 271, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_vertex_values = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +272: 	D.stage_vertex_values = &vertex_values[0,0]

      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_v_D->stage_vertex_values = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vertex_values.data + __pyx_t_3 * __pyx_v_vertex_values.strides[0]) )) + __pyx_t_4)) ))));

     273:

    +274: 	vertex_values = xmomentum.vertex_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_xmomentum, __pyx_n_s_vertex_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 274, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_vertex_values, 1);
      __pyx_v_vertex_values = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +275: 	D.xmom_vertex_values = &vertex_values[0,0]

      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_v_D->xmom_vertex_values = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vertex_values.data + __pyx_t_4 * __pyx_v_vertex_values.strides[0]) )) + __pyx_t_3)) ))));

     276:

    +277: 	vertex_values = ymomentum.vertex_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ymomentum, __pyx_n_s_vertex_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 277, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_vertex_values, 1);
      __pyx_v_vertex_values = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +278: 	D.ymom_vertex_values = &vertex_values[0,0]

      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_v_D->ymom_vertex_values = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vertex_values.data + __pyx_t_3 * __pyx_v_vertex_values.strides[0]) )) + __pyx_t_4)) ))));

     279:

    +280: 	vertex_values = elevation.vertex_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_elevation, __pyx_n_s_vertex_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 280, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_vertex_values, 1);
      __pyx_v_vertex_values = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +281: 	D.bed_vertex_values = &vertex_values[0,0]

      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_v_D->bed_vertex_values = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vertex_values.data + __pyx_t_4 * __pyx_v_vertex_values.strides[0]) )) + __pyx_t_3)) ))));

     282:

    +283: 	vertex_values = height.vertex_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_height, __pyx_n_s_vertex_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 283, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_vertex_values, 1);
      __pyx_v_vertex_values = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +284: 	D.height_vertex_values = &vertex_values[0,0]

      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_v_D->height_vertex_values = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_vertex_values.data + __pyx_t_3 * __pyx_v_vertex_values.strides[0]) )) + __pyx_t_4)) ))));

     285:

    +286: 	boundary_values = stage.boundary_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stage, __pyx_n_s_boundary_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 286, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_boundary_values = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +287: 	D.stage_boundary_values = &boundary_values[0]

      __pyx_t_4 = 0;
      __pyx_v_D->stage_boundary_values = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_boundary_values.data) + __pyx_t_4)) ))));

     288:

    +289: 	boundary_values = xmomentum.boundary_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_xmomentum, __pyx_n_s_boundary_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 289, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_boundary_values, 1);
      __pyx_v_boundary_values = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +290: 	D.xmom_boundary_values = &boundary_values[0]

      __pyx_t_4 = 0;
      __pyx_v_D->xmom_boundary_values = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_boundary_values.data) + __pyx_t_4)) ))));

     291:

    +292: 	boundary_values = ymomentum.boundary_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ymomentum, __pyx_n_s_boundary_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 292, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_boundary_values, 1);
      __pyx_v_boundary_values = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +293: 	D.ymom_boundary_values = &boundary_values[0]

      __pyx_t_4 = 0;
      __pyx_v_D->ymom_boundary_values = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_boundary_values.data) + __pyx_t_4)) ))));

     294:

    +295: 	boundary_values = elevation.boundary_values

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_elevation, __pyx_n_s_boundary_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 295, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_boundary_values, 1);
      __pyx_v_boundary_values = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +296: 	D.bed_boundary_values = &boundary_values[0]

      __pyx_t_4 = 0;
      __pyx_v_D->bed_boundary_values = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_boundary_values.data) + __pyx_t_4)) ))));

     297:

    +298: 	explicit_update = stage.explicit_update

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stage, __pyx_n_s_explicit_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 298, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_explicit_update = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +299: 	D.stage_explicit_update = &explicit_update[0]

      __pyx_t_4 = 0;
      __pyx_v_D->stage_explicit_update = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_explicit_update.data) + __pyx_t_4)) ))));

     300:

    +301: 	explicit_update = xmomentum.explicit_update

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_xmomentum, __pyx_n_s_explicit_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 301, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_explicit_update, 1);
      __pyx_v_explicit_update = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +302: 	D.xmom_explicit_update = &explicit_update[0]

      __pyx_t_4 = 0;
      __pyx_v_D->xmom_explicit_update = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_explicit_update.data) + __pyx_t_4)) ))));

     303:

    +304: 	explicit_update = ymomentum.explicit_update

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ymomentum, __pyx_n_s_explicit_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_XDEC_MEMVIEW(&__pyx_v_explicit_update, 1);
      __pyx_v_explicit_update = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +305: 	D.ymom_explicit_update = &explicit_update[0]

      __pyx_t_4 = 0;
      __pyx_v_D->ymom_explicit_update = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_explicit_update.data) + __pyx_t_4)) ))));

     306:

     307: 	#------------------------------------------------------

     308: 	# Riverwall structures

     309: 	#------------------------------------------------------

    +310: 	riverwallData = domain_object.riverwallData

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain_object, __pyx_n_s_riverwallData); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_riverwallData = __pyx_t_1;
      __pyx_t_1 = 0;

     311:

    +312: 	riverwall_elevation = riverwallData.riverwall_elevation

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_riverwallData, __pyx_n_s_riverwall_elevation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 312, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_riverwall_elevation = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +313: 	D.riverwall_elevation = &riverwall_elevation[0]

      __pyx_t_4 = 0;
      __pyx_v_D->riverwall_elevation = (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_riverwall_elevation.data) + __pyx_t_4)) ))));

     314:

    +315: 	riverwall_rowIndex = riverwallData.hydraulic_properties_rowIndex

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_riverwallData, __pyx_n_s_hydraulic_properties_rowIndex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 315, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_riverwall_rowIndex = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

    +316: 	D.riverwall_rowIndex = &riverwall_rowIndex[0]

      __pyx_t_4 = 0;
      __pyx_v_D->riverwall_rowIndex = (&(*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_riverwall_rowIndex.data) + __pyx_t_4)) ))));

     317:

    +318: 	D.ncol_riverwall_hydraulic_properties = riverwallData.ncol_hydraulic_properties

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_riverwallData, __pyx_n_s_ncol_hydraulic_properties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_8 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_D->ncol_riverwall_hydraulic_properties = __pyx_t_8;

     319:

    +320: 	riverwall_hydraulic_properties = riverwallData.hydraulic_properties

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_riverwallData, __pyx_n_s_hydraulic_properties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 320, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_riverwall_hydraulic_properties = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +321: 	D.riverwall_hydraulic_properties = &riverwall_hydraulic_properties[0,0]

      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_v_D->riverwall_hydraulic_properties = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_riverwall_hydraulic_properties.data + __pyx_t_4 * __pyx_v_riverwall_hydraulic_properties.strides[0]) )) + __pyx_t_3)) ))));

     322:

     323:

     324: #===============================================================================

     325:

    +326: def compute_fluxes_ext_central(object domain_object, double timestep):

    /* Python wrapper */
    static PyObject *__pyx_pw_5anuga_13shallow_water_16swDE1_domain_ext_1compute_fluxes_ext_central(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_mdef_5anuga_13shallow_water_16swDE1_domain_ext_1compute_fluxes_ext_central = {"compute_fluxes_ext_central", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5anuga_13shallow_water_16swDE1_domain_ext_1compute_fluxes_ext_central, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_5anuga_13shallow_water_16swDE1_domain_ext_1compute_fluxes_ext_central(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_domain_object = 0;
      double __pyx_v_timestep;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("compute_fluxes_ext_central (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domain_object,&__pyx_n_s_timestep,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_object)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timestep)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("compute_fluxes_ext_central", 1, 2, 2, 1); __PYX_ERR(0, 326, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_fluxes_ext_central") < 0)) __PYX_ERR(0, 326, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_domain_object = values[0];
        __pyx_v_timestep = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_timestep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 326, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("compute_fluxes_ext_central", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 326, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("anuga.shallow_water.swDE1_domain_ext.compute_fluxes_ext_central", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5anuga_13shallow_water_16swDE1_domain_ext_compute_fluxes_ext_central(__pyx_self, __pyx_v_domain_object, __pyx_v_timestep);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5anuga_13shallow_water_16swDE1_domain_ext_compute_fluxes_ext_central(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain_object, double __pyx_v_timestep) {
      struct domain __pyx_v_D;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("compute_fluxes_ext_central", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("anuga.shallow_water.swDE1_domain_ext.compute_fluxes_ext_central", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_domain_object, __pyx_n_s_timestep, __pyx_n_s_D); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__21);
      __Pyx_GIVEREF(__pyx_tuple__21);
    /* … */
      __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5anuga_13shallow_water_16swDE1_domain_ext_1compute_fluxes_ext_central, NULL, __pyx_n_s_anuga_shallow_water_swDE1_domain_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_compute_fluxes_ext_central, __pyx_t_1) < 0) __PYX_ERR(0, 326, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_anuga_shallow_water_swDE1_domain, __pyx_n_s_compute_fluxes_ext_central, 326, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 326, __pyx_L1_error)

     327:

     328: 	cdef domain D

     329:

    +330: 	get_python_domain_parameters(&D, domain_object)

      __pyx_t_1 = __pyx_f_5anuga_13shallow_water_16swDE1_domain_ext_get_python_domain_parameters((&__pyx_v_D), __pyx_v_domain_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +331: 	get_python_domain_pointers(&D, domain_object)

      __pyx_t_1 = __pyx_f_5anuga_13shallow_water_16swDE1_domain_ext_get_python_domain_pointers((&__pyx_v_D), __pyx_v_domain_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     332:

    +333: 	with nogil:

      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          __Pyx_FastGIL_Remember();
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L5:;
          }
      }

    +334: 		timestep = _compute_fluxes_central(&D, timestep)

            __pyx_v_timestep = _compute_fluxes_central((&__pyx_v_D), __pyx_v_timestep);
          }

     335:

    +336: 	return timestep

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_timestep); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     337:

    +338: def extrapolate_second_order_edge_sw(object domain_object):

    /* Python wrapper */
    static PyObject *__pyx_pw_5anuga_13shallow_water_16swDE1_domain_ext_3extrapolate_second_order_edge_sw(PyObject *__pyx_self, PyObject *__pyx_v_domain_object); /*proto*/
    static PyMethodDef __pyx_mdef_5anuga_13shallow_water_16swDE1_domain_ext_3extrapolate_second_order_edge_sw = {"extrapolate_second_order_edge_sw", (PyCFunction)__pyx_pw_5anuga_13shallow_water_16swDE1_domain_ext_3extrapolate_second_order_edge_sw, METH_O, 0};
    static PyObject *__pyx_pw_5anuga_13shallow_water_16swDE1_domain_ext_3extrapolate_second_order_edge_sw(PyObject *__pyx_self, PyObject *__pyx_v_domain_object) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("extrapolate_second_order_edge_sw (wrapper)", 0);
      __pyx_r = __pyx_pf_5anuga_13shallow_water_16swDE1_domain_ext_2extrapolate_second_order_edge_sw(__pyx_self, ((PyObject *)__pyx_v_domain_object));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5anuga_13shallow_water_16swDE1_domain_ext_2extrapolate_second_order_edge_sw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain_object) {
      struct domain __pyx_v_D;
      int __pyx_v_e;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("extrapolate_second_order_edge_sw", 0);
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("anuga.shallow_water.swDE1_domain_ext.extrapolate_second_order_edge_sw", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__23 = PyTuple_Pack(3, __pyx_n_s_domain_object, __pyx_n_s_D, __pyx_n_s_e); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__23);
      __Pyx_GIVEREF(__pyx_tuple__23);
    /* … */
      __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5anuga_13shallow_water_16swDE1_domain_ext_3extrapolate_second_order_edge_sw, NULL, __pyx_n_s_anuga_shallow_water_swDE1_domain_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_extrapolate_second_order_edge_sw, __pyx_t_1) < 0) __PYX_ERR(0, 338, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_anuga_shallow_water_swDE1_domain, __pyx_n_s_extrapolate_second_order_edge_sw, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 338, __pyx_L1_error)

     339:

     340: 	cdef domain D

     341: 	cdef int e

     342:

    +343: 	get_python_domain_parameters(&D, domain_object)

      __pyx_t_1 = __pyx_f_5anuga_13shallow_water_16swDE1_domain_ext_get_python_domain_parameters((&__pyx_v_D), __pyx_v_domain_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +344: 	get_python_domain_pointers(&D, domain_object)

      __pyx_t_1 = __pyx_f_5anuga_13shallow_water_16swDE1_domain_ext_get_python_domain_pointers((&__pyx_v_D), __pyx_v_domain_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     345:

    +346: 	with nogil:

      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          __Pyx_FastGIL_Remember();
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L5:;
          }
      }

    +347: 		e = _extrapolate_second_order_edge_sw(&D)

            __pyx_v_e = _extrapolate_second_order_edge_sw((&__pyx_v_D));
          }

     348:

    +349: 	if e == -1:

      __pyx_t_2 = ((__pyx_v_e == -1L) != 0);
      if (__pyx_t_2) {
    /* … */
      }

    +350: 		return None

        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

     351:

    +352: def protect_new(object domain_object):

    /* Python wrapper */
    static PyObject *__pyx_pw_5anuga_13shallow_water_16swDE1_domain_ext_5protect_new(PyObject *__pyx_self, PyObject *__pyx_v_domain_object); /*proto*/
    static PyMethodDef __pyx_mdef_5anuga_13shallow_water_16swDE1_domain_ext_5protect_new = {"protect_new", (PyCFunction)__pyx_pw_5anuga_13shallow_water_16swDE1_domain_ext_5protect_new, METH_O, 0};
    static PyObject *__pyx_pw_5anuga_13shallow_water_16swDE1_domain_ext_5protect_new(PyObject *__pyx_self, PyObject *__pyx_v_domain_object) {
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("protect_new (wrapper)", 0);
      __pyx_r = __pyx_pf_5anuga_13shallow_water_16swDE1_domain_ext_4protect_new(__pyx_self, ((PyObject *)__pyx_v_domain_object));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5anuga_13shallow_water_16swDE1_domain_ext_4protect_new(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain_object) {
      struct domain __pyx_v_D;
      double __pyx_v_mass_error;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("protect_new", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("anuga.shallow_water.swDE1_domain_ext.protect_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__25 = PyTuple_Pack(3, __pyx_n_s_domain_object, __pyx_n_s_D, __pyx_n_s_mass_error); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 352, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__25);
      __Pyx_GIVEREF(__pyx_tuple__25);
    /* … */
      __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5anuga_13shallow_water_16swDE1_domain_ext_5protect_new, NULL, __pyx_n_s_anuga_shallow_water_swDE1_domain_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_protect_new, __pyx_t_1) < 0) __PYX_ERR(0, 352, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_anuga_shallow_water_swDE1_domain, __pyx_n_s_protect_new, 352, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 352, __pyx_L1_error)

     353:

     354: 	cdef domain D

     355:

     356: 	cdef double mass_error

     357:

    +358: 	get_python_domain_parameters(&D, domain_object)

      __pyx_t_1 = __pyx_f_5anuga_13shallow_water_16swDE1_domain_ext_get_python_domain_parameters((&__pyx_v_D), __pyx_v_domain_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +359: 	get_python_domain_pointers(&D, domain_object)

      __pyx_t_1 = __pyx_f_5anuga_13shallow_water_16swDE1_domain_ext_get_python_domain_pointers((&__pyx_v_D), __pyx_v_domain_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     360:

    +361: 	with nogil:

      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          __Pyx_FastGIL_Remember();
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L5:;
          }
      }

    +362: 		mass_error = _protect_new(&D)

            __pyx_v_mass_error = _protect_new((&__pyx_v_D));
          }

     363:

    +364: 	return mass_error

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_mass_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     365:

    +366: def compute_flux_update_frequency(object domain_object, double timestep):

    /* Python wrapper */
    static PyObject *__pyx_pw_5anuga_13shallow_water_16swDE1_domain_ext_7compute_flux_update_frequency(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_mdef_5anuga_13shallow_water_16swDE1_domain_ext_7compute_flux_update_frequency = {"compute_flux_update_frequency", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5anuga_13shallow_water_16swDE1_domain_ext_7compute_flux_update_frequency, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_5anuga_13shallow_water_16swDE1_domain_ext_7compute_flux_update_frequency(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_domain_object = 0;
      double __pyx_v_timestep;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("compute_flux_update_frequency (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domain_object,&__pyx_n_s_timestep,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_object)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timestep)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("compute_flux_update_frequency", 1, 2, 2, 1); __PYX_ERR(0, 366, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_flux_update_frequency") < 0)) __PYX_ERR(0, 366, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_domain_object = values[0];
        __pyx_v_timestep = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_timestep == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 366, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("compute_flux_update_frequency", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 366, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("anuga.shallow_water.swDE1_domain_ext.compute_flux_update_frequency", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5anuga_13shallow_water_16swDE1_domain_ext_6compute_flux_update_frequency(__pyx_self, __pyx_v_domain_object, __pyx_v_timestep);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5anuga_13shallow_water_16swDE1_domain_ext_6compute_flux_update_frequency(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_domain_object, double __pyx_v_timestep) {
      struct domain __pyx_v_D;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("compute_flux_update_frequency", 0);
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("anuga.shallow_water.swDE1_domain_ext.compute_flux_update_frequency", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__27 = PyTuple_Pack(3, __pyx_n_s_domain_object, __pyx_n_s_timestep, __pyx_n_s_D); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 366, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__27);
      __Pyx_GIVEREF(__pyx_tuple__27);
    /* … */
      __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5anuga_13shallow_water_16swDE1_domain_ext_7compute_flux_update_frequency, NULL, __pyx_n_s_anuga_shallow_water_swDE1_domain_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_compute_flux_update_frequency, __pyx_t_1) < 0) __PYX_ERR(0, 366, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_anuga_shallow_water_swDE1_domain, __pyx_n_s_compute_flux_update_frequency, 366, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 366, __pyx_L1_error)

     367:

     368: 	cdef domain D

     369:

    +370: 	get_python_domain_parameters(&D, domain_object)

      __pyx_t_1 = __pyx_f_5anuga_13shallow_water_16swDE1_domain_ext_get_python_domain_parameters((&__pyx_v_D), __pyx_v_domain_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +371: 	get_python_domain_pointers(&D, domain_object)

      __pyx_t_1 = __pyx_f_5anuga_13shallow_water_16swDE1_domain_ext_get_python_domain_pointers((&__pyx_v_D), __pyx_v_domain_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     372:

    +373: 	with nogil:

      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          __Pyx_FastGIL_Remember();
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              __Pyx_FastGIL_Forget();
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L5:;
          }
      }

    +374: 		_compute_flux_update_frequency(&D, timestep)

            (void)(_compute_flux_update_frequency((&__pyx_v_D), __pyx_v_timestep));
          }

     375:

     376: