(tempdir, cell_type)
| 109 | |
| 110 | @pytest.mark.parametrize("cell_type", cell_types_2D) |
| 111 | def test_save_2d_vector(tempdir, cell_type): |
| 112 | mesh = create_unit_square(MPI.COMM_WORLD, 16, 16, cell_type=cell_type) |
| 113 | gdim = mesh.geometry.dim |
| 114 | u = Function(functionspace(mesh, ("Lagrange", 1, (gdim,)))) |
| 115 | |
| 116 | def f(x): |
| 117 | vals = np.zeros((2, x.shape[1])) |
| 118 | vals[0] = x[0] |
| 119 | vals[1] = 2 * x[0] * x[1] |
| 120 | return vals |
| 121 | |
| 122 | u.interpolate(f) |
| 123 | filename = Path(tempdir, "u.pvd") |
| 124 | with VTKFile(MPI.COMM_WORLD, filename, "w") as vtk: |
| 125 | vtk.write_function(u, 0.0) |
| 126 | vtk.write_function(u, 1.0) |
| 127 | |
| 128 | |
| 129 | @pytest.mark.skip_in_parallel |
nothing calls this directly
no test coverage detected