(tempdir)
| 128 | |
| 129 | @pytest.mark.skip_in_parallel |
| 130 | def test_save_2d_vector_CG2(tempdir): |
| 131 | points = np.array( |
| 132 | [[0, 0], [1, 0], [1, 2], [0, 2], [1 / 2, 0], [1, 1], [1 / 2, 2], [0, 1], [1 / 2, 1]], |
| 133 | dtype=default_real_type, |
| 134 | ) |
| 135 | points = np.array( |
| 136 | [[0, 0], [1, 0], [0, 2], [0.5, 1], [0, 1], [0.5, 0], [1, 2], [0.5, 2], [1, 1]], |
| 137 | dtype=default_real_type, |
| 138 | ) |
| 139 | cells = np.array([[0, 1, 2, 3, 4, 5], [1, 6, 2, 7, 3, 8]]) |
| 140 | domain = ufl.Mesh(element("Lagrange", "triangle", 2, shape=(2,), dtype=default_real_type)) |
| 141 | mesh = create_mesh(MPI.COMM_WORLD, cells, domain, points) |
| 142 | gdim = mesh.geometry.dim |
| 143 | u = Function(functionspace(mesh, ("Lagrange", 2, (gdim,)))) |
| 144 | u.interpolate(lambda x: np.vstack((x[0], x[1]))) |
| 145 | filename = Path(tempdir, "u.pvd") |
| 146 | with VTKFile(mesh.comm, filename, "w") as vtk: |
| 147 | vtk.write_function(u, 0.0) |
| 148 | |
| 149 | |
| 150 | def test_save_vtk_mixed(tempdir): |
nothing calls this directly
no test coverage detected