This repository was archived by the owner on May 18, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -58,13 +58,29 @@ template ModelExchange(SimCode simCode)
5858match simCode
5959case SIMCODE(__) then
6060 let modelIdentifier = modelNamePrefix(simCode)
61+ let pdd = providesDirectionalDerivative(simCode)
6162 <<
6263 <ModelExchange
63- modelIdentifier =" <%modelIdentifier%>" <% if Flags.isSet(FMU_EXPERIMENTAL) then ' providesDirectionalDerivative="true"' % >>
64+ modelIdentifier =" <%modelIdentifier%>" <% if not pdd then ' >' % >
65+ <% if pdd then 'providesDirectionalDerivative="' + pdd + '">' %>
6466 </ModelExchange >
6567 >>
6668end ModelExchange;
6769
70+ template providesDirectionalDerivative(SimCode simCode)
71+ "Returns true if Jacobian is present, returns nothing otherwise"
72+ ::=
73+ match simCode
74+ case SIMCODE(__) then
75+ let result = if isSome(modelStructure) then
76+ match modelStructure
77+ case SOME(FMIMODELSTRUCTURE(continuousPartialDerivatives=SOME(__)))
78+ then "true"
79+ else ""
80+ else ""
81+ '<%result%>'
82+ end providesDirectionalDerivative;
83+
6884template fmiModelVariables(SimCode simCode, String FMUVersion)
6985 "Generates code for ModelVariables file for FMU target."
7086::=
You can’t perform that action at this time.
0 commit comments