Skip to content

Commit

Permalink
[iss-222]
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit a1e54cb
Author: joaquin.f.fernandez <joaquin.f.fernandez@gmail.com>
Date:   Tue Apr 25 14:24:06 2023 -0300

    Move QSS_TEST method to the end of Solver enum.

commit a11aef4
Author: joaquin.f.fernandez <joaquin.f.fernandez@gmail.com>
Date:   Tue Apr 25 14:23:27 2023 -0300

    Revert "Updated system tests GT files."

    This reverts commit 3496290.

commit 3496290
Author: joaquin.f.fernandez <joaquin.f.fernandez@gmail.com>
Date:   Tue Apr 25 11:49:21 2023 -0300

    Updated system tests GT files.

commit 45f7f4d
Author: joaquin.f.fernandez <joaquin.f.fernandez@gmail.com>
Date:   Thu Apr 20 10:47:40 2023 -0300

    Add qss test method to annotations.
  • Loading branch information
joaquinffernandez committed Apr 26, 2023
1 parent 9eafe4b commit f897250
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions src/mmoc/ir/annotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ void ModelAnnotation::processList(AST_Expression x, list<double> *l)
AST_ExpressionListIterator it;
foreach (it, el) {
if (current_element(it)->expressionType() == EXPOUTPUT) {
// If we have a pair, select the first element as the
// If we have a pair, select the first element as the
// value and the second as the size.
// This is used for DQMin and DQRel for arrays.
AST_Expression_Output out = current_element(it)->getAsOutput();
Expand All @@ -308,7 +308,7 @@ void ModelAnnotation::processList(AST_Expression x, list<double> *l)
AST_ExpressionListIterator pair_exp_it;
bool first = true;
AnnotationValue size;
foreach (pair_exp_it, pair_exp) {
foreach (pair_exp_it, pair_exp) {
if (first) {
av = ea.apply(current_element(pair_exp_it));
first = false;
Expand Down Expand Up @@ -448,11 +448,15 @@ Solver ModelAnnotation::getSolver(string s)
_order = 4;
_polyCoeffs = 5;
return QSS4;
} else if (!s.compare("QSS_TEST")) {
_order = 2;
_polyCoeffs = 3;
return QSS_TEST;
}
return QSS;
}

void ModelAnnotation::parseMatrix(AST_Expression exp, IR::MATRIX::UserDefMatrixExps& matrix)
void ModelAnnotation::parseMatrix(AST_Expression exp, IR::MATRIX::UserDefMatrixExps &matrix)
{
AST_ExpressionList matrix_exps = newAST_ExpressionList();
processExpressionList(exp, matrix_exps);
Expand Down Expand Up @@ -727,6 +731,7 @@ EvalAnnotation::EvalAnnotation() : _tokens()
_tokens.insert(pair<string, string>("LIQSS_BDF", "LIQSS_BDF"));
_tokens.insert(pair<string, string>("LIQSS3", "LIQSS3"));
_tokens.insert(pair<string, string>("QSS4", "QSS4"));
_tokens.insert(pair<string, string>("QSS_TEST", "QSS_TEST"));
_tokens.insert(pair<string, string>("DASSL", "DASSL"));
_tokens.insert(pair<string, string>("DOPRI", "DOPRI"));
_tokens.insert(pair<string, string>("CVODE_AM", "CVODE_AM"));
Expand Down
4 changes: 2 additions & 2 deletions src/mmoc/ir/annotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
namespace MicroModelica {
namespace IR {

typedef enum { QSS, CQSS, LIQSS, QSS2, LIQSS2, LIQSS_BDF, QSS3, LIQSS3, QSS4, DASSL, DOPRI, CVODE_BDF, CVODE_AM, IDA } Solver;
typedef enum { QSS, CQSS, LIQSS, QSS2, LIQSS2, LIQSS_BDF, QSS3, LIQSS3, QSS4, DASSL, DOPRI, CVODE_BDF, CVODE_AM, IDA, QSS_TEST } Solver;

typedef enum { Metis, HMetis, Scotch, Patoh, MTPL, MTPL_IT, Manual } PartitionMethod;

Expand Down Expand Up @@ -175,7 +175,7 @@ class ModelAnnotation {
Solver getSolver(string s);
PartitionMethod getPartitionMethod(string s);
DT_Synch getDtSynch(string s);
void parseMatrix(AST_Expression exp, IR::MATRIX::UserDefMatrixExps& matrix);
void parseMatrix(AST_Expression exp, IR::MATRIX::UserDefMatrixExps &matrix);

Solver _solver;
string _solverString;
Expand Down

0 comments on commit f897250

Please sign in to comment.