I am using Mathematica 12.0, AceGen version 7.101. I have not detected this problem when I was using older versions of both, but I've had no need to use the SMSPrint[]
command for quite some time, so I don't know if this problem is recent or not.
Using SMSPrint[exp1,exp2,"Output" -> {"File", "test.out"}]
in the element code, causes the element .dll not to be generated in AceFem. This is the error I get:
Compiler's messages: TestElement.c: In function 'SKR': TestElement.c:4087:1: error: expected declaration or statement at end of input }; ^
By not using the option "Output"->{"File", "test.out"}
, the SMSPrint[exp1,exp2]
works fine, but I want to be able to print the results in a file, not inside the Mathematica notebook.
Another problem is the use of a new line \n
in the expression inside the SMSPrint function. For some reason the element code is not even generated if new line is used. This is the error I get when I try to write the element code, using SMSWrite[]:
SMC::Warning: Cannot split program line.(Sigma=',(double)(v[1382]),(double)(v[1383]),(double)(v[1384]),(double)(v[1385]),(double)(v[1386]),(double)(v[1387]),(double)(v[1388]),(double)(v[1389])); ).
For example, using the option \t
inside the SMSPrint[] works fine.
Is there any fix to this, or am I doing something wrong? I have tested this on 2 different basic element codes, but have not tried using an older version of software.
Edit: I was able to recreate the error on an element code from AceShare found here http://symech.fgg.uni-lj.si/MainLibraryV11/SE/7/SEMSS1ASHYANSP6DFiSVenant.html By changing the "Mode" from "Optimal+" to "Debug", and inserting the SMSPrint[] function (that must include a newline \n) somewhere in the code, the same error ("Cannot split program line....") can be observed and the element is not generated.