

def setup(self, conductance, quantity, super_pore_conductance):
    '\n        This setup provides the initial data for the solver from the provided\n        properties.\n        It also creates the matrices A and b.\n        '
    if (super_pore_conductance is None):
        self.super_pore_conductance = []
    else:
        self.super_pore_conductance = super_pore_conductance
    if (sp.size(self._phase) == 1):
        self._conductance = ('throat.' + conductance.split('.')[(- 1)])
        self._quantity = ('pore.' + quantity.split('.')[(- 1)])
        if self._phase.check_data_health(props=d._conductance).health:
            self['throat.conductance'] = self._phase[self._conductance]
        else:
            raise Exception('The provided throat conductance has problems')
    else:
        raise Exception('The linear solver accepts just one phase.')
    diag_added_data = sp.zeros(self.Np)
    RHS_added_data = sp.zeros(self.Np)
    for label in self.labels():
        if ('pore.source_' in label):
            source_name = ('pore.' + label.split('.')[(- 1)].replace('source_', ''))
            matching_physics = [phys for phys in self._phase._physics if (source_name in phys.models.keys())]
            for phys in matching_physics:
                x = phys.models[source_name]['x']
                if ((x != '') and (type(x) == str)):
                    if (x.split('.')[(- 1)] != quantity.split('.')[(- 1)]):
                        raise Exception(((((((((('The quantity(pore.' + x.split('.')[(- 1)]) + '), provided by source term(') + source_name) + '), is different ') + 'from the main quantity(pore.') + quantity.split('.')[(- 1)]) + ') in ') + self.name) + ' algorithm.'))
            source_name = label.replace('pore.source_', '')
            if (('pore.source_linear_s1_' + source_name) in self.props()):
                prop1 = ('pore.source_linear_s1_' + source_name)
                pores = (~ sp.isnan(self[prop1]))
                diag_added_data[pores] = (diag_added_data[pores] + self[prop1][pores])
                prop2 = ('pore.source_linear_s2_' + source_name)
                pores = (~ sp.isnan(self[prop2]))
                RHS_added_data[pores] = (RHS_added_data[pores] + self[prop2][pores])
    logger.info('Creating Coefficient matrix for the algorithm')
    d = diag_added_data
    self.A = self._build_coefficient_matrix(modified_diag_pores=self.Ps, diag_added_data=d)
    logger.info('Creating RHS matrix for the algorithm')
    self.b = self._build_RHS_matrix(modified_RHS_pores=self.Ps, RHS_added_data=(- RHS_added_data))

dataset/ETHPy150Open PMEAL/OpenPNM/OpenPNM/Algorithms/__GenericLinearTransport__.py GenericLinearTransport.setup/VarMisuse@113/208 `self`->`d`