Skip to content

Commit

Permalink
Add qss test method to annotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquinffernandez committed Apr 20, 2023
1 parent 3927fd4 commit 45f7f4d
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, QSS_TEST, DASSL, DOPRI, CVODE_BDF, CVODE_AM, IDA } 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 45f7f4d

Please sign in to comment.