예제 #1
0
    def get_resource(self):
        """Get the full resource name for a Ceed context.

       Returns:
         resource: resource name"""

        # libCEED call
        resource = ffi.new("char **")
        lib.CeedGetResource(self._pointer[0], resource)

        return ffi.string(resource[0]).decode("UTF-8")
예제 #2
0
 def _check_error(self, err_code):
     """Check return code and retrieve error message for non-zero code"""
     if (err_code != lib.CEED_ERROR_SUCCESS):
         message = ffi.new("char **")
         lib.CeedGetErrorMessage(self._pointer[0], message)
         raise Exception(ffi.string(message[0]).decode("UTF-8"))