コード例 #1
0
ファイル: LagrangianView.py プロジェクト: mpigou/code_saturne
    def __init__(self, parent, case):
        """
        Constructor
        """
        QWidget.__init__(self, parent)

        Ui_LagrangianForm.__init__(self)
        self.setupUi(self)

        self.case = case
        self.case.undoStopGlobal()
        self.model = LagrangianModel(self.case)

        # Default settings
        self.default = {}
        self.default['scheme_order'] = self.model.getSchemeOrder()
        self.default['regular_particles'] = self.model.getRegularParticles()
        self.result = self.default.copy()

        # Combo model
        self.modelIPHYLA = ComboModel(self.comboBoxIPHYLA, 2, 1)
        self.modelIPHYLA.addItem(self.tr("No model"), 'off')
        self.modelIPHYLA.addItem(self.tr("Heat transfer and evaporation"),
                                 'thermal')
        if CoalCombustionModel(
                self.case).getCoalCombustionModel("only") != 'off':
            self.modelIPHYLA.addItem(self.tr("Pulverised coal model"), 'coal')
コード例 #2
0
    def __init__(self, parent, case):
        """
        Constructor
        """
        QWidget.__init__(self, parent)

        Ui_LagrangianForm.__init__(self)
        self.setupUi(self)

        self.case = case
        self.case.undoStopGlobal()
        self.model = LagrangianModel(self.case)

        # Combo model
        self.modelIPHYLA = ComboModel(self.comboBoxIPHYLA,2,1)
        self.modelIPHYLA.addItem(self.tr("No model"), 'off')
        self.modelIPHYLA.addItem(self.tr("Heat transfer and evaporation"), 'thermal')
        if CoalCombustionModel(self.case).getCoalCombustionModel("only") != 'off':
            self.modelIPHYLA.addItem(self.tr("Pulverised coal model"), 'coal')
コード例 #3
0
    def __init__(self, parent, case):
        """
        Constructor
        """
        QWidget.__init__(self, parent)

        Ui_LagrangianForm.__init__(self)
        self.setupUi(self)

        self.case = case
        self.case.undoStopGlobal()
        self.model = LagrangianModel(self.case)

        # Combo model
        self.modelIILAGR = ComboModel(self.comboBoxIILAGR,3,1)
        self.modelIILAGR.addItem(self.tr("One-way coupling"), "one_way")
        self.modelIILAGR.addItem(self.tr("Two-way coupling"), "two_way")
        self.modelIILAGR.addItem(self.tr("Frozen carrier flow"), "frozen")

        self.modelIPHYLA = ComboModel(self.comboBoxIPHYLA,2,1)
        self.modelIPHYLA.addItem(self.tr("No model"), 'off')
        self.modelIPHYLA.addItem(self.tr("Heat transfer and evaporation"), 'thermal')
        self.modelIPHYLA.addItem(self.tr("Pulverised coal model"), 'coal')

        # Connections
        self.connect(self.comboBoxIILAGR, SIGNAL("activated(const QString&)"), self.slotIILAGR)
        self.connect(self.checkBoxISUILA, SIGNAL("clicked()"), self.slotISUILA)
        self.connect(self.checkBoxISTTIO, SIGNAL("clicked()"), self.slotISTTIO)
        self.connect(self.checkBoxINJCON, SIGNAL("clicked()"), self.slotINJCON)
        self.connect(self.checkBoxIDEPST, SIGNAL("clicked()"), self.slotIDEPST)
        self.connect(self.comboBoxIPHYLA, SIGNAL("activated(const QString&)"), self.slotIPHYLA)
        self.connect(self.checkBoxITPVAR, SIGNAL("clicked()"), self.slotITPVAR)
        self.connect(self.checkBoxIMPVAR, SIGNAL("clicked()"), self.slotIMPVAR)
        self.connect(self.checkBoxIENCRA, SIGNAL("clicked()"), self.slotIENCRA)
        #
        self.connect(self.lineEditNSTITS, SIGNAL("textChanged(const QString &)"), self.slotNSTITS)
        self.connect(self.checkBoxLTSDYN, SIGNAL("clicked()"), self.slotLTSDYN)
        self.connect(self.checkBoxLTSMAS, SIGNAL("clicked()"), self.slotLTSMAS)
        self.connect(self.checkBoxLTSTHE, SIGNAL("clicked()"), self.slotLTSTHE)
        self.connect(self.toolButtonAdvanced, SIGNAL("clicked()"), self.slotAdvancedOptions)

        # Validators
        validatorNSTITS = IntValidator(self.lineEditNSTITS)

        self.lineEditNSTITS.setValidator(validatorNSTITS)

        # initialize Widgets

#        # Update the lagrangian list with the calculation features
#
#        for mdl in self.model.lagrangianCouplingMode():
#            if mdl not in self.model.lagrangianStatus():
#                self.modelIILAGR.disableItem(str_model=mdl)

        from code_saturne.Pages.CoalCombustionModel import CoalCombustionModel
        if CoalCombustionModel(self.case).getCoalCombustionModel() != 'off':
            self.modelIILAGR.disableItem(str_model="one_way")
            self.modelIILAGR.disableItem(str_model="two_way")
        del CoalCombustionModel

        model = self.model.getCouplingMode()
        self.modelIILAGR.setItem(str_model=model)
        self.slotIILAGR(self.modelIILAGR.dicoM2V[model])

        status = self.model.getRestart()
        if status == "on":
            self.checkBoxISUILA.setChecked(True)
        else:
            self.checkBoxISUILA.setChecked(False)

        status = self.model.getCarrierFlowStationary()
        if status == "on":
            self.checkBoxISTTIO.setChecked(True)
        else:
            self.checkBoxISTTIO.setChecked(False)

        status = self.model.getContinuousInjection()
        if status == "on":
            self.checkBoxINJCON.setChecked(True)
        else:
            self.checkBoxINJCON.setChecked(False)

        status = self.model.getDepositionSubmodel()
        if status == "on":
            self.checkBoxIDEPST.setChecked(True)
        else:
            self.checkBoxIDEPST.setChecked(False)

        if ( model == "frozen" ):
            self.labelISTTIO.setDisabled(True)
            self.checkBoxISTTIO.setChecked(True)
            self.checkBoxISTTIO.setDisabled(True)

        status = self.model.getContinuousInjection()
        if status == "on":
            self.checkBoxINJCON.setChecked(True)
        else:
            self.checkBoxINJCON.setChecked(False)

        part_model = self.model.getParticlesModel()
        self.modelIPHYLA.setItem(str_model=part_model)
        self.slotIPHYLA(self.modelIPHYLA.dicoM2V[part_model])

        self.case.undoStartGlobal()