Skip to content

Commit

Permalink
Solver interface: removed the DAE type of solver (#1515).
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Jan 11, 2018
1 parent e580447 commit 8b4beee
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 289 deletions.
Expand Up @@ -288,10 +288,6 @@
<source>None available</source>
<translation>Aucun disponible</translation>
</message>
<message>
<source>DAE solver</source>
<translation>Solveur EAD</translation>
</message>
<message>
<source>NLA solver</source>
<translation>Solveur ANL</translation>
Expand Down Expand Up @@ -561,30 +557,14 @@
<source>the model needs both an ODE and an NLA solver, but no NLA solver is available</source>
<translation>le modèle a besoin à la fois d&apos;un solveur EDO et d&apos;un solveur ALN, mais aucun solveur ALN n&apos;est disponible</translation>
</message>
<message>
<source>the model needs both a DAE and an NLA solver, but none are available</source>
<translation>le modèle a besoin à la fois d&apos;un solveur EAD et d&apos;un solveur ALN, mais aucun n&apos;est disponible</translation>
</message>
<message>
<source>the model needs both a DAE and an NLA solver, but no NLA solver is available</source>
<translation>le modèle a besoin à la fois d&apos;un solveur EAD et d&apos;un solveur ALN, mais aucun solveur ALN n&apos;est disponible</translation>
</message>
<message>
<source>the model needs both an ODE and an NLA solver, but no ODE solver is available</source>
<translation>le modèle a besoin à la fois d&apos;un solveur EDO et d&apos;un solveur ALN, mais aucun solveur EDO n&apos;est disponible</translation>
</message>
<message>
<source>the model needs both a DAE and an NLA solver, but no DAE solver is available</source>
<translation>le modèle a besoin à la fois d&apos;un solveur EAD et d&apos;un solveur ALN, mais aucun solveur EAD n&apos;est disponible</translation>
</message>
<message>
<source>the model needs an ODE solver, but none is available</source>
<translation>le modèle a besoin d&apos;un solveur EDO, mais aucun n&apos;est disponible</translation>
</message>
<message>
<source>the model needs a DAE solver, but none is available</source>
<translation>le modèle a besoin d&apos;un solveur EAD, mais aucun n&apos;est disponible</translation>
</message>
<message>
<source>Save File</source>
<translation>Sauvegarder Fichier</translation>
Expand Down
Expand Up @@ -94,16 +94,11 @@ SimulationExperimentViewInformationSolversWidget::SimulationExperimentViewInform
// Add properties for our different solvers

mOdeSolverData = addSolverProperties(Solver::Ode);
mDaeSolverData = addSolverProperties(Solver::Dae);
mNlaSolverData = addSolverProperties(Solver::Nla);

// Show/hide the relevant properties

if (mOdeSolverData)
doSolverChanged(mOdeSolverData, mOdeSolverData->solversListProperty()->value());

if (mDaeSolverData)
doSolverChanged(mDaeSolverData, mDaeSolverData->solversListProperty()->value());
doSolverChanged(mOdeSolverData, mOdeSolverData->solversListProperty()->value());

if (mNlaSolverData)
doSolverChanged(mNlaSolverData, mNlaSolverData->solversListProperty()->value());
Expand All @@ -125,7 +120,6 @@ SimulationExperimentViewInformationSolversWidget::~SimulationExperimentViewInfor
// Delete some internal objects

delete mOdeSolverData;
delete mDaeSolverData;
delete mNlaSolverData;
}

Expand All @@ -142,13 +136,6 @@ void SimulationExperimentViewInformationSolversWidget::retranslateUi()
mOdeSolverData->solversListProperty()->setEmptyListValue(tr("None available"));
}

if (mDaeSolverData) {
mDaeSolverData->solversProperty()->setName(tr("DAE solver"));
mDaeSolverData->solversListProperty()->setName(tr("Name"));

mDaeSolverData->solversListProperty()->setEmptyListValue(tr("None available"));
}

if (mNlaSolverData) {
mNlaSolverData->solversProperty()->setName(tr("NLA solver"));
mNlaSolverData->solversListProperty()->setName(tr("Name"));
Expand Down Expand Up @@ -330,13 +317,9 @@ void SimulationExperimentViewInformationSolversWidget::initialize(SimulationSupp
// Make sure that the CellML file runtime is valid

if (pSimulation->runtime()->isValid()) {
// Show/hide the ODE/DAE/NLA solver information

if (mOdeSolverData)
mOdeSolverData->solversProperty()->setVisible(pSimulation->runtime()->needOdeSolver());
// Show/hide the ODE/NLA solver information

if (mDaeSolverData)
mDaeSolverData->solversProperty()->setVisible(pSimulation->runtime()->needDaeSolver());
mOdeSolverData->solversProperty()->setVisible(true);

if (mNlaSolverData)
mNlaSolverData->solversProperty()->setVisible(pSimulation->runtime()->needNlaSolver());
Expand All @@ -347,7 +330,6 @@ void SimulationExperimentViewInformationSolversWidget::initialize(SimulationSupp
QString voiUnit = pSimulation->runtime()->variableOfIntegration()->unit();

setPropertiesUnit(mOdeSolverData, voiUnit);
setPropertiesUnit(mDaeSolverData, voiUnit);
setPropertiesUnit(mNlaSolverData, voiUnit);

// Initialise our simulation's NLA solver's properties, so that we can then
Expand Down Expand Up @@ -375,15 +357,6 @@ QStringList SimulationExperimentViewInformationSolversWidget::odeSolvers() const

//==============================================================================

QStringList SimulationExperimentViewInformationSolversWidget::daeSolvers() const
{
// Return the available DAE solvers, if any

return mDaeSolverData?mDaeSolverData->solversListProperty()->listValues():QStringList();
}

//==============================================================================

QStringList SimulationExperimentViewInformationSolversWidget::nlaSolvers() const
{
// Return the available NLA solvers, if any
Expand All @@ -402,15 +375,6 @@ SimulationExperimentViewInformationSolversWidgetData * SimulationExperimentViewI

//==============================================================================

SimulationExperimentViewInformationSolversWidgetData * SimulationExperimentViewInformationSolversWidget::daeSolverData() const
{
// Return our DAE solver data

return mDaeSolverData;
}

//==============================================================================

SimulationExperimentViewInformationSolversWidgetData * SimulationExperimentViewInformationSolversWidget::nlaSolverData() const
{
// Return our NLA solver data
Expand Down Expand Up @@ -465,9 +429,6 @@ void SimulationExperimentViewInformationSolversWidget::updateGui(SimulationExper
if (mOdeSolverData && (!pSolverData || (pSolverData == mOdeSolverData)))
updateSolverGui(mOdeSolverData);

if (mDaeSolverData && (!pSolverData || (pSolverData == mDaeSolverData)))
updateSolverGui(mDaeSolverData);

if (mNlaSolverData && (!pSolverData || (pSolverData == mNlaSolverData)))
updateSolverGui(mNlaSolverData);
}
Expand Down Expand Up @@ -499,19 +460,17 @@ void SimulationExperimentViewInformationSolversWidget::doSolverChanged(Simulatio

void SimulationExperimentViewInformationSolversWidget::solverChanged(Core::Property *pProperty)
{
// Try, for the ODE/DAE/NLA solvers list property, to handle the change in
// the list property
// Note: the ODE/DAE/NLA solvers list property is our first property, hence
// we make sure that its row number is equal to zero (in case there is
// Try, for the ODE/NLA solvers list property, to handle the change in the
// list property
// Note: the ODE/NLA solvers list property is our first property, hence we
// make sure that its row number is equal to zero (in case there is
// one or several other list properties, as is the case for the CVODE
// and IDA solvers)...
// solver)...

if (!pProperty->row()) {
doSolverChanged((mOdeSolverData && (pProperty == mOdeSolverData->solversListProperty()))?
mOdeSolverData:
(mDaeSolverData && (pProperty == mDaeSolverData->solversListProperty()))?
mDaeSolverData:
mNlaSolverData,
mNlaSolverData,
pProperty->value());
}
}
Expand Down
Expand Up @@ -83,18 +83,15 @@ class SimulationExperimentViewInformationSolversWidget : public Core::PropertyEd
void initialize(SimulationSupport::Simulation *pSimulation);

QStringList odeSolvers() const;
QStringList daeSolvers() const;
QStringList nlaSolvers() const;

SimulationExperimentViewInformationSolversWidgetData * odeSolverData() const;
SimulationExperimentViewInformationSolversWidgetData * daeSolverData() const;
SimulationExperimentViewInformationSolversWidgetData * nlaSolverData() const;

void updateGui(SimulationExperimentViewInformationSolversWidgetData *pSolverData);

private:
SimulationExperimentViewInformationSolversWidgetData *mOdeSolverData;
SimulationExperimentViewInformationSolversWidgetData *mDaeSolverData;
SimulationExperimentViewInformationSolversWidgetData *mNlaSolverData;

QMap<Core::Property *, Descriptions> mDescriptions;
Expand Down

0 comments on commit 8b4beee

Please sign in to comment.