3.11.10

Debug ABAQUS subroutine with Visual Studio

thank Steven's great effort! It is working now to debug user subroutine inside ABAQUS:
Step0: make sure the ABAQUS and Visual studio are working properly
Step1: copy the following "abaqus_v6.env" into the working directory
-----------------------------------------------------------------------
import os

def prepDebug(var, dbgOption):
import types
varOptions = globals().get(var)
if varOptions:
# Add debug option
if type(varOptions) == types.StringType:
varOptions = varOptions.split()
varOptions.insert(6, dbgOption)
# Remove compiler performance options
if var[:5] == 'comp':
optOption = ['/O', '-O', '-xO', '-fast', '-depend', '-vpara']
for option in varOptions[:]:
for opt in optOption:
if len(option) >= len(opt) and option[:len(opt)] == opt:
varOptions.remove(option)
return varOptions

if os.name == 'nt':
compile_fortran = prepDebug('compile_fortran', '/debug')
compile_cpp = prepDebug('compile_cpp', '/Z7')
link_sl = prepDebug('link_sl', '/DEBUG')
link_exe = prepDebug('link_exe', '/DEBUG')
else:
compile_fortran = prepDebug('compile_fortran', '-g')
compile_cpp = prepDebug('compile_cpp', '-g')

del prepDebug
---------------------------------------------------------------------------------

Step2: Command line:

Abaqus –j jobname –user routinename –debug -standard

Step3: Visual Studio appears and open the code file

Step4: Set break point and debug!!!!!!

没有评论: