(tempdir, cell_type)
| 185 | |
| 186 | @pytest.mark.parametrize("cell_type", cell_types_2D) |
| 187 | def test_save_vector_element(tempdir, cell_type): |
| 188 | mesh = create_unit_square(MPI.COMM_WORLD, 16, 16, cell_type=cell_type) |
| 189 | u = Function(functionspace(mesh, ("RT", 1))) |
| 190 | |
| 191 | def f(x): |
| 192 | vals = np.zeros((2, x.shape[1])) |
| 193 | vals[0] = x[0] |
| 194 | vals[1] = 2 * x[0] * x[1] |
| 195 | return vals |
| 196 | |
| 197 | u.interpolate(f) |
| 198 | filename = Path(tempdir, "u.pvd") |
| 199 | with pytest.raises(RuntimeError): |
| 200 | with VTKFile(MPI.COMM_WORLD, filename, "w") as vtk: |
| 201 | vtk.write_function(u, 0.0) |
| 202 | vtk.write_function(u, 1.0) |
| 203 | |
| 204 | |
| 205 | def test_save_vtk_cell_point(tempdir): |
nothing calls this directly
no test coverage detected