MicroModelicaCCompiler  4.5.3
annotation.cpp
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  This file is part of QSS Solver.
4 
5  QSS Solver is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  QSS Solver is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QSS Solver. If not, see <http://www.gnu.org/licenses/>.
17 
18  ******************************************************************************/
19 
20 #include <algorithm>
21 #include <utility>
22 
23 #include "annotation.hpp"
24 
25 #include <ast/element.hpp>
26 #include <ast/expression.hpp>
27 #include <ast/modification.hpp>
28 #include <util/error.hpp>
29 #include <util/model_config.hpp>
30 #include <util/symbol_table.hpp>
31 #include <util/util.hpp>
32 
33 namespace MicroModelica {
34 using namespace Util;
35 namespace IR {
36 
37 FunctionAnnotation::FunctionAnnotation() : _annotations(), _derivative(), _include() { initialize(); }
38 
40 {
43  _annotations.insert(pair<string, FunctionAnnotation::type>("derivative", type::DERIVATIVE));
44  _annotations.insert(pair<string, FunctionAnnotation::type>("Include", type::INCLUDE));
45  _annotations.insert(pair<string, FunctionAnnotation::type>("IncludeDirectory", type::INCLUDE_DIRECTORY));
46  _annotations.insert(pair<string, FunctionAnnotation::type>("Library", type::LIBRARY));
47  _annotations.insert(pair<string, FunctionAnnotation::type>("LibraryDirectory", type::LIBRARY_DIRECTORY));
48 }
49 
50 bool FunctionAnnotation::hasDerivative() { return !_derivative.empty(); }
51 
52 bool FunctionAnnotation::hasInclude() { return !_include.empty(); }
53 
55 
57 
59 
60 bool FunctionAnnotation::insert(AST_Argument_Modification x)
61 {
62  string annot = *(x->name());
63  map<string, FunctionAnnotation::type>::const_iterator itf = _annotations.find(annot);
64  if (itf == _annotations.end()) {
65  return false;
66  }
67  if (x->hasModification() && (x->modification()->modificationType() == MODEQUAL)) {
68  AST_Expression mod = x->modification()->getAsEqual()->exp();
69  switch (itf->second) {
70  case type::INCLUDE:
71  if (mod->expressionType() == EXPSTRING) {
72  _include = mod->getAsString()->str();
73  }
74  break;
76  if (mod->expressionType() == EXPSTRING) {
77  _includeDirectory = mod->getAsString()->str();
78  }
79  break;
80  case type::LIBRARY:
81  if (mod->expressionType() == EXPSTRING) {
82  string l = mod->getAsString()->str();
83  _libraries.insert(l, l);
84  } else if (mod->expressionType() == EXPBRACE) {
85  AST_ExpressionList el = mod->getAsBrace()->arguments();
86  AST_ExpressionListIterator eli;
87  foreach (eli, el) {
88  string l = current_element(eli)->getAsString()->str();
89  _libraries.insert(l, l);
90  }
91  }
92  break;
94  if (mod->expressionType() == EXPSTRING) {
95  _libraryDirectory = mod->getAsString()->str();
96  }
97  break;
98  case type::DERIVATIVE:
99  if (mod->expressionType() == EXPSTRING) {
100  _derivative = mod->getAsString()->str();
101  }
102  break;
103  default:
104  break;
105  }
106  }
107  return true;
108 }
109 
110 string FunctionAnnotation::derivative() { return _derivative; }
111 
112 string FunctionAnnotation::include() { return _include; }
113 
115 
117 
119 
121  : _solver(Solver::LIQSS2),
122  _solverString("LIQSS2"),
123  _commInterval("CI_Step"),
124  _symDiff(true),
125  _minStep(1e-14),
126  _lps(1),
127  _derDelta(1e-8),
128  _nodeSize(10000),
129  _ZCHyst(1e-12),
130  _order(1),
131  _scheduler("ST_Binary"),
132  _storeData("SD_Memory"),
133  _annotations(),
134  _DQMin(),
135  _DQRel(),
136  _weight(-1),
137  _sample(),
138  _output(),
139  _initialTime(0),
140  _finalTime(0),
141  _partition_method_string("Scotch"),
142  _parallel(false),
143  _dt(0),
144  _polyCoeffs(1),
145  _dtSynch(DT_Synch::DT_Fixed),
146  _dtSynchString("SD_DT_Asynchronous"),
147  _desc(),
148  _patohSettings(),
149  _scotchSettings(),
150  _metisSettings(),
151  _jacobian(0),
152  _BDFPartition(newAST_ExpressionList()),
153  _BDFPartitionDepth(),
154  _BDFMaxStep(0),
155  _hd_matrix(),
156  _hz_matrix(),
157  _hh_matrix(),
158  _sd_matrix(),
159  _sz_matrix(),
160  _event_ids(),
161  _current_exp_id(-1)
162 {
163  initialize();
164 }
165 
167 {
168  _annotations.insert(pair<string, ModelAnnotation::type>("experiment", type::EXPERIMENT));
169  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_Description", type::DESC));
170  _annotations.insert(pair<string, ModelAnnotation::type>("Tolerance", type::DQREL));
171  _annotations.insert(pair<string, ModelAnnotation::type>("AbsTolerance", type::DQMIN));
172  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_Weight", type::WEIGHT));
173  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_Solver", type::SOLVER));
174  _annotations.insert(pair<string, ModelAnnotation::type>("StartTime", type::INITIAL_TIME));
175  _annotations.insert(pair<string, ModelAnnotation::type>("StopTime", type::FINAL_TIME));
176  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_MinStep", type::MIN_STEP));
177  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_ZCHyst", type::ZCHYST));
178  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_DerDelta", type::DER_DELTA));
179  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_LPS", type::LPS));
180  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_NodeSize", type::NODE_SIZE));
181  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_OutputType", type::COMM_INTERVAL));
182  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_Period", type::STEP_SIZE));
183  _annotations.insert(pair<string, ModelAnnotation::type>("Jacobian", type::JACOBIAN));
184  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_SymDiff", type::SYM_DIFF));
185  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_Scheduler", type::SCHEDULER));
186  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_Output", type::OUTPUT));
187  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_StoreData", type::STORE_DATA));
188  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_PartitionMethod", type::PARTITION_METHOD));
189  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_Parallel", type::PARALLEL));
190  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_DT_Min", type::DELTAT));
191  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_DT_Synch", type::DELTAT_SYNCH));
192  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_PatohSettings", type::PATOH_SETTINGS));
193  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_MetisSettings", type::METIS_SETTINGS));
194  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_ScotchSettings", type::SCOTCH_SETTINGS));
195  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_BDF_Part", type::BDF_PARTITION));
196  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_BDF_PDepth", type::BDF_PARTITION_DEPTH));
197  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_BDF_Max_Step", type::BDF_MAX_STEP));
198  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_Event_Id", type::EVENT_ID));
199  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_HD", type::HD_MATRIX));
200  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_HZ", type::HZ_MATRIX));
201  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_HH", type::HH_MATRIX));
202  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_LHS_ST", type::LHS_ST_MATRIX));
203  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_LHS_DSC", type::LHS_DSC_MATRIX));
204  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_RHS_ST", type::RHS_ST_MATRIX));
205  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_SD", type::SD_MATRIX));
206  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_SZ", type::SZ_MATRIX));
207  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_RandomSeed", type::RANDOM_SEED));
208  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_CVODEMaxOrder", type::CV_ODE_MAX_ORDER));
209  _annotations.insert(pair<string, ModelAnnotation::type>("MMO_XOutput", type::X_OUTPUT));
210  _integer_annotations_map.insert(pair<string, IntegerAnnotations>("MMO_RandomSeed", IntegerAnnotations::RandomSeed));
211  _integer_annotations_map.insert(pair<string, IntegerAnnotations>("MMO_CVODEMaxOrder", IntegerAnnotations::CVODEMaxOrder));
212  _integer_annotations_map.insert(pair<string, IntegerAnnotations>("MMO_XOutput", IntegerAnnotations::XOutput));
213  _sample.push_back(1e-2);
214  _DQMin.push_back(1e-3);
215  _DQRel.push_back(1e-3);
216 }
217 
218 void ModelAnnotation::expComment(AST_Comment x, int id)
219 {
220  if (x == nullptr) {
221  return;
222  }
223  _current_exp_id = id;
224  _weight = -1;
225  AST_ArgumentList al = x->arguments();
226  AST_ArgumentListIterator it;
227  foreach (it, al) {
228  AST_Argument a = current_element(it);
229  if (a->argumentType() == AR_MODIFICATION) {
230  insert(a->getAsModification());
231  }
232  }
233 }
234 
235 void ModelAnnotation::processArgument(AST_Argument_Modification arg)
236 {
237  if (arg->hasModification()) {
238  AST_Modification m = arg->modification();
239  if (m->modificationType() == MODEQUAL) {
240  processAnnotation(*(arg->name()), m->getAsEqual());
241  } else {
242  Error::instance().add(m->lineNum(), EM_IR | EM_ANNOTATION_TYPE, ER_Error, "%s", arg->name()->c_str());
243  }
244  } else {
245  Error::instance().add(arg->lineNum(), EM_IR | EM_ANNOTATION_TYPE, ER_Error, "%s", arg->name()->c_str());
246  }
247 }
248 
249 bool ModelAnnotation::insert(AST_Argument_Modification x)
250 {
251  string annot = *(x->name());
252  map<string, ModelAnnotation::type>::const_iterator itf = _annotations.find(annot);
253  if (itf == _annotations.end()) {
254  return false;
255  }
256  switch (itf->second) {
257  case type::EXPERIMENT: {
258  if (x->hasModification()) {
259  AST_Modification mod = x->modification();
260  if (mod->modificationType() == MODCLASS) {
261  AST_Modification_Class mc = mod->getAsClass();
262  AST_ArgumentListIterator it;
263  foreach (it, mc->arguments()) {
264  if (current_element(it)->argumentType() == AR_MODIFICATION) {
265  processArgument(current_element(it)->getAsModification());
266  } else {
267  Error::instance().add(x->lineNum(), EM_IR | EM_ANNOTATION_TYPE, ER_Error, "%s", x->name()->c_str());
268  }
269  }
270  } else {
271  Error::instance().add(x->lineNum(), EM_IR | EM_ANNOTATION_NOT_FOUND, ER_Error, "Missing modification arguments. %s",
272  x->name()->c_str());
273  }
274  } else {
275  Error::instance().add(x->lineNum(), EM_IR | EM_ANNOTATION_NOT_FOUND, ER_Warning, "%s", x->name()->c_str());
276  }
277  } break;
278  case type::WEIGHT:
279  case type::EVENT_ID:
280  case type::HD_MATRIX:
281  case type::HZ_MATRIX:
282  case type::HH_MATRIX:
283  case type::LHS_ST_MATRIX:
285  case type::RHS_ST_MATRIX:
286  case type::SD_MATRIX:
287  case type::SZ_MATRIX:
288  processArgument(x);
289  break;
290  default:
291  break;
292  }
293  return true;
294 }
295 
296 void ModelAnnotation::processList(AST_Expression x, list<double> *l)
297 {
298  l->clear();
299  EvalAnnotation ea;
300  AnnotationValue av;
301  if (x->expressionType() == EXPBRACE) {
302  AST_Expression_Brace b = x->getAsBrace();
303  AST_ExpressionList el = b->arguments();
304  AST_ExpressionListIterator it;
305  foreach (it, el) {
306  if (current_element(it)->expressionType() == EXPOUTPUT) {
307  // If we have a pair, select the first element as the
308  // value and the second as the size.
309  // This is used for DQMin and DQRel for arrays.
310  AST_Expression_Output out = current_element(it)->getAsOutput();
311  AST_ExpressionList pair_exp = out->expressionList();
312  if (pair_exp->size() != 2) {
313  Error::instance().add(x->lineNum(), EM_IR | EM_ANNOTATION_NOT_FOUND, ER_Warning, "Tolerances expression must be a pair.");
314  return;
315  }
316  AST_ExpressionListIterator pair_exp_it;
317  bool first = true;
318  AnnotationValue size;
319  foreach (pair_exp_it, pair_exp) {
320  if (first) {
321  av = ea.apply(current_element(pair_exp_it));
322  first = false;
323  } else {
324  size = ea.apply(current_element(pair_exp_it));
325  }
326  }
327  for (int i = 0; i < size.integer(); i++) {
328  l->push_back(av.real());
329  }
330  } else {
331  av = ea.apply(current_element(it));
332  l->push_back(av.real());
333  }
334  }
335  }
336 }
337 
338 void ModelAnnotation::processList(AST_Expression x, list<string> *l)
339 {
340  l->clear();
341  EvalAnnotation ea;
342  AnnotationValue av;
343  if (x->expressionType() == EXPBRACE) {
344  AST_Expression_Brace b = x->getAsBrace();
345  AST_ExpressionList el = b->arguments();
346  AST_ExpressionListIterator it;
347  foreach (it, el) {
348  av = ea.apply(current_element(it));
349  l->push_back(av.str());
350  }
351  } else {
352  av = ea.apply(x);
353  l->push_back(av.str());
354  }
355 }
356 
357 void ModelAnnotation::processExpressionList(AST_Expression x, AST_ExpressionList exps)
358 {
359  if (x->expressionType() == EXPBRACE) {
360  AST_Expression_Brace b = x->getAsBrace();
361  AST_ExpressionList el = b->arguments();
362  AST_ExpressionListIterator it;
363  foreach (it, el) {
364  exps->push_back(current_element(it));
365  }
366  }
367 }
368 
370 {
371  if (!s.compare("SD_DT_Fixed")) {
372  return DT_Synch::DT_Fixed;
373  } else if (!s.compare("SD_DT_Asynchronous")) {
375  }
376  return DT_Synch::DT_Fixed;
377 }
378 
380 {
381  if (!s.compare("QSS")) {
382  _order = 1;
383  _polyCoeffs = 2;
384  return Solver::QSS;
385  } else if (!s.compare("CQSS")) {
386  _order = 1;
387  _polyCoeffs = 2;
388  return Solver::CQSS;
389  } else if (!s.compare("LIQSS")) {
390  _order = 1;
391  _polyCoeffs = 2;
392  return Solver::LIQSS;
393  } else if (!s.compare("QSS2")) {
394  _order = 2;
395  _polyCoeffs = 3;
396  return Solver::QSS2;
397  } else if (!s.compare("LIQSS2")) {
398  _order = 2;
399  _polyCoeffs = 3;
400  return Solver::LIQSS2;
401  } else if (!s.compare("LIQSS_BDF")) {
402  _order = 2;
403  _polyCoeffs = 3;
404  return Solver::LIQSS_BDF;
405  } else if (!s.compare("QSS3")) {
406  _order = 3;
407  _polyCoeffs = 4;
408  return Solver::QSS3;
409  } else if (!s.compare("LIQSS3")) {
410  _order = 3;
411  _polyCoeffs = 4;
412  return Solver::LIQSS3;
413  } else if (!s.compare("DASSL")) {
414  _order = 1;
415  _polyCoeffs = 1;
416  return Solver::DASSL;
417  } else if (!s.compare("DOPRI")) {
418  _order = 1;
419  _polyCoeffs = 1;
420  return Solver::DOPRI;
421  } else if (!s.compare("CVODE_BDF")) {
422  _order = 1;
423  _polyCoeffs = 1;
424  return Solver::CVODE_BDF;
425  } else if (!s.compare("IDA")) {
426  _order = 1;
427  _polyCoeffs = 1;
428  return Solver::IDA;
429  } else if (!s.compare("CVODE_AM")) {
430  _order = 1;
431  _polyCoeffs = 1;
432  return Solver::CVODE_AM;
433  } else if (!s.compare("QSS4")) {
434  _order = 4;
435  _polyCoeffs = 5;
436  return Solver::QSS4;
437  } else if (!s.compare("mLIQSS")) {
438  _order = 1;
439  _polyCoeffs = 2;
440  return Solver::mLIQSS;
441  } else if (!s.compare("mLIQSS2")) {
442  _order = 2;
443  _polyCoeffs = 3;
444  return Solver::mLIQSS2;
445  }
446  return Solver::QSS;
447 }
448 
449 void ModelAnnotation::parseMatrix(AST_Expression exp, IR::MATRIX::UserDefMatrixExps &matrix)
450 {
451  AST_ExpressionList matrix_exps = newAST_ExpressionList();
452  processExpressionList(exp, matrix_exps);
453  matrix[_current_exp_id] = matrix_exps;
454 }
455 
456 void ModelAnnotation::processAnnotation(string annot, AST_Modification_Equal x)
457 {
458  map<string, ModelAnnotation::type>::const_iterator itf = _annotations.find(annot);
459  if (itf == _annotations.end()) {
460  Error::instance().add(x->lineNum(), EM_IR | EM_ANNOTATION_NOT_FOUND, ER_Warning, "%s", annot.c_str());
461  }
462  EvalAnnotation ea;
463  AnnotationValue av;
464  if (itf->second != type::DQMIN && itf->second != type::DQREL && itf->second != type::STEP_SIZE) {
465  av = ea.apply(x->exp());
466  }
467  switch (itf->second) {
468  case type::DESC:
469  _desc = av.str();
470  break;
471  case type::DQMIN:
472  processList(x->exp(), &_DQMin);
473  break;
474  case type::DQREL:
475  processList(x->exp(), &_DQRel);
476  break;
477  case type::WEIGHT:
478  _weight = av.real();
479  break;
480  case type::SOLVER:
481  _solver = getSolver(av.str());
482  _solverString = av.str();
483  break;
484  case type::INITIAL_TIME:
485  _initialTime = av.real();
486  break;
487  case type::FINAL_TIME:
488  _finalTime = av.real();
489  break;
490  case type::MIN_STEP:
491  _minStep = av.real();
492  break;
493  case type::ZCHYST:
494  _ZCHyst = av.real();
495  break;
496  case type::DER_DELTA:
497  _derDelta = av.real();
498  break;
499  case type::LPS:
500  _lps = av.integer();
501  break;
502  case type::NODE_SIZE:
503  _nodeSize = av.integer();
504  break;
505  case type::COMM_INTERVAL:
506  _commInterval = av.str();
507  break;
508  case type::STEP_SIZE:
509  processList(x->exp(), &_sample);
510  break;
511  case type::SCHEDULER:
512  _scheduler = av.str();
513  break;
514  case type::JACOBIAN:
515  _jacobian = ("Sparse" == av.str() ? 0 : 1);
516  break;
517  case type::SYM_DIFF:
518  _symDiff = true;
519  if (av.integer() == 0) {
520  _symDiff = false;
521  }
522  break;
523  case type::OUTPUT:
524  processExpressionList(x->exp(), &_output);
525  break;
527  _partition_method_string = av.str();
528  break;
529  case type::DELTAT_SYNCH:
530  _dtSynch = getDtSynch(av.str());
531  _dtSynchString = av.str();
532  break;
533  case type::PARALLEL:
534  _parallel = true;
535  if (av.integer() == 0) {
536  _parallel = false;
537  }
538  break;
539  case type::DELTAT:
540  _dt = av.real();
541  break;
542  case type::STORE_DATA:
543  break;
545  processList(x->exp(), &_patohSettings);
546  break;
548  processList(x->exp(), &_scotchSettings);
549  break;
551  processList(x->exp(), &_metisSettings);
552  break;
553  case type::BDF_PARTITION:
555  break;
557  _BDFPartitionDepth = av.integer();
558  break;
559  case type::BDF_MAX_STEP:
560  _BDFMaxStep = av.real();
561  break;
562  case type::EVENT_ID:
563  _event_ids = av.plainStr();
564  break;
565  case type::HD_MATRIX:
566  parseMatrix(x->exp(), _hd_matrix);
567  break;
568  case type::HZ_MATRIX:
569  parseMatrix(x->exp(), _hz_matrix);
570  break;
571  case type::HH_MATRIX:
572  parseMatrix(x->exp(), _hh_matrix);
573  break;
574  case type::LHS_ST_MATRIX:
575  parseMatrix(x->exp(), _lhs_st_matrix);
576  break;
577  case type::RHS_ST_MATRIX:
578  parseMatrix(x->exp(), _rhs_st_matrix);
579  break;
581  parseMatrix(x->exp(), _lhs_dsc_matrix);
582  break;
583  case type::SD_MATRIX:
584  parseMatrix(x->exp(), _sd_matrix);
585  break;
586  case type::SZ_MATRIX:
587  parseMatrix(x->exp(), _sz_matrix);
588  break;
589  case type::RANDOM_SEED:
591  case type::X_OUTPUT: {
592  IntegerAnnotations int_annot = _integer_annotations_map[itf->first];
593  _integer_annotations_val.insert(pair<IntegerAnnotations, int>(int_annot, av.integer()));
594  break;
595  }
596  default:
597  break;
598  }
599 }
600 
603 {
604  if (hasAnnotation(annot)) {
605  return _integer_annotations_val.at(annot);
606  }
607  return 0;
608 }
609 
611 {
612  return _integer_annotations_val.find(annot) != _integer_annotations_val.end();
613 }
614 
615 string ModelAnnotation::desc() { return _desc; }
616 
617 list<double> ModelAnnotation::dqmin() { return _DQMin; }
618 
619 double ModelAnnotation::DT() { return _dt; }
620 
621 list<double> ModelAnnotation::dqrel() { return _DQRel; }
622 
623 double ModelAnnotation::weight() { return _weight; }
624 
625 string ModelAnnotation::solverString() { return _solverString; }
626 
628 
630 
632 
634 
635 double ModelAnnotation::initialTime() { return _initialTime; }
636 
637 double ModelAnnotation::finalTime() { return _finalTime; }
638 
639 double ModelAnnotation::minStep() { return _minStep; }
640 
641 double ModelAnnotation::ZCHyst() { return _ZCHyst; }
642 
643 double ModelAnnotation::derDelta() { return _derDelta; }
644 
645 string ModelAnnotation::storeData() { return _storeData; }
646 
647 int ModelAnnotation::jacobian() { return _jacobian; }
648 
650 {
653 }
654 
655 int ModelAnnotation::lps() { return _lps; }
656 
657 int ModelAnnotation::nodeSize() { return _nodeSize; }
658 
659 string ModelAnnotation::commInterval() { return _commInterval; }
660 
661 list<double> ModelAnnotation::sample() { return _sample; }
662 
663 string ModelAnnotation::scheduler() { return _scheduler; }
664 
665 bool ModelAnnotation::symDiff() { return _symDiff; }
666 
667 int ModelAnnotation::order() { return _order; }
668 
669 list<AST_Expression> ModelAnnotation::output() { return _output; }
670 
671 list<string> ModelAnnotation::patohSettings() { return _patohSettings; }
672 
673 list<string> ModelAnnotation::scotchSettings() { return _scotchSettings; }
674 
675 list<string> ModelAnnotation::metisSettings() { return _metisSettings; }
676 
677 AST_ExpressionList ModelAnnotation::BDFPartition() { return _BDFPartition; }
678 
680 
681 double ModelAnnotation::BDFMaxStep() { return _BDFMaxStep; }
682 
683 bool ModelAnnotation::parallel() { return _parallel; }
684 
686 
687 string ModelAnnotation::EventId() { return _event_ids; }
688 
690 
692 
694 
696 
698 
700 
702 
704 
705 /* AnnotationValue class */
706 
707 AnnotationValue::AnnotationValue() : _integer(0), _real(0), _str(), _plain_str() {}
708 
709 int AnnotationValue::integer() { return _integer; }
710 
711 void AnnotationValue::setInteger(int i) { _integer = i; }
712 
713 double AnnotationValue::real() { return _real; }
714 
715 void AnnotationValue::setReal(double d) { _real = d; }
716 
717 string AnnotationValue::str() { return _str; }
718 
719 void AnnotationValue::setStr(string s) { _str = s; }
720 
721 string AnnotationValue::plainStr() { return _plain_str; }
722 
723 void AnnotationValue::setPlainStr(string plain_str) { _plain_str = plain_str; }
724 
725 /* EvalAnnotation class */
726 
727 EvalAnnotation::EvalAnnotation() : _tokens()
728 {
729  _tokens.emplace_back("QSS");
730  _tokens.emplace_back("CQSS");
731  _tokens.emplace_back("QSS2");
732  _tokens.emplace_back("QSS3");
733  _tokens.emplace_back("LIQSS");
734  _tokens.emplace_back("LIQSS2");
735  _tokens.emplace_back("LIQSS_BDF");
736  _tokens.emplace_back("LIQSS3");
737  _tokens.emplace_back("QSS4");
738  _tokens.emplace_back("mLIQSS");
739  _tokens.emplace_back("mLIQSS2");
740  _tokens.emplace_back("DASSL");
741  _tokens.emplace_back("DOPRI");
742  _tokens.emplace_back("CVODE_AM");
743  _tokens.emplace_back("IDA");
744  _tokens.emplace_back("CVODE_BDF");
745  _tokens.emplace_back("ST_Linear");
746  _tokens.emplace_back("ST_Binary");
747  _tokens.emplace_back("ST_Random");
748  _tokens.emplace_back("CI_Step");
749  _tokens.emplace_back("CI_Dense");
750  _tokens.emplace_back("CI_Sampled");
751  _tokens.emplace_back("SD_File");
752  _tokens.emplace_back("SD_Memory");
753  _tokens.emplace_back("Metis");
754  _tokens.emplace_back("HMetis");
755  _tokens.emplace_back("Scotch");
756  _tokens.emplace_back("Patoh");
757  _tokens.emplace_back("KaHIP");
758  _tokens.emplace_back("Manual");
759  _tokens.emplace_back("SD_DT_Fixed");
760  _tokens.emplace_back("Sparse");
761  _tokens.emplace_back("Dense");
762  _tokens.emplace_back("SD_DT_Asynchronous");
763 }
764 
766 {
767  auto av = AnnotationValue();
768  switch (e->expressionType()) {
769  case EXPSTRING:
770  av.setStr(e->getAsString()->print());
771  av.setPlainStr(e->getAsString()->str());
772  break;
773  case EXPCOMPREF: {
774  AST_Expression_ComponentReference cr = e->getAsComponentReference();
775  string name = cr->name();
777  if (vi) {
778  if (vi->isConstant()) {
779  av.setInteger(vi->value());
780  }
781  } else {
782  if (std::find(_tokens.begin(), _tokens.end(), name) != _tokens.end()) {
783  av.setStr(name);
784  }
785  }
786  } break;
787  case EXPINTEGER:
788  av.setInteger(e->getAsInteger()->val());
789  av.setReal(e->getAsInteger()->val());
790  break;
791  case EXPREAL:
792  av.setReal(e->getAsReal()->val());
793  av.setInteger(static_cast<int>(e->getAsReal()->val()));
794  break;
795  case EXPBOOLEAN:
796  if (e->getAsBoolean()->value()) {
797  av.setInteger(1);
798  } else {
799  av.setInteger(0);
800  }
801  break;
802  case EXPBOOLEANNOT: {
803  AnnotationValue a = apply(e->getAsBooleanNot()->exp());
804  if (a.integer() == 1) {
805  av.setInteger(0);
806  } else {
807  av.setInteger(1);
808  }
809  break;
810  }
811  default:
812  break;
813  }
814  return av;
815 }
816 
817 void EvalAnnotation::setBoolean(bool condition, AnnotationValue *e)
818 {
819  if (condition) {
820  e->setInteger(1);
821  } else {
822  e->setInteger(0);
823  }
824 }
825 
826 AnnotationValue EvalAnnotation::foldTraverseElement(AnnotationValue e1, AnnotationValue e2, BinOpType bot)
827 {
828  auto av = AnnotationValue();
829  switch (bot) {
830  case BINOPOR:
831  setBoolean(e1.integer() || e2.integer(), &av);
832  break;
833  case BINOPAND:
834  setBoolean(e1.integer() && e2.integer(), &av);
835  break;
836  case BINOPLOWER:
837  setBoolean((e1.integer() < e2.integer()) || (e1.real() < e2.real()), &av);
838  break;
839  case BINOPLOWEREQ:
840  setBoolean((e1.integer() <= e2.integer()) || (e1.real() <= e2.real()), &av);
841  break;
842  case BINOPGREATER:
843  setBoolean((e1.integer() > e2.integer()) || (e1.real() > e2.real()), &av);
844  break;
845  case BINOPGREATEREQ:
846  setBoolean((e1.integer() >= e2.integer()) || (e1.real() >= e2.real()), &av);
847  break;
848  case BINOPCOMPNE:
849  setBoolean((e1.integer() != e2.integer()) || (e1.real() != e2.real()), &av);
850  break;
851  case BINOPCOMPEQ:
852  setBoolean((e1.integer() == e2.integer()) || (e1.real() == e2.real()), &av);
853  break;
854  case BINOPADD:
855  av.setInteger(e1.integer() + e2.integer());
856  av.setReal(e1.real() + e2.real());
857  break;
858  case BINOPSUB:
859  av.setInteger(e1.integer() - e2.integer());
860  av.setReal(e1.real() - e2.real());
861  break;
862  case BINOPDIV:
863  if (e2.integer() != 0) {
864  av.setInteger(e1.integer() / e2.integer());
865  }
866  if (e2.real() != 0) {
867  av.setReal(e1.real() / e2.real());
868  }
869  break;
870  case BINOPMULT:
871  av.setInteger(e1.integer() * e2.integer());
872  av.setReal(e1.real() * e2.real());
873  break;
874  default:
875  break;
876  }
877  return av;
878 }
879 
880 AnnotationValue EvalAnnotation::foldTraverseElementUMinus(AST_Expression e)
881 {
882  AnnotationValue av = foldTraverseElement(e);
883  av.setInteger(-1 * av.integer());
884  av.setReal(-1 * av.real());
885  return av;
886 }
887 
888 } // namespace IR
889 } // namespace MicroModelica
MicroModelica::IR::ModelAnnotation::HZMatrix
IR::MATRIX::UserDefMatrixExps HZMatrix()
Definition: annotation.cpp:708
MicroModelica::IR::FunctionAnnotation::includeDirectory
string includeDirectory()
Definition: annotation.cpp:131
MicroModelica::IR::AnnotationValue::_real
double _real
Definition: annotation.hpp:297
MicroModelica::IR::Solver::LIQSS2
@ LIQSS2
MicroModelica::IR::ModelAnnotation::type::SYM_DIFF
@ SYM_DIFF
MicroModelica::IR::ModelAnnotation::type::BDF_MAX_STEP
@ BDF_MAX_STEP
MicroModelica::IR::ModelAnnotation::_parallel
bool _parallel
Definition: annotation.hpp:253
MicroModelica::Util::ModelConfig::lookup
Option< Variable > lookup(std::string var_name)
Definition: model_config.hpp:125
EXPINTEGER
@ EXPINTEGER
Definition: ast_types.hpp:180
EXPOUTPUT
@ EXPOUTPUT
Definition: ast_types.hpp:182
MicroModelica::IR::AnnotationValue::AnnotationValue
AnnotationValue()
Definition: annotation.cpp:724
MicroModelica::IR::Solver::LIQSS3
@ LIQSS3
MicroModelica::IR::ModelAnnotation::_sz_matrix
IR::MATRIX::UserDefMatrixExps _sz_matrix
Definition: annotation.hpp:273
MicroModelica::Util::Error::instance
static Error & instance()
Definition: error.hpp:128
MicroModelica::IR::ModelAnnotation::ModelAnnotation
ModelAnnotation()
Definition: annotation.cpp:137
MicroModelica::IR::DT_Synch::DT_Asynchronous
@ DT_Asynchronous
MicroModelica::IR::FunctionAnnotation::type::LIBRARY_DIRECTORY
@ LIBRARY_DIRECTORY
MicroModelica::IR::AnnotationValue::setPlainStr
void setPlainStr(string plain_str)
Definition: annotation.cpp:740
EM_ANNOTATION_NOT_FOUND
#define EM_ANNOTATION_NOT_FOUND
Definition: error.hpp:117
MicroModelica::IR::FunctionAnnotation::_libraries
Util::SymbolTable _libraries
Definition: annotation.hpp:115
MicroModelica::IR::ModelAnnotation::insert
bool insert(AST_Argument_Modification x)
Definition: annotation.cpp:266
BINOPAND
@ BINOPAND
Definition: ast_types.hpp:139
EXPCOMPREF
@ EXPCOMPREF
Definition: ast_types.hpp:165
BINOPCOMPEQ
@ BINOPCOMPEQ
Definition: ast_types.hpp:145
MicroModelica::IR::ModelAnnotation::ZCHyst
double ZCHyst()
Definition: annotation.cpp:658
MicroModelica::IR::ModelAnnotation::_commInterval
string _commInterval
Definition: annotation.hpp:234
MicroModelica::IR::ModelAnnotation::_BDFPartitionDepth
int _BDFPartitionDepth
Definition: annotation.hpp:264
MicroModelica::IR::ModelAnnotation::initialTime
double initialTime()
Definition: annotation.cpp:652
MicroModelica::IR::ModelAnnotation::type::RHS_ST_MATRIX
@ RHS_ST_MATRIX
MicroModelica::IR::ModelAnnotation::_dtSynch
DT_Synch _dtSynch
Definition: annotation.hpp:256
MicroModelica::IR::IntegerAnnotations::CVODEMaxOrder
@ CVODEMaxOrder
MicroModelica::IR::ModelAnnotation::type::HH_MATRIX
@ HH_MATRIX
MicroModelica::IR::FunctionAnnotation::initialize
void initialize()
Definition: annotation.cpp:56
MicroModelica::IR::ModelAnnotation::BDFPartition
AST_ExpressionList BDFPartition()
Definition: annotation.cpp:694
MicroModelica::IR::ModelAnnotation::_lps
int _lps
Definition: annotation.hpp:237
MicroModelica::IR::ModelAnnotation::type::X_OUTPUT
@ X_OUTPUT
MicroModelica::IR::ModelAnnotation::type::DELTAT_SYNCH
@ DELTAT_SYNCH
MicroModelica::IR::ModelAnnotation::parseMatrix
void parseMatrix(AST_Expression exp, IR::MATRIX::UserDefMatrixExps &matrix)
Definition: annotation.cpp:466
MicroModelica::IR::ModelAnnotation::_DQMin
list< double > _DQMin
Definition: annotation.hpp:245
EM_ANNOTATION_TYPE
#define EM_ANNOTATION_TYPE
Definition: error.hpp:118
MicroModelica::IR::EvalAnnotation::foldTraverseElement
AnnotationValue foldTraverseElement(AST_Expression) override
Definition: annotation.cpp:782
MicroModelica::IR::ModelAnnotation::LHSDSCMatrix
IR::MATRIX::UserDefMatrixExps LHSDSCMatrix()
Definition: annotation.cpp:714
MicroModelica::IR::ModelAnnotation::type::HD_MATRIX
@ HD_MATRIX
MicroModelica::IR::ModelAnnotation::type::BDF_PARTITION_DEPTH
@ BDF_PARTITION_DEPTH
MicroModelica::IR::ModelAnnotation::BDFPartitionDepth
int BDFPartitionDepth()
Definition: annotation.cpp:696
MicroModelica::IR::ModelAnnotation::type::SD_MATRIX
@ SD_MATRIX
MicroModelica::IR::IntegerAnnotations
IntegerAnnotations
Definition: annotation.hpp:119
MicroModelica::IR::FunctionAnnotation::_libraryDirectory
std::string _libraryDirectory
Definition: annotation.hpp:116
MicroModelica::IR::ModelAnnotation::_patohSettings
list< string > _patohSettings
Definition: annotation.hpp:259
MicroModelica::IR::ModelAnnotation::processArgument
void processArgument(AST_Argument_Modification arg)
Definition: annotation.cpp:252
BINOPGREATER
@ BINOPGREATER
Definition: ast_types.hpp:142
MicroModelica::IR::ModelAnnotation::type::LHS_ST_MATRIX
@ LHS_ST_MATRIX
MicroModelica::IR::AnnotationValue::real
double real()
Definition: annotation.cpp:730
MicroModelica::IR::ModelAnnotation::metisSettings
list< string > metisSettings()
Definition: annotation.cpp:692
MicroModelica::IR::ModelAnnotation::type::LPS
@ LPS
symbol_table.hpp
MicroModelica::IR::EvalAnnotation::setBoolean
void setBoolean(bool condition, AnnotationValue *e)
Definition: annotation.cpp:834
MicroModelica::IR::AnnotationValue
Definition: annotation.hpp:282
MicroModelica::IR::ModelAnnotation::solver
Solver solver()
Definition: annotation.cpp:644
MicroModelica::IR::AnnotationValue::setStr
void setStr(string s)
Definition: annotation.cpp:736
element.hpp
MicroModelica::IR::ModelAnnotation::minStep
double minStep()
Definition: annotation.cpp:656
MicroModelica::IR::ModelAnnotation::initialize
void initialize()
Definition: annotation.cpp:183
MicroModelica::IR::IntegerAnnotations::RandomSeed
@ RandomSeed
MicroModelica::IR::FunctionAnnotation::hasIncludeDirectory
bool hasIncludeDirectory()
Definition: annotation.cpp:71
MicroModelica::IR::ModelAnnotation::processAnnotation
void processAnnotation(string annot, AST_Modification_Equal x)
Definition: annotation.cpp:473
MicroModelica::IR::ModelAnnotation::type::DQMIN
@ DQMIN
MicroModelica::IR::ModelAnnotation::type::LHS_DSC_MATRIX
@ LHS_DSC_MATRIX
MicroModelica::IR::Solver::CVODE_AM
@ CVODE_AM
Option
Definition: util_types.hpp:32
MicroModelica::IR::FunctionAnnotation::hasInclude
bool hasInclude()
Definition: annotation.cpp:69
BINOPLOWER
@ BINOPLOWER
Definition: ast_types.hpp:140
MicroModelica::IR::ModelAnnotation::_lhs_dsc_matrix
IR::MATRIX::UserDefMatrixExps _lhs_dsc_matrix
Definition: annotation.hpp:271
MicroModelica::IR::MATRIX::UserDefMatrixExps
std::map< int,AST_ExpressionList > UserDefMatrixExps
Definition: model_matrix_gen.hpp:90
MicroModelica::IR::ModelAnnotation::_output
list< AST_Expression > _output
Definition: annotation.hpp:249
MicroModelica::IR::FunctionAnnotation::hasLibraryDirectory
bool hasLibraryDirectory()
Definition: annotation.cpp:75
MicroModelica::IR::Solver::QSS3
@ QSS3
MicroModelica::IR::ModelAnnotation::type::CV_ODE_MAX_ORDER
@ CV_ODE_MAX_ORDER
MicroModelica::IR::ModelAnnotation::_finalTime
double _finalTime
Definition: annotation.hpp:251
MicroModelica::IR::ModelAnnotation::desc
string desc()
Definition: annotation.cpp:632
MicroModelica::IR::Solver::LIQSS_BDF
@ LIQSS_BDF
BINOPMULT
@ BINOPMULT
Definition: ast_types.hpp:152
MicroModelica::IR::ModelAnnotation::nodeSize
int nodeSize()
Definition: annotation.cpp:674
model_config.hpp
MicroModelica::IR::ModelAnnotation::_solverString
string _solverString
Definition: annotation.hpp:233
MicroModelica::IR::AnnotationValue::_str
string _str
Definition: annotation.hpp:298
MicroModelica::IR::ModelAnnotation::type::NODE_SIZE
@ NODE_SIZE
MicroModelica::IR::ModelAnnotation::dtSynch
DT_Synch dtSynch()
Definition: annotation.cpp:648
MicroModelica::IR::ModelAnnotation::type::WEIGHT
@ WEIGHT
MicroModelica::IR::ModelAnnotation::type::PARTITION_METHOD
@ PARTITION_METHOD
MicroModelica::IR::ModelAnnotation::SZMatrix
IR::MATRIX::UserDefMatrixExps SZMatrix()
Definition: annotation.cpp:720
MicroModelica::IR::ModelAnnotation::_minStep
double _minStep
Definition: annotation.hpp:236
MicroModelica::IR::ModelAnnotation::_nodeSize
int _nodeSize
Definition: annotation.hpp:239
MicroModelica::Util::SymbolTable
ModelTable< std::string, std::string > SymbolTable
Definition: equation.hpp:62
MicroModelica::IR::ModelAnnotation::isClassic
bool isClassic()
Definition: annotation.cpp:666
MicroModelica::IR::ModelAnnotation::_current_exp_id
int _current_exp_id
Definition: annotation.hpp:275
MicroModelica::IR::ModelAnnotation::_solver
Solver _solver
Definition: annotation.hpp:232
EXPBOOLEAN
@ EXPBOOLEAN
Definition: ast_types.hpp:177
MicroModelica::IR::Solver::IDA
@ IDA
MicroModelica::IR::ModelAnnotation::patohSettings
list< string > patohSettings()
Definition: annotation.cpp:688
MicroModelica::IR::ModelAnnotation::type::STEP_SIZE
@ STEP_SIZE
MicroModelica::IR::FunctionAnnotation::_include
std::string _include
Definition: annotation.hpp:113
MicroModelica::Util::ER_Error
@ ER_Error
ER_Error.
Definition: error.hpp:122
MicroModelica::IR::ModelAnnotation::HHMatrix
IR::MATRIX::UserDefMatrixExps HHMatrix()
Definition: annotation.cpp:710
MicroModelica::IR::ModelAnnotation::weight
double weight()
Definition: annotation.cpp:640
MicroModelica::IR::ModelAnnotation::type::BDF_PARTITION
@ BDF_PARTITION
MicroModelica::IR::ModelAnnotation::polyCoeffs
int polyCoeffs()
Definition: annotation.cpp:702
MicroModelica::IR::ModelAnnotation::_hd_matrix
IR::MATRIX::UserDefMatrixExps _hd_matrix
Definition: annotation.hpp:266
MicroModelica::IR::ModelAnnotation::_rhs_st_matrix
IR::MATRIX::UserDefMatrixExps _rhs_st_matrix
Definition: annotation.hpp:270
MicroModelica::IR::ModelAnnotation::type::JACOBIAN
@ JACOBIAN
BINOPSUB
@ BINOPSUB
Definition: ast_types.hpp:148
MicroModelica::IR::DT_Synch::DT_Fixed
@ DT_Fixed
MicroModelica::IR::ModelAnnotation::type::DESC
@ DESC
MicroModelica::IR::ModelAnnotation::_sd_matrix
IR::MATRIX::UserDefMatrixExps _sd_matrix
Definition: annotation.hpp:272
MicroModelica::IR::ModelAnnotation::_scheduler
string _scheduler
Definition: annotation.hpp:242
MicroModelica::IR::ModelAnnotation::_desc
string _desc
Definition: annotation.hpp:258
MicroModelica::IR::AnnotationValue::setReal
void setReal(double d)
Definition: annotation.cpp:732
MicroModelica::IR::ModelAnnotation::symDiff
bool symDiff()
Definition: annotation.cpp:682
MicroModelica::IR::ModelAnnotation::type::HZ_MATRIX
@ HZ_MATRIX
MicroModelica::IR::FunctionAnnotation::type::DERIVATIVE
@ DERIVATIVE
MicroModelica::IR::ModelAnnotation::_BDFPartition
AST_ExpressionList _BDFPartition
Definition: annotation.hpp:263
MicroModelica::IR::ModelAnnotation::_weight
double _weight
Definition: annotation.hpp:247
MicroModelica::IR::FunctionAnnotation::libraries
Util::SymbolTable libraries() const
Definition: annotation.cpp:133
MicroModelica::IR::ModelAnnotation::type::EXPERIMENT
@ EXPERIMENT
MicroModelica::IR::ModelAnnotation::_annotations
map< string, ModelAnnotation::type > _annotations
Definition: annotation.hpp:244
MicroModelica::IR::ModelAnnotation::_storeData
string _storeData
Definition: annotation.hpp:243
MicroModelica::IR::ModelAnnotation::dqrel
list< double > dqrel()
Definition: annotation.cpp:638
MicroModelica::IR::ModelAnnotation::sample
list< double > sample()
Definition: annotation.cpp:678
MicroModelica::IR::ModelAnnotation::hasAnnotation
bool hasAnnotation(IntegerAnnotations annot) const
Definition: annotation.cpp:627
MicroModelica::Util::ER_Warning
@ ER_Warning
ER_Warning.
Definition: error.hpp:121
BINOPOR
@ BINOPOR
Definition: ast_types.hpp:138
BINOPGREATEREQ
@ BINOPGREATEREQ
Definition: ast_types.hpp:143
MicroModelica::IR::ModelAnnotation::type::SZ_MATRIX
@ SZ_MATRIX
MicroModelica::IR::ModelAnnotation::_partition_method_string
string _partition_method_string
Definition: annotation.hpp:252
MicroModelica::Util::Error::add
void add(int pos, unsigned int code, ER_Type t, const std::string message,...)
Definition: error.cpp:42
MicroModelica::IR::Solver::DOPRI
@ DOPRI
MicroModelica::IR::ModelAnnotation::_lhs_st_matrix
IR::MATRIX::UserDefMatrixExps _lhs_st_matrix
Definition: annotation.hpp:269
MicroModelica::IR::ModelAnnotation::_hh_matrix
IR::MATRIX::UserDefMatrixExps _hh_matrix
Definition: annotation.hpp:268
MicroModelica::IR::ModelAnnotation::type::MIN_STEP
@ MIN_STEP
MicroModelica::IR::DT_Synch
DT_Synch
Definition: annotation.hpp:88
MicroModelica::IR::AnnotationValue::setInteger
void setInteger(int i)
Definition: annotation.cpp:728
MicroModelica::IR::ModelAnnotation::dqmin
list< double > dqmin()
Definition: annotation.cpp:634
MicroModelica::IR::FunctionAnnotation::type::INCLUDE_DIRECTORY
@ INCLUDE_DIRECTORY
MicroModelica::IR::ModelAnnotation::type::RANDOM_SEED
@ RANDOM_SEED
MicroModelica::IR::ModelAnnotation::derDelta
double derDelta()
Definition: annotation.cpp:660
MicroModelica::IR::ModelAnnotation::type::SCHEDULER
@ SCHEDULER
MicroModelica::IR::ModelAnnotation::type::EVENT_ID
@ EVENT_ID
MicroModelica::IR::ModelAnnotation::type::COMM_INTERVAL
@ COMM_INTERVAL
MicroModelica::IR::ModelAnnotation::output
list< AST_Expression > output()
Definition: annotation.cpp:686
MicroModelica::Util::ModelConfig::instance
static ModelConfig & instance()
Definition: model_config.hpp:87
MicroModelica::IR::ModelAnnotation::EventId
string EventId()
Definition: annotation.cpp:704
MicroModelica::IR::ModelAnnotation::type::DER_DELTA
@ DER_DELTA
MicroModelica::IR::Solver::CQSS
@ CQSS
MicroModelica::IR::ModelAnnotation::type::SCOTCH_SETTINGS
@ SCOTCH_SETTINGS
MicroModelica::IR::Solver::LIQSS
@ LIQSS
MicroModelica::IR::ModelAnnotation::getAnnotation
int getAnnotation(IntegerAnnotations annot) const
Definition: annotation.cpp:619
MODEQUAL
@ MODEQUAL
Definition: ast_types.hpp:189
MicroModelica::IR::FunctionAnnotation::_derivative
std::string _derivative
Definition: annotation.hpp:112
MicroModelica::IR::ModelAnnotation::type::PATOH_SETTINGS
@ PATOH_SETTINGS
MicroModelica::IR::ModelAnnotation::type::OUTPUT
@ OUTPUT
MicroModelica::IR::ModelAnnotation::finalTime
double finalTime()
Definition: annotation.cpp:654
MicroModelica::IR::ModelAnnotation::_integer_annotations_val
IntAnnotValMap _integer_annotations_val
Definition: annotation.hpp:277
MicroModelica::IR::ModelAnnotation::lps
int lps()
Definition: annotation.cpp:672
MicroModelica::IR::ModelAnnotation::commInterval
string commInterval()
Definition: annotation.cpp:676
MicroModelica::IR::ModelAnnotation::_dt
double _dt
Definition: annotation.hpp:254
AR_MODIFICATION
@ AR_MODIFICATION
Definition: ast_types.hpp:206
MicroModelica::IR::ModelAnnotation::_derDelta
double _derDelta
Definition: annotation.hpp:238
MicroModelica::IR::ModelAnnotation::expComment
void expComment(AST_Comment x, int id)
Definition: annotation.cpp:235
MicroModelica::IR::ModelAnnotation::order
int order()
Definition: annotation.cpp:684
BINOPDIV
@ BINOPDIV
Definition: ast_types.hpp:150
MicroModelica::IR::Solver::mLIQSS
@ mLIQSS
MicroModelica::IR::FunctionAnnotation::include
string include()
Definition: annotation.cpp:129
MicroModelica::IR::AnnotationValue::_integer
int _integer
Definition: annotation.hpp:296
MicroModelica::IR::ModelAnnotation::type::METIS_SETTINGS
@ METIS_SETTINGS
MicroModelica::IR::ModelAnnotation::processList
void processList(AST_Expression x, list< double > *l)
Definition: annotation.cpp:313
MicroModelica::IR::ModelAnnotation::_ZCHyst
double _ZCHyst
Definition: annotation.hpp:240
MicroModelica::IR::ModelAnnotation::type::PARALLEL
@ PARALLEL
EXPBOOLEANNOT
@ EXPBOOLEANNOT
Definition: ast_types.hpp:181
MicroModelica::IR::ModelAnnotation::type::STORE_DATA
@ STORE_DATA
MicroModelica::IR::IntegerAnnotations::XOutput
@ XOutput
MicroModelica::IR::ModelAnnotation::processExpressionList
void processExpressionList(AST_Expression x, AST_ExpressionList exps)
Definition: annotation.cpp:374
MicroModelica::IR::ModelAnnotation::partitionMethodString
string partitionMethodString()
Definition: annotation.cpp:646
MicroModelica::IR::ModelAnnotation::_event_ids
string _event_ids
Definition: annotation.hpp:274
MicroModelica::IR::ModelAnnotation::jacobian
int jacobian()
Definition: annotation.cpp:664
MicroModelica::IR::ModelAnnotation::_integer_annotations_map
map< string, IntegerAnnotations > _integer_annotations_map
Definition: annotation.hpp:276
EM_IR
#define EM_IR
Definition: error.hpp:66
MicroModelica::IR::ModelAnnotation::getDtSynch
DT_Synch getDtSynch(string s)
Definition: annotation.cpp:386
MicroModelica::IR::ModelAnnotation::_DQRel
list< double > _DQRel
Definition: annotation.hpp:246
MicroModelica::IR::FunctionAnnotation::FunctionAnnotation
FunctionAnnotation()
Definition: annotation.cpp:54
MicroModelica::IR::ModelAnnotation::_jacobian
int _jacobian
Definition: annotation.hpp:262
modification.hpp
MicroModelica
Definition: files.cpp:45
MicroModelica::IR::FunctionAnnotation::_annotations
map< std::string, FunctionAnnotation::type > _annotations
Definition: annotation.hpp:111
ModelTable::empty
bool empty()
Definition: table.hpp:108
MicroModelica::IR::ModelAnnotation::_BDFMaxStep
double _BDFMaxStep
Definition: annotation.hpp:265
MicroModelica::IR::ModelAnnotation::_polyCoeffs
int _polyCoeffs
Definition: annotation.hpp:255
MicroModelica::IR::ModelAnnotation::SDMatrix
IR::MATRIX::UserDefMatrixExps SDMatrix()
Definition: annotation.cpp:718
BINOPCOMPNE
@ BINOPCOMPNE
Definition: ast_types.hpp:144
MicroModelica::IR::ModelAnnotation::_order
int _order
Definition: annotation.hpp:241
MicroModelica::IR::FunctionAnnotation::type::LIBRARY
@ LIBRARY
MicroModelica::IR::Solver::DASSL
@ DASSL
MicroModelica::IR::ModelAnnotation::type::DELTAT
@ DELTAT
MicroModelica::IR::ModelAnnotation::storeData
string storeData()
Definition: annotation.cpp:662
MicroModelica::IR::EvalAnnotation::foldTraverseElementUMinus
AnnotationValue foldTraverseElementUMinus(AST_Expression) override
Definition: annotation.cpp:897
MODCLASS
@ MODCLASS
Definition: ast_types.hpp:189
MicroModelica::IR::Solver
Solver
Definition: annotation.hpp:69
MicroModelica::IR::ModelAnnotation::RHSSTMatrix
IR::MATRIX::UserDefMatrixExps RHSSTMatrix()
Definition: annotation.cpp:716
MicroModelica::IR::FunctionAnnotation::hasDerivative
bool hasDerivative()
Definition: annotation.cpp:67
MicroModelica::IR::ModelAnnotation::_dtSynchString
string _dtSynchString
Definition: annotation.hpp:257
MicroModelica::IR::FunctionAnnotation::libraryDirectory
string libraryDirectory()
Definition: annotation.cpp:135
MicroModelica::Util::Utils::instance
static Utils & instance()
Definition: util.hpp:83
MicroModelica::IR::FunctionAnnotation::type::INCLUDE
@ INCLUDE
MicroModelica::IR::AnnotationValue::str
string str()
Definition: annotation.cpp:734
MicroModelica::IR::AnnotationValue::plainStr
string plainStr()
Definition: annotation.cpp:738
MicroModelica::IR::Solver::mLIQSS2
@ mLIQSS2
MicroModelica::IR::ModelAnnotation::parallel
bool parallel()
Definition: annotation.cpp:700
ModelTable::insert
void insert(Key k, Value v)
Definition: table.hpp:48
BINOPLOWEREQ
@ BINOPLOWEREQ
Definition: ast_types.hpp:141
MicroModelica::IR::Solver::QSS
@ QSS
MicroModelica::IR::ModelAnnotation::LHSSTMatrix
IR::MATRIX::UserDefMatrixExps LHSSTMatrix()
Definition: annotation.cpp:712
MicroModelica::IR::ModelAnnotation::type::FINAL_TIME
@ FINAL_TIME
MicroModelica::IR::ModelAnnotation::DT
double DT()
Definition: annotation.cpp:636
MicroModelica::IR::Solver::QSS4
@ QSS4
MicroModelica::IR::ModelAnnotation::getSolver
Solver getSolver(string s)
Definition: annotation.cpp:396
BINOPADD
@ BINOPADD
Definition: ast_types.hpp:146
MicroModelica::IR::EvalAnnotation::EvalAnnotation
EvalAnnotation()
Definition: annotation.cpp:744
AST_Expression_Fold< AnnotationValue >::apply
AnnotationValue apply(AST_Expression e)
Definition: ast_util.hpp:199
MicroModelica::Util::Utils::environmentVariable
std::string environmentVariable(std::string ev)
Definition: util.cpp:307
BinOpType
BinOpType
Definition: ast_types.hpp:137
MicroModelica::IR::ModelAnnotation::_initialTime
double _initialTime
Definition: annotation.hpp:250
MicroModelica::IR::ModelAnnotation::_symDiff
bool _symDiff
Definition: annotation.hpp:235
EXPREAL
@ EXPREAL
Definition: ast_types.hpp:179
MicroModelica::IR::ModelAnnotation::type::DQREL
@ DQREL
MicroModelica::IR::FunctionAnnotation::_includeDirectory
std::string _includeDirectory
Definition: annotation.hpp:114
newAST_ExpressionList
AST_ExpressionList newAST_ExpressionList(AST_Expression e)
Definition: ast_builder.cpp:132
MicroModelica::IR::ModelAnnotation::scotchSettings
list< string > scotchSettings()
Definition: annotation.cpp:690
MicroModelica::IR::ModelAnnotation::scheduler
string scheduler()
Definition: annotation.cpp:680
annotation.hpp
MicroModelica::IR::ModelAnnotation::type::INITIAL_TIME
@ INITIAL_TIME
EXPBRACE
@ EXPBRACE
Definition: ast_types.hpp:172
MicroModelica::IR::AnnotationValue::integer
int integer()
Definition: annotation.cpp:726
MicroModelica::IR::Solver::QSS2
@ QSS2
MicroModelica::IR::Solver::CVODE_BDF
@ CVODE_BDF
MicroModelica::IR::ModelAnnotation::_scotchSettings
list< string > _scotchSettings
Definition: annotation.hpp:260
MicroModelica::IR::FunctionAnnotation::hasLibraries
bool hasLibraries()
Definition: annotation.cpp:73
MicroModelica::IR::ModelAnnotation::type::SOLVER
@ SOLVER
current_element
#define current_element(it)
Definition: ast_types.hpp:34
MicroModelica::IR::FunctionAnnotation::insert
bool insert(AST_Argument_Modification x)
Definition: annotation.cpp:77
MicroModelica::IR::AnnotationValue::_plain_str
string _plain_str
Definition: annotation.hpp:299
util.hpp
MicroModelica::IR::ModelAnnotation::solverString
string solverString()
Definition: annotation.cpp:642
MicroModelica::IR::ModelAnnotation::_metisSettings
list< string > _metisSettings
Definition: annotation.hpp:261
MicroModelica::IR::ModelAnnotation::HDMatrix
IR::MATRIX::UserDefMatrixExps HDMatrix()
Definition: annotation.cpp:706
MicroModelica::IR::ModelAnnotation::_hz_matrix
IR::MATRIX::UserDefMatrixExps _hz_matrix
Definition: annotation.hpp:267
MicroModelica::IR::FunctionAnnotation::derivative
string derivative()
Definition: annotation.cpp:127
EXPSTRING
@ EXPSTRING
Definition: ast_types.hpp:178
MicroModelica::IR::EvalAnnotation::_tokens
std::vector< string > _tokens
Definition: annotation.hpp:312
MicroModelica::IR::ModelAnnotation::BDFMaxStep
double BDFMaxStep()
Definition: annotation.cpp:698
error.hpp
expression.hpp
MicroModelica::IR::ModelAnnotation::type::ZCHYST
@ ZCHYST
MicroModelica::IR::ModelAnnotation::dtSynchString
string dtSynchString()
Definition: annotation.cpp:650
MicroModelica::IR::ModelAnnotation::_sample
list< double > _sample
Definition: annotation.hpp:248