Skip to content

Commit

Permalink
Change proposal to use annotation instead of special syntax
Browse files Browse the repository at this point in the history
This shows that we don't really need any new syntax for handling the choice of solver method, at the cost of having this important information hidden away in an annotation.
  • Loading branch information
henrikt-ma committed Oct 25, 2022
1 parent 1d0da35 commit 7d3e4a5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
12 changes: 12 additions & 0 deletions RationaleMCP/0031/annotations.md
Expand Up @@ -38,6 +38,7 @@ These are all the non-vendor specific annotations inherited from full Modelica t

These are the new annotations introduced in Flat Modelica, each explained in more detail below:
- [`Protected`](#protected) — Indicate whether component declaration comes from protected section in original full Modelica model
- [`solverMethod`](#solvermethod) — Discretization method for a clocked sub-partition


### `Protected`
Expand Down Expand Up @@ -103,6 +104,17 @@ package 'M'
end 'M';
```

### `solverMethod`

Form:
```
String solverMethod = "ImplicitEuler";
```

The `solverMethod` annotation is only allowed on a `subpartition`.
The recognized method names are the same as for the `solverMethod` named argument of the `Clock` constructor in full Modelica.



## Vendor annotations

Expand Down
2 changes: 1 addition & 1 deletion RationaleMCP/0031/differences.md
Expand Up @@ -1272,7 +1272,7 @@ partition /* Beginning of base-partition */
'baseVar' = sample('x');
subpartition
discretization "ImplicitEuler";
annotation(solverMethod = "ImplicitEuler");
Clock _subClock0 = subSample('baseClock', 2); /* Automatically generated clock name. */
equation
der('cVar1') = noClock('baseVar');
Expand Down
1 change: 0 additions & 1 deletion RationaleMCP/0031/grammar.md
Expand Up @@ -185,7 +185,6 @@ end _F;
> _sub-partition_\
>   **subpartition** _string-comment_\
>   ( _annotation-comment_ **;** )?
>   ( **discretization** _STRING_ **;** )?\
>   _clock-clause_ **;**\
>   ( **equation** ( _equation_ **;** )* \
>   | **algorithm** ( _statement_ **;** )* \
Expand Down

0 comments on commit 7d3e4a5

Please sign in to comment.