MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / tabulate

Function tabulate

python/test/unit/fem/test_custom_jit_kernels.py:33–47  ·  view source on GitHub ↗
(A_, w_, c_, coords_, entity_local_index, cell_orientation, custom_data)

Source from the content-addressed store, hash-verified

31def tabulate_rank2(dtype, xdtype):
32 @numba.cfunc(ufcx_signature(dtype, xdtype), nopython=True)
33 def tabulate(A_, w_, c_, coords_, entity_local_index, cell_orientation, custom_data):
34 A = numba.carray(A_, (3, 3), dtype=dtype)
35 coordinate_dofs = numba.carray(coords_, (3, 3), dtype=xdtype)
36
37 # Ke=∫Ωe BTe Be dΩ
38 x0, y0 = coordinate_dofs[0, :2]
39 x1, y1 = coordinate_dofs[1, :2]
40 x2, y2 = coordinate_dofs[2, :2]
41
42 # 2x Element area Ae
43 Ae = abs((x0 - x1) * (y2 - y1) - (y0 - y1) * (x2 - x1))
44 B = np.array([y1 - y2, y2 - y0, y0 - y1, x2 - x1, x0 - x2, x1 - x0], dtype=dtype).reshape(
45 2, 3
46 )
47 A[:, :] = np.dot(B.T, B) / (2 * Ae)
48
49 return tabulate
50

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.45

Tested by

no test coverage detected