How to read binout(elout) using LS-PrePost Scriptin Command Languages
I am attempting to automate post-processing using LS-PrePost's SCL (Scripting Command Language).
I want to read the shell stress and strain information from binout.
However, I cannot read the elout information properly.
How can I read the elout using SCL successfully?
/*** SCL code ***/
Int i=0;
char buf[256];
char str1[256];
FILE *binout;
binout = SCLBinoutOpen(binout_file_name);
BINOUT_Parameter param;
SCLBinoutInit(¶m);
Int ret=0;
Int value = 0;
char array[64][64];
// The elout exists in the binout branch
ret = SCLBinoutReadInt(binout, BINOUT_NUM_BRANCH, &value, ¶m);
sprintf(buf,"%d BINOUT_NUM_BRANCH = %d", ret, value);
Echo(buf);
ret = SCLBinoutReadStringArray(binout, BINOUT_BRANCHES, &array, ¶m);
for(i=0;i<value;i=i+1){
strcat(str1, " ");
strcat(str1, array[i]);
}
sprintf(buf,"%d BINOUT_BRANCHES = %s", ret, str1);
Echo(buf);
// I can read rcforce
param.idtype = BINOUT_RCFORC_ID_MASTER;
param.id = 2;
ret = SCLBinoutReadInt(binout, BINOUT_RCFORC_NUM_TIMESTEP, &value, ¶m);
sprintf(buf,"%d BINOUT_RCFORC_NUM_TIMESTEP = %d", ret, value);
Echo(buf);
// but I can not read elout. All the following ret are 0.
SCLBinoutInit(¶m);
param.idtype = BINOUT_ELOUT_ID_SHELL;
for(i=0;i<999999;i=i+1){
param.id = i;
ret = SCLBinoutReadInt(binout, BINOUT_ELOUT_NUM_TIMESTEP, &value, ¶m);
sprintf(buf,"%d BINOUT_ELOUT_NUM_TIMESTEP = %d", ret, value);
Echo(buf);
}
/*** Running the above code produces the following output ***/
1 BINOUT_NUM_BRANCH = 8
1 BINOUT_BRANCHES = elout eloutdet glstat matsum rcforc rwforc slefsi sleout
0 BINOUT_ELOUT_NUM_TIMESTEP = 0
0 BINOUT_ELOUT_NUM_TIMESTEP = 0
...
/*** elout(from ASCII file) ***/
ls-dyna smp s R13 R13.1.1_6_e41832f date 06/30/2022
e l e m e n t s t r e s s c a l c u l a t i o n s f o r t i m e s t e p 1 ( at time 0.00000E+00 )
element materl(local)
ipt-shl stress sig-xx sig-yy sig-zz sig-xy sig-yz sig-zx plastic
state strain
1- 1
1- 16 elastic 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00
2- 16 elastic 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00
3- 16 elastic 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00
...