(Nphi, Nr, k, dealias, basis, dtype, layout)
| 140 | @pytest.mark.parametrize('dtype', [np.float64, np.complex128]) |
| 141 | @pytest.mark.parametrize('layout', ['c', 'g']) |
| 142 | def test_convert_vector(Nphi, Nr, k, dealias, basis, dtype, layout): |
| 143 | c, d, b, phi, r, x, y = basis(Nphi, Nr, k, dealias, dtype) |
| 144 | u = field.Field(dist=d, bases=(b,), tensorsig=(c,), dtype=dtype) |
| 145 | u.preset_scales(b.dealias) |
| 146 | ex = np.array([-np.sin(phi)+0.*r,np.cos(phi)+0.*r]) |
| 147 | ey = np.array([np.cos(phi)+0.*r,np.sin(phi)+0.*r]) |
| 148 | u['g'] = 4*x**3*ey + 3*y**2*ey |
| 149 | v = operators.Laplacian(u, c).evaluate() |
| 150 | u.change_layout(layout) |
| 151 | v.change_layout(layout) |
| 152 | w = (u + v).evaluate() |
| 153 | assert np.allclose(w['g'], u['g'] + v['g']) |
| 154 | |
| 155 | |
| 156 | @pytest.mark.parametrize('basis', [build_disk, build_annulus]) |
nothing calls this directly
no test coverage detected