MCPcopy Create free account
hub / github.com/DedalusProject/dedalus / test_transpose_implicit

Function test_transpose_implicit

dedalus/tests/test_cartesian_operators.py:236–248  ·  view source on GitHub ↗

Test implicit evaluation of transpose operator for correctness.

(basis, N, dealias, dtype)

Source from the content-addressed store, hash-verified

234@pytest.mark.parametrize('dealias', dealias_range)
235@pytest.mark.parametrize('dtype', dtype_range)
236def test_transpose_implicit(basis, N, dealias, dtype):
237 """Test implicit evaluation of transpose operator for correctness."""
238 c, d, b, r = basis(N, dealias, dtype)
239 # Random tensor field
240 f = d.TensorField((c,c), bases=b)
241 f.fill_random(layout='g')
242 # Transpose LBVP
243 u = d.TensorField((c,c), bases=b)
244 problem = d3.LBVP([u], namespace=locals())
245 problem.add_equation("transpose(u) = transpose(f)")
246 solver = problem.build_solver()
247 solver.solve()
248 assert np.allclose(u['c'], f['c'])
249
250
251@pytest.mark.parametrize('basis', [build_FF, build_FC, build_CC])

Callers

nothing calls this directly

Calls 5

TensorFieldMethod · 0.80
fill_randomMethod · 0.80
add_equationMethod · 0.80
build_solverMethod · 0.80
solveMethod · 0.45

Tested by

no test coverage detected