peter.greaves
Structural
- May 16, 2019
- 4
Hi,
I’m trying to run APDL scripts from MatLab using the system command. I have an Ansys script which opens up a results file, filters for elements using specific materials, finds the max stress element and saves it to a file which can then be read back into MatLab. This file contains the following, and runs no problem when using the APDL GUI using File-> Read Input From…
/CWD,D:\Temp\ANSYSTemp
/FILNAME,submod ! New jobname = submod
/POST1 ! Enter POST1
RESUME
FILE,submod,rst ! Use coarse model results file
set,last
!SelectElements with nickel material 2
*SET,NickelID,1
*SET,GlueID,2
set,last
!SelectElements with nickel material 2
esel,all
ESEL,S,SEC,,NickelID,NickelID
PLNSOL,S,EQV,0,1.0
*GET,MaxNickel,PLNSOL,0,Max
esel,all
ESEL,S,SEC,,GlueID,GlueID
PLNSOL, S,EQV, 0,1.0
*GET,MaxGlue,PLNSOL,0,Max
!Write to output file
*cfopen,MaxStresses.txt
*VWRITE,MaxGlue,',',MaxNickel
(F15.0,A3,F15.0)
*cfclose
ALLSEL
Eplot
I’m trying to call this from the command line using a batch file containing the following:
SET KMP_STACKSIZE=4096k & "C:\Program Files\ANSYS Inc\v190\ansys\bin\winx64\ANSYS190.exe" -dir "D:\Temp\ANSYSTemp" -i Test.txt
And the max stress is shown to be -0.126765060E+31 (which I assume is some kind of overflow value). The VWRITE command just writes ***************, *************** as the number is too big for the specified format.
It’s kind of driving me insane… any ideas on why this might be happening? I can provide submod.rst if anyone wants to do a test. Any help will be much appreciated!
I’m trying to run APDL scripts from MatLab using the system command. I have an Ansys script which opens up a results file, filters for elements using specific materials, finds the max stress element and saves it to a file which can then be read back into MatLab. This file contains the following, and runs no problem when using the APDL GUI using File-> Read Input From…
/CWD,D:\Temp\ANSYSTemp
/FILNAME,submod ! New jobname = submod
/POST1 ! Enter POST1
RESUME
FILE,submod,rst ! Use coarse model results file
set,last
!SelectElements with nickel material 2
*SET,NickelID,1
*SET,GlueID,2
set,last
!SelectElements with nickel material 2
esel,all
ESEL,S,SEC,,NickelID,NickelID
PLNSOL,S,EQV,0,1.0
*GET,MaxNickel,PLNSOL,0,Max
esel,all
ESEL,S,SEC,,GlueID,GlueID
PLNSOL, S,EQV, 0,1.0
*GET,MaxGlue,PLNSOL,0,Max
!Write to output file
*cfopen,MaxStresses.txt
*VWRITE,MaxGlue,',',MaxNickel
(F15.0,A3,F15.0)
*cfclose
ALLSEL
Eplot
I’m trying to call this from the command line using a batch file containing the following:
SET KMP_STACKSIZE=4096k & "C:\Program Files\ANSYS Inc\v190\ansys\bin\winx64\ANSYS190.exe" -dir "D:\Temp\ANSYSTemp" -i Test.txt
And the max stress is shown to be -0.126765060E+31 (which I assume is some kind of overflow value). The VWRITE command just writes ***************, *************** as the number is too big for the specified format.
It’s kind of driving me insane… any ideas on why this might be happening? I can provide submod.rst if anyone wants to do a test. Any help will be much appreciated!