Contents     Functions         Previous Next     PDF Index

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)


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 incremently 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.

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.

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.

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 connectivit, 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

For the moment, only nodal data transfer is completely implemented. More information can be found on Python at http://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


©1991-2019 by SDTools
Previous Up Next