Input File Parser#

The inpParser module provides functions that allow you to parse an Abaqus input file.

Create input files#

class InputFile(file: str, directory: str = '')[source]#

The InputFile object is used to store the definitions in an Abaqus input file. InputFile objects can be created using the methods described in this section.

Notes

This object can be accessed by:

import inpParser
Attributes:
file: str

A String specifying the source file name of the Abaqus input file.

directory: str

A String specifying the directory where the input file is located.

includes: tuple

A sequence of Strings specifying any additional input files included in the specified input file.

missingIncludes: tuple

A sequence of Strings for input files included in the specified input file that could not be located.

Methods

parse([organize, verbose, bulk, usePyArray])

This method parses the input file associated with the InputFile object.

Object features#

AbaqusNDarray#

class AbaqusNDarray[source]#

The AbaqusNDarray object is a sequence object derived from numpy.ndarray and is used to store numeric keyword data from an Abaqus input file. This object is similar to the numpy.ndarray object, but the numeric elements are returned as standard Python objects, not numpy numeric types. The numeric elements can be: - All ints. - All floats. - First column int, all other columns floats. In the last of these cases, the member colZeroIsInt will be True; in the other two cases, it will be False.

Notes

This object can be accessed by:

InputFile#

class InputFile(file: str, directory: str = '')[source]#

The InputFile object is used to store the definitions in an Abaqus input file. InputFile objects can be created using the methods described in this section.

Notes

This object can be accessed by:

import inpParser
Attributes:
file: str

A String specifying the source file name of the Abaqus input file.

directory: str

A String specifying the directory where the input file is located.

includes: tuple

A sequence of Strings specifying any additional input files included in the specified input file.

missingIncludes: tuple

A sequence of Strings for input files included in the specified input file that could not be located.

Methods

parse([organize, verbose, bulk, usePyArray])

This method parses the input file associated with the InputFile object.

parse(organize: BooleanType = False, verbose: BooleanType = False, bulk: BooleanType = True, usePyArray: BooleanType = False)[source]#

This method parses the input file associated with the InputFile object.

Parameters:
organize

A Boolean specifying whether keywords should be organized into suboptions. The default is False.

verbose

A Boolean specifying whether verbose output is to be printed. If verbose is True, information about fatal errors is printed. If no fatal errors occur, there is no output. The default is False.

bulk

A Boolean specifying whether the input file includes bulk data that should be parsed. The default is True.

usePyArray

A Boolean specifying that parse method can return an AbaqusNDarray object for a keyword data value. In cases where large amounts of numerical data (i.e., large node arrays) are expected, it is recommended that you use the option usePyArray=True. The default is False.

Returns:
A KeywordSequence object.
Raises:
If you parse an input file more than once, a ValueError is raised for each subsequent
parsing.

Keyword#

class Keyword[source]#

The Keyword object is used to store a keyword definition from an Abaqus input file. Keyword objects are returned via the InputFile.parse() method.

Notes

This object can be accessed by:

import inpParser
Attributes:
name: str

A String specifying the name of the keyword.

parameter: dict

A Dictionary of Strings specifying the keyword parameters.

data: tuple

A sequence of sequences or an AbaqusNDarray.:py:class:~abaqus.InputFileParser.AbaqusNDarray.AbaqusNDarray` object specifying the keyword data. The type of the leaf objects depends on the keyword. The AbaqusNDarray.:py:class:~abaqus.InputFileParser.AbaqusNDarray.AbaqusNDarray` object is returned only if the data is suitable and if the InputFile.parse() method was called with the option usePyArray=True. In cases where large amounts of numerical data (i.e., large node arrays) are expected, it is recommended that you use the option usePyArray=True.

suboptions: str

A KeywordSequence specifying the suboptions of the keyword.

comments: tuple

A sequence of Strings specifying the comments.