[ -1.0*x/(x**2 + y**2 + z**2)**(3/2) ] grad(x,y,z) = [ -1.0*y/(x**2 + y**2 + z**2)**(3/2) ] [ -1.0*z/(x**2 + y**2 + z**2)**(3/2) ]
(charges)
| 28 | for c in charges], axis=0); |
| 29 | |
| 30 | def test_function_grad(charges): |
| 31 | """ |
| 32 | [ -1.0*x/(x**2 + y**2 + z**2)**(3/2) ] |
| 33 | grad(x,y,z) = [ -1.0*y/(x**2 + y**2 + z**2)**(3/2) ] |
| 34 | [ -1.0*z/(x**2 + y**2 + z**2)**(3/2) ] |
| 35 | """ |
| 36 | return lambda pts: np.sum([-(pts-c) / np.power(numpy.linalg.norm(pts-c, axis=1), 3)[:,np.newaxis] |
| 37 | for c in charges], axis=0); |
| 38 | |
| 39 | def get_quadrature_pts(mesh): |
| 40 | """ Generate second degree Gaussian quadrature points for tets. |