Exporting finite element models in Abaqus™ input file format.
This module provides functions and classes to export finite element models from pyFormex in the Abaqus™ input format (.inp). The exporter handles the mesh geometry as well as model, node and element properties gathered in a PropertyDB database (see module properties).
While this module provides only a small part of the Abaqus input file format, it suffices for most standard jobs. While we continue to expand the interface, depending on our own necessities or when asked by third parties, we do not intend to make this into a full implementation of the Abaqus input specification. If you urgently need some missing function, there is always the possibility to edit the resulting text file or to import it into the Abaqus environment for further processing.
The module provides two levels of functionality: on the lowest level, there are functions that just generate a part of an Abaqus input file, conforming to the Abaqus™ Keywords manual.
Then there are higher level functions that read data from the property module and write them to the Abaqus input file and some data classes to organize all the data involved with the finite element model.
Classes defined in module fe_abq
The basic logical unit in the simulation history.
In Abaqus, a step is the smallest logical entity in the simulation history. It is typically a time step in a dynamic simulation, but it can also describe different loading states in a (quasi-)static simulation.
Our Step class holds all the data describing the global step parameters. It combines the Abaqus ‘STEP’, ‘STATIC’, ‘DYNAMIC’ and ‘BUCKLE’ keyword commands (and even some more global parameter setting commands).
Parameters:
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.
Parameters:
For kind==’‘:
For kind==’NODE’ or ‘ELEMENT’:
Methods
Format an output request.
Return a string with the formatted output command.
A request for output of results on nodes or elements.
Parameters:
Extra keyword arguments are available: see the writeNodeResults and writeElemResults methods for details.
Methods
Contains all data required to write the Abaqus input file.
Methods
Write an Abaqus input file.
Functions defined in module fe_abq
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’
Determine the name for writing a node set property.
Determine the name for writing an element set property.
Format a command.
Format numerical data in lines with maximum npl items.
data is a numeric array. The array is flattened and then the data are formatted in lines with maximum npl items, separated by sep. Lines are separated by linesep.
Format numerical data in lines with maximum npl items.
data is a numeric array, which is coerced to be a 2D array, either by adding a first axis or by collapsing the first ndim-1 axies. Then the data are formatted in lines with maximum npl items, separated by sep. Lines are separated by linesep.
Format the heading of the Abaqus input file.
Start a new Part.
Write a material section.
mat is the property dict of the material. The following keys are recognized and output accordingly:
Write transform command for the given set.
Write a frame section for the named element set.
Recognized data fields in the property record:
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:
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:
Write a connector section.
Optional data:
Format the surface definitions.
Required:
Format the interactions.
Optional:
Format the general contact.
Only implemented on model level
Required:
Format the contact pair.
Required:
Format the orientation.
Optional:
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.
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.
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.
Write an element section.
prop is a an element property record with a section and eltype attribute
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!
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!
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.
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.
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.
Write a request for nodal result output to the .odb file.
Write a request for nodal result output to the .fil or .dat file.
Extra arguments:
Extra arguments for output=``PRINT``:
Remark: the kind argument is not used, but is included so that we can easily call it with a Results dict as arguments
Write a request for element output to the .odb file.
Write a request for element result output to the .fil or .dat file.
Extra arguments:
pos: Position of the points in the elements at which the results are written. Should be one of:
Non-default values are only available for ABAQUS/Standard.
Extra arguments for output=’PRINT’:
Remark: the kind argument is not used, but is included so that we can easily call it with a Results dict as arguments
Write the FILE OUTPUT command for Abaqus/Explicit
Write model props for this step
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.