MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / test_SymDevMatrixValuedL2

Function test_SymDevMatrixValuedL2

tests/pytest/test_interpolate.py:72–84  ·  view source on GitHub ↗
(mesh2d)

Source from the content-addressed store, hash-verified

70
71
72def test_SymDevMatrixValuedL2(mesh2d):
73 mesh = mesh2d
74 space = MatrixValued(L2(mesh, order=2), dim=3, symmetric=True, deviatoric=True)
75
76 def _expr(x, y):
77 return ((6 * x**2 + 4 * y**2, y**1 - 1.5 * x**2, y**2 - 1.5 * x**2),
78 (y**1 - 1.5 * x**2, 1 * x**2 - 5 * y**2 + 3*x*y, 0),
79 (y**2 - 1.5 * x**2, 0, -7 * x**2 + 1 * y**2 - 3*x*y))
80
81 def _check(gf):
82 return np.allclose(gf(mesh(0.5, 0.5)), np.array(_expr(0.5, 0.5)).flatten(), atol=1e-10, rtol=1e-10)
83
84 _test_interpolation(space, _expr(x, y), _check)
85
86
87if __name__ == "__main__":

Callers

nothing calls this directly

Calls 2

_test_interpolationFunction · 0.85
_exprFunction · 0.85

Tested by

no test coverage detected