def test_P(): g = Grid_1D.periodic(11) f = form(0, c, (sin(x), )) assert f.P(g, True) == g.P(f.degree, True, f.lambdify) assert f.P(g, False) == g.P(f.degree, False, f.lambdify) f = form(1, c, (cos(x), )) assert f.P(g, True) == g.P(f.degree, True, f.lambdify) assert f.P(g, False) == g.P(f.degree, False, f.lambdify) g = Grid_1D.regular(11) f = form(0, c, (x, )) assert f.P(g, True) == g.P(f.degree, True, f.lambdify) assert f.P(g, False) == g.P(f.degree, False, f.lambdify) f = form(1, c, (x**3, )) assert f.P(g, True) == g.P(f.degree, True, f.lambdify) assert f.P(g, False) == g.P(f.degree, False, f.lambdify) g = Grid_1D.chebyshev(11) f = form(0, c, (x, )) assert f.P(g, True) == g.P(f.degree, True, f.lambdify) assert f.P(g, False) == g.P(f.degree, False, f.lambdify) f = form(1, c, (x**3, )) assert f.P(g, True) == g.P(f.degree, True, f.lambdify) assert f.P(g, False) == g.P(f.degree, False, f.lambdify)
def test_P(): g = Grid_1D.periodic(11) f = form(0, c, (sin(x),)) assert f.P(g, True) == g.P(f.degree, True, f.lambdify) assert f.P(g, False) == g.P(f.degree, False, f.lambdify) f = form(1, c, (cos(x),)) assert f.P(g, True) == g.P(f.degree, True, f.lambdify) assert f.P(g, False) == g.P(f.degree, False, f.lambdify) g = Grid_1D.regular(11) f = form(0, c, (x,)) assert f.P(g, True) == g.P(f.degree, True, f.lambdify) assert f.P(g, False) == g.P(f.degree, False, f.lambdify) f = form(1, c, (x**3,)) assert f.P(g, True) == g.P(f.degree, True, f.lambdify) assert f.P(g, False) == g.P(f.degree, False, f.lambdify) g = Grid_1D.chebyshev(11) f = form(0, c, (x,)) assert f.P(g, True) == g.P(f.degree, True, f.lambdify) assert f.P(g, False) == g.P(f.degree, False, f.lambdify) f = form(1, c, (x**3,)) assert f.P(g, True) == g.P(f.degree, True, f.lambdify) assert f.P(g, False) == g.P(f.degree, False, f.lambdify)
def test_D(): g = Grid_1D.periodic(11) f = form(0, c, (cos(x), )) assert f.D.P(g, True) == f.P(g, True).D assert f.D.P(g, False) == f.P(g, False).D g = Grid_1D.regular(11) f = form(0, c, (x, )) assert f.D.P(g, True) == f.P(g, True).D bc = g.boundary_condition(f.lambdify) assert f.D.P(g, False) == f.P(g, False).D + bc f = form(0, c, (x**3, )) assert f.D.P(g, True) == f.P(g, True).D bc = g.boundary_condition(f.lambdify) assert f.D.P(g, False) == f.P(g, False).D + bc g = Grid_1D.chebyshev(11) f = form(0, c, (x, )) assert f.D.P(g, True) == f.P(g, True).D bc = g.boundary_condition(f.lambdify) assert f.D.P(g, False) == f.P(g, False).D + bc f = form(0, c, (x**3, )) assert f.D.P(g, True) == f.P(g, True).D bc = g.boundary_condition(f.lambdify) assert f.D.P(g, False) == f.P(g, False).D + bc
def test_D(): g = Grid_1D.periodic(11) f = form(0, c, (cos(x),)) assert f.D.P(g, True) == f.P(g, True).D assert f.D.P(g, False) == f.P(g, False).D g = Grid_1D.regular(11) f = form(0, c, (x,)) assert f.D.P(g, True) == f.P(g, True).D bc = g.boundary_condition(f.lambdify) assert f.D.P(g, False) == f.P(g, False).D + bc f = form(0, c, (x**3,)) assert f.D.P(g, True) == f.P(g, True).D bc = g.boundary_condition(f.lambdify) assert f.D.P(g, False) == f.P(g, False).D + bc g = Grid_1D.chebyshev(11) f = form(0, c, (x,)) assert f.D.P(g, True) == f.P(g, True).D bc = g.boundary_condition(f.lambdify) assert f.D.P(g, False) == f.P(g, False).D + bc f = form(0, c, (x**3,)) assert f.D.P(g, True) == f.P(g, True).D bc = g.boundary_condition(f.lambdify) assert f.D.P(g, False) == f.P(g, False).D + bc