Skip to content

Commit

Permalink
- Changed the extraPolate macro so we don't get warnings because vari…
Browse files Browse the repository at this point in the history
…ables contain $-signs

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@9953 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Sep 27, 2011
1 parent 3ba4b5c commit c5aba33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Compiler/susan_codegen/SimCode/SimCodeC.tpl
Expand Up @@ -1881,9 +1881,10 @@ case SES_NONLINEAR(__) then
#endif<%\n%>
start_nonlinear_system(<%size%>);
<%crefs |> name hasindex i0 =>
let namestr = cref(name)
<<
nls_x[<%i0%>] = extraPolate(<%cref(name)%>);
nls_xold[<%i0%>] = $P$old<%cref(name)%>;
nls_x[<%i0%>] = extraPolate($P$old<%namestr%>,$P$old2<%namestr%>);
nls_xold[<%i0%>] = $P$old<%namestr%>;
>>
;separator="\n"%>
solve_nonlinear_system(residualFunc<%index%>, <%reverseLookupEquationNumber(index)%>);
Expand Down
6 changes: 3 additions & 3 deletions c_runtime/matrix.h
Expand Up @@ -296,9 +296,9 @@ int lr = (size*(size + 1)) / 2; \
int ldfjac = size;
#define end_nonlinear_system() } do {} while(0)

#define extraPolate(v) (localData->oldTime == localData->oldTime2 ) ? v: \
((($P$old##v)-($P$old2##v))/(localData->oldTime-localData->oldTime2)*localData->timeValue \
+(localData->oldTime*($P$old2##v)-localData->oldTime2*($P$old##v))/ \
#define extraPolate(old1,old2) (localData->oldTime == localData->oldTime2 ) ? v: \
(((old1)-(old2))/(localData->oldTime-localData->oldTime2)*localData->timeValue \
+(localData->oldTime*(old2)-localData->oldTime2*(old1))/ \
(localData->oldTime-localData->oldTime2))

#define mixed_equation_system(size) do { \
Expand Down

0 comments on commit c5aba33

Please sign in to comment.