Ejemplo n.º 1
0
    def _verifyVar(self, var):
        if var is not None:
            raise SolutionVariableNumberError('The solution variable should not be specified.')

        if len(self._vars) != len(self._uncoupledTerms):
            raise SolutionVariableNumberError

        return _AbstractBinaryTerm._verifyVar(self, _CoupledCellVariable(self._vars))
Ejemplo n.º 2
0
    def __call__(self, _vars):
        _vars = list(_vars)

        if len(_vars) != len(self._vars) or len(set(_vars)) != len(self._vars):
            raise SolutionVariableNumberError

        for var in _vars:
            if var not in set(self._vars):
                raise SolutionVariableNumberError('Variable not in previously defined variables for this coupled equation.')

        self._internalVars = _vars
        return self