def warning(self, msg): """ Add a warning to the log file. Args: msg (str): Content of the warning See also: :py:func:`~matlab2cpp.Node.error` """ backend.error(self, msg, True)
def error(self, msg): """ Add an error to the log file. Args: msg (str): Content of the error Example: >>> print mc.qlog(" a") Error in class Var on line 1: a ^ unknown data type """ backend.error(self, msg, False)
def __init__(self, data, zero=False, fn_space=None): self.data = data if not (self.data is None or isinstance(self.data, backend.Function) or isinstance(self.data, ufl.Form) or isinstance(self.data, backend.MultiMeshFunction)): backend.error("Got " + str(self.data.__class__) + " as input to the Vector() class. Don't know how to handle that.") # self.zero is true if we can prove that the vector is zero. if data is None: self.zero = True else: self.zero = zero if fn_space is not None: self.fn_space = fn_space