abaqus#

Purpose Interface between ABAQUS and SDT (part of FEMLink) Warning this function requires MATLAB 7.1 or later.

Syntax

  abaqus('read FileName');
  abaqus('job');

read[*.fil, *.inp, *.mtx, *.dat]#

By itself the read command imports the model from a .inp ASCII input or .fil binary output file. Support for .dat read is very partial, but provides a framework for users to parse desired tokens.

Models created by an *Assembly command using several instances and/or additional nodes or elements are treated with superelements. Each part instance (called by *Instance*end instance) becomes then a specific superelement in the SDT model. A packaged call allows to get a full model back

model=abaqus('read Job-1.inp');
model=abaqus('ResolveModel',model);
% both calls at once:
model=abaqus('read-resolve Job-1.inp');

The ResolveModel command has a limited robustness in the general case due to the difficulty to handle heterogeneous Stack data while renumbering parts of a model. Most cases should be properly handled. One can use command read-resolve to perform both operations at once.

When reading deformations, sdtdef('OutOfCoreBufferSize') is used to determine whether the vectors are left in the file or not. When left, def.def is a v_handle object that lets you access deformations with standard indexing commands. Use def.def=def.def(:,:) to load all. If a modal basis is read, it is stored in the model stack, as curve,Mode. If static steps are present all associated deformation are concatenated in order of occurrence in the model stack as curve,step(1).

Command option -wd allows to save the model generated in a directory different from the one in which the abaqus files are saved.

You can request the output of element matrices which will then be read into an upcom model. To do so, you need to define an element set. To read matrices, you have to provide some information before running the job in order to select which matrices you want to write and read. In the .inp input file you may enter the following line

*ELSET, ELSET=ALL ELT FOR SDT
THIN SHELL1 , THIN SHELL1_1 

(second line contains all the ABAQUS defined sets) just before the *STEP line and

*ELEMENT MATRIX OUTPUT, ELSET=ALL ELT FOR SDT, STIFFNESS=YES
*ELEMENT MATRIX OUTPUT, ELSET=ALL ELT FOR SDT, MASS=YES

just after the *STEP line.

Note that this information are automatically generated using the following command abaqus('elementmatrices model.inp'); .


Running the Abaqus job generates outputs specified by the user, with *OUTPUT commands in the Abaqus job input file. Current default use generates an odb file, using commands of the type *NODE OUTPUT. The odb format however requires the use of Abaqus libraries to be read.

Imports are thus handled in SDT using the .fil output binary file. This file is readable without Abaqus, and its reading has been optimized in FEMLink. This type of output is generated using commands of the type *NODE FILE. A sample command to obtain nodal deformation a the end of a step is then

** general command to .fil and ask for nodal deformation field
*OUTPUT, FIELD
*NODE FILE
 U

All nodal variable keywords should be expressed on separated lines. This must be repeated in all steps of interest in an ABAQUS computation file input .inp.

Most common and general nodal variables keywords of interest are the following (this is not applicable to all ABAQUS procedures)

  • U, V, A respectively for nodal displacement, velocity and acceleration output
  • RF,CF, VF, TF respectively for nodal reaction forces, constrained forces, viscous forces, and total forces output
  • GU, GV, GA respectively for generalized displacement, velocity ad acceleration (when reduction is involved)


Since not all information (materials, set names, ...) can be found in the .fil, you may want to combine two reads into an upcom model

abaqus('read file.inp', 'buildup file.fil');.


Abaqus features a matrix sparse output starting from version 6.7-1. Their generation is performed in a dedicated step as follows

*STEP
*MATRIX GENERATE, STIFFNESS, MASS
*END STEP

The output is one ASCII file .mtx by matrix requested, which can be read by abaqus.


Reading a .dat file should be avoided in general as the ASCII storage format and variation between ABAQUS versions makes it unpractical. There are however cases where such reading is the easiest way; A framework adapted to such parsing is provided with support to read complex mode shapes (that cannot be stoed in the .fil file).

One can call data=abaqus('Read',fdat,li); with fdat a .dat file and li an optionnal Nx2 cell array providing a list of tokens to detect and and associated callback. The supported tokens are used if li is omitted, it is separately accessible with li=abaqus('DatList'); if users wish to combine supported features with customized ones.

If a token is detected in the file, a callback will be fired as out1=feval(cbk1,fid,evt,cbk2:end); with cbk the callback cell array provided in the second column of li, fid the valid opened file object set a the starting position of the currently detected token, evt a structure with fields .p0 the starting position of the scanned text buffer (not the current position to be recovered by pcur=ftell(fid);, .p1 the file length, .bufs a buffer size to be exploited. The callback command must rethrow a structure whose field will be incrementally added to the global output structure.

Build[model,case,contact,...]#

Thise set of high level commands aims at transforming a raw imported model into a functional model in SDT. It exploits in particular the lower level abaqus Resolve commands.

  • BuildCase step istep
    model=abaqus('BuildCase step1',model); This command prepares the model case loading corresponding to a given step index istep. Raw model reading imports indiferently all boundary conditions and loading into the Case Stack. The loading sequence is stored in the stack entry info,BSHist and is exploited by BuildCase to generate the loading relative to a given step. One can ask for the last step by using token steplast instead of step istep. Command options
    • all restores all case entries in the Case Stack.
    • -noResolve asks not to perform the abaqus Resolve call if this was previously performed.
  • BuildModel step istep
    model=abaqus('BuildModel step1',model); This command generates the model global state at a given step specified by step index istep. In addition to the BuildCase functionalities, this function looks for a static response result corresponding to the given set to define a curve,q0 entry, thus declaring a static state in the SDT model. One can ask for the last step by using token steplast instead of step istep. Command options
    • -noResolve asks not to perform the abaqus Resolve call if this was previously performed.
    • -contactCAM link to a call to the BuildContact command with forwarding of additional command options given in CAM. This feature is only accessible with a valid SDT-Contact module license.
    • -getStatic to only resolve the static state. The output is then the static state. It is possible to specifiy in intial set of static deformations in an additional argument. q0=abaqus('buildModel-steplast-getStatic',model,...
      stack_get(mo1,'curve','step(1)','get')).
  • BuildContact step istep
    model=abaqus('BuildContact step1',model); This command packages the generation of SDT contact elements and laws based on the ABAQUS definition. This feature is only accessible with a valid SDT-Contact module license. The import generates contact elements based on master surfaces with penalized contact laws. Hard contact laws are thus automatically penalized with a calibrated stiffness density. Support for the *CONTACT PAIR, *MOTION, *CLEARANCE, *CHANGEFRICTION commands is provided and integrates *SURFACE BEHAVIOR and *FRICTION law inputs.

    The step definition is mostly usefull for *MOTION and *CHANGE FRICTION commands.One can ask for the last step by using token steplast instead of step istep. Command options

    • -module has to be used for users with no access to the SDT-NL tools outside SDT-Contact.
    • Command option -useRes asks to initialize contact states based on static force resultants on surface rather than by observing gaps on the static deformation field. This can be useful to alleviate contact state import discrepancies due to different contact implementations between ABAQUS and SDT.
    • -optim is used to remove curves from the model that are not useful for further analysis after the BuildContact step is performed. Step history and q0.Stack is mainly targetted as it may contain element-wise information and multiple shapes.
    • -tgStickNoMotion can be used to define tangential sticking property for contact with friction and no motion.
    • -moRot is used to specify the local definition of contacts : tangent and normal directions
      • -moRot"cyl" defines a cylindrical contact (for example the sliding contact of a drum brake)

Resolve#

This set of commands transforms a raw model import by abaqus read into en exploitable SDT model. This is for example useful when the ABAQUS model has been generated with *PART and *INSTANCE. In such case, the representation of an ABAQUS model becomes very far from an SDT model. The raw reading obtained by read will thus interpret parts as superelements, and leave the instance data, and some internal information not translated. Some other advanced definitions need special care and are thus handled in this section.

Some adaptations, performed by ResolveModel are thus needed. In particular, renumbering can occur, however all sets definitions are maintained.

  • ResolveModel
    This command will create the elements conforming to the instance information. Commands ResolveSet, ResolveMass, AssembleUserElements, ResolveCase and ResolveShellC will also be called, to generate a fully exploitable SDT model.
  • ResolveSet
    This command transforms each ABAQUS implicitly defined sets into explicit SDT sets. This is very useful if some sets have been defined in ABAQUS using internal part numbering. This command is also useful to distinguish sets of different types but with initially the same name. This behavior is not available in SDT and special care is taken not to mix-up set names and types. Called by ResolveModel.
  • ResolveCase
    This command aims at resolving all implicitly defined case entries in the model, including *MODEL CHANGE, and some connector calls. This also handles the multiple slave resolution in the manner of ABAQUS, and should thus be performed before assembling models if multiple slave error occur.
  • ResolveMass
    This command handles the model stack entry info,UnResolvedMasses that may have been created during the read call, and assigns mass values missing in mass elements. This is necessary when masses have been defined in an ABAQUS part, such that the attribution of the mass amplitude by *MASS is not directly retrievable. Called by ResolveModel.
  • ResolveShellC
    Continuum shell elements (SC8R and SC6R) have no direct counterparts in SDT. A base resolution just ignores the shell declaration and declare these elements as solids with reduced integration (this may not work for stacked layers of continuum shells). The following command options are available
    • -shellSE will generate a superelement embedding shells in SDT format from the neutral fiber of the continuum shells, within the 3D topology. In that way a behavior equivalent to ABAQUS is expected.
    • -order2 in combination with -shellSE uses second order shells instead of first order ones.

write#

abaqus('write Name.inp',model); writes and ABAQUS input file.

abaqus('BwMTX',model); writes all matrices stored in model.K in the abaqus sparse output format. Each matrix file is named after the model.file entry and model.Klab. For a model stored in model.mat containing a matrix 'k', the file output will be named model_k.mat.

BwMat ; BwMp ; BwSet ; Bwbas ; BwStepEig are implemented.

JobWrite#

Job generation functionality. This command aims at automating job steps and output edition. From context stored in a nmap, one defines a list of keywords that will be sequentially processed to write the input files. The minimum context requires a job configuration structure stored in nmap('CurJob') with fields

  • .Code set to abaqus.
  • .Job the job name.
  • .RelDir the local directory where the job data will be stored.

Then the mesh file or model must be stored in the nmap with a key to be provided in the job sequence.

The sequence has three main phases MeshCfg, SimuCfg and RunCfg to respectively define the mesh, the steps and job execution. Each of these phases can implement as many operations as needed, defined by colon separated tokens.

  • MeshCfg{Mesh:... } defines the working mesh as a model, and allows modifications in callbacks (e.g. sets editions, ...)
    • The first entry Mesh is an entry to the nmap providing either a model structure or an input file .inp containing a mesh. It is recommended not to have steps in this file.
    • Following tokens will specify nmap entries that will be interpreted as callbacks, that can take the variables model (the working model) and RO (with field .nmap as inputs and must rethrow the model as first output.
  • SimuCfg{...: } defines the job files to be included and steps to be written. Each implementation refers to an nmap entry stored in abaqus JobNMap with available options. The following entries are supported
    • MoP writes parameters with BwParam. The input structure should have a field .Stack with a info,Range entry, see fe_range
    • Inc will write the include card with BwInclude, if additional files where incoluded in the base input mesh, they will be copied to the directory pointed by RelDir.
    • Sets{opt,name} will write sets entries with BwSet, either NSET, ELSET, or SURFACE. By default all sets are written, it is possible to write a single set by giving its name in further options.
    • SpurNode{opt,[-bc,-bcstore]} writes the spurious node feature for free mode reduction, with BwSpurNode. Options -bc to write the associated boundary condition or -bcstore store it for later.
    • MAT{mattype,mi,ElSet,stname} writes a matrix output step with BwStepMat, of type mi (1 for stiffness, 2 for mass, 3 for viscous damping, 4 for structural damping) and for element set stname.
    • EIG{opt,[AMS,nfile,-bc]} writes a frequency step with BwStepEig. Available options to use AMS, ndat node print, nodb node output, nfil node file, and -bc additional boundary conditions.
    • SEGen{opt,[nsub,noK,noM,...]} writes a substructre generate step with BWStepSeGen. Options to restrain recovery matrix to nsub node set, not to output mass or stiffness.
    • cbk Any other command can be added as a key stored in nmap associated to a callback that can take the variables model (the working model) and RO (with field .nmap) as inputs and must output a string that will be printed in the job file.
  • RunCfg{... } handles job preparation and execution using sdtjob. The following commnands are available:
    • ioset handles file input and output using JobIOSet. Declares the list of input files and generates the list of expected output files.
    • host handles execution host data. It expects the host configuration to be stored in OsDic from sdtjob host configuration and selected host in nmap('CurJobHost').
    • check checks and completes the job execution data structure RJ calling JobOpt.
    • cbk Any other command can be added as a key stored in nmap associated to a callback that can take the variables RJ as job data structure and output must output it back as first argument.
    • run launches an monitors the job using JobRun and sdtjob.
% ABAQUS job generation example
% demonstration model
mo1=demosdt('demoubeam-noplot');
% Export mesh in input format
finp=fullfile(sdtdef('tempdir'),'ubeam_fem.inp'); % mesh file name
abaqus(['write' finp],mo1); % export command

% Prepare job generation % setup context: data storage RT=struct('nmap',vhandle.nmap); % declare mesh file for input handling RT.nmap('MeshFile')=finp; % declare job name and working directory, store RJ=struct('Code','abaqus','Job','ubeam_job1','RelDir',pwd); RT.nmap('CurJob')=RJ; %RT.nmap('CurJobHost')='local'; % see with your job hosts configurations

% Declare job: working model, set for frequency step, output in .fil li={['MeshCfg{MeshFile};'... 'SimuCfg{Inc:EIG{opt,nfile}}'... 'RunCfg{ioset-local{.dat,.fil}:host:check}']}

% Write Job abaqus('JobWrite',RT,li) % see data RJ=RT.nmap('CurJob') % with sdtjob module, you can run and monitor % RJ=abaqus('JobRun',RJ);

JobOpt#

JobOpt = abaqus('JobOpt',Opt); This command returns a filled JobOpt structure to be run by sdtjob. Opt is a structure containing at least the field Job as the job name or file. InList and OutList must be filled. Further options concern the fields Input when the input file is different from the job name, RunOptions to append the usual option to the Abaqus command, RemoveFile to remove files from the remote directory when needed.

conv#

This command lists conversion tables for elements, topologies, face topologies. You can redefine (enhance) these tables by setting preferences of the form sd_pref('set','FEMLink','abaqus.list',value), but please also request enhancements so that the quality of our translators is improved.

splitcelas#

model=abaqus('SplitCelas',model) splits all SDT celas elements to one dimension celas elements that can be handled by Abaqus. This command can change the EltId so it must be used when meshing the model.

uniquematpro#

Merges duplicated pl/il instances.

AssembleUserElements#

Returns a matrix and its corresponding DOF, from the assembly of all USER ELEMENT instances in an ABAQUS model. This command is exploited in abaqus Resolve calls.

[K,dof] = abaqus('AssembleUserElements',model);

Command option -inModel directly sets a SDT functional superelement named usere in the model. In this case, element matrices are removed from the stack. They can be kept with command option -keep.

Command option -disjsplit splits the assembled SE into disjoint SE regarding DOF connectivity, resulting SE are named uei with i a 6 digit fixed index.

model=abaqus('AssembleUserElements-inModel',model);

odb2sdt#

Utility functions to transfer Abaqus .odb file data into a format similar to MATLAB 6 binary .mat file and readable by sdthdf. The changes in the format are introduced to support datasets larger than 2GB.

Abaqus outputs are commonly written in .odb files, using a non documented format. The only way to access its data is to use Abaqus CAE or Abaqus Python. These utility functions are to be used with Abaqus Python to extract data from the output database for further use outside Abaqus. The modules used are

  • odbAccess. Abaqus access libraries.
  • abaqusConstants. Common output values dictionary, such as 'U', 'UR'
  • Numeric. Module for array handling utilities.
  • struct. Module to pack data into binary strings.

For the moment, only nodal data transfer is completely implemented. More information can be found on Python at https://www.python.org. Note that def is a reserved word in Python for the function definition command; remember not to use it in another way!

The following script is a quick example of what can be done with these functions. It can be launched directly if written in a .py file readODB.py for example, by abaqus python readODB.py

from odb2sdt import *   # import read functions

jobName='my_abaqus_job' odb=openOdb(jobName + '.odb') allNodal2mat(odb)

This second script will only write the DOF set in a .mat binary file

from odb2sdt import *   # import read functions

jobName='my_abaqus_job'

odb=openOdb(jobName + '.odb') #open the database stepName=odb.steps.keys()[0] #get the name of the first step fieldItem=['U'] #I want the 'U' displacement field

# get the fieldOutputs instances list from the first frame: fieldOutputs=odb.steps.getitem(stepName).getFrame(0).fieldOuputs

f=matFile(jobName + '_dof.mat') # Initialize the file dof2mat(f,fieldOutputs,fieldItem,stepName) # write the DOF array to it f.close()

Once a file_allNodal.mat file has been generated, it is possible to load the deformation structure fields using

def=abaqus('read file_allNodal.mat')

def output is here a cell array containing all def structures found in the allNodal.mat file. Only simple cases of .odb outputs are supported. The rest of the data is not automatically read, it can nevertheless be attained using

r1=sdthdf('open',file_allNodal.mat);

where r1 is a cell array containing all the fields contained in the allNodal.mat file.

odb2sdt.py reference#

The following lists the main subfunctions in odb2sdt.py

matFile(fname)Creation of a the file fname, with the standard .mat header.f=matFile(fname)
 
dof2mat(f, fields ,fieldItems, stepName)Writes the DOF array in SDT format to file f. fields is the list of fieldOutput instances from the step named stepName. fieldItems is the sorted list containing the displacement fieldOutputs present in the fieldOuputs list. It must contain in that order, and at least one entry of the list ['U' , 'UR' , 'UT']. It is a direct call with no output.
 
defSet2mat(f, step, fieldList)Writes a fieldOutput set for all frames of a step, contiguously into file f. step is a step instance, fieldList is the list of fieldOutputs to be output from the frame object. All kind of nodal vector output can be treated although this was designed to treat displacement fields linked to the dof2mat function. It is a direct call with no output. In case of a modal deformation set, the EIGIMAG, EIGFREQ, EIGREAL and DAMPRATIO historyOutput data are also output.
 
nodalScalarValues2mat (f, field, stepName, frameName)Outputs an array of scalar nodal values to file f, for a particular fieldOutput instance field. stepName is the name of the step considered, frameName the name of the frame. However, since the fieldOutput is given the last two arguments are strings only needed to compose the array name in f.It is a direct call with no output.
 
allNodal2mat(odb)This function combines the lower level nodal output function to create and fill directly a .mat file containing DOFs, deformations sets, and nodal scalar values form an odb instance, created with openOdb. It is a direct call with no output.

The following are lower level calls, and alternative calls, with output in the workspace.

sortFieldList( fieldList)Returns a field keys list in which the existing displacement field keys have been sorted at the list beginning, in the order 'U', 'UR' , 'UT'. fieldList=sortFieldList(fieldList).
 
rmFromList(list1, list2)Returns list1 in which the items in list2 have been removed.
 
arrayHead2mat(f, nValSize, isCpx, dim1,dim2, arrayName)Low level command. Initialization of an array entry into the file f. The corresponding header is written such that the array values can be written right after. nValSize is the space needed to store the values form the array in Bytes. isCpx takes the value 0 if the data to store are real, or 16 if the values to store are complex. dim1 and dim2 are the dimensions of the array in direction 1 and 2. arrayName is the name given to the array. It is a direct call with no output.
 
getNodes(frame)Returns a nodeId array in the workspace, taken in a frame instance.nodeId=getNodes(frame)
 
getLabels(frame, fieldKeys)Returns the list of componentLabels contained in all the fieldKeys list, in a frame instance. It also generates a list in which the field keys are repeated to match the componentLabels list. labels,labelField=getLabels(frame,fieldKeys)
 
setDOF(nodeId, field, fieldKeys)Returns a DOF array interpreted from a fieldOuputs list, a nodeId array and fieldKeys giving the fieldOutput displacement keys relevant in field. DOF=setDOF(nodeId,fieldOutputs,['U'])
 
readData(value)A way to output a data member of a value instance regardless of the precision used during the computation. data=readData(value)
 
readNodalValues(field, outList)

Examples#

See also

FEMLink