Skip to content

Commit

Permalink
py - refactor tests needing output
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylt committed Aug 2, 2021
1 parent 9733b31 commit 4dee459
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 172 deletions.
1 change: 1 addition & 0 deletions python/build_ceed_cffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
header = '\n'.join(lines)
header = header.split("static inline CeedInt CeedIntPow", 1)[0]
header += '\nextern int CeedVectorGetState(CeedVector, uint64_t*);'
header += '\nextern int CeedElemRestrictionGetELayout(CeedElemRestriction, CeedInt *layout);'
# Note: cffi cannot handle vargs
header = re.sub("va_list", "const char *", header)
ffibuilder.cdef(header)
Expand Down
23 changes: 23 additions & 0 deletions python/ceed_elemrestriction.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,29 @@ def get_multiplicity(self):
# Return
return mult

# Get ElemRestrition Layout
def get_layout(self):
"""Get the element vector layout of an ElemRestriction.
Returns:
layout: Vector containing layout array, stored as [nodes, components, elements].
The data for node i, component j, element k in the element
vector is given by i*layout[0] + j*layout[1] + k*layout[2]."""

# Create output array
layout = np.zeros(3, dtype="int32")
array_pointer = ffi.cast(
"CeedInt *",
layout.__array_interface__['data'][0])

# libCEED call
err_code = lib.CeedElemRestrictionGetELayout(
self._pointer[0], array_pointer)
self._ceed._check_error(err_code)

# Return
return layout

# ------------------------------------------------------------------------------


Expand Down
33 changes: 0 additions & 33 deletions python/tests/output/test_202.out

This file was deleted.

23 changes: 0 additions & 23 deletions python/tests/output/test_208.out

This file was deleted.

15 changes: 0 additions & 15 deletions python/tests/output/test_301.out

This file was deleted.

22 changes: 0 additions & 22 deletions python/tests/output/test_304.out

This file was deleted.

Loading

0 comments on commit 4dee459

Please sign in to comment.