def test_linearRampBC(self): t_list = get_time_array() t1 = 3. value = 5. BC = BoundaryCondition() BC.setLinearRamp(t1, value) for t in t_list: x = get_random_x() b = BC.uOfXT(x, t) npt.assert_almost_equal(b, min(value, value * t / t1))
def test_linearBC(self): t_list = get_time_array() a0 = 1 a = np.ndarray([1, 2, 3]) BC = BoundaryCondition() BC.setLinearBC(a0, a) for t in t_list: x = get_random_x() b = BC.uOfXT(x, t) npt.assert_equal(b, a0 + sum(a * x))