def nodal_flux_builder_cell(coefficient): flux_legendre1 = Legendre(coefficient[:5]) flux_legendre2 = Legendre(coefficient[5:]) flux1 = flux_legendre1.linspace(64, [0, 10]) flux2 = flux_legendre2.linspace(64, [10, 20]) total_flux = np.concatenate((flux1[1], flux2[1])) flux_position = np.concatenate((flux1[0], flux2[0])) return total_flux, flux_position
def nodal_flux_builder_edge(coefficient, diff1, diff2): flux_legendre1 = Legendre(coefficient[:5]) flux_legendre2 = Legendre(coefficient[5:]) flux_legendre1 = flux_legendre1.deriv(1) flux_legendre2 = flux_legendre2.deriv(1) flux1 = flux_legendre1.linspace(65, [0, 10]) flux2 = flux_legendre2.linspace(65, [10, 20]) total_flux = np.concatenate((diff1 * flux1[1], diff2 * flux2[1])) flux_position = np.concatenate((flux1[0], flux2[0])) return total_flux, flux_position