An interface to write Finite Element models in Abaqus input file format.
There are low level functions that just generate a part of an Abaqus (R) input file, conforming to the Keywords manual.
Then there are higher level functions that read data from the property module and write them to the Abaqus input file.
Contains all data about a step.
Methods
Create new analysis data.
analysis: the analysis type. Should be one of: ‘STATIC’, ‘DYNAMIC’, ‘EXPLICIT’, ‘PERTURBATION’, ‘BUCKLE’, ‘RIKS’
time: either
In most cases, only the step time should be specified.
nlgeom=’YES’ specifies that the analysis will be non-linear. ‘RIKS’ always sets nlgeom='YES', ‘BUCKLE’ sets it to 'NO', ‘PERTURBATION’ ignores nlgeom.
tags : a list of property tags to include in this step.
inc: the maximum number of increments in a step (the default is 100)
sdi: determines how severe discontinuities are accounted for
buckle: specifies the BUCKLE type: ‘SUBSPACE’ or ‘LANCZOS’
incr: the increment in ‘RIKS’ type
bulkvisc: a list of two floats (default: [0.06,1.2]), only used in Explicit steps.
out and res: specific output/result records for this step. They come in addition to the global ones.
Methods
Step objects have the following methods:
Write a load step.
propDB is the properties database to use.
Except for the step data itself, this will also write the passed output and result requests. out is a list of Output-instances. res is a list of Result-instances. resfreq and timemarks are global values only used by Explicit
A request for output to .odb and history.
Methods
Create new output request.
For kind==’‘:
- variable: ‘ALL’, ‘PRESELECT’ or ‘’
For kind==’NODE’ or ‘ELEMENT’:
- keys: a list of output identifiers (compatible with kind type)
- set: a single item or a list of items, where each item is either a property number or a node/element set name for which the results should be written. If no set is specified, the default is ‘Nall’ for kind==’NODE’ and ‘Eall’ for kind=’ELEMENT’
Methods
Output objects have the following methods:
Format an output request.
Return a string with the formatted output command.
A request for output of results on nodes or elements.
Methods
Create new result request.
kind: ‘NODE’ or ‘ELEMENT’ (first character suffices)
keys: a list of output identifiers (compatible with kind type)
a property number or a node/element set name for which the results should be written. If no set is specified, the default is ‘Nall’ for kind==’NODE’ and ‘Eall’ for kind=’ELEMENT’
output is either FILE (for .fil output) or PRINT (for .dat output)(Abaqus/Standard only)
freq is the output frequency in increments (0 = no output)
Extra keyword arguments are available: see the writeNodeResults and writeElemResults methods for details.
Methods
Result objects have the following methods:
Contains all data required to write the Abaqus input file.
Methods
Create new AbqData.
Methods
AbqData objects have the following methods:
Write an Abaqus input file.
Functions defined in the module fe_abq
- fe_abq.abqInputNames(job)¶
Returns corresponding Abq jobname and input filename.
job can be either a jobname or input file name, with or without directory part, with or without extension (.inp)
The Abq jobname is the basename without the extension. The abq filename is the abspath of the job with extension ‘.inp’
- fe_abq.nsetName(p)¶
- Determine the name for writing a node set property.
- fe_abq.esetName(p)¶
- Determine the name for writing an element set property.
- fe_abq.fmtCmd(cmd='*')¶
- Format a command.
- fe_abq.fmtHeading(text='')¶
- Format the heading of the Abaqus input file.
- fe_abq.fmtPart(name='Part-1')¶
- Start a new Part.
- fe_abq.fmtMaterial(mat)¶
Write a material section.
mat is the property dict of the material. If the material has a name and has already been written, this function does nothing.
- fe_abq.fmtTransform(setname, csys)¶
Write transform command for the given set.
- setname is the name of a node set
- csys is a CoordSystem.
- fe_abq.fmtFrameSection(el, setname)¶
Write a frame section for the named element set.
Recognized data fields in the property record:
- sectiontype GENERAL:
- cross_section
- moment_inertia_11
- moment_inertia_12
- moment_inertia_22
- torsional_constant
- sectiontype CIRC:
- radius
- sectiontype RECT:
- width
- height
- all sectiontypes:
- young_modulus
- shear_modulus
- optional:
- density: density of the material
- yield_stress: yield stress of the material
- orientation: a vector specifying the direction cosines of the 1 axis
- fe_abq.fmtGeneralBeamSection(el, setname)¶
Write a general beam section for the named element set.
To specify a beam section when numerical integration over the section is not required.
Recognized data fields in the property record:
- sectiontype GENERAL:
- cross_section
- moment_inertia_11
- moment_inertia_12
- moment_inertia_22
- torsional_constant
- sectiontype CIRC:
- radius
- sectiontype RECT:
- width, height
- all sectiontypes:
- young_modulus
- shear_modulus or poisson_ration
- optional:
- density: density of the material (required in Abaqus/Explicit)
- fe_abq.fmtBeamSection(el, setname)¶
Write a beam section for the named element set.
To specify a beam section when numerical integration over the section is required.
Recognized data fields in the property record:
- all sectiontypes: material
- sectiontype GENERAL:
- cross_section
- moment_inertia_11
- moment_inertia_12
- moment_inertia_22
- torsional_constant
- sectiontype CIRC:
- radius
- intpoints1 (number of integration points in the first direction) optional
- intpoints2 (number of integration points in the second direction) optional
- sectiontype RECT:
- width, height
- intpoints1 (number of integration points in the first direction) optional
- intpoints2 (number of integration points in the second direction) optional
- fe_abq.fmtConnectorSection(el, setname)¶
Write a connector section.
Optional data:
- behavior : connector behavior name
- orient : connector orientation
- fe_abq.fmtConnectorBehavior(fil, name)¶
- fe_abq.fmtShellSection(el, setname, matname)¶
- fe_abq.fmtSurface(prop)¶
Format the surface definitions.
Required:
- set: the elements/nodes in the surface, either numbers or a set name.
- name: the surface name
- surftype: ‘ELEMENT’ or ‘NODE’
- label: face or edge identifier (only required for surftype = ‘NODE’)
- fe_abq.fmtSurfaceInteraction(prop)¶
Format the interactions.
Optional:
- cross_section (for node based interaction)
- friction : friction coeff
- fe_abq.fmtGeneralContact(prop)¶
Format the general contact.
Only implemented on model level
Required:
- interaction: interaction properties : name or Dict
- fe_abq.fmtContactPair(prop)¶
Format the contact pair.
Required:
- master: master surface
- slave: slave surface
- interaction: interaction properties : name or Dict
- fe_abq.fmtOrientation(prop)¶
Format the orientation.
Optional:
- definition
- system: coordinate system
- a: a first point
- b: a second point
- fe_abq.writeNodes(fil, nodes, name='Nall', nofs=1)¶
Write nodal coordinates.
The nodes are added to the named node set. If a name different from ‘Nall’ is specified, the nodes will also be added to a set named ‘Nall’. The nofs specifies an offset for the node numbers. The default is 1, because Abaqus numbering starts at 1.
- fe_abq.writeElems(fil, elems, type, name='Eall', eid=None, eofs=1, nofs=1)¶
Write element group of given type.
elems is the list with the element node numbers. The elements are added to the named element set. If a name different from ‘Eall’ is specified, the elements will also be added to a set named ‘Eall’. The eofs and nofs specify offsets for element and node numbers. The default is 1, because Abaqus numbering starts at 1. If eid is specified, it contains the element numbers increased with eofs.
- fe_abq.writeSet(fil, type, name, set, ofs=1)¶
Write a named set of nodes or elements (type=NSET|ELSET)
set : an ndarray. set can be a list of node/element numbers, in which case the ofs value will be added to them, or a list of names the name of another already defined set.
- fe_abq.writeSection(fil, prop)¶
Write an element section.
prop is a an element property record with a section and eltype attribute
- fe_abq.writeBoundaries(fil, prop, op='MOD')¶
Write nodal boundary conditions.
prop is a list of node property records that should be scanned for bound attributes to write.
By default, the boundary conditions are applied as a modification of the existing boundary conditions, i.e. initial conditions and conditions from previous steps remain in effect. The user can set op=’NEW’ to remove the previous conditions. This will also remove initial conditions!
- fe_abq.writeDisplacements(fil, prop, op='MOD')¶
Write boundary conditions of type BOUNDARY, TYPE=DISPLACEMENT
prop is a list of node property records that should be scanned for displ attributes to write.
By default, the boundary conditions are applied as a modification of the existing boundary conditions, i.e. initial conditions and conditions from previous steps remain in effect. The user can set op=’NEW’ to remove the previous conditions. This will also remove initial conditions!
- fe_abq.writeCloads(fil, prop, op='NEW')¶
Write cloads.
prop is a list of node property records that should be scanned for displ attributes to write.
By default, the loads are applied as new values in the current step. The user can set op=’MOD’ to add the loads to already existing ones.
- fe_abq.writeDloads(fil, prop, op='NEW')¶
Write Dloads.
prop is a list property records having an attribute dload
By default, the loads are applied as new values in the current step. The user can set op=’MOD’ to add the loads to already existing ones.
- fe_abq.writeDsloads(fil, prop, op='NEW')¶
Write Dsloads.
prop is a list property records having an attribute dsload
By default, the loads are applied as new values in the current step. The user can set op=’MOD’ to add the loads to already existing ones.
- fe_abq.writeAmplitude(fil, prop)¶
- fe_abq.writeNodeOutput(fil, kind, keys, set='Nall')¶
Write a request for nodal result output to the .odb file.
- keys: a list of NODE output identifiers
- set: a single item or a list of items, where each item is either a property number or a node set name for which the results should be written
- fe_abq.writeNodeResult(fil, kind, keys, set='Nall', output='FILE', freq=1, globalaxes=False, lastmode=None, summary=False, total=False)¶
Write a request for nodal result output to the .fil or .dat file.
- keys: a list of NODE output identifiers
- set: a single item or a list of items, where each item is either a property number or a node set name for which the results should be written
- output is either FILE (for .fil output) or PRINT (for .dat output)(Abaqus/Standard only)
- freq is the output frequency in increments (0 = no output)
Extra arguments:
- globalaxes: If ‘YES’, the requested output is returned in the global axes. Default is to use the local axes wherever defined.
Extra arguments for output=``PRINT``:
- summary: if True, a summary with minimum and maximum is written
- total: if True, sums the values for each key
Remark: the kind argument is not used, but is included so that we can easily call it with a Results dict as arguments
- fe_abq.writeElemOutput(fil, kind, keys, set='Eall')¶
Write a request for element output to the .odb file.
- keys: a list of ELEMENT output identifiers
- set: a single item or a list of items, where each item is either a property number or an element set name for which the results should be written
- fe_abq.writeElemResult(fil, kind, keys, set='Eall', output='FILE', freq=1, pos=None, summary=False, total=False)¶
Write a request for element result output to the .fil or .dat file.
- keys: a list of ELEMENT output identifiers
- set: a single item or a list of items, where each item is either a property number or an element set name for which the results should be written
- output is either FILE (for .fil output) or PRINT (for .dat output)(Abaqus/Standard only)
- freq is the output frequency in increments (0 = no output)
Extra arguments:
pos: Position of the points in the elements at which the results are written. Should be one of:
- ‘INTEGRATION POINTS’ (default)
- ‘CENTROIDAL’
- ‘NODES’
- ‘AVERAGED AT NODES’
Non-default values are only available for ABAQUS/Standard.
Extra arguments for output=’PRINT’:
- summary: if True, a summary with minimum and maximum is written
- total: if True, sums the values for each key
Remark: the kind argument is not used, but is included so that we can easily call it with a Results dict as arguments
- fe_abq.writeFileOutput(fil, resfreq=1, timemarks=False)¶
- Write the FILE OUTPUT command for Abaqus/Explicit
- fe_abq.writeModelProps(fil, prop)¶
- Write model props for this step
- fe_abq.exportMesh(filename, mesh, eltype=None, header='')¶
Export a finite element mesh in Abaqus .inp format.
This is a convenience function to quickly export a mesh to Abaqus without having to go through the whole setup of a complete finite element model. This just writes the nodes and elements specified in the mesh to the file with the specified name. The resulting file can then be imported in Abaqus/CAE or manual be edited to create a full model. If an eltype is specified, it will oerride the value stored in the mesh. This should be used to set a correct Abaqus element type matchin the mesh.