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!!!!!!

Advertisements

About yhtian

I am an academic researcher working on Offshore Geotechnical Engineering. My blog aims to write down some work related trivial things and tricks about software, programming. It is basically a memo for me to back up some thoughts and small details. But I am more than happy if someone would visit and discuss.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s