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

Function test_implicit_trace_tensor

dedalus/tests/test_polar_operators.py:226–237  ·  view source on GitHub ↗
(Nphi, Nr, k, dealias, basis, dtype)

Source from the content-addressed store, hash-verified

224@pytest.mark.parametrize('basis', [build_disk, build_annulus])
225@pytest.mark.parametrize('dtype', [np.float64, np.complex128])
226def test_implicit_trace_tensor(Nphi, Nr, k, dealias, basis, dtype):
227 c, d, b, phi, r, x, y = basis(Nphi, Nr, k, dealias, dtype)
228 f = field.Field(dist=d, bases=(b,), dtype=dtype)
229 g = field.Field(dist=d, bases=(b,), dtype=dtype)
230 g.fill_random('g')
231 g.low_pass_filter(scales=0.5)
232 I = d.IdentityTensor(c, bases=b.radial_basis)
233 problem = problems.LBVP([f])
234 problem.add_equation((operators.Trace(I*f), 2*g))
235 solver = solvers.LinearBoundaryValueSolver(problem, matrix_coupling=[False, True])
236 solver.solve()
237 assert np.allclose(f['c'], g['c'])
238
239
240@pytest.mark.parametrize('basis', [build_disk, build_annulus])

Callers

nothing calls this directly

Calls 6

fill_randomMethod · 0.95
low_pass_filterMethod · 0.95
solveMethod · 0.95
FieldMethod · 0.80
IdentityTensorMethod · 0.80
add_equationMethod · 0.80

Tested by

no test coverage detected