def test_copy_3d_field_to_2d_x(c3d_x, c2d_x, boundary, facet): utility.SubFunctionExtractor(c3d_x, c2d_x, boundary=boundary, elem_facet=facet).solve() assert np.allclose(c2d_x.dat.data_ro.min(), 2.0) assert np.allclose(c2d_x.dat.data_ro.max(), 3.0)
def test_copy_3d_field_to_2d_vec(uv_3d, uv_2d, params): boundary, facet, expect = params utility.SubFunctionExtractor(uv_3d, uv_2d, boundary=boundary, elem_facet=facet).solve() assert np.allclose(uv_2d.dat.data_ro, expect)
def test_copy_3d_field_to_2d_x_vec(uv_3d_x, uv_2d_x, boundary, facet): utility.SubFunctionExtractor(uv_3d_x, uv_2d_x, boundary=boundary, elem_facet=facet).solve() assert np.allclose(uv_2d_x.dat.data_ro[:, 0].min(), 1.0) assert np.allclose(uv_2d_x.dat.data_ro[:, 0].max(), 2.0) assert np.allclose(uv_2d_x.dat.data_ro[:, 1].min(), 4.0) assert np.allclose(uv_2d_x.dat.data_ro[:, 1].max(), 6.0)